Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2015-12-09 10:58:00 -0500
committerBrian Vosburgh2015-12-09 10:58:00 -0500
commiteb9881f5b24e8d0d0c582dcda5bb92eed5ac4add (patch)
tree0063cdd0eb6123f5d38619665b2a31e218aa278f
parent6186402c0cc65e163b892572526b8b3948f6d187 (diff)
downloadwebtools.dali-eb9881f5b24e8d0d0c582dcda5bb92eed5ac4add.tar.gz
webtools.dali-eb9881f5b24e8d0d0c582dcda5bb92eed5ac4add.tar.xz
webtools.dali-eb9881f5b24e8d0d0c582dcda5bb92eed5ac4add.zip
fix comparator compiler warnings
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/comparator/ComparatorTools.java15
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/comparator/VersionComparator.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/JpaPlatform.java4
3 files changed, 12 insertions, 11 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/comparator/ComparatorTools.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/comparator/ComparatorTools.java
index ed7142fe92..b90567561e 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/comparator/ComparatorTools.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/comparator/ComparatorTools.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Oracle. All rights reserved.
+ * Copyright (c) 2013, 2015 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.
@@ -92,6 +92,7 @@ public final class ComparatorTools {
/**
* @see #chain(Iterable)
*/
+ @SafeVarargs
public static <E> Comparator<E> chain(Comparator<? super E>... comparators) {
return chain(ArrayTools.iterable(comparators));
}
@@ -105,7 +106,7 @@ public final class ComparatorTools {
* @param <E> the type of elements to be compared
*/
public static <E> Comparator<E> chain(Iterable<Comparator<? super E>> comparators) {
- return new ComparatorChain<E>(comparators);
+ return new ComparatorChain<>(comparators);
}
@@ -137,7 +138,7 @@ public final class ComparatorTools {
* @param <E> the type of elements to be compared
*/
public static <E> Comparator<E> nullsFirst(Comparator<? super E> comparator) {
- return new NullsFirstComparator<E>(comparator);
+ return new NullsFirstComparator<>(comparator);
}
/**
@@ -147,7 +148,7 @@ public final class ComparatorTools {
* @param <E> the type of elements to be compared
*/
public static <E> Comparator<E> nullsLast(Comparator<? super E> comparator) {
- return new NullsLastComparator<E>(comparator);
+ return new NullsLastComparator<>(comparator);
}
@@ -169,7 +170,7 @@ public final class ComparatorTools {
* @param <E> the type of elements to be compared
*/
public static <E> Comparator<E> reverse(Comparator<? super E> comparator) {
- return new ReverseComparator<E>(comparator);
+ return new ReverseComparator<>(comparator);
}
@@ -236,7 +237,7 @@ public final class ComparatorTools {
* of the elements to be compared by the wrapped comaparator, if present
*/
public static <E, O> Comparator<E> transformationComparator(Transformer<? super E, ? extends O> transformer, Comparator<O> comparator) {
- return new TransformationComparator<E, O>(transformer, comparator);
+ return new TransformationComparator<>(transformer, comparator);
}
@@ -290,7 +291,7 @@ public final class ComparatorTools {
* @param <T> the type of comparable returned by the comparator's segment parser
*/
public static <T extends Comparable<T>> Comparator<String> versionComparator(String delimiters, SegmentParser<T> segmentParser) {
- return new VersionComparator<T>(delimiters, segmentParser);
+ return new VersionComparator<>(delimiters, segmentParser);
}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/comparator/VersionComparator.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/comparator/VersionComparator.java
index a74e47934c..4b7dc6cd22 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/comparator/VersionComparator.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/comparator/VersionComparator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2015 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.
@@ -89,7 +89,7 @@ public class VersionComparator<T extends Comparable<T>>
* compared individually.
*/
protected ArrayList<T> parseVersion(String s) {
- ArrayList<T> segments = new ArrayList<T>();
+ ArrayList<T> segments = new ArrayList<>();
int i = 0;
for (StringTokenizer stream = new StringTokenizer(s, this.delimiters); stream.hasMoreTokens(); ) {
segments.add(this.segmentParser.parse(i++, stream.nextToken()));
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/JpaPlatform.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/JpaPlatform.java
index 4a2b327689..9328cbc9cc 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/JpaPlatform.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/JpaPlatform.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2015 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.
@@ -228,7 +228,7 @@ public interface JpaPlatform
/**
* Return whether the platform is compatible with the specified JPA
* specification version.
- * @see org.eclipse.jpt.common.utility.internal.comparator.VersionComparator#INTEGER_VERSION_COMPARATOR
+ * @see org.eclipse.jpt.common.utility.internal.comparator.ComparatorTools#INTEGER_VERSION_COMPARATOR
* @see JpaProject#FACET_VERSION_STRING
* @see JpaProject2_0#FACET_VERSION_STRING
* @see JpaProject2_1#FACET_VERSION_STRING

Back to the top