You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

JIRA152.java 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package test4;
  2. import java.util.Map;
  3. import java.util.HashMap;
  4. public class JIRA152 {
  5. public int foo(int i) { return i; }
  6. public int bar(int j) { return j; }
  7. public int tested(int k) {
  8. String[] p;
  9. if (k > 0)
  10. p = new String[1];
  11. else
  12. p = null;
  13. if (p != null)
  14. while (k < p.length)
  15. k++;
  16. return 0;
  17. }
  18. public String put(String s, Object obj) {
  19. return s;
  20. }
  21. private static Map<String, String[]> buildColumnOverride(JIRA152 element, String path) {
  22. Map<String, String[]> columnOverride = new HashMap<String, String[]>();
  23. if ( element == null ) return null;
  24. String singleOverride = element.toString();
  25. String multipleOverrides = element.toString();
  26. String[] overrides;
  27. if ( singleOverride != null ) {
  28. overrides = new String[] { singleOverride };
  29. }
  30. /*else if ( multipleOverrides != null ) {
  31. // overrides = columnOverride.get("foo");
  32. overrides = null;
  33. }*/
  34. else {
  35. overrides = null;
  36. }
  37. if ( overrides != null ) {
  38. for (String depAttr : overrides) {
  39. columnOverride.put(
  40. element.put(path, depAttr.getClass()),
  41. new String[] { depAttr.toLowerCase() }
  42. );
  43. //columnOverride.put("a", new String[1]);
  44. }
  45. }
  46. return columnOverride;
  47. }
  48. public int test() {
  49. Map<String,String[]> map = buildColumnOverride(this, "foo");
  50. return map.size();
  51. }
  52. }