"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/java/edu/umd/cs/findbugs/detect/InefficientMemberAccess.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.

InefficientMemberAccess.java  (findbugs-3.0.0-source):InefficientMemberAccess.java  (findbugs-3.0.1-source)
skipping to change at line 32 skipping to change at line 32
import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.generic.Type; import org.apache.bcel.generic.Type;
import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugInstance;
import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BugReporter;
import edu.umd.cs.findbugs.BytecodeScanningDetector; import edu.umd.cs.findbugs.BytecodeScanningDetector;
import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.StatelessDetector;
import edu.umd.cs.findbugs.ba.AnalysisContext; import edu.umd.cs.findbugs.ba.AnalysisContext;
import edu.umd.cs.findbugs.ba.ClassContext; import edu.umd.cs.findbugs.ba.ClassContext;
import edu.umd.cs.findbugs.ba.InnerClassAccess; import edu.umd.cs.findbugs.ba.InnerClassAccess;
import edu.umd.cs.findbugs.ba.SignatureParser;
public class InefficientMemberAccess extends BytecodeScanningDetector implements StatelessDetector { public class InefficientMemberAccess extends BytecodeScanningDetector implements StatelessDetector {
public static final String ACCESS_PREFIX = "access$"; public static final String ACCESS_PREFIX = "access$";
private final BugReporter bugReporter; private final BugReporter bugReporter;
private String clsName; private String clsName;
public InefficientMemberAccess(BugReporter bugReporter) { public InefficientMemberAccess(BugReporter bugReporter) {
skipping to change at line 76 skipping to change at line 77
return; return;
} }
String parCls = argTypes[0].getSignature(); String parCls = argTypes[0].getSignature();
if (parCls.length() < 3) { if (parCls.length() < 3) {
return; return;
} }
parCls = parCls.substring(1, parCls.length() - 1); parCls = parCls.substring(1, parCls.length() - 1);
if (!parCls.equals(getClassConstantOperand())) { if (!parCls.equals(getClassConstantOperand())) {
return; return;
} }
if ((argTypes.length == 2) && !argTypes[1].getSignature().equals(Typ e.getReturnType(methodSig).getSignature())) { if ((argTypes.length == 2) && !argTypes[1].getSignature().equals(new SignatureParser(methodSig).getReturnTypeSignature())) {
return; return;
} }
InnerClassAccess access = null; InnerClassAccess access = null;
try { try {
String dottedClassConstantOperand = getDottedClassConstantOperan d(); String dottedClassConstantOperand = getDottedClassConstantOperan d();
access = AnalysisContext.currentAnalysisContext().getInnerClassA ccessMap().getInnerClassAccess(dottedClassConstantOperand, methodName); access = AnalysisContext.currentAnalysisContext().getInnerClassA ccessMap().getInnerClassAccess(dottedClassConstantOperand, methodName);
if(access != null) { if(access != null) {
// if the enclosing class of the field differs from the encl osing class of the method, we shouln't report // if the enclosing class of the field differs from the encl osing class of the method, we shouln't report
// because there is nothing wrong: see bug 1226 // because there is nothing wrong: see bug 1226
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added

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