aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/test4/JIRA152.java
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2012-02-19 12:41:47 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2012-02-19 12:41:47 +0000
commite50d7c0862acc66ca1d6b26ec126eb3ed5295d7d (patch)
treea469d5da08dc4ad80401739f827974606ac8621b /src/test/test4/JIRA152.java
parent205b65d96c5fb9d0086eb98d31e21e927d79cf27 (diff)
downloadjavassist-e50d7c0862acc66ca1d6b26ec126eb3ed5295d7d.tar.gz
javassist-e50d7c0862acc66ca1d6b26ec126eb3ed5295d7d.zip
fixed JASSIST-152
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@615 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/test/test4/JIRA152.java')
-rw-r--r--src/test/test4/JIRA152.java60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/test/test4/JIRA152.java b/src/test/test4/JIRA152.java
new file mode 100644
index 00000000..8fba32a1
--- /dev/null
+++ b/src/test/test4/JIRA152.java
@@ -0,0 +1,60 @@
+package test4;
+
+import java.util.Map;
+import java.util.HashMap;
+
+public class JIRA152 {
+ public int foo(int i) { return i; }
+ public int bar(int j) { return j; }
+ public int tested(int k) {
+ String[] p;
+ if (k > 0)
+ p = new String[1];
+ else
+ p = null;
+
+ if (p != null)
+ while (k < p.length)
+ k++;
+
+ return 0;
+ }
+
+ public String put(String s, Object obj) {
+ return s;
+ }
+
+ private static Map<String, String[]> buildColumnOverride(JIRA152 element, String path) {
+ Map<String, String[]> columnOverride = new HashMap<String, String[]>();
+ if ( element == null ) return null;
+ String singleOverride = element.toString();
+ String multipleOverrides = element.toString();
+ String[] overrides;
+ if ( singleOverride != null ) {
+ overrides = new String[] { singleOverride };
+ }
+ /*else if ( multipleOverrides != null ) {
+ // overrides = columnOverride.get("foo");
+ overrides = null;
+ }*/
+ else {
+ overrides = null;
+ }
+
+ if ( overrides != null ) {
+ for (String depAttr : overrides) {
+ columnOverride.put(
+ element.put(path, depAttr.getClass()),
+ new String[] { depAttr.toLowerCase() }
+ );
+ //columnOverride.put("a", new String[1]);
+ }
+ }
+ return columnOverride;
+ }
+
+ public int test() {
+ Map<String,String[]> map = buildColumnOverride(this, "foo");
+ return map.size();
+ }
+}