"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/java/edu/umd/cs/findbugs/ba/SignatureParser.java" between
findbugs-3.0.0-source.zip and findbugs-3.0.1-source.zip

About: FindBugs uses static analysis to look for bugs in Java code. Source.

SignatureParser.java  (findbugs-3.0.0-source):SignatureParser.java  (findbugs-3.0.1-source)
skipping to change at line 60 skipping to change at line 60
if ( parameterOffset != null ) { if ( parameterOffset != null ) {
return parameterOffset; return parameterOffset;
} }
ArrayList<Integer> offsets = new ArrayList<Integer>(); ArrayList<Integer> offsets = new ArrayList<Integer>();
Iterator<String> i = parameterSignatureIterator(); Iterator<String> i = parameterSignatureIterator();
int totalSize = 0; int totalSize = 0;
while (i.hasNext()) { while (i.hasNext()) {
String s = i.next(); String s = i.next();
if (s.equals("D") || s.equals("J")) { if ("D".equals(s) || "J".equals(s)) {
totalSize += 2; totalSize += 2;
} else { } else {
totalSize += 1; totalSize += 1;
} }
offsets.add(totalSize); offsets.add(totalSize);
} }
totalArgumentSize = totalSize; totalArgumentSize = totalSize;
int numParameters = offsets.size(); int numParameters = offsets.size();
parameterOffset = new int[numParameters]; parameterOffset = new int[numParameters];
skipping to change at line 268 skipping to change at line 268
/** /**
* Return how many stack frame slots a type whose signature is given will * Return how many stack frame slots a type whose signature is given will
* occupy. long and double values take 2 slots, while all other kinds of * occupy. long and double values take 2 slots, while all other kinds of
* values take 1 slot. * values take 1 slot.
* *
* @param sig * @param sig
* a type signature * a type signature
* @return number of stack frame slots a value of the given type will occupy * @return number of stack frame slots a value of the given type will occupy
*/ */
public static int getNumSlotsForType(String sig) { public static int getNumSlotsForType(String sig) {
if (sig.equals("J") || sig.equals("D")) { if ("J".equals(sig) || "D".equals(sig)) {
return 2; return 2;
} else { } else {
return 1; return 1;
} }
} }
public static void main(String[] args) { public static void main(String[] args) {
if (args.length != 1) { if (args.length != 1) {
System.err.println("Usage: " + SignatureParser.class.getName() + " ' <method signature>'"); System.err.println("Usage: " + SignatureParser.class.getName() + " ' <method signature>'");
System.exit(1); System.exit(1);
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS