Lines 10-15
Link Here
|
10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
11 |
package org.eclipse.jdt.internal.core.util; |
11 |
package org.eclipse.jdt.internal.core.util; |
12 |
|
12 |
|
|
|
13 |
import org.eclipse.jdt.core.Signature; |
13 |
import org.eclipse.jdt.core.compiler.CharOperation; |
14 |
import org.eclipse.jdt.core.compiler.CharOperation; |
14 |
import org.eclipse.jdt.core.util.ClassFileBytesDisassembler; |
15 |
import org.eclipse.jdt.core.util.ClassFileBytesDisassembler; |
15 |
import org.eclipse.jdt.core.util.IBytecodeVisitor; |
16 |
import org.eclipse.jdt.core.util.IBytecodeVisitor; |
Lines 26-31
Link Here
|
26 |
*/ |
27 |
*/ |
27 |
public class DefaultBytecodeVisitor implements IBytecodeVisitor { |
28 |
public class DefaultBytecodeVisitor implements IBytecodeVisitor { |
28 |
private static final String EMPTY_CLASS_NAME = "\"\""; //$NON-NLS-1$ |
29 |
private static final String EMPTY_CLASS_NAME = "\"\""; //$NON-NLS-1$ |
|
|
30 |
private static final String EMPTY_LOCAL_NAME = ""; //$NON-NLS-1$ |
29 |
private static final int T_BOOLEAN = 4; |
31 |
private static final int T_BOOLEAN = 4; |
30 |
private static final int T_CHAR = 5; |
32 |
private static final int T_CHAR = 5; |
31 |
private static final int T_FLOAT = 6; |
33 |
private static final int T_FLOAT = 6; |
Lines 153-159
Link Here
|
153 |
dumpPcNumber(pc); |
155 |
dumpPcNumber(pc); |
154 |
buffer.append(Messages.bind(Messages.classformat_load, (new String[] { |
156 |
buffer.append(Messages.bind(Messages.classformat_load, (new String[] { |
155 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ALOAD], |
157 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ALOAD], |
156 |
getLocalVariableName(pc, index) |
158 |
getLocalVariableName(pc, index, true) |
157 |
}))); |
159 |
}))); |
158 |
writeNewLine(); |
160 |
writeNewLine(); |
159 |
} |
161 |
} |
Lines 214-219
Link Here
|
214 |
writeNewLine(); |
216 |
writeNewLine(); |
215 |
} |
217 |
} |
216 |
private String getLocalVariableName(int pc, int index) { |
218 |
private String getLocalVariableName(int pc, int index) { |
|
|
219 |
return getLocalVariableName(pc, index, false); |
220 |
} |
221 |
|
222 |
private String getLocalVariableName(int pc, int index, boolean showIndex) { |
217 |
int nextPC = pc + 1; |
223 |
int nextPC = pc + 1; |
218 |
switch(index) { |
224 |
switch(index) { |
219 |
case 0 : |
225 |
case 0 : |
Lines 229-239
Link Here
|
229 |
final ILocalVariableTableEntry entry = this.localVariableTableEntries[i]; |
235 |
final ILocalVariableTableEntry entry = this.localVariableTableEntries[i]; |
230 |
final int startPC = entry.getStartPC(); |
236 |
final int startPC = entry.getStartPC(); |
231 |
if (entry.getIndex() == index && (startPC <= nextPC) && ((startPC + entry.getLength()) > nextPC)) { |
237 |
if (entry.getIndex() == index && (startPC <= nextPC) && ((startPC + entry.getLength()) > nextPC)) { |
232 |
return new String(entry.getName()); |
238 |
final StringBuffer stringBuffer = new StringBuffer(); |
|
|
239 |
if (showIndex) { |
240 |
stringBuffer.append(' ').append(index); |
241 |
} |
242 |
stringBuffer.append(' ').append('[').append(entry.getName()).append(']'); |
243 |
return String.valueOf(stringBuffer); |
233 |
} |
244 |
} |
234 |
} |
245 |
} |
235 |
String localVariableName = Messages.bind(Messages.disassembler_localvariablename, (new String[] {Integer.toString(index)})); |
246 |
if (showIndex) { |
236 |
return localVariableName; |
247 |
final StringBuffer stringBuffer = new StringBuffer(); |
|
|
248 |
stringBuffer.append(' ').append(index); |
249 |
return String.valueOf(stringBuffer); |
250 |
} |
251 |
return EMPTY_LOCAL_NAME; |
237 |
} |
252 |
} |
238 |
|
253 |
|
239 |
/** |
254 |
/** |
Lines 267-273
Link Here
|
267 |
dumpPcNumber(pc); |
282 |
dumpPcNumber(pc); |
268 |
buffer.append(Messages.bind(Messages.classformat_store, (new String[] { |
283 |
buffer.append(Messages.bind(Messages.classformat_store, (new String[] { |
269 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ASTORE], |
284 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ASTORE], |
270 |
getLocalVariableName(pc, index) |
285 |
getLocalVariableName(pc, index, true) |
271 |
}))); |
286 |
}))); |
272 |
writeNewLine(); |
287 |
writeNewLine(); |
273 |
} |
288 |
} |
Lines 496-502
Link Here
|
496 |
dumpPcNumber(pc); |
511 |
dumpPcNumber(pc); |
497 |
buffer.append(Messages.bind(Messages.classformat_load, (new String[] { |
512 |
buffer.append(Messages.bind(Messages.classformat_load, (new String[] { |
498 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DLOAD], |
513 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DLOAD], |
499 |
getLocalVariableName(pc, index) |
514 |
getLocalVariableName(pc, index, true) |
500 |
}))); |
515 |
}))); |
501 |
writeNewLine(); |
516 |
writeNewLine(); |
502 |
} |
517 |
} |
Lines 592-598
Link Here
|
592 |
dumpPcNumber(pc); |
607 |
dumpPcNumber(pc); |
593 |
buffer.append(Messages.bind(Messages.classformat_store, (new String[] { |
608 |
buffer.append(Messages.bind(Messages.classformat_store, (new String[] { |
594 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DSTORE], |
609 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DSTORE], |
595 |
getLocalVariableName(pc, index) |
610 |
getLocalVariableName(pc, index, true) |
596 |
}))); |
611 |
}))); |
597 |
writeNewLine(); |
612 |
writeNewLine(); |
598 |
} |
613 |
} |
Lines 823-829
Link Here
|
823 |
dumpPcNumber(pc); |
838 |
dumpPcNumber(pc); |
824 |
buffer.append(Messages.bind(Messages.classformat_load, (new String[] { |
839 |
buffer.append(Messages.bind(Messages.classformat_load, (new String[] { |
825 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FLOAD], |
840 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FLOAD], |
826 |
getLocalVariableName(pc, index) |
841 |
getLocalVariableName(pc, index, true) |
827 |
}))); |
842 |
}))); |
828 |
writeNewLine(); |
843 |
writeNewLine(); |
829 |
} |
844 |
} |
Lines 919-925
Link Here
|
919 |
dumpPcNumber(pc); |
934 |
dumpPcNumber(pc); |
920 |
buffer.append(Messages.bind(Messages.classformat_store, (new String[] { |
935 |
buffer.append(Messages.bind(Messages.classformat_store, (new String[] { |
921 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FSTORE], |
936 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FSTORE], |
922 |
getLocalVariableName(pc, index) |
937 |
getLocalVariableName(pc, index, true) |
923 |
}))); |
938 |
}))); |
924 |
writeNewLine(); |
939 |
writeNewLine(); |
925 |
} |
940 |
} |
Lines 943-949
Link Here
|
943 |
Integer.toString(index), |
958 |
Integer.toString(index), |
944 |
returnDeclaringClassName(constantFieldref), |
959 |
returnDeclaringClassName(constantFieldref), |
945 |
new String(constantFieldref.getFieldName()), |
960 |
new String(constantFieldref.getFieldName()), |
946 |
new String(constantFieldref.getFieldDescriptor()) |
961 |
returnClassName(Signature.toCharArray(constantFieldref.getFieldDescriptor())) |
947 |
}))); |
962 |
}))); |
948 |
writeNewLine(); |
963 |
writeNewLine(); |
949 |
} |
964 |
} |
Lines 954-965
Link Here
|
954 |
public void _getstatic(int pc, int index, IConstantPoolEntry constantFieldref) { |
969 |
public void _getstatic(int pc, int index, IConstantPoolEntry constantFieldref) { |
955 |
dumpPcNumber(pc); |
970 |
dumpPcNumber(pc); |
956 |
buffer.append(Messages.bind(Messages.classformat_getstatic, (new String[] { |
971 |
buffer.append(Messages.bind(Messages.classformat_getstatic, (new String[] { |
957 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.GETSTATIC], |
972 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.GETSTATIC], |
958 |
Integer.toString(index), |
973 |
Integer.toString(index), |
959 |
returnDeclaringClassName(constantFieldref), |
974 |
returnDeclaringClassName(constantFieldref), |
960 |
new String(constantFieldref.getFieldName()), |
975 |
new String(constantFieldref.getFieldName()), |
961 |
new String(constantFieldref.getFieldDescriptor()) |
976 |
returnClassName(Signature.toCharArray(constantFieldref.getFieldDescriptor())) |
962 |
}))); |
977 |
}))); |
963 |
writeNewLine(); |
978 |
writeNewLine(); |
964 |
} |
979 |
} |
965 |
|
980 |
|
Lines 1392-1398
Link Here
|
1392 |
dumpPcNumber(pc); |
1407 |
dumpPcNumber(pc); |
1393 |
buffer.append(Messages.bind(Messages.classformat_load, (new String[] { |
1408 |
buffer.append(Messages.bind(Messages.classformat_load, (new String[] { |
1394 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ILOAD], |
1409 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ILOAD], |
1395 |
getLocalVariableName(pc, index) |
1410 |
getLocalVariableName(pc, index, true) |
1396 |
}))); |
1411 |
}))); |
1397 |
writeNewLine(); |
1412 |
writeNewLine(); |
1398 |
} |
1413 |
} |
Lines 1438-1464
Link Here
|
1438 |
IConstantPoolEntry constantInterfaceMethodref) { |
1453 |
IConstantPoolEntry constantInterfaceMethodref) { |
1439 |
|
1454 |
|
1440 |
dumpPcNumber(pc); |
1455 |
dumpPcNumber(pc); |
1441 |
if (isCompact()) { |
1456 |
buffer.append(Messages.bind(Messages.classformat_invokeinterface, (new String[] { |
1442 |
buffer.append(Messages.bind(Messages.classformat_invokeinterface_compact, (new String[] { |
1457 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKEINTERFACE], |
1443 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKEINTERFACE], |
1458 |
Integer.toString(index), |
1444 |
Integer.toString(index), |
1459 |
Integer.toString(nargs), |
1445 |
Integer.toString(nargs), |
1460 |
Util.toString( |
1446 |
Util.toString( |
1461 |
constantInterfaceMethodref.getClassName(), |
1447 |
constantInterfaceMethodref.getClassName(), |
1462 |
constantInterfaceMethodref.getMethodName(), |
1448 |
constantInterfaceMethodref.getMethodName(), |
1463 |
constantInterfaceMethodref.getMethodDescriptor(), |
1449 |
constantInterfaceMethodref.getMethodDescriptor(), |
1464 |
true, |
1450 |
true) |
1465 |
isCompact()) |
1451 |
}))); |
1466 |
}))); |
1452 |
} else { |
|
|
1453 |
buffer.append(Messages.bind(Messages.classformat_invokeinterface, (new String[] { |
1454 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKEINTERFACE], |
1455 |
Integer.toString(index), |
1456 |
Integer.toString(nargs), |
1457 |
returnDeclaringClassName(constantInterfaceMethodref), |
1458 |
new String(constantInterfaceMethodref.getMethodName()), |
1459 |
new String(constantInterfaceMethodref.getMethodDescriptor()), |
1460 |
}))); |
1461 |
} |
1462 |
writeNewLine(); |
1467 |
writeNewLine(); |
1463 |
} |
1468 |
} |
1464 |
|
1469 |
|
Lines 1467-1491
Link Here
|
1467 |
*/ |
1472 |
*/ |
1468 |
public void _invokespecial(int pc, int index, IConstantPoolEntry constantMethodref) { |
1473 |
public void _invokespecial(int pc, int index, IConstantPoolEntry constantMethodref) { |
1469 |
dumpPcNumber(pc); |
1474 |
dumpPcNumber(pc); |
1470 |
if (isCompact()) { |
1475 |
buffer.append(Messages.bind(Messages.classformat_invokespecial, (new String[] { |
1471 |
buffer.append(Messages.bind(Messages.classformat_invokespecial_compact, (new String[] { |
1476 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKESPECIAL], |
1472 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKESPECIAL], |
1477 |
Integer.toString(index), |
1473 |
Integer.toString(index), |
1478 |
Util.toString( |
1474 |
Util.toString( |
1479 |
constantMethodref.getClassName(), |
1475 |
constantMethodref.getClassName(), |
1480 |
constantMethodref.getMethodName(), |
1476 |
constantMethodref.getMethodName(), |
1481 |
constantMethodref.getMethodDescriptor(), |
1477 |
constantMethodref.getMethodDescriptor(), |
1482 |
true, |
1478 |
true) |
1483 |
isCompact()) |
1479 |
}))); |
1484 |
}))); |
1480 |
} else { |
|
|
1481 |
buffer.append(Messages.bind(Messages.classformat_invokespecial, (new String[] { |
1482 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKESPECIAL], |
1483 |
Integer.toString(index), |
1484 |
returnDeclaringClassName(constantMethodref), |
1485 |
new String(constantMethodref.getMethodName()), |
1486 |
new String(constantMethodref.getMethodDescriptor()), |
1487 |
}))); |
1488 |
} |
1489 |
writeNewLine(); |
1485 |
writeNewLine(); |
1490 |
} |
1486 |
} |
1491 |
|
1487 |
|
Lines 1494-1518
Link Here
|
1494 |
*/ |
1490 |
*/ |
1495 |
public void _invokestatic(int pc, int index, IConstantPoolEntry constantMethodref) { |
1491 |
public void _invokestatic(int pc, int index, IConstantPoolEntry constantMethodref) { |
1496 |
dumpPcNumber(pc); |
1492 |
dumpPcNumber(pc); |
1497 |
if (isCompact()) { |
1493 |
buffer.append(Messages.bind(Messages.classformat_invokestatic, (new String[] { |
1498 |
buffer.append(Messages.bind(Messages.classformat_invokestatic_compact, (new String[] { |
1494 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKESTATIC], |
1499 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKESTATIC], |
1495 |
Integer.toString(index), |
1500 |
Integer.toString(index), |
1496 |
Util.toString( |
1501 |
Util.toString( |
1497 |
constantMethodref.getClassName(), |
1502 |
constantMethodref.getClassName(), |
1498 |
constantMethodref.getMethodName(), |
1503 |
constantMethodref.getMethodName(), |
1499 |
constantMethodref.getMethodDescriptor(), |
1504 |
constantMethodref.getMethodDescriptor(), |
1500 |
true, |
1505 |
true) |
1501 |
isCompact()) |
1506 |
}))); |
1502 |
}))); |
1507 |
} else { |
|
|
1508 |
buffer.append(Messages.bind(Messages.classformat_invokestatic, (new String[] { |
1509 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKESTATIC], |
1510 |
Integer.toString(index), |
1511 |
returnDeclaringClassName(constantMethodref), |
1512 |
new String(constantMethodref.getMethodName()), |
1513 |
new String(constantMethodref.getMethodDescriptor()), |
1514 |
}))); |
1515 |
} |
1516 |
writeNewLine(); |
1503 |
writeNewLine(); |
1517 |
} |
1504 |
} |
1518 |
|
1505 |
|
Lines 1521-1545
Link Here
|
1521 |
*/ |
1508 |
*/ |
1522 |
public void _invokevirtual(int pc, int index, IConstantPoolEntry constantMethodref) { |
1509 |
public void _invokevirtual(int pc, int index, IConstantPoolEntry constantMethodref) { |
1523 |
dumpPcNumber(pc); |
1510 |
dumpPcNumber(pc); |
1524 |
if (isCompact()) { |
1511 |
buffer.append(Messages.bind(Messages.classformat_invokevirtual, (new String[] { |
1525 |
buffer.append(Messages.bind(Messages.classformat_invokevirtual_compact, (new String[] { |
1512 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKEVIRTUAL], |
1526 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKEVIRTUAL], |
1513 |
Integer.toString(index), |
1527 |
Integer.toString(index), |
1514 |
Util.toString( |
1528 |
Util.toString( |
1515 |
constantMethodref.getClassName(), |
1529 |
constantMethodref.getClassName(), |
1516 |
constantMethodref.getMethodName(), |
1530 |
constantMethodref.getMethodName(), |
1517 |
constantMethodref.getMethodDescriptor(), |
1531 |
constantMethodref.getMethodDescriptor(), |
1518 |
true, |
1532 |
true) |
1519 |
isCompact()) |
1533 |
}))); |
1520 |
}))); |
1534 |
} else { |
|
|
1535 |
buffer.append(Messages.bind(Messages.classformat_invokevirtual, (new String[] { |
1536 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKEVIRTUAL], |
1537 |
Integer.toString(index), |
1538 |
returnDeclaringClassName(constantMethodref), |
1539 |
new String(constantMethodref.getMethodName()), |
1540 |
new String(constantMethodref.getMethodDescriptor()), |
1541 |
}))); |
1542 |
} |
1543 |
writeNewLine(); |
1521 |
writeNewLine(); |
1544 |
} |
1522 |
} |
1545 |
|
1523 |
|
Lines 1643-1649
Link Here
|
1643 |
dumpPcNumber(pc); |
1621 |
dumpPcNumber(pc); |
1644 |
buffer.append(Messages.bind(Messages.classformat_store, (new String[] { |
1622 |
buffer.append(Messages.bind(Messages.classformat_store, (new String[] { |
1645 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ISTORE], |
1623 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ISTORE], |
1646 |
getLocalVariableName(pc, index) |
1624 |
getLocalVariableName(pc, index, true) |
1647 |
}))); |
1625 |
}))); |
1648 |
writeNewLine(); |
1626 |
writeNewLine(); |
1649 |
} |
1627 |
} |
Lines 1948-1954
Link Here
|
1948 |
dumpPcNumber(pc); |
1926 |
dumpPcNumber(pc); |
1949 |
buffer.append(Messages.bind(Messages.classformat_load, (new String[] { |
1927 |
buffer.append(Messages.bind(Messages.classformat_load, (new String[] { |
1950 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LLOAD], |
1928 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LLOAD], |
1951 |
getLocalVariableName(pc, index) |
1929 |
getLocalVariableName(pc, index, true) |
1952 |
}))); |
1930 |
}))); |
1953 |
writeNewLine(); |
1931 |
writeNewLine(); |
1954 |
} |
1932 |
} |
Lines 2091-2097
Link Here
|
2091 |
dumpPcNumber(pc); |
2069 |
dumpPcNumber(pc); |
2092 |
buffer.append(Messages.bind(Messages.classformat_store, (new String[] { |
2070 |
buffer.append(Messages.bind(Messages.classformat_store, (new String[] { |
2093 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LSTORE], |
2071 |
OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LSTORE], |
2094 |
getLocalVariableName(pc, index) |
2072 |
getLocalVariableName(pc, index, true) |
2095 |
}))); |
2073 |
}))); |
2096 |
writeNewLine(); |
2074 |
writeNewLine(); |
2097 |
} |
2075 |
} |
Lines 2266-2272
Link Here
|
2266 |
Integer.toString(index), |
2244 |
Integer.toString(index), |
2267 |
returnDeclaringClassName(constantFieldref), |
2245 |
returnDeclaringClassName(constantFieldref), |
2268 |
new String(constantFieldref.getFieldName()), |
2246 |
new String(constantFieldref.getFieldName()), |
2269 |
new String(constantFieldref.getFieldDescriptor()) |
2247 |
returnClassName(Signature.toCharArray(constantFieldref.getFieldDescriptor())) |
2270 |
}))); |
2248 |
}))); |
2271 |
writeNewLine(); |
2249 |
writeNewLine(); |
2272 |
} |
2250 |
} |
Lines 2281-2287
Link Here
|
2281 |
Integer.toString(index), |
2259 |
Integer.toString(index), |
2282 |
returnDeclaringClassName(constantFieldref), |
2260 |
returnDeclaringClassName(constantFieldref), |
2283 |
new String(constantFieldref.getFieldName()), |
2261 |
new String(constantFieldref.getFieldName()), |
2284 |
new String(constantFieldref.getFieldDescriptor()) |
2262 |
returnClassName(Signature.toCharArray(constantFieldref.getFieldDescriptor())) |
2285 |
}))); |
2263 |
}))); |
2286 |
writeNewLine(); |
2264 |
writeNewLine(); |
2287 |
} |
2265 |
} |
Lines 2464-2469
Link Here
|
2464 |
|
2442 |
|
2465 |
private String returnConstantClassName(IConstantPoolEntry constantClass) { |
2443 |
private String returnConstantClassName(IConstantPoolEntry constantClass) { |
2466 |
char[] classInfoName = constantClass.getClassInfoName(); |
2444 |
char[] classInfoName = constantClass.getClassInfoName(); |
|
|
2445 |
return returnClassName(classInfoName); |
2446 |
} |
2447 |
private String returnClassName(char[] classInfoName) { |
2467 |
if (classInfoName.length == 0) { |
2448 |
if (classInfoName.length == 0) { |
2468 |
return EMPTY_CLASS_NAME; |
2449 |
return EMPTY_CLASS_NAME; |
2469 |
} else if (isCompact()) { |
2450 |
} else if (isCompact()) { |
Lines 2471-2492
Link Here
|
2471 |
if (lastIndexOfSlash != -1) { |
2452 |
if (lastIndexOfSlash != -1) { |
2472 |
return new String(classInfoName, lastIndexOfSlash + 1, classInfoName.length - lastIndexOfSlash - 1); |
2453 |
return new String(classInfoName, lastIndexOfSlash + 1, classInfoName.length - lastIndexOfSlash - 1); |
2473 |
} |
2454 |
} |
2474 |
return new String(classInfoName); |
|
|
2475 |
} else { |
2476 |
return new String(classInfoName); |
2477 |
} |
2455 |
} |
|
|
2456 |
CharOperation.replace(classInfoName, '/', '.'); |
2457 |
return new String(classInfoName); |
2478 |
} |
2458 |
} |
2479 |
|
2459 |
|
2480 |
private String returnDeclaringClassName(IConstantPoolEntry constantRef) { |
2460 |
private String returnDeclaringClassName(IConstantPoolEntry constantRef) { |
2481 |
if (isCompact()) { |
2461 |
final char[] className = constantRef.getClassName(); |
2482 |
char[] className = constantRef.getClassName(); |
2462 |
return returnClassName(className); |
2483 |
int lastIndexOfSlash = CharOperation.lastIndexOf('/', className); |
|
|
2484 |
if (lastIndexOfSlash != -1) { |
2485 |
return new String(className, lastIndexOfSlash + 1, className.length - lastIndexOfSlash - 1); |
2486 |
} |
2487 |
return new String(constantRef.getClassName()); |
2488 |
} |
2489 |
return new String(constantRef.getClassName()); |
2490 |
} |
2463 |
} |
2491 |
|
2464 |
|
2492 |
private void writeNewLine() { |
2465 |
private void writeNewLine() { |