diff options
author | Brian Vosburgh | 2016-01-23 00:03:36 +0000 |
---|---|---|
committer | Brian Vosburgh | 2017-05-18 22:35:50 +0000 |
commit | 992195860fb65621aabfd088ca9ef1f2485033d0 (patch) | |
tree | 7035258cea68e73c6d7156f4f2f0a60398353500 /common/tests | |
parent | 36fdfe422cfb0f5471286a42e3bfcf9382156868 (diff) | |
download | webtools.dali-992195860fb65621aabfd088ca9ef1f2485033d0.tar.gz webtools.dali-992195860fb65621aabfd088ca9ef1f2485033d0.tar.xz webtools.dali-992195860fb65621aabfd088ca9ef1f2485033d0.zip |
clean up compiler warnings in stacks and tests
Diffstat (limited to 'common/tests')
5 files changed, 51 insertions, 51 deletions
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/ArrayStackTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/ArrayStackTests.java index 0334b14f57..4d8e7bbae2 100644 --- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/ArrayStackTests.java +++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/ArrayStackTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2015 Oracle. All rights reserved. + * Copyright (c) 2012, 2016 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -26,11 +26,11 @@ public class ArrayStackTests @Override Stack<String> buildStack() { - return new ArrayStack<String>(); + return new ArrayStack<>(); } public void testCollectionConstructor() { - ArrayList<String> c = new ArrayList<String>(); + ArrayList<String> c = new ArrayList<>(); c.add("first"); c.add("second"); c.add("third"); @@ -68,7 +68,7 @@ public class ArrayStackTests } public void testSerialization_fullArray() throws Exception { - Stack<String> stack = new ArrayStack<String>(3); + Stack<String> stack = new ArrayStack<>(3); stack.push("first"); stack.push("second"); stack.push("third"); @@ -83,7 +83,7 @@ public class ArrayStackTests } public void testTrimToSize() throws Exception { - ArrayStack<String> stack = new ArrayStack<String>(5); + ArrayStack<String> stack = new ArrayStack<>(5); stack.push("first"); stack.push("second"); stack.push("third"); @@ -97,7 +97,7 @@ public class ArrayStackTests } public void testTrimToSize_noChange() throws Exception { - ArrayStack<String> stack = new ArrayStack<String>(3); + ArrayStack<String> stack = new ArrayStack<>(3); stack.push("first"); stack.push("second"); stack.push("third"); diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/FixedCapacityArrayStackTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/FixedCapacityArrayStackTests.java index 315b4d66ee..201d78efa7 100644 --- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/FixedCapacityArrayStackTests.java +++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/FixedCapacityArrayStackTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 Oracle. All rights reserved. + * Copyright (c) 2015, 2016 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -29,7 +29,7 @@ public class FixedCapacityArrayStackTests } public void testCollectionConstructor() { - ArrayList<String> c = new ArrayList<String>(); + ArrayList<String> c = new ArrayList<>(); c.add("first"); c.add("second"); c.add("third"); @@ -131,7 +131,7 @@ public class FixedCapacityArrayStackTests } public void testSerialization_fullArray() throws Exception { - Stack<String> stack = new FixedCapacityArrayStack<String>(3); + Stack<String> stack = new FixedCapacityArrayStack<>(3); stack.push("first"); stack.push("second"); stack.push("third"); diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/LinkedStackTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/LinkedStackTests.java index 74e85690b2..d03253cca1 100644 --- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/LinkedStackTests.java +++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/LinkedStackTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2015 Oracle. All rights reserved. + * Copyright (c) 2012, 2016 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -72,7 +72,7 @@ public class LinkedStackTests } public void testNodeCache_max() { - Stack<String> stack = new LinkedStack<String>(2); + Stack<String> stack = new LinkedStack<>(2); String first = "first"; String second = "second"; String third = "third"; @@ -110,7 +110,7 @@ public class LinkedStackTests } public void testNodeCache_unlimited() { - Stack<String> stack = new LinkedStack<String>(-1); + Stack<String> stack = new LinkedStack<>(-1); String first = "first"; String second = "second"; String third = "third"; diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/StackToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/StackToolsTests.java index 79d0c86c8d..e9167bf12c 100644 --- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/StackToolsTests.java +++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/StackToolsTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 Oracle. All rights reserved. + * Copyright (c) 2015, 2016 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -37,7 +37,7 @@ public class StackToolsTests // ********** push all ********** public void testPushAllIterable() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); iterable.add("one"); iterable.add("two"); iterable.add("three"); @@ -49,14 +49,14 @@ public class StackToolsTests } public void testPushAllIterable_empty() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); Stack<String> stack = StackTools.arrayStack(); assertFalse(StackTools.pushAll(stack, iterable)); assertTrue(stack.isEmpty()); } public void testPushAllIterator() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); iterable.add("one"); iterable.add("two"); iterable.add("three"); @@ -68,7 +68,7 @@ public class StackToolsTests } public void testPushAllArray() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); iterable.add("one"); iterable.add("two"); iterable.add("three"); @@ -80,7 +80,7 @@ public class StackToolsTests } public void testPushAllArray_empty() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); Stack<String> stack = StackTools.arrayStack(); assertFalse(StackTools.pushAll(stack, iterable.toArray(StringTools.EMPTY_STRING_ARRAY))); assertTrue(stack.isEmpty()); @@ -105,7 +105,7 @@ public class StackToolsTests stack.push("one"); stack.push("two"); stack.push("three"); - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); assertTrue(StackTools.popAllTo(stack, list)); assertEquals("three", list.get(0)); assertEquals("two", list.get(1)); @@ -114,13 +114,13 @@ public class StackToolsTests public void testPopAllToCollection_empty() { ArrayStack<String> stack = StackTools.arrayStack(); - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); assertFalse(StackTools.popAllTo(stack, list)); assertTrue(list.isEmpty()); } public void testPopAllToListIndex() { - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); list.add("one"); list.add("two"); list.add("three"); @@ -138,7 +138,7 @@ public class StackToolsTests } public void testPopAllToListIndex_end() { - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); list.add("one"); list.add("two"); list.add("three"); @@ -156,7 +156,7 @@ public class StackToolsTests } public void testPopAllToListIndex_empty() { - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); list.add("one"); list.add("two"); list.add("three"); @@ -210,7 +210,7 @@ public class StackToolsTests stack.push("zero"); stack.push("one"); stack.push("two"); - Map<String, String>map = new HashMap<String, String>(); + Map<String, String>map = new HashMap<>(); assertTrue(StackTools.popAllTo(stack, map, FIRST_LETTER_TRANSFORMER)); assertEquals("one", map.get("o")); assertEquals("two", map.get("t")); @@ -219,7 +219,7 @@ public class StackToolsTests public void testPopAllToMapTransformer_empty() { ArrayStack<String> stack = StackTools.arrayStack(); - Map<String, String>map = new HashMap<String, String>(); + Map<String, String>map = new HashMap<>(); assertFalse(StackTools.popAllTo(stack, map, FIRST_LETTER_TRANSFORMER)); assertTrue(map.isEmpty()); } @@ -229,7 +229,7 @@ public class StackToolsTests stack.push("zero"); stack.push("one"); stack.push("two"); - Map<String, String>map = new HashMap<String, String>(); + Map<String, String>map = new HashMap<>(); assertTrue(StackTools.popAllTo(stack, map, FIRST_LETTER_TRANSFORMER, EMPHASIZER)); assertEquals("*one*", map.get("o")); assertEquals("*two*", map.get("t")); @@ -238,7 +238,7 @@ public class StackToolsTests public void testPopAllToMapTransformerTransformer_empty() { ArrayStack<String> stack = StackTools.arrayStack(); - Map<String, String>map = new HashMap<String, String>(); + Map<String, String>map = new HashMap<>(); assertFalse(StackTools.popAllTo(stack, map, FIRST_LETTER_TRANSFORMER, EMPHASIZER)); assertTrue(map.isEmpty()); } @@ -274,7 +274,7 @@ public class StackToolsTests } public void testArrayStackIterable() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); iterable.add("one"); iterable.add("two"); iterable.add("three"); @@ -285,7 +285,7 @@ public class StackToolsTests } public void testArrayStackIterableInt() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); iterable.add("one"); iterable.add("two"); iterable.add("three"); @@ -296,7 +296,7 @@ public class StackToolsTests } public void testArrayStackIterator() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); iterable.add("one"); iterable.add("two"); iterable.add("three"); @@ -307,7 +307,7 @@ public class StackToolsTests } public void testArrayStackIteratorInt() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); iterable.add("one"); iterable.add("two"); iterable.add("three"); @@ -318,7 +318,7 @@ public class StackToolsTests } public void testArrayStackArray() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); iterable.add("one"); iterable.add("two"); iterable.add("three"); @@ -341,7 +341,7 @@ public class StackToolsTests } public void testLinkedStackIterable() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); iterable.add("one"); iterable.add("two"); iterable.add("three"); @@ -352,7 +352,7 @@ public class StackToolsTests } public void testLinkedStackIterableInt() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); iterable.add("one"); iterable.add("two"); iterable.add("three"); @@ -363,7 +363,7 @@ public class StackToolsTests } public void testLinkedStackIterator() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); iterable.add("one"); iterable.add("two"); iterable.add("three"); @@ -374,7 +374,7 @@ public class StackToolsTests } public void testLinkedStackIteratorInt() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); iterable.add("one"); iterable.add("two"); iterable.add("three"); @@ -385,7 +385,7 @@ public class StackToolsTests } public void testLinkedStackArray() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); iterable.add("one"); iterable.add("two"); iterable.add("three"); @@ -396,7 +396,7 @@ public class StackToolsTests } public void testLinkedStackArrayInt() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); iterable.add("one"); iterable.add("two"); iterable.add("three"); @@ -409,7 +409,7 @@ public class StackToolsTests // ********** fixed-capacity array stack ********** public void testFixedCapacityArrayStackCollection() { - ArrayList<String> iterable = new ArrayList<String>(); + ArrayList<String> iterable = new ArrayList<>(); iterable.add("one"); iterable.add("two"); iterable.add("three"); diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/SynchronizedStackTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/SynchronizedStackTests.java index d8bf22803e..2c51d3f4bc 100644 --- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/SynchronizedStackTests.java +++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/stack/SynchronizedStackTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 Oracle. All rights reserved. + * Copyright (c) 2007, 2016 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -569,7 +569,7 @@ public class SynchronizedStackTests // ********** additional protocol ********** public void testPushAllIterable() throws Exception { - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); list.add("one"); list.add("two"); list.add("three"); @@ -581,7 +581,7 @@ public class SynchronizedStackTests } public void testPushAllIterable_empty() throws Exception { - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); this.ss.pushAll(list); assertTrue(this.ss.isEmpty()); } @@ -656,7 +656,7 @@ public class SynchronizedStackTests this.ss.push("one"); this.ss.push("two"); this.ss.push("three"); - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); assertTrue(this.ss.popAllTo(list)); assertTrue(this.ss.isEmpty()); assertEquals("three", list.get(0)); @@ -665,7 +665,7 @@ public class SynchronizedStackTests } public void testPopAllToCollection_empty() throws Exception { - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); assertFalse(this.ss.popAllTo(list)); assertTrue(this.ss.isEmpty()); assertTrue(list.isEmpty()); @@ -675,7 +675,7 @@ public class SynchronizedStackTests this.ss.push("one"); this.ss.push("two"); this.ss.push("three"); - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); list.add("aaa"); list.add("bbb"); list.add("ccc"); @@ -692,7 +692,7 @@ public class SynchronizedStackTests this.ss.push("one"); this.ss.push("two"); this.ss.push("three"); - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); list.add("aaa"); list.add("bbb"); list.add("ccc"); @@ -706,7 +706,7 @@ public class SynchronizedStackTests } public void testPopAllToListInt_empty() throws Exception { - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); list.add("aaa"); list.add("bbb"); list.add("ccc"); @@ -760,7 +760,7 @@ public class SynchronizedStackTests this.ss.push("one"); this.ss.push("two"); this.ss.push("zero"); - Map<String, String>map = new HashMap<String, String>(); + Map<String, String>map = new HashMap<>(); assertTrue(this.ss.popAllTo(map, DequeToolsTests.FIRST_LETTER_TRANSFORMER)); assertEquals("one", map.get("o")); assertEquals("two", map.get("t")); @@ -768,7 +768,7 @@ public class SynchronizedStackTests } public void testPopAllToMapTransformer_empty() { - Map<String, String>map = new HashMap<String, String>(); + Map<String, String>map = new HashMap<>(); assertFalse(this.ss.popAllTo(map, DequeToolsTests.FIRST_LETTER_TRANSFORMER)); assertTrue(map.isEmpty()); } @@ -777,7 +777,7 @@ public class SynchronizedStackTests this.ss.push("one"); this.ss.push("two"); this.ss.push("zero"); - Map<String, String>map = new HashMap<String, String>(); + Map<String, String>map = new HashMap<>(); assertTrue(this.ss.popAllTo(map, DequeToolsTests.FIRST_LETTER_TRANSFORMER, DequeToolsTests.EMPHASIZER)); assertEquals("*one*", map.get("o")); assertEquals("*two*", map.get("t")); @@ -785,7 +785,7 @@ public class SynchronizedStackTests } public void testPopAllToMapTransformerTransformer_empty() { - Map<String, String>map = new HashMap<String, String>(); + Map<String, String>map = new HashMap<>(); assertFalse(this.ss.popAllTo(map, DequeToolsTests.FIRST_LETTER_TRANSFORMER, DequeToolsTests.EMPHASIZER)); assertTrue(map.isEmpty()); } |