groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [groovy] branch master updated: minor refactor: avoid deprecated method usage
Date Wed, 08 May 2019 23:56:21 GMT
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new cac2910  minor refactor: avoid deprecated method usage
cac2910 is described below

commit cac291068cf80ba23b05184d4b4a526b8189bdeb
Author: Paul King <paulk@asert.com.au>
AuthorDate: Thu May 9 09:56:02 2019 +1000

    minor refactor: avoid deprecated method usage
---
 src/main/groovy/groovy/lang/MetaClassImpl.java     |  16 +-
 src/main/groovy/groovy/util/Node.java              |   2 +-
 .../groovy/classgen/asm/util/TypeUtil.java         |   2 +-
 .../codehaus/groovy/control/ResolveVisitor.java    |  16 +-
 .../groovy/runtime/DefaultGroovyMethods.java       |   2 +-
 src/test/groovy/lang/TupleTest.java                | 200 ++++++++-------------
 .../src/main/java/groovy/xml/SAXBuilder.java       |  35 ++--
 7 files changed, 111 insertions(+), 162 deletions(-)

diff --git a/src/main/groovy/groovy/lang/MetaClassImpl.java b/src/main/groovy/groovy/lang/MetaClassImpl.java
index 579a520..171bf7c 100644
--- a/src/main/groovy/groovy/lang/MetaClassImpl.java
+++ b/src/main/groovy/groovy/lang/MetaClassImpl.java
@@ -1193,8 +1193,8 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
                     break;
                 case Closure.DELEGATE_FIRST:
                     Tuple2<Object, MetaMethod> tuple = invokeMethod(method, delegate,
closure, methodName, argClasses, originalArguments, owner);
-                    Object result = tuple.getFirst();
-                    method = tuple.getSecond();
+                    Object result = tuple.getV1();
+                    method = tuple.getV2();
                     if (InvokeMethodResult.NONE != result) {
                         return result;
                     }
@@ -1223,8 +1223,8 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
                     break;
                 default:
                     Tuple2<Object, MetaMethod> t = invokeMethod(method, delegate, closure,
methodName, argClasses, originalArguments, owner);
-                    Object r = t.getFirst();
-                    method = t.getSecond();
+                    Object r = t.getV1();
+                    method = t.getV2();
                     if (InvokeMethodResult.NONE != r) {
                         return r;
                     }
@@ -1852,12 +1852,12 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass
{
         }
 
         Tuple2<MetaMethod, MetaProperty> methodAndProperty = createMetaMethodAndMetaProperty(sender,
sender, name, useSuper, isStatic);
-        MetaMethod method = methodAndProperty.getFirst();
+        MetaMethod method = methodAndProperty.getV1();
 
         //----------------------------------------------------------------------
         // getter
         //----------------------------------------------------------------------
-        MetaProperty mp = methodAndProperty.getSecond();
+        MetaProperty mp = methodAndProperty.getV2();
 
         //----------------------------------------------------------------------
         // field
@@ -1969,12 +1969,12 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass
{
         }
 
         Tuple2<MetaMethod, MetaProperty> methodAndProperty = createMetaMethodAndMetaProperty(sender,
theClass, name, useSuper, isStatic);
-        MetaMethod method = methodAndProperty.getFirst();
+        MetaMethod method = methodAndProperty.getV1();
 
         //----------------------------------------------------------------------
         // getter
         //----------------------------------------------------------------------
-        MetaProperty mp = methodAndProperty.getSecond();
+        MetaProperty mp = methodAndProperty.getV2();
 
         //----------------------------------------------------------------------
         // field
diff --git a/src/main/groovy/groovy/util/Node.java b/src/main/groovy/groovy/util/Node.java
index 91faad9..b1907ce 100644
--- a/src/main/groovy/groovy/util/Node.java
+++ b/src/main/groovy/groovy/util/Node.java
@@ -737,7 +737,7 @@ public class Node implements Serializable, Cloneable {
         }
         while (!stack.isEmpty()) {
             Tuple2<Object, Integer> next = stack.pop();
-            callClosureForNode(c, next.getFirst(), next.getSecond());
+            callClosureForNode(c, next.getV1(), next.getV2());
         }
     }
 
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/util/TypeUtil.java b/src/main/java/org/codehaus/groovy/classgen/asm/util/TypeUtil.java
index 9b79858..e3d1ade 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/util/TypeUtil.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/util/TypeUtil.java
@@ -114,7 +114,7 @@ public abstract class TypeUtil {
                 arrayDescription.append("[");
             }
 
