Thread: [Fb-contrib-commit] SF.net SVN: fb-contrib: [919] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
From: <dbr...@us...> - 2007-09-27 10:39:11
|
Revision: 919 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=919&view=rev Author: dbrosius Date: 2007-09-27 03:39:13 -0700 (Thu, 27 Sep 2007) Log Message: ----------- null out fields at each class parse Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2007-09-23 05:16:33 UTC (rev 918) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2007-09-27 10:39:13 UTC (rev 919) @@ -82,6 +82,8 @@ localizableFields = new HashMap<String, FieldInfo>(); visitedBlocks = new BitSet(); clsContext = classContext; + cfg = null; + cpg = null; JavaClass cls = classContext.getJavaClass(); Field[] fields = cls.getFields(); for (Field f : fields) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2007-11-24 01:22:26
|
Revision: 978 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=978&view=rev Author: dbrosius Date: 2007-11-23 17:22:26 -0800 (Fri, 23 Nov 2007) Log Message: ----------- be precise about setup/teardown Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2007-11-23 07:59:00 UTC (rev 977) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2007-11-24 01:22:26 UTC (rev 978) @@ -79,36 +79,37 @@ */ @Override public void visitClassContext(ClassContext classContext) { - localizableFields = new HashMap<String, FieldInfo>(); - visitedBlocks = new BitSet(); - clsContext = classContext; - cfg = null; - cpg = null; - JavaClass cls = classContext.getJavaClass(); - Field[] fields = cls.getFields(); - for (Field f : fields) { - if ((!f.isStatic() && f.getName().indexOf('$') < 0) && f.isPrivate()) { - FieldAnnotation fa = new FieldAnnotation(cls.getClassName(), f.getName(), f.getSignature(), false); - localizableFields.put(f.getName(), new FieldInfo(fa)); + try { + localizableFields = new HashMap<String, FieldInfo>(); + visitedBlocks = new BitSet(); + clsContext = classContext; + JavaClass cls = classContext.getJavaClass(); + Field[] fields = cls.getFields(); + for (Field f : fields) { + if ((!f.isStatic() && f.getName().indexOf('$') < 0) && f.isPrivate()) { + FieldAnnotation fa = new FieldAnnotation(cls.getClassName(), f.getName(), f.getSignature(), false); + localizableFields.put(f.getName(), new FieldInfo(fa)); + } } - } - - if (localizableFields.size() > 0) { - super.visitClassContext(classContext); - for (FieldInfo fi : localizableFields.values()) { - FieldAnnotation fa = fi.getFieldAnnotation(); - SourceLineAnnotation sla = fi.getSrcLineAnnotation(); - BugInstance bug = new BugInstance(this, "FCBL_FIELD_COULD_BE_LOCAL", NORMAL_PRIORITY) - .addClass(this) - .addField(fa); - if (sla != null) - bug.addSourceLine(sla); - bugReporter.reportBug(bug); + + if (localizableFields.size() > 0) { + super.visitClassContext(classContext); + for (FieldInfo fi : localizableFields.values()) { + FieldAnnotation fa = fi.getFieldAnnotation(); + SourceLineAnnotation sla = fi.getSrcLineAnnotation(); + BugInstance bug = new BugInstance(this, "FCBL_FIELD_COULD_BE_LOCAL", NORMAL_PRIORITY) + .addClass(this) + .addField(fa); + if (sla != null) + bug.addSourceLine(sla); + bugReporter.reportBug(bug); + } } + } finally { + localizableFields = null; + visitedBlocks = null; + clsContext = null; } - localizableFields = null; - visitedBlocks = null; - clsContext = null; } /** @@ -138,6 +139,7 @@ } finally { cfg = null; + cpg = null; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-04-02 03:15:53
|
Revision: 1017 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1017&view=rev Author: dbrosius Date: 2008-04-01 20:15:53 -0700 (Tue, 01 Apr 2008) Log Message: ----------- fix deprecations Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2008-04-02 03:14:57 UTC (rev 1016) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2008-04-02 03:15:53 UTC (rev 1017) @@ -209,7 +209,7 @@ bb = bState.getBasicBlock(); uncheckedFields = bState.getUncheckedFields(); - visitedBlocks.set(bb.getId()); + visitedBlocks.set(bb.getLabel()); InstructionIterator ii = bb.instructionIterator(); while ((uncheckedFields.size() > 0) && ii.hasNext()) { InstructionHandle ih = ii.next(); @@ -236,7 +236,7 @@ while (oei.hasNext()) { Edge e = oei.next(); BasicBlock cb = e.getTarget(); - if (!visitedBlocks.get(cb.getId())) { + if (!visitedBlocks.get(cb.getLabel())) { toBeProcessed.addLast(new BlockState(cb, uncheckedFields)); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |