[Fb-contrib-commit] SF.net SVN: fb-contrib:[1706] trunk/fb-contrib
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2011-11-23 00:17:07
|
Revision: 1706
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1706&view=rev
Author: dbrosius
Date: 2011-11-23 00:17:01 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
changes from git repository
Modified Paths:
--------------
trunk/fb-contrib/samples/WOC_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
Modified: trunk/fb-contrib/samples/WOC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/WOC_Sample.java 2011-10-14 05:34:15 UTC (rev 1705)
+++ trunk/fb-contrib/samples/WOC_Sample.java 2011-11-23 00:17:01 UTC (rev 1706)
@@ -17,10 +17,7 @@
private final Set<String> memberSet = new HashSet<String>();
private Set<String> fpSet;
private final List<String> fpList = new ArrayList<String>();
- private final Set<String> fpMergeSet = new HashSet<String>(fpSet);
- private boolean abug = true;
-
public void testWOCSimple()
{
Set<String> s = new HashSet<String>();
@@ -104,13 +101,4 @@
{
return ws.fpList;
}
-
- public void fpMergeListWOC()
- {
- caller(fpMergeSet, !abug);
- }
-
- private void caller(Set<String> set, boolean b)
- {
- }
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2011-10-14 05:34:15 UTC (rev 1705)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2011-11-23 00:17:01 UTC (rev 1706)
@@ -314,6 +314,15 @@
ScopeBlock sb = findScopeBlock(rootScopeBlock, getPC());
if (sb != null)
{
+ ScopeBlock parentSB = sb.getParent();
+ while (parentSB != null) {
+ if (parentSB.getStart() >= target) {
+ sb = parentSB;
+ parentSB = parentSB.getParent();
+ } else {
+ break;
+ }
+ }
sb.setLoop();
}
}
@@ -651,7 +660,7 @@
if (children != null) {
for (ScopeBlock child : children) {
- if ((newChild.startLocation > child.startLocation) && (newChild.finishLocation < child.finishLocation)) {
+ if ((newChild.startLocation > child.startLocation) && (newChild.finishLocation <= child.finishLocation)) {
child.addChild(newChild);
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|