< prev index next >

src/java.base/share/classes/sun/invoke/util/BytecodeDescriptor.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 82,100 **** * bootstrap class loader) */ private static Class<?> parseSig(String str, int[] i, int end, ClassLoader loader) { if (i[0] == end) return null; char c = str.charAt(i[0]++); ! if (c == 'L') { int begc = i[0], endc = str.indexOf(';', begc); if (endc < 0) return null; i[0] = endc+1; String name = str.substring(begc, endc).replace('/', '.'); try { ! return (loader == null) ! ? Class.forName(name, false, null) ! : loader.loadClass(name); } catch (ClassNotFoundException ex) { throw new TypeNotPresentException(name, ex); } } else if (c == '[') { Class<?> t = parseSig(str, i, end, loader); --- 82,101 ---- * bootstrap class loader) */ private static Class<?> parseSig(String str, int[] i, int end, ClassLoader loader) { if (i[0] == end) return null; char c = str.charAt(i[0]++); ! if (c == 'L' || c == 'Q') { int begc = i[0], endc = str.indexOf(';', begc); if (endc < 0) return null; i[0] = endc+1; String name = str.substring(begc, endc).replace('/', '.'); try { ! Class<?> clz = (loader == null) ! ? Class.forName(name, false, null) ! : loader.loadClass(name); ! return c == 'Q' ? clz.asPrimaryType() : clz.asIndirectType(); } catch (ClassNotFoundException ex) { throw new TypeNotPresentException(name, ex); } } else if (c == '[') { Class<?> t = parseSig(str, i, end, loader);
*** 155,165 **** sb.append(c); } else if (t == Object.class) { sb.append("Ljava/lang/Object;"); } else { boolean lsemi = (!t.isArray()); ! if (lsemi) sb.append('L'); sb.append(t.getName().replace('.', '/')); if (lsemi) sb.append(';'); } } --- 156,168 ---- sb.append(c); } else if (t == Object.class) { sb.append("Ljava/lang/Object;"); } else { boolean lsemi = (!t.isArray()); ! if (!t.isIndirectType()) ! c = 'Q'; ! if (lsemi) sb.append(c); sb.append(t.getName().replace('.', '/')); if (lsemi) sb.append(';'); } }
< prev index next >