commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1697756 - in /commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6: Constants.java generic/ReferenceType.java
Date Tue, 25 Aug 2015 18:53:42 GMT
Author: sebb
Date: Tue Aug 25 18:53:41 2015
New Revision: 1697756

URL: http://svn.apache.org/r1697756
Log:
Prepare for eventual privatisation of other array constants

Modified:
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/Constants.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ReferenceType.java

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/Constants.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/Constants.java?rev=1697756&r1=1697755&r2=1697756&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/Constants.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/Constants.java Tue Aug
25 18:53:41 2015
@@ -17,6 +17,9 @@
  */
 package org.apache.commons.bcel6;
 
+import java.util.Arrays;
+import java.util.Collections;
+
 /**
  * Constants for the project, mostly defined in the JVM specification.
  *
@@ -380,10 +383,11 @@ public final class Constants {
    * @return
    * @since 6.0
    */
-  public static String getConstasntName(int index) {
-      return INTERFACES_IMPLEMENTED_BY_ARRAYS[index];
+  public static Iterable<String> getInterfacesImplementedByArrays() {
+      return Collections.unmodifiableList(Arrays.asList(INTERFACES_IMPLEMENTED_BY_ARRAYS));
   }
 
+
   /**
    * Maximum Constant Pool entries.
    * One of the limitations of the Java Virtual Machine.

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ReferenceType.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ReferenceType.java?rev=1697756&r1=1697755&r2=1697756&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ReferenceType.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ReferenceType.java
Tue Aug 25 18:53:41 2015
@@ -161,7 +161,7 @@ public abstract class ReferenceType exte
             // on one of them "interfaces implemented by arrays" is exchanged with "'Cloneable'
or
             // 'java.io.Serializable'"
             if ((T instanceof ObjectType) && (((ObjectType) T).referencesInterfaceExact()))
{
-                for (String element : Constants.INTERFACES_IMPLEMENTED_BY_ARRAYS) {
+                for (String element : Constants.getInterfacesImplementedByArrays()) {
                     if (T.equals(ObjectType.getInstance(element))) {
                         return true;
                     }



Mime
View raw message