-            ClassNode componentType = arrayInfo.getFirst();
+            ClassNode componentType = arrayInfo.getV1();
             return arrayDescription.append(getDescriptionByType(componentType)).toString();
         }
 
diff --git a/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java b/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
index 69a0a9c..9f6cf24 100644
--- a/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
+++ b/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
@@ -912,8 +912,8 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
                 }
                 String varName = ve.getName();
                 Tuple2<StringBuilder, Boolean> classNameInfo = makeClassName(doInitialClassTest,
name, varName);
-                name = classNameInfo.getFirst();
-                doInitialClassTest = classNameInfo.getSecond();
+                name = classNameInfo.getV1();
+                doInitialClassTest = classNameInfo.getV2();
 
                 break;
             }
@@ -929,8 +929,8 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
                     return null;
                 }
                 Tuple2<StringBuilder, Boolean> classNameInfo = makeClassName(doInitialClassTest,
name, propertyPart);
-                name = classNameInfo.getFirst();
-                doInitialClassTest = classNameInfo.getSecond();
+                name = classNameInfo.getV1();
+                doInitialClassTest = classNameInfo.getV2();
             }
         }
 
@@ -1655,14 +1655,14 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer
{
         }
 
         for (Tuple2<ClassNode, ClassNode> tp : upperBoundsToResolve) {
-            ClassNode upperBound = tp.getFirst();
-            ClassNode classNode = tp.getSecond();
+            ClassNode upperBound = tp.getV1();
+            ClassNode classNode = tp.getV2();
             resolveOrFail(upperBound, classNode);
         }
 
         for (Tuple2<ClassNode, GenericsType> tp : upperBoundsWithGenerics) {
-            ClassNode upperBound = tp.getFirst();
-            GenericsType gt = tp.getSecond();
+            ClassNode upperBound = tp.getV1();
+            GenericsType gt = tp.getV2();
             resolveGenericsHeader(upperBound.getGenericsTypes(), 0 == level ? gt : rootType,
level + 1);
         }
     }
diff --git a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
index d1b14f8..afc3fb4 100644
--- a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
+++ b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
@@ -8798,7 +8798,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport
{
         Iterator<Tuple2<Integer, E>> indexed = indexed(self.iterator(), offset);
         while (indexed.hasNext()) {
             Tuple2<Integer, E> next = indexed.next();
-            result.put(next.getFirst(), next.getSecond());
+            result.put(next.getV1(), next.getV2());
         }
         return result;
     }
diff --git a/src/test/groovy/lang/TupleTest.java b/src/test/groovy/lang/TupleTest.java
index 3ced3aa..7900fe0 100644
--- a/src/test/groovy/lang/TupleTest.java
+++ b/src/test/groovy/lang/TupleTest.java
@@ -19,17 +19,20 @@
 package groovy.lang;
 
 import groovy.util.GroovyTestCase;
+import org.codehaus.groovy.runtime.DefaultGroovyMethods;
 
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
 import static groovy.lang.Tuple.tuple;
+import static org.junit.Assert.assertNotEquals;
 
 public class TupleTest extends GroovyTestCase {
 
-    final Object[] data = {"a", "b", "c"};
-    final Tuple t = new Tuple(data);
+    private final Object[] data = {"a", "b", "c"};
+    final Tuple t = new Tuple<>(data);
 
     public void testSize() {
         assertEquals("Size of " + t, 3, t.size());
@@ -40,13 +43,13 @@ public class TupleTest extends GroovyTestCase {
 
     public void testGetOutOfTuple() {
         try {
-            t.get(-1);
+            System.out.println(t.get(-1));
             fail("Should have thrown IndexOut");
         } catch (IndexOutOfBoundsException e) {
             // worked
         }
         try {
-            t.get(10);
+            System.out.println(t.get(10));
             fail("Should have thrown IndexOut");
         } catch (IndexOutOfBoundsException e) {
             // worked
@@ -69,45 +72,50 @@ public class TupleTest extends GroovyTestCase {
 
     public void testSubTuple() {
         Tuple s = t.subTuple(1, 2);
-
-        assertTrue("is a Tuple", s instanceof Tuple);
-
+        assertTrue("is a Tuple", isTuple(s));
         assertEquals("size", 1, s.size());
     }
 
+    private boolean isTuple(Object s) {
+        return s instanceof Tuple;
+    }
+
     public void testHashCodeAndEquals() {
-        Tuple a = new Tuple(new Object[]{"a", "b", "c"});
-        Tuple b = new Tuple(new Object[]{"a", "b", "c"});
-        Tuple c = new Tuple(new Object[]{"d", "b", "c"});
-        Tuple d = new Tuple(new Object[]{"a", "b"});
-        Tuple2<String, String> e = new Tuple2<String, String>("a", "b");
-        Tuple2<String, String> f = new Tuple2<String, String>("a", "c");
+        Tuple a = new Tuple<Object>("a", "b", "c");
+        Tuple b = new Tuple<Object>("a", "b", "c");
+        Tuple c = new Tuple<Object>("d", "b", "c");
+        Tuple d = new Tuple<Object>("a", "b");
+        Tuple2<String, String> e = new Tuple2<>("a", "b");
+        Tuple2<String, String> f = new Tuple2<>("a", "c");
 
         assertEquals("hashcode", a.hashCode(), b.hashCode());
         assertTrue("hashcode", a.hashCode() != c.hashCode());
 
         assertEquals("a and b", a, b);
-        assertFalse("a != c", a.equals(c));
+        assertNotEquals("a != c", a, c);
 
-        assertFalse("!a.equals(null)", a.equals(null));
+        assertNotEquals("!a.equals(null)", null, a);
 
-        assertTrue("d.equals(e)", d.equals(e));
-        assertTrue("e.equals(d)", e.equals(d));
-        assertFalse("!e.equals(f)", e.equals(f));
-        assertFalse("!f.equals(e)", f.equals(e));
+        assertEquals("d.equals(e)", d, e);
+        assertEquals("e.equals(d)", e, d);
+        assertNotEquals("!e.equals(f)", e, f);
+        assertNotEquals("!f.equals(e)", f, e);
     }
 
     public void testIterator() {
+        final Tuple<Object> t = new Tuple<>(1, 2, 3);
+        assertEquals(6, DefaultGroovyMethods.sum(t.iterator()));
+        final Tuple3<Integer, Integer, Integer> t3 = new Tuple3<>(1, 2, 3);
+        Iterator iterator = t3.iterator();
+        assertEquals(6, DefaultGroovyMethods.sum(iterator));
     }
 
     public void testTuple1() {
         Tuple1<Integer> t = new Tuple1<>(1);
 
         assertEquals(1, t.size());
-
-        assertEquals(new Integer(1), t.getFirst());
+        assertEquals(Integer.valueOf(1), t.getV1());
         assertEquals(1, t.get(0));
-
         assertEquals(t, t.subTuple(0, t.size()));
     }
 
@@ -115,13 +123,10 @@ public class TupleTest extends GroovyTestCase {
         Tuple2<Integer, Integer> t = new Tuple2<>(1, 2);
 
         assertEquals(2, t.size());
-
-        assertEquals(new Integer(1), t.getFirst());
+        assertEquals(Integer.valueOf(1), t.getV1());
         assertEquals(1, t.get(0));
-
-        assertEquals(new Integer(2), t.getSecond());
+        assertEquals(Integer.valueOf(2), t.getV2());
         assertEquals(2, t.get(1));
-
         assertEquals(t, t.subTuple(0, t.size()));
     }
 
@@ -129,16 +134,12 @@ public class TupleTest extends GroovyTestCase {
         Tuple3<Integer, Integer, Integer> t = new Tuple3<>(1, 2, 3);
 
         assertEquals(3, t.size());
-
-        assertEquals(new Integer(1), t.getFirst());
+        assertEquals(Integer.valueOf(1), t.getV1());
         assertEquals(1, t.get(0));
-
-        assertEquals(new Integer(2), t.getSecond());
+        assertEquals(Integer.valueOf(2), t.getV2());
         assertEquals(2, t.get(1));
-
-        assertEquals(new Integer(3), t.getThird());
+        assertEquals(Integer.valueOf(3), t.getV3());
         assertEquals(3, t.get(2));
-
         assertEquals(t, t.subTuple(0, t.size()));
     }
 
@@ -146,19 +147,14 @@ public class TupleTest extends GroovyTestCase {
         Tuple4<Integer, Integer, Integer, Integer> t = new Tuple4<>(1, 2, 3,
4);
 
         assertEquals(4, t.size());
-
-        assertEquals(new Integer(1), t.getFirst());
+        assertEquals(Integer.valueOf(1), t.getV1());
         assertEquals(1, t.get(0));
-
-        assertEquals(new Integer(2), t.getSecond());
+        assertEquals(Integer.valueOf(2), t.getV2());
         assertEquals(2, t.get(1));
-
-        assertEquals(new Integer(3), t.getThird());
+        assertEquals(Integer.valueOf(3), t.getV3());
         assertEquals(3, t.get(2));
-
-        assertEquals(new Integer(4), t.getFourth());
+        assertEquals(Integer.valueOf(4), t.getV4());
         assertEquals(4, t.get(3));
-
         assertEquals(t, t.subTuple(0, t.size()));
     }
 
@@ -166,22 +162,16 @@ public class TupleTest extends GroovyTestCase {
         Tuple5<Integer, Integer, Integer, Integer, Integer> t = new Tuple5<>(1,
2, 3, 4, 5);
 
         assertEquals(5, t.size());
-
-        assertEquals(new Integer(1), t.getFirst());
+        assertEquals(Integer.valueOf(1), t.getV1());
         assertEquals(1, t.get(0));
-
-        assertEquals(new Integer(2), t.getSecond());
+        assertEquals(Integer.valueOf(2), t.getV2());
         assertEquals(2, t.get(1));
-
-        assertEquals(new Integer(3), t.getThird());
+        assertEquals(Integer.valueOf(3), t.getV3());
         assertEquals(3, t.get(2));
-
-        assertEquals(new Integer(4), t.getFourth());
+        assertEquals(Integer.valueOf(4), t.getV4());
         assertEquals(4, t.get(3));
-
-        assertEquals(new Integer(5), t.getFifth());
+        assertEquals(Integer.valueOf(5), t.getV5());
         assertEquals(5, t.get(4));
-
         assertEquals(t, t.subTuple(0, t.size()));
     }
 
@@ -189,25 +179,18 @@ public class TupleTest extends GroovyTestCase {
         Tuple6<Integer, Integer, Integer, Integer, Integer, Integer> t = new Tuple6<>(1,
2, 3, 4, 5, 6);
 
         assertEquals(6, t.size());
-
-        assertEquals(new Integer(1), t.getFirst());
+        assertEquals(Integer.valueOf(1), t.getV1());
         assertEquals(1, t.get(0));
-
-        assertEquals(new Integer(2), t.getSecond());
+        assertEquals(Integer.valueOf(2), t.getV2());
         assertEquals(2, t.get(1));
-
-        assertEquals(new Integer(3), t.getThird());
+        assertEquals(Integer.valueOf(3), t.getV3());
         assertEquals(3, t.get(2));
-
-        assertEquals(new Integer(4), t.getFourth());
+        assertEquals(Integer.valueOf(4), t.getV4());
         assertEquals(4, t.get(3));
-
-        assertEquals(new Integer(5), t.getFifth());
+        assertEquals(Integer.valueOf(5), t.getV5());
         assertEquals(5, t.get(4));
-
-        assertEquals(new Integer(6), t.getSixth());
+        assertEquals(Integer.valueOf(6), t.getV6());
         assertEquals(6, t.get(5));
-
         assertEquals(t, t.subTuple(0, t.size()));
     }
 
@@ -215,28 +198,20 @@ public class TupleTest extends GroovyTestCase {
         Tuple7<Integer, Integer, Integer, Integer, Integer, Integer, Integer> t = new
Tuple7<>(1, 2, 3, 4, 5, 6, 7);
 
         assertEquals(7, t.size());
-
-        assertEquals(new Integer(1), t.getFirst());
+        assertEquals(Integer.valueOf(1), t.getV1());
         assertEquals(1, t.get(0));
-
-        assertEquals(new Integer(2), t.getSecond());
+        assertEquals(Integer.valueOf(2), t.getV2());
         assertEquals(2, t.get(1));
-
-        assertEquals(new Integer(3), t.getThird());
+        assertEquals(Integer.valueOf(3), t.getV3());
         assertEquals(3, t.get(2));
-
-        assertEquals(new Integer(4), t.getFourth());
+        assertEquals(Integer.valueOf(4), t.getV4());
         assertEquals(4, t.get(3));
-
-        assertEquals(new Integer(5), t.getFifth());
+        assertEquals(Integer.valueOf(5), t.getV5());
         assertEquals(5, t.get(4));
-
-        assertEquals(new Integer(6), t.getSixth());
+        assertEquals(Integer.valueOf(6), t.getV6());
         assertEquals(6, t.get(5));
-
-        assertEquals(new Integer(7), t.getSeventh());
+        assertEquals(Integer.valueOf(7), t.getV7());
         assertEquals(7, t.get(6));
-
         assertEquals(t, t.subTuple(0, t.size()));
     }
 
@@ -244,31 +219,22 @@ public class TupleTest extends GroovyTestCase {
         Tuple8<Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer>
t = new Tuple8<>(1, 2, 3, 4, 5, 6, 7, 8);
 
         assertEquals(8, t.size());
-
-        assertEquals(new Integer(1), t.getFirst());
+        assertEquals(Integer.valueOf(1), t.getV1());
         assertEquals(1, t.get(0));
-
-        assertEquals(new Integer(2), t.getSecond());
+        assertEquals(Integer.valueOf(2), t.getV2());
         assertEquals(2, t.get(1));
-
-        assertEquals(new Integer(3), t.getThird());
+        assertEquals(Integer.valueOf(3), t.getV3());
         assertEquals(3, t.get(2));
-
-        assertEquals(new Integer(4), t.getFourth());
+        assertEquals(Integer.valueOf(4), t.getV4());
         assertEquals(4, t.get(3));
-
-        assertEquals(new Integer(5), t.getFifth());
+        assertEquals(Integer.valueOf(5), t.getV5());
         assertEquals(5, t.get(4));
-
-        assertEquals(new Integer(6), t.getSixth());
+        assertEquals(Integer.valueOf(6), t.getV6());
         assertEquals(6, t.get(5));
-
-        assertEquals(new Integer(7), t.getSeventh());
+        assertEquals(Integer.valueOf(7), t.getV7());
         assertEquals(7, t.get(6));
-
-        assertEquals(new Integer(8), t.getEighth());
+        assertEquals(Integer.valueOf(8), t.getV8());
         assertEquals(8, t.get(7));
-
         assertEquals(t, t.subTuple(0, t.size()));
     }
 
@@ -276,34 +242,24 @@ public class TupleTest extends GroovyTestCase {
         Tuple9<Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer,
Integer> t = new Tuple9<>(1, 2, 3, 4, 5, 6, 7, 8, 9);
 
         assertEquals(9, t.size());
-
-        assertEquals(new Integer(1), t.getFirst());
+        assertEquals(Integer.valueOf(1), t.getV1());
         assertEquals(1, t.get(0));
-
-        assertEquals(new Integer(2), t.getSecond());
+        assertEquals(Integer.valueOf(2), t.getV2());
         assertEquals(2, t.get(1));
-
-        assertEquals(new Integer(3), t.getThird());
+        assertEquals(Integer.valueOf(3), t.getV3());
         assertEquals(3, t.get(2));
-
-        assertEquals(new Integer(4), t.getFourth());
+        assertEquals(Integer.valueOf(4), t.getV4());
         assertEquals(4, t.get(3));
-
-        assertEquals(new Integer(5), t.getFifth());
+        assertEquals(Integer.valueOf(5), t.getV5());
         assertEquals(5, t.get(4));
-
-        assertEquals(new Integer(6), t.getSixth());
+        assertEquals(Integer.valueOf(6), t.getV6());
         assertEquals(6, t.get(5));
-
-        assertEquals(new Integer(7), t.getSeventh());
+        assertEquals(Integer.valueOf(7), t.getV7());
         assertEquals(7, t.get(6));
-
-        assertEquals(new Integer(8), t.getEighth());
+        assertEquals(Integer.valueOf(8), t.getV8());
         assertEquals(8, t.get(7));
-
-        assertEquals(new Integer(9), t.getNinth());
+        assertEquals(Integer.valueOf(9), t.getV9());
         assertEquals(9, t.get(8));
-
         assertEquals(t, t.subTuple(0, t.size()));
     }
 
@@ -325,16 +281,16 @@ public class TupleTest extends GroovyTestCase {
     }
 
     public void testEqualsNull() {
-        assertFalse(tuple(1).equals(null));
-        assertFalse(tuple(1, 2).equals(null));
-        assertFalse(tuple(1, 2, 3).equals(null));
+        assertNotEquals(null, tuple(1));
+        assertNotEquals(null, tuple(1, 2));
+        assertNotEquals(null, tuple(1, 2, 3));
     }
 
     public void testGroovyStyleAccessor() {
         try {
             assertScript("def t = new Tuple1<String>('Daniel'); assert 'Daniel' ==
t.v1");
         } catch (Exception e) {
-            assert false: e.getMessage();
+            assert false : e.getMessage();
         }
     }
 }
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/SAXBuilder.java b/subprojects/groovy-xml/src/main/java/groovy/xml/SAXBuilder.java
index c901f8d..b0b165d 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/xml/SAXBuilder.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/xml/SAXBuilder.java
@@ -25,7 +25,6 @@ import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.AttributesImpl;
 
-import java.util.Iterator;
 import java.util.Map;
 
 /**
@@ -54,30 +53,26 @@ public class SAXBuilder extends BuilderSupport {
         return name;
     }
 
-    /**
-     * @param value
-     */
     private void doText(Object value) {
         try {
             char[] text = value.toString().toCharArray();
             handler.characters(text, 0, text.length);
-        }
-        catch (SAXException e) {
+        } catch (SAXException e) {
             handleException(e);
         }
     }
 
     protected Object createNode(Object name, Map attributeMap, Object text) {
         AttributesImpl attributes = new AttributesImpl();
-        for (Iterator iter = attributeMap.entrySet().iterator(); iter.hasNext();) {
-            Map.Entry entry = (Map.Entry) iter.next();
+        for (Object o : attributeMap.entrySet()) {
+            Map.Entry entry = (Map.Entry) o;
             Object key = entry.getKey();
             Object value = entry.getValue();
 
             Tuple3<String, String, String> nameInfo = getNameInfo(key);
-            String uri = nameInfo.getFirst();
-            String localName = nameInfo.getSecond();
-            String qualifiedName = nameInfo.getThird();
+            String uri = nameInfo.getV1();
+            String localName = nameInfo.getV2();
+            String qualifiedName = nameInfo.getV3();
             String valueText = (value != null) ? value.toString() : "";
 
             attributes.addAttribute(uri, localName, qualifiedName, "CDATA", valueText);
@@ -91,28 +86,26 @@ public class SAXBuilder extends BuilderSupport {
 
     protected void doStartElement(Object name, Attributes attributes) {
         Tuple3<String, String, String> nameInfo = getNameInfo(name);
-        String uri = nameInfo.getFirst();
-        String localName = nameInfo.getSecond();
-        String qualifiedName = nameInfo.getThird();
+        String uri = nameInfo.getV1();
+        String localName = nameInfo.getV2();
+        String qualifiedName = nameInfo.getV3();
 
         try {
             handler.startElement(uri, localName, qualifiedName, attributes);
-        }
-        catch (SAXException e) {
+        } catch (SAXException e) {
             handleException(e);
         }
     }
 
     protected void nodeCompleted(Object parent, Object name) {
         Tuple3<String, String, String> nameInfo = getNameInfo(name);
-        String uri = nameInfo.getFirst();
-        String localName = nameInfo.getSecond();
-        String qualifiedName = nameInfo.getThird();
+        String uri = nameInfo.getV1();
+        String localName = nameInfo.getV2();
+        String qualifiedName = nameInfo.getV3();
 
         try {
             handler.endElement(uri, localName, qualifiedName);
-        }
-        catch (SAXException e) {
+        } catch (SAXException e) {
             handleException(e);
         }
     }


Mime
View raw message