< prev index next >

src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java

Print this page




 366                     /*
 367                      * if a subclass of this exception is on the list
 368                      * to catch, then remove it;
 369                      */
 370                     uniqueList.remove(j);
 371                 } else {
 372                     j++;        // else continue comparing.
 373                 }
 374             }
 375             // This exception is unique (so far): add it to the list to catch.
 376             uniqueList.add(ex);
 377         }
 378         return uniqueList;
 379     }
 380 
 381     /**
 382      * Convert a fully qualified class name that uses '.' as the package
 383      * separator, the external representation used by the Java language
 384      * and APIs, to a fully qualified class name that uses '/' as the
 385      * package separator, the representation used in the class file
 386      * format (see JVMS section 4.2).
 387      */
 388     private static String dotToSlash(String name) {
 389         return name.replace('.', '/');
 390     }
 391 
 392     /**
 393      * Return the number of abstract "words", or consecutive local variable
 394      * indexes, required to contain a value of the given type.  See JVMS
 395      * section 3.6.1.
 396      * <p>
 397      * Note that the original version of the JVMS contained a definition of
 398      * this abstract notion of a "word" in section 3.4, but that definition
 399      * was removed for the second edition.
 400      */
 401     private static int getWordsPerType(Class<?> type) {
 402         if (type == long.class || type == double.class) {
 403             return 2;
 404         } else {
 405             return 1;
 406         }




 366                     /*
 367                      * if a subclass of this exception is on the list
 368                      * to catch, then remove it;
 369                      */
 370                     uniqueList.remove(j);
 371                 } else {
 372                     j++;        // else continue comparing.
 373                 }
 374             }
 375             // This exception is unique (so far): add it to the list to catch.
 376             uniqueList.add(ex);
 377         }
 378         return uniqueList;
 379     }
 380 
 381     /**
 382      * Convert a fully qualified class name that uses '.' as the package
 383      * separator, the external representation used by the Java language
 384      * and APIs, to a fully qualified class name that uses '/' as the
 385      * package separator, the representation used in the class file
 386      * format (see JVMS section {@jvms 4.2}).
 387      */
 388     private static String dotToSlash(String name) {
 389         return name.replace('.', '/');
 390     }
 391 
 392     /**
 393      * Return the number of abstract "words", or consecutive local variable
 394      * indexes, required to contain a value of the given type.  See JVMS
 395      * section 3.6.1.
 396      * <p>
 397      * Note that the original version of the JVMS contained a definition of
 398      * this abstract notion of a "word" in section 3.4, but that definition
 399      * was removed for the second edition.
 400      */
 401     private static int getWordsPerType(Class<?> type) {
 402         if (type == long.class || type == double.class) {
 403             return 2;
 404         } else {
 405             return 1;
 406         }


< prev index next >