ICU-20119 BRS63RC Fix javac/javadoc/Eclipse errors/warnings (#132)

* ICU-20119 BRS63RC Fixing java compiler warnings

* ICU-20119 BRS63RC Fixing JavaDoc errors
This commit is contained in:
Yoshito Umaoka 2018-09-18 01:31:03 -04:00 committed by Shane Carr
parent 74759b467e
commit cc6b107513
No known key found for this signature in database
GPG key ID: FCED3B24AAB18B5C
9 changed files with 63 additions and 47 deletions

View file

@ -2,8 +2,11 @@ eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
@ -13,6 +16,7 @@ org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
@ -62,12 +66,14 @@ org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
@ -84,12 +90,16 @@ org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=info
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
@ -97,6 +107,7 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning

View file

@ -37,11 +37,11 @@ public class Relation<K, V> implements Freezable<Relation<K,V>> { // TODO: add ,
Object[] setComparatorParam;
public static <K, V> Relation<K, V> of(Map<K, Set<V>> map, Class<?> setCreator) {
return new Relation<K, V>(map, setCreator);
return new Relation<>(map, setCreator);
}
public static <K,V> Relation<K, V> of(Map<K, Set<V>> map, Class<?> setCreator, Comparator<V> setComparator) {
return new Relation<K, V>(map, setCreator, setComparator);
return new Relation<>(map, setCreator, setComparator);
}
public Relation(Map<K, Set<V>> map, Class<?> setCreator) {
@ -91,10 +91,10 @@ public class Relation<K, V> implements Freezable<Relation<K,V>> { // TODO: add ,
}
public Set<Entry<K, V>> keyValueSet() {
Set<Entry<K, V>> result = new LinkedHashSet<Entry<K, V>>();
Set<Entry<K, V>> result = new LinkedHashSet<>();
for (K key : data.keySet()) {
for (V value : data.get(key)) {
result.add(new SimpleEntry<K, V>(key, value));
result.add(new SimpleEntry<>(key, value));
}
}
return result;
@ -320,7 +320,9 @@ public class Relation<K, V> implements Freezable<Relation<K,V>> { // TODO: add ,
return result;
}
public Set<V> removeAll(K... keys) {
@SafeVarargs
@SuppressWarnings("varargs") // Not supported by Eclipse, but we need this for javac
public final Set<V> removeAll(K... keys) {
return removeAll(Arrays.asList(keys));
}
@ -333,7 +335,7 @@ public class Relation<K, V> implements Freezable<Relation<K,V>> { // TODO: add ,
}
public Set<V> removeAll(Collection<K> toBeRemoved) {
Set<V> result = new LinkedHashSet<V>();
Set<V> result = new LinkedHashSet<>();
for (K key : toBeRemoved) {
try {
final Set<V> removals = data.remove(key);

View file

@ -44,7 +44,9 @@ public class XCldrStub {
? setClass
: HashSet.class);
}
public Multimap<K, V> putAll(K key, V... values) {
@SafeVarargs
@SuppressWarnings("varargs") // Not supported by Eclipse, but we need this for javac
public final Multimap<K, V> putAll(K key, V... values) {
if (values.length != 0) {
createSetIfMissing(key).addAll(Arrays.asList(values));
}
@ -107,7 +109,7 @@ public class XCldrStub {
return map.size();
}
public Iterable<Entry<K, V>> entries() {
return new MultimapIterator<K, V>(map);
return new MultimapIterator<>(map);
}
@Override
public boolean equals(Object obj) {
@ -147,7 +149,7 @@ public class XCldrStub {
private static class MultimapIterator<K,V> implements Iterator<Entry<K,V>>, Iterable<Entry<K,V>> {
private final Iterator<Entry<K, Set<V>>> it1;
private Iterator<V> it2 = null;
private final ReusableEntry<K,V> entry = new ReusableEntry<K,V>();
private final ReusableEntry<K,V> entry = new ReusableEntry<>();
private MultimapIterator(Map<K,Set<V>> map) {
it1 = map.entrySet().iterator();
@ -199,7 +201,7 @@ public class XCldrStub {
super(new HashMap<K, Set<V>>(), HashSet.class);
}
public static <K, V> HashMultimap<K, V> create() {
return new HashMultimap<K, V>();
return new HashMultimap<>();
}
}
@ -208,7 +210,7 @@ public class XCldrStub {
super(new TreeMap<K, Set<V>>(), TreeSet.class);
}
public static <K, V> TreeMultimap<K, V> create() {
return new TreeMultimap<K, V>();
return new TreeMultimap<>();
}
}
@ -217,7 +219,7 @@ public class XCldrStub {
super(new LinkedHashMap<K, Set<V>>(), LinkedHashSet.class);
}
public static <K, V> LinkedHashMultimap<K, V> create() {
return new LinkedHashMultimap<K, V>();
return new LinkedHashMultimap<>();
}
}
@ -315,24 +317,24 @@ public class XCldrStub {
public static class ImmutableSet {
public static <T> Set<T> copyOf(Set<T> values) {
return Collections.unmodifiableSet(new LinkedHashSet<T>(values)); // copy set for safety, preserve order
return Collections.unmodifiableSet(new LinkedHashSet<>(values)); // copy set for safety, preserve order
}
}
public static class ImmutableMap {
public static <K,V> Map<K,V> copyOf(Map<K,V> values) {
return Collections.unmodifiableMap(new LinkedHashMap<K,V>(values)); // copy set for safety, preserve order
return Collections.unmodifiableMap(new LinkedHashMap<>(values)); // copy set for safety, preserve order
}
}
public static class ImmutableMultimap {
public static <K,V> Multimap<K,V> copyOf(Multimap<K,V> values) {
LinkedHashMap<K, Set<V>> temp = new LinkedHashMap<K,Set<V>>(); // semi-deep copy, preserve order
LinkedHashMap<K, Set<V>> temp = new LinkedHashMap<>(); // semi-deep copy, preserve order
for (Entry<K, Set<V>> entry : values.asMap().entrySet()) {
Set<V> value = entry.getValue();
temp.put(entry.getKey(), value.size() == 1
? Collections.singleton(value.iterator().next())
: Collections.unmodifiableSet(new LinkedHashSet<V>(value)));
: Collections.unmodifiableSet(new LinkedHashSet<>(value)));
}
return new Multimap<K,V>(Collections.unmodifiableMap(temp), null);
return new Multimap<>(Collections.unmodifiableMap(temp), null);
}
}

View file

@ -380,8 +380,8 @@ public abstract class CodePointMap implements Iterable<CodePointMap.Range> {
*
* @param start range start
* @param option defines whether surrogates are treated normally,
* or as having the surrogateValue; usually {@value RangeOption#NORMAL}
* @param surrogateValue value for surrogates; ignored if option=={@value RangeOption#NORMAL}
* or as having the surrogateValue; usually {@link RangeOption#NORMAL}
* @param surrogateValue value for surrogates; ignored if option=={@link RangeOption#NORMAL}
* @param filter an object that may modify the map data value,
* or null if the values from the map are to be used unmodified
* @param range the range object that will be set to the code point range and value

View file

@ -33,7 +33,7 @@ public abstract class CodePointTrie extends CodePointMap {
* <p>Use null for {@link #fromBinary} to accept any type;
* {@link #getType} will return the actual type.
*
* @see MutableCodePointTrie#buildImmutable(Type, ValueWidth)
* @see MutableCodePointTrie#buildImmutable(CodePointTrie.Type, CodePointTrie.ValueWidth)
* @see #fromBinary
* @see #getType
* @draft ICU 63
@ -133,7 +133,7 @@ public abstract class CodePointTrie extends CodePointMap {
* @param bytes a buffer containing the binary data of a CodePointTrie
* @return the trie
* @see MutableCodePointTrie#MutableCodePointTrie(int, int)
* @see MutableCodePointTrie#buildImmutable(Type, ValueWidth)
* @see MutableCodePointTrie#buildImmutable(CodePointTrie.Type, CodePointTrie.ValueWidth)
* @see #toBinary(OutputStream)
* @draft ICU 63
* @provisional This API might change or be removed in a future release.
@ -740,7 +740,7 @@ public abstract class CodePointTrie extends CodePointMap {
protected abstract int cpIndex(int c);
/**
* A CodePointTrie with {@value Type#FAST}.
* A CodePointTrie with {@link Type#FAST}.
*
* @draft ICU 63
* @provisional This API might change or be removed in a future release.
@ -754,7 +754,7 @@ public abstract class CodePointTrie extends CodePointMap {
/**
* Creates a trie from its binary form.
* Same as {@link CodePointTrie#fromBinary(Type, ValueWidth, ByteBuffer)}
* with {@value Type#FAST}.
* with {@link Type#FAST}.
*
* @param valueWidth selects the number of bits in a data value; this method throws an exception
* if the valueWidth does not match the binary data;
@ -769,7 +769,7 @@ public abstract class CodePointTrie extends CodePointMap {
}
/**
* @return {@value Type#FAST}
* @return {@link Type#FAST}
* @draft ICU 63
* @provisional This API might change or be removed in a future release.
*/
@ -884,7 +884,7 @@ public abstract class CodePointTrie extends CodePointMap {
}
/**
* A CodePointTrie with {@value Type#SMALL}.
* A CodePointTrie with {@link Type#SMALL}.
*
* @draft ICU 63
* @provisional This API might change or be removed in a future release.
@ -898,7 +898,7 @@ public abstract class CodePointTrie extends CodePointMap {
/**
* Creates a trie from its binary form.
* Same as {@link CodePointTrie#fromBinary(Type, ValueWidth, ByteBuffer)}
* with {@value Type#SMALL}.
* with {@link Type#SMALL}.
*
* @param valueWidth selects the number of bits in a data value; this method throws an exception
* if the valueWidth does not match the binary data;
@ -913,7 +913,7 @@ public abstract class CodePointTrie extends CodePointMap {
}
/**
* @return {@value Type#SMALL}
* @return {@link Type#SMALL}
* @draft ICU 63
* @provisional This API might change or be removed in a future release.
*/
@ -1005,7 +1005,7 @@ public abstract class CodePointTrie extends CodePointMap {
}
/**
* A CodePointTrie with {@value Type#FAST} and {@value ValueWidth#BITS_16}.
* A CodePointTrie with {@link Type#FAST} and {@link ValueWidth#BITS_16}.
*
* @draft ICU 63
* @provisional This API might change or be removed in a future release.
@ -1022,7 +1022,7 @@ public abstract class CodePointTrie extends CodePointMap {
/**
* Creates a trie from its binary form.
* Same as {@link CodePointTrie#fromBinary(Type, ValueWidth, ByteBuffer)}
* with {@value Type#FAST} and {@value ValueWidth#BITS_16}.
* with {@link Type#FAST} and {@link ValueWidth#BITS_16}.
*
* @param bytes a buffer containing the binary data of a CodePointTrie
* @return the trie
@ -1067,7 +1067,7 @@ public abstract class CodePointTrie extends CodePointMap {
}
/**
* A CodePointTrie with {@value Type#FAST} and {@value ValueWidth#BITS_32}.
* A CodePointTrie with {@link Type#FAST} and {@link ValueWidth#BITS_32}.
*
* @draft ICU 63
* @provisional This API might change or be removed in a future release.
@ -1084,7 +1084,7 @@ public abstract class CodePointTrie extends CodePointMap {
/**
* Creates a trie from its binary form.
* Same as {@link CodePointTrie#fromBinary(Type, ValueWidth, ByteBuffer)}
* with {@value Type#FAST} and {@value ValueWidth#BITS_32}.
* with {@link Type#FAST} and {@link ValueWidth#BITS_32}.
*
* @param bytes a buffer containing the binary data of a CodePointTrie
* @return the trie
@ -1129,7 +1129,7 @@ public abstract class CodePointTrie extends CodePointMap {
}
/**
* A CodePointTrie with {@value Type#FAST} and {@value ValueWidth#BITS_8}.
* A CodePointTrie with {@link Type#FAST} and {@link ValueWidth#BITS_8}.
*
* @draft ICU 63
* @provisional This API might change or be removed in a future release.
@ -1146,7 +1146,7 @@ public abstract class CodePointTrie extends CodePointMap {
/**
* Creates a trie from its binary form.
* Same as {@link CodePointTrie#fromBinary(Type, ValueWidth, ByteBuffer)}
* with {@value Type#FAST} and {@value ValueWidth#BITS_8}.
* with {@link Type#FAST} and {@link ValueWidth#BITS_8}.
*
* @param bytes a buffer containing the binary data of a CodePointTrie
* @return the trie
@ -1191,7 +1191,7 @@ public abstract class CodePointTrie extends CodePointMap {
}
/**
* A CodePointTrie with {@value Type#SMALL} and {@value ValueWidth#BITS_16}.
* A CodePointTrie with {@link Type#SMALL} and {@link ValueWidth#BITS_16}.
*
* @draft ICU 63
* @provisional This API might change or be removed in a future release.
@ -1205,7 +1205,7 @@ public abstract class CodePointTrie extends CodePointMap {
/**
* Creates a trie from its binary form.
* Same as {@link CodePointTrie#fromBinary(Type, ValueWidth, ByteBuffer)}
* with {@value Type#SMALL} and {@value ValueWidth#BITS_16}.
* with {@link Type#SMALL} and {@link ValueWidth#BITS_16}.
*
* @param bytes a buffer containing the binary data of a CodePointTrie
* @return the trie
@ -1218,7 +1218,7 @@ public abstract class CodePointTrie extends CodePointMap {
}
/**
* A CodePointTrie with {@value Type#SMALL} and {@value ValueWidth#BITS_32}.
* A CodePointTrie with {@link Type#SMALL} and {@link ValueWidth#BITS_32}.
*
* @draft ICU 63
* @provisional This API might change or be removed in a future release.
@ -1232,7 +1232,7 @@ public abstract class CodePointTrie extends CodePointMap {
/**
* Creates a trie from its binary form.
* Same as {@link CodePointTrie#fromBinary(Type, ValueWidth, ByteBuffer)}
* with {@value Type#SMALL} and {@value ValueWidth#BITS_32}.
* with {@link Type#SMALL} and {@link ValueWidth#BITS_32}.
*
* @param bytes a buffer containing the binary data of a CodePointTrie
* @return the trie
@ -1245,7 +1245,7 @@ public abstract class CodePointTrie extends CodePointMap {
}
/**
* A CodePointTrie with {@value Type#SMALL} and {@value ValueWidth#BITS_8}.
* A CodePointTrie with {@link Type#SMALL} and {@link ValueWidth#BITS_8}.
*
* @draft ICU 63
* @provisional This API might change or be removed in a future release.
@ -1259,7 +1259,7 @@ public abstract class CodePointTrie extends CodePointMap {
/**
* Creates a trie from its binary form.
* Same as {@link CodePointTrie#fromBinary(Type, ValueWidth, ByteBuffer)}
* with {@value Type#SMALL} and {@value ValueWidth#BITS_8}.
* with {@link Type#SMALL} and {@link ValueWidth#BITS_8}.
*
* @param bytes a buffer containing the binary data of a CodePointTrie
* @return the trie

View file

@ -50,7 +50,7 @@ import com.ibm.icu.impl.EraRules;
* names in OpenJDK. ICU4J implementation enables the CLDR tentative era when
* this property is defined, but it does not use the start date and names specified
* by the property value.)</li>
* </nl>
* </ol>
* <p>
* This class should not be subclassed.</p>
* <p>

View file

@ -332,6 +332,7 @@ public class RBBIMonkeyTest extends TestFmwk {
fBreakRules.add(thisRule);
};
@SuppressWarnings("unused")
private static String hexToCodePoint(String hex) {
int cp = Integer.parseInt(hex, 16);
return new StringBuilder().appendCodePoint(cp).toString();

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="output" path="out/bin"/>
</classpath>

View file

@ -1,9 +1,9 @@
#Thu Jan 19 10:20:40 EST 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@ -71,7 +71,8 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
@ -153,7 +154,6 @@ org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert