Thread: [Fb-contrib-commit] SF.net SVN: fb-contrib:[1546] trunk/fb-contrib/samples/WOC_Sample.java
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2010-05-08 01:06:07
|
Revision: 1546
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1546&view=rev
Author: dbrosius
Date: 2010-05-08 01:06:00 +0000 (Sat, 08 May 2010)
Log Message:
-----------
add another fp with putting a WOC into an array element
Modified Paths:
--------------
trunk/fb-contrib/samples/WOC_Sample.java
Modified: trunk/fb-contrib/samples/WOC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/WOC_Sample.java 2010-05-07 08:30:28 UTC (rev 1545)
+++ trunk/fb-contrib/samples/WOC_Sample.java 2010-05-08 01:06:00 UTC (rev 1546)
@@ -3,6 +3,7 @@
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
+import java.util.Vector;
public class WOC_Sample
@@ -34,6 +35,13 @@
Set<String> c = s;
}
+ public void testFPWOCInArray()
+ {
+ Vector<Integer> v = new Vector<Integer>();
+ v.addElement(Integer.valueOf(0));
+ Object[] o = new Object[] { v };
+ }
+
private void helper(int i, Map<String, String> x)
{
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2010-05-08 04:05:20
|
Revision: 1547
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1547&view=rev
Author: dbrosius
Date: 2010-05-08 04:05:14 +0000 (Sat, 08 May 2010)
Log Message:
-----------
add a test for when a 'write' method returns a value that is looked at
Modified Paths:
--------------
trunk/fb-contrib/samples/WOC_Sample.java
Modified: trunk/fb-contrib/samples/WOC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/WOC_Sample.java 2010-05-08 01:06:00 UTC (rev 1546)
+++ trunk/fb-contrib/samples/WOC_Sample.java 2010-05-08 04:05:14 UTC (rev 1547)
@@ -1,6 +1,7 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
+import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import java.util.Vector;
@@ -42,6 +43,18 @@
Object[] o = new Object[] { v };
}
+ public void testFPWOCUseReturnVal()
+ {
+ LinkedList<String> l = new LinkedList<String>();
+ l.add("Foo");
+ l.add("Bar");
+
+ if (l.remove("Foo"))
+ {
+ System.out.println("Dont' report");
+ }
+ }
+
private void helper(int i, Map<String, String> x)
{
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2010-05-08 04:17:47
|
Revision: 1548
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1548&view=rev
Author: dbrosius
Date: 2010-05-08 04:17:41 +0000 (Sat, 08 May 2010)
Log Message:
-----------
add test for field collections
Modified Paths:
--------------
trunk/fb-contrib/samples/WOC_Sample.java
Modified: trunk/fb-contrib/samples/WOC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/WOC_Sample.java 2010-05-08 04:05:14 UTC (rev 1547)
+++ trunk/fb-contrib/samples/WOC_Sample.java 2010-05-08 04:17:41 UTC (rev 1548)
@@ -9,16 +9,20 @@
public class WOC_Sample
{
+ private Set<String> memberSet = new HashSet<String>();
+
public void testWOCSimple()
{
Set<String> s = new HashSet<String>();
- s.add("Foo");
+ s.add("Foo");
+ memberSet.add("fee");
}
public Map<String, String> testFPWOCReturn()
{
Map<String, String> m = new HashMap<String, String>();
m.put("Foo", "Bar");
+ memberSet.add("fi");
return m;
}
@@ -26,6 +30,7 @@
{
Map<String, String> m = new HashMap<String, String>();
m.put("Foo", "Bar");
+ memberSet.add("fo");
helper(0, m);
}
@@ -34,6 +39,7 @@
Set<String> s = new LinkedHashSet<String>();
s.add("foo");
Set<String> c = s;
+ memberSet.add("fum");
}
public void testFPWOCInArray()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2010-08-17 04:36:46
|
Revision: 1587
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1587&view=rev
Author: dbrosius
Date: 2010-08-17 04:36:40 +0000 (Tue, 17 Aug 2010)
Log Message:
-----------
don't report WOC on synthetic fields, as an inner class can obtain a member from an owning method
Modified Paths:
--------------
trunk/fb-contrib/samples/WOC_Sample.java
Modified: trunk/fb-contrib/samples/WOC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/WOC_Sample.java 2010-08-17 04:36:13 UTC (rev 1586)
+++ trunk/fb-contrib/samples/WOC_Sample.java 2010-08-17 04:36:40 UTC (rev 1587)
@@ -1,3 +1,5 @@
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
@@ -2,2 +4,3 @@
import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
@@ -9,7 +12,7 @@
public class WOC_Sample
{
- private Set<String> memberSet = new HashSet<String>();
+ private final Set<String> memberSet = new HashSet<String>();
private Set<String> fpSet;
public void testWOCSimple()
@@ -70,4 +73,15 @@
private void helper(int i, Map<String, String> x)
{
}
+
+ public void testFPInnerClass(final Set<String> data)
+ {
+ ActionListener al = new ActionListener()
+ {
+ public void actionPerformed(ActionEvent ae)
+ {
+ data.add("Woot");
+ }
+ };
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-03-25 23:26:28
|
Revision: 1659
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1659&view=rev
Author: dbrosius
Date: 2011-03-25 23:26:22 +0000 (Fri, 25 Mar 2011)
Log Message:
-----------
add fp to WOC
Modified Paths:
--------------
trunk/fb-contrib/samples/WOC_Sample.java
Modified: trunk/fb-contrib/samples/WOC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/WOC_Sample.java 2011-03-06 21:56:49 UTC (rev 1658)
+++ trunk/fb-contrib/samples/WOC_Sample.java 2011-03-25 23:26:22 UTC (rev 1659)
@@ -1,20 +1,23 @@
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Vector;
-public class WOC_Sample
+public class WOC_Sample
{
private final Set<String> memberSet = new HashSet<String>();
private Set<String> fpSet;
-
+ private final List<String> fpList = new ArrayList<String>();
+
public void testWOCSimple()
{
Set<String> s = new HashSet<String>();
@@ -24,7 +27,7 @@
System.out.println("woops");
}
}
-
+
public Map<String, String> testFPWOCReturn()
{
Map<String, String> m = new HashMap<String, String>();
@@ -33,7 +36,7 @@
fpSet = new HashSet<String>();
return m;
}
-
+
public void testFPWOCAsParm()
{
Map<String, String> m = new HashMap<String, String>();
@@ -42,7 +45,7 @@
fpSet.add("boo");
helper(0, m);
}
-
+
public void testFPWOCCopy()
{
Set<String> s = new LinkedHashSet<String>();
@@ -50,42 +53,42 @@
Set<String> c = s;
memberSet.add("fum");
}
-
+
public void testFPWOCInArray()
{
Vector<Integer> v = new Vector<Integer>();
v.addElement(Integer.valueOf(0));
Object[] o = new Object[] { v };
}
-
+
public void testFPWOCUseReturnVal()
{
LinkedList<String> l = new LinkedList<String>();
l.add("Foo");
l.add("Bar");
-
+
if (l.remove("Foo"))
{
System.out.println("Dont' report");
}
}
-
+
public Set<String> testFPTrinary(boolean b)
{
Set<String> s = new HashSet<String>();
s.add("foo");
s.add("bar");
-
+
return b ? s : Collections.<String>emptySet();
}
-
+
private void helper(int i, Map<String, String> x)
- {
+ {
}
-
+
public void testFPInnerClass(final Set<String> data)
{
- ActionListener al = new ActionListener()
+ ActionListener al = new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
@@ -93,4 +96,9 @@
}
};
}
+
+ public List<String> fpOtherClass(WOC_Sample ws)
+ {
+ return ws.fpList;
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2011-07-08 18:50:48
|
Revision: 1701
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1701&view=rev
Author: dbrosius
Date: 2011-07-08 18:50:42 +0000 (Fri, 08 Jul 2011)
Log Message:
-----------
add fp for WOC due to mergeList
Modified Paths:
--------------
trunk/fb-contrib/samples/WOC_Sample.java
Modified: trunk/fb-contrib/samples/WOC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/WOC_Sample.java 2011-07-07 04:25:40 UTC (rev 1700)
+++ trunk/fb-contrib/samples/WOC_Sample.java 2011-07-08 18:50:42 UTC (rev 1701)
@@ -17,7 +17,10 @@
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>();
@@ -101,4 +104,13 @@
{
return ws.fpList;
}
+
+ public void fpMergeListWOC()
+ {
+ caller(fpMergeSet, !abug);
+ }
+
+ private void caller(Set<String> set, boolean b)
+ {
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|