commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1812843 - in /commons/proper/codec/trunk/src: main/java/org/apache/commons/codec/language/ main/java/org/apache/commons/codec/language/bm/ test/java/org/apache/commons/codec/digest/ test/java/org/apache/commons/codec/language/bm/
Date Sat, 21 Oct 2017 18:07:29 GMT
Author: ggregory
Date: Sat Oct 21 18:07:28 2017
New Revision: 1812843

URL: http://svn.apache.org/viewvc?rev=1812843&view=rev
Log:
[CODEC-244] Update from Java 6 to Java 7. Remove redundant type arguments.

Modified:
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/DaitchMokotoffSoundex.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Lang.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Languages.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Rule.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/language/bm/PhoneticEngineRegressionTest.java

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/DaitchMokotoffSoundex.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/DaitchMokotoffSoundex.java?rev=1812843&r1=1812842&r2=1812843&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/DaitchMokotoffSoundex.java
(original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/DaitchMokotoffSoundex.java
Sat Oct 21 18:07:28 2017
@@ -220,10 +220,10 @@ public class DaitchMokotoffSoundex imple
     private static final int MAX_LENGTH = 6;
 
     /** Transformation rules indexed by the first character of their pattern. */
-    private static final Map<Character, List<Rule>> RULES = new HashMap<Character,
List<Rule>>();
+    private static final Map<Character, List<Rule>> RULES = new HashMap<>();
 
     /** Folding rules. */
-    private static final Map<Character, Character> FOLDINGS = new HashMap<Character,
Character>();
+    private static final Map<Character, Character> FOLDINGS = new HashMap<>();
 
     static {
         final InputStream rulesIS = DaitchMokotoffSoundex.class.getClassLoader().getResourceAsStream(RESOURCE_FILE);
@@ -316,7 +316,7 @@ public class DaitchMokotoffSoundex imple
                         final char patternKey = r.pattern.charAt(0);
                         List<Rule> rules = ruleMapping.get(patternKey);
                         if (rules == null) {
-                            rules = new ArrayList<Rule>();
+                            rules = new ArrayList<>();
                             ruleMapping.put(patternKey, rules);
                         }
                         rules.add(r);
@@ -490,7 +490,7 @@ public class DaitchMokotoffSoundex imple
 
         final String input = cleanup(source);
 
-        final Set<Branch> currentBranches = new LinkedHashSet<Branch>();
+        final Set<Branch> currentBranches = new LinkedHashSet<>();
         currentBranches.add(new Branch());
 
         char lastChar = '\0';

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Lang.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Lang.java?rev=1812843&r1=1812842&r2=1812843&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Lang.java
(original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Lang.java
Sat Oct 21 18:07:28 2017
@@ -93,7 +93,7 @@ public class Lang {
         }
     }
 
-    private static final Map<NameType, Lang> Langs = new EnumMap<NameType, Lang>(NameType.class);
+    private static final Map<NameType, Lang> Langs = new EnumMap<>(NameType.class);
 
     private static final String LANGUAGE_RULES_RN = "org/apache/commons/codec/language/bm/%s_lang.txt";
 
@@ -127,7 +127,7 @@ public class Lang {
      * @return a Lang encapsulating the loaded language-guessing rules.
      */
     public static Lang loadFromResource(final String languageRulesResourceName, final Languages
languages) {
-        final List<LangRule> rules = new ArrayList<LangRule>();
+        final List<LangRule> rules = new ArrayList<>();
         final InputStream lRulesIS = Lang.class.getClassLoader().getResourceAsStream(languageRulesResourceName);
 
         if (lRulesIS == null) {
@@ -174,7 +174,7 @@ public class Lang {
                         final String[] langs = parts[1].split("\\+");
                         final boolean accept = parts[2].equals("true");
 
-                        rules.add(new LangRule(pattern, new HashSet<String>(Arrays.asList(langs)),
accept));
+                        rules.add(new LangRule(pattern, new HashSet<>(Arrays.asList(langs)),
accept));
                     }
                 }
             }
@@ -214,7 +214,7 @@ public class Lang {
     public Languages.LanguageSet guessLanguages(final String input) {
         final String text = input.toLowerCase(Locale.ENGLISH);
 
-        final Set<String> langs = new HashSet<String>(this.languages.getLanguages());
+        final Set<String> langs = new HashSet<>(this.languages.getLanguages());
         for (final LangRule rule : this.rules) {
             if (rule.matches(text)) {
                 if (rule.acceptOnMatch) {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Languages.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Languages.java?rev=1812843&r1=1812842&r2=1812843&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Languages.java
(original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Languages.java
Sat Oct 21 18:07:28 2017
@@ -119,7 +119,7 @@ public class Languages {
                 return this;
             } else {
                 final SomeLanguages sl = (SomeLanguages) other;
-                final Set<String> ls = new HashSet<String>(Math.min(languages.size(),
sl.languages.size()));
+                final Set<String> ls = new HashSet<>(Math.min(languages.size(),
sl.languages.size()));
                 for (final String lang : languages) {
                     if (sl.languages.contains(lang)) {
                         ls.add(lang);
@@ -137,7 +137,7 @@ public class Languages {
                 return other;
             } else {
                 final SomeLanguages sl = (SomeLanguages) other;
-                final Set<String> ls = new HashSet<String>(languages);
+                final Set<String> ls = new HashSet<>(languages);
                 for (final String lang : sl.languages) {
                   ls.add(lang);
                 }
@@ -154,7 +154,7 @@ public class Languages {
 
     public static final String ANY = "any";
 
-    private static final Map<NameType, Languages> LANGUAGES = new EnumMap<NameType,
Languages>(NameType.class);
+    private static final Map<NameType, Languages> LANGUAGES = new EnumMap<>(NameType.class);
 
     static {
         for (final NameType s : NameType.values()) {
@@ -168,7 +168,7 @@ public class Languages {
 
     public static Languages getInstance(final String languagesResourceName) {
         // read languages list
-        final Set<String> ls = new HashSet<String>();
+        final Set<String> ls = new HashSet<>();
         final InputStream langIS = Languages.class.getClassLoader().getResourceAsStream(languagesResourceName);
 
         if (langIS == null) {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java?rev=1812843&r1=1812842&r2=1812843&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java
(original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java
Sat Oct 21 18:07:28 2017
@@ -75,7 +75,7 @@ public class PhoneticEngine {
         private final Set<Rule.Phoneme> phonemes;
 
         private PhonemeBuilder(final Rule.Phoneme phoneme) {
-            this.phonemes = new LinkedHashSet<Rule.Phoneme>();
+            this.phonemes = new LinkedHashSet<>();
             this.phonemes.add(phoneme);
         }
 
@@ -104,7 +104,7 @@ public class PhoneticEngine {
          * @param maxPhonemes   the maximum number of phonemes to build up
          */
         public void apply(final Rule.PhonemeExpr phonemeExpr, final int maxPhonemes) {
-            final Set<Rule.Phoneme> newPhonemes = new LinkedHashSet<Rule.Phoneme>(maxPhonemes);
+            final Set<Rule.Phoneme> newPhonemes = new LinkedHashSet<>(maxPhonemes);
 
             EXPR: for (final Rule.Phoneme left : this.phonemes) {
                 for (final Rule.Phoneme right : phonemeExpr.getPhonemes()) {
@@ -232,19 +232,19 @@ public class PhoneticEngine {
         }
     }
 
-    private static final Map<NameType, Set<String>> NAME_PREFIXES = new EnumMap<NameType,
Set<String>>(NameType.class);
+    private static final Map<NameType, Set<String>> NAME_PREFIXES = new EnumMap<>(NameType.class);
 
     static {
         NAME_PREFIXES.put(NameType.ASHKENAZI,
                 Collections.unmodifiableSet(
-                        new HashSet<String>(Arrays.asList("bar", "ben", "da", "de",
"van", "von"))));
+                        new HashSet<>(Arrays.asList("bar", "ben", "da", "de", "van",
"von"))));
         NAME_PREFIXES.put(NameType.SEPHARDIC,
                 Collections.unmodifiableSet(
-                        new HashSet<String>(Arrays.asList("al", "el", "da", "dal",
"de", "del", "dela", "de la",
+                        new HashSet<>(Arrays.asList("al", "el", "da", "dal", "de",
"del", "dela", "de la",
                                                           "della", "des", "di", "do", "dos",
"du", "van", "von"))));
         NAME_PREFIXES.put(NameType.GENERIC,
                 Collections.unmodifiableSet(
-                        new HashSet<String>(Arrays.asList("da", "dal", "de", "del",
"dela", "de la", "della",
+                        new HashSet<>(Arrays.asList("da", "dal", "de", "del", "dela",
"de la", "della",
                                                           "des", "di", "do", "dos", "du",
"van", "von"))));
     }
 
@@ -336,7 +336,7 @@ public class PhoneticEngine {
         }
 
         final Map<Rule.Phoneme, Rule.Phoneme> phonemes =
-            new TreeMap<Rule.Phoneme, Rule.Phoneme>(Rule.Phoneme.COMPARATOR);
+            new TreeMap<>(Rule.Phoneme.COMPARATOR);
 
         for (final Rule.Phoneme phoneme : phonemeBuilder.getPhonemes()) {
             PhonemeBuilder subBuilder = PhonemeBuilder.empty(phoneme.getLanguages());
@@ -424,7 +424,7 @@ public class PhoneticEngine {
         }
 
         final List<String> words = Arrays.asList(input.split("\\s+"));
-        final List<String> words2 = new ArrayList<String>();
+        final List<String> words2 = new ArrayList<>();
 
         // special-case handling of word prefixes based upon the name type
         switch (this.nameType) {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Rule.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Rule.java?rev=1812843&r1=1812842&r2=1812843&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Rule.java
(original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Rule.java
Sat Oct 21 18:07:28 2017
@@ -207,15 +207,15 @@ public class Rule {
     private static final String HASH_INCLUDE = "#include";
 
     private static final Map<NameType, Map<RuleType, Map<String, Map<String,
List<Rule>>>>> RULES =
-            new EnumMap<NameType, Map<RuleType, Map<String, Map<String, List<Rule>>>>>(NameType.class);
+            new EnumMap<>(NameType.class);
 
     static {
         for (final NameType s : NameType.values()) {
             final Map<RuleType, Map<String, Map<String, List<Rule>>>>
rts =
-                    new EnumMap<RuleType, Map<String, Map<String, List<Rule>>>>(RuleType.class);
+                    new EnumMap<>(RuleType.class);
 
             for (final RuleType rt : RuleType.values()) {
-                final Map<String, Map<String, List<Rule>>> rs = new HashMap<String,
Map<String, List<Rule>>>();
+                final Map<String, Map<String, List<Rule>>> rs = new HashMap<>();
 
                 final Languages ls = Languages.getInstance(s);
                 for (final String l : ls.getLanguages()) {
@@ -306,7 +306,7 @@ public class Rule {
     public static List<Rule> getInstance(final NameType nameType, final RuleType rt,
                                          final Languages.LanguageSet langs) {
         final Map<String, List<Rule>> ruleMap = getInstanceMap(nameType, rt,
langs);
-        final List<Rule> allRules = new ArrayList<Rule>();
+        final List<Rule> allRules = new ArrayList<>();
         for (final List<Rule> rules : ruleMap.values()) {
             allRules.addAll(rules);
         }
@@ -325,7 +325,7 @@ public class Rule {
      * @return a list of Rules that apply
      */
     public static List<Rule> getInstance(final NameType nameType, final RuleType rt,
final String lang) {
-        return getInstance(nameType, rt, LanguageSet.from(new HashSet<String>(Arrays.asList(lang))));
+        return getInstance(nameType, rt, LanguageSet.from(new HashSet<>(Arrays.asList(lang))));
     }
 
     /**
@@ -378,7 +378,7 @@ public class Rule {
             }
             final String before = ph.substring(0, open);
             final String in = ph.substring(open + 1, ph.length() - 1);
-            final Set<String> langs = new HashSet<String>(Arrays.asList(in.split("[+]")));
+            final Set<String> langs = new HashSet<>(Arrays.asList(in.split("[+]")));
 
             return new Phoneme(before, Languages.LanguageSet.from(langs));
         }
@@ -391,7 +391,7 @@ public class Rule {
                 throw new IllegalArgumentException("Phoneme starts with '(' so must end with
')'");
             }
 
-            final List<Phoneme> phs = new ArrayList<Phoneme>();
+            final List<Phoneme> phs = new ArrayList<>();
             final String body = ph.substring(1, ph.length() - 1);
             for (final String part : body.split("[|]")) {
                 phs.add(parsePhoneme(part));
@@ -406,7 +406,7 @@ public class Rule {
     }
 
     private static Map<String, List<Rule>> parseRules(final Scanner scanner,
final String location) {
-        final Map<String, List<Rule>> lines = new HashMap<String, List<Rule>>();
+        final Map<String, List<Rule>> lines = new HashMap<>();
         int currentLine = 0;
 
         boolean inMultilineComment = false;
@@ -482,7 +482,7 @@ public class Rule {
                             final String patternKey = r.pattern.substring(0,1);
                             List<Rule> rules = lines.get(patternKey);
                             if (rules == null) {
-                                rules = new ArrayList<Rule>();
+                                rules = new ArrayList<>();
                                 lines.put(patternKey, rules);
                             }
                             rules.add(r);

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java?rev=1812843&r1=1812842&r2=1812843&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java
Sat Oct 21 18:07:28 2017
@@ -102,7 +102,7 @@ public class HmacAlgorithmsTest {
                         { HmacAlgorithms.HMAC_SHA_512, STANDARD_SHA512_RESULT_BYTES, STANDARD_SHA512_RESULT_STRING
} });
         // @formatter:on
         if (SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_8)) {
-            list = new ArrayList<Object[]>(list);
+            list = new ArrayList<>(list);
             list.add(new Object[] {HmacAlgorithms.HMAC_SHA_224, STANDARD_SHA224_RESULT_BYTES,
STANDARD_SHA224_RESULT_STRING});
         }
         return list;

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java?rev=1812843&r1=1812842&r2=1812843&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java
Sat Oct 21 18:07:28 2017
@@ -224,7 +224,7 @@ public class PureJavaCrc32Test {
     public static final int BYTES_PER_SIZE = MAX_LEN * 4;
 
     static final Class<? extends Checksum> zip = CRC32.class;
-    static final List<Class<? extends Checksum>> CRCS = new ArrayList<Class<?
extends Checksum>>();
+    static final List<Class<? extends Checksum>> CRCS = new ArrayList<>();
     static {
       CRCS.add(zip);
       CRCS.add(PureJavaCrc32.class);
@@ -286,7 +286,7 @@ public class PureJavaCrc32Test {
         printCell(String.valueOf(numThreads), numThreadsStr.length(), out);
 
         BenchResult expected = null;
-        final List<BenchResult> previous = new ArrayList<BenchResult>();
+        final List<BenchResult> previous = new ArrayList<>();
         for(final Class<? extends Checksum> c : crcs) {
           System.gc();
 

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/language/bm/PhoneticEngineRegressionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/language/bm/PhoneticEngineRegressionTest.java?rev=1812843&r1=1812842&r2=1812843&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/language/bm/PhoneticEngineRegressionTest.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/language/bm/PhoneticEngineRegressionTest.java
Sat Oct 21 18:07:28 2017
@@ -38,7 +38,7 @@ public class PhoneticEngineRegressionTes
         Map<String, String> args;
 
         // concat is true, ruleType is EXACT
-        args = new TreeMap<String, String>();
+        args = new TreeMap<>();
         args.put("nameType", "GENERIC");
         assertEquals(encode(args, true, "Angelo"), "YngYlo|Yngilo|agilo|angYlo|angilo|aniilo|anilo|anxilo|anzilo|ogilo|ongYlo|ongilo|oniilo|onilo|onxilo|onzilo");
         args.put("ruleType", "EXACT");
@@ -49,7 +49,7 @@ public class PhoneticEngineRegressionTes
         assertEquals(encode(args, true, "1234"), "");
 
         // concat is false, ruleType is EXACT
-        args = new TreeMap<String, String>();
+        args = new TreeMap<>();
         assertEquals(encode(args, false, "Angelo"), "YngYlo|Yngilo|agilo|angYlo|angilo|aniilo|anilo|anxilo|anzilo|ogilo|ongYlo|ongilo|oniilo|onilo|onxilo|onzilo");
         args.put("ruleType", "EXACT");
         assertEquals(encode(args, false, "Angelo"), "anZelo|andZelo|angelo|anhelo|anjelo|anxelo");
@@ -59,7 +59,7 @@ public class PhoneticEngineRegressionTes
         assertEquals(encode(args, false, "1234"), "");
 
         // concat is true, ruleType is APPROX
-        args = new TreeMap<String, String>();
+        args = new TreeMap<>();
         assertEquals(encode(args, true, "Angelo"), "YngYlo|Yngilo|agilo|angYlo|angilo|aniilo|anilo|anxilo|anzilo|ogilo|ongYlo|ongilo|oniilo|onilo|onxilo|onzilo");
         args.put("ruleType", "APPROX");
         assertEquals(encode(args, true, "Angelo"), "YngYlo|Yngilo|agilo|angYlo|angilo|aniilo|anilo|anxilo|anzilo|ogilo|ongYlo|ongilo|oniilo|onilo|onxilo|onzilo");
@@ -69,7 +69,7 @@ public class PhoneticEngineRegressionTes
         assertEquals(encode(args, true, "1234"), "");
 
         // concat is false, ruleType is APPROX
-        args = new TreeMap<String, String>();
+        args = new TreeMap<>();
         assertEquals(encode(args, false, "Angelo"), "YngYlo|Yngilo|agilo|angYlo|angilo|aniilo|anilo|anxilo|anzilo|ogilo|ongYlo|ongilo|oniilo|onilo|onxilo|onzilo");
         args.put("ruleType", "APPROX");
         assertEquals(encode(args, false, "Angelo"), "YngYlo|Yngilo|agilo|angYlo|angilo|aniilo|anilo|anxilo|anzilo|ogilo|ongYlo|ongilo|oniilo|onilo|onxilo|onzilo");
@@ -84,7 +84,7 @@ public class PhoneticEngineRegressionTes
         Map<String, String> args;
 
         // concat is true, ruleType is EXACT
-        args = new TreeMap<String, String>();
+        args = new TreeMap<>();
         args.put("nameType", "ASHKENAZI");
         assertEquals(encode(args, true, "Angelo"), "YngYlo|Yngilo|angYlo|angilo|anilo|anxilo|anzilo|ongYlo|ongilo|onilo|onxilo|onzilo");
         args.put("ruleType", "EXACT");
@@ -95,7 +95,7 @@ public class PhoneticEngineRegressionTes
         assertEquals(encode(args, true, "1234"), "");
 
         // concat is false, ruleType is EXACT
-        args = new TreeMap<String, String>();
+        args = new TreeMap<>();
         args.put("nameType", "ASHKENAZI");
         assertEquals(encode(args, false, "Angelo"), "YngYlo|Yngilo|angYlo|angilo|anilo|anxilo|anzilo|ongYlo|ongilo|onilo|onxilo|onzilo");
         args.put("ruleType", "EXACT");
@@ -106,7 +106,7 @@ public class PhoneticEngineRegressionTes
         assertEquals(encode(args, false, "1234"), "");
 
         // concat is true, ruleType is APPROX
-        args = new TreeMap<String, String>();
+        args = new TreeMap<>();
         args.put("nameType", "ASHKENAZI");
         assertEquals(encode(args, true, "Angelo"), "YngYlo|Yngilo|angYlo|angilo|anilo|anxilo|anzilo|ongYlo|ongilo|onilo|onxilo|onzilo");
         args.put("ruleType", "APPROX");
@@ -117,7 +117,7 @@ public class PhoneticEngineRegressionTes
         assertEquals(encode(args, true, "1234"), "");
 
         // concat is false, ruleType is APPROX
-        args = new TreeMap<String, String>();
+        args = new TreeMap<>();
         args.put("nameType", "ASHKENAZI");
         assertEquals(encode(args, false, "Angelo"), "YngYlo|Yngilo|angYlo|angilo|anilo|anxilo|anzilo|ongYlo|ongilo|onilo|onxilo|onzilo");
         args.put("ruleType", "APPROX");
@@ -133,7 +133,7 @@ public class PhoneticEngineRegressionTes
         Map<String, String> args;
 
         // concat is true, ruleType is EXACT
-        args = new TreeMap<String, String>();
+        args = new TreeMap<>();
         args.put("nameType", "SEPHARDIC");
         assertEquals(encode(args, true, "Angelo"), "anhila|anhilu|anzila|anzilu|nhila|nhilu|nzila|nzilu");
         args.put("ruleType", "EXACT");
@@ -144,7 +144,7 @@ public class PhoneticEngineRegressionTes
         assertEquals(encode(args, true, "1234"), "");
 
         // concat is false, ruleType is EXACT
-        args = new TreeMap<String, String>();
+        args = new TreeMap<>();
         args.put("nameType", "SEPHARDIC");
         assertEquals(encode(args, false, "Angelo"), "anhila|anhilu|anzila|anzilu|nhila|nhilu|nzila|nzilu");
         args.put("ruleType", "EXACT");
@@ -155,7 +155,7 @@ public class PhoneticEngineRegressionTes
         assertEquals(encode(args, false, "1234"), "");
 
         // concat is true, ruleType is APPROX
-        args = new TreeMap<String, String>();
+        args = new TreeMap<>();
         args.put("nameType", "SEPHARDIC");
         assertEquals(encode(args, true, "Angelo"), "anhila|anhilu|anzila|anzilu|nhila|nhilu|nzila|nzilu");
         args.put("ruleType", "APPROX");
@@ -166,7 +166,7 @@ public class PhoneticEngineRegressionTes
         assertEquals(encode(args, true, "1234"), "");
 
         // concat is false, ruleType is APPROX
-        args = new TreeMap<String, String>();
+        args = new TreeMap<>();
         args.put("nameType", "SEPHARDIC");
         assertEquals(encode(args, false, "Angelo"), "anhila|anhilu|anzila|anzilu|nhila|nhilu|nzila|nzilu");
         args.put("ruleType", "APPROX");
@@ -182,7 +182,7 @@ public class PhoneticEngineRegressionTes
         // see CODEC-187
         // comparison: http://stevemorse.org/census/soundex.html
 
-        final Map<String, String> args = new TreeMap<String, String>();
+        final Map<String, String> args = new TreeMap<>();
         args.put("nameType", "GENERIC");
         args.put("ruleType", "APPROX");
 
@@ -223,7 +223,7 @@ public class PhoneticEngineRegressionTes
         if (languageSetArg == null || languageSetArg.equals("auto")) {
             languageSet = null;
         } else {
-            languageSet = Languages.LanguageSet.from(new HashSet<String>(Arrays.asList(languageSetArg.split(","))));
+            languageSet = Languages.LanguageSet.from(new HashSet<>(Arrays.asList(languageSetArg.split(","))));
         }
 
         /*



Mime
View raw message