issue_id
int64
2.04k
425k
title
stringlengths
9
251
body
stringlengths
4
32.8k
status
stringclasses
6 values
after_fix_sha
stringlengths
7
7
project_name
stringclasses
6 values
repo_url
stringclasses
6 values
repo_name
stringclasses
6 values
language
stringclasses
1 value
issue_url
null
before_fix_sha
null
pull_url
null
commit_datetime
timestamp[us, tz=UTC]
report_datetime
timestamp[us, tz=UTC]
updated_file
stringlengths
23
187
chunk_content
stringlengths
1
22k
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
throwIaxIfNull(o, name); if (null != c) { Class actualClass = o.getClass(); if (!c.isAssignableFrom(actualClass)) { String message = name + " not assignable to " + c.getName(); throw new IllegalArgumentException(message); } } } /** */ } } } /** * Shorthand for "if false, throw IllegalArgumentException" * * @throws IllegalArgumentException "{message}" if test is false */
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
public static final void throwIaxIfFalse(final boolean test, final String message) { if (!test) { throw new IllegalArgumentException(message); } } } public static boolean isEmpty(String s) { return ((null == s) || (0 == s.length())); } public static boolean isEmpty(Object[] ra) { return ((null == ra) || (0 == ra.length)); } public static boolean isEmpty(Collection collection) { return ((null == collection) || (0 == collection.size())); } /** * Splits <code>text</code> at whitespace. * * @param text <code>String</code> to split. */ public static String[] split(String text) { return (String[]) strings(text).toArray(new String[0]); }
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
/** * Splits <code>input</code> at commas, trimming any white space. * * @param input <code>String</code> to split. * @return List of String of elements. */ public static List commaSplit(String input) { return anySplit(input, ","); } /** * Split string as classpath, delimited at File.pathSeparator. Entries are * not trimmed, but empty entries are ignored. * * @param classpath the String to split - may be null or empty * @return String[] of classpath entries */ public static String[] splitClasspath(String classpath) { if (LangUtil.isEmpty(classpath)) { return new String[0]; } StringTokenizer st = new StringTokenizer(classpath, File.pathSeparator); ArrayList result = new ArrayList(st.countTokens()); while (st.hasMoreTokens()) { String entry = st.nextToken(); if (!LangUtil.isEmpty(entry)) { result.add(entry); } } return (String[]) result.toArray(new String[0]); }
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
/** * Get System property as boolean, but use default value where the system * property is not set. * * @return true if value is set to true, false otherwise */ public static boolean getBoolean(String propertyName, boolean defaultValue) { if (null != propertyName) { try { String value = System.getProperty(propertyName); if (null != value) { return Boolean.valueOf(value).booleanValue(); } } catch (Throwable t) { } } return defaultValue; } /** * Splits <code>input</code>, removing delimiter and trimming any white * space. Returns an empty collection if the input is null. If delimiter is * null or empty or if the input contains no delimiters, the input itself is * returned after trimming white space. * * @param input <code>String</code> to split. * @param delim <code>String</code> separators for input. * @return List of String of elements. */ public static List anySplit(String input, String delim) {
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
if (null == input) { return Collections.EMPTY_LIST; } ArrayList result = new ArrayList(); if (LangUtil.isEmpty(delim) || (-1 == input.indexOf(delim))) { result.add(input.trim()); } else { StringTokenizer st = new StringTokenizer(input, delim); while (st.hasMoreTokens()) { result.add(st.nextToken().trim()); } } return result; } /** * Splits strings into a <code>List</code> using a * <code>StringTokenizer</code>. * * @param text <code>String</code> to split. */ public static List strings(String text) { if (LangUtil.isEmpty(text)) { return Collections.EMPTY_LIST; } List strings = new ArrayList(); StringTokenizer tok = new StringTokenizer(text); while (tok.hasMoreTokens()) { strings.add(tok.nextToken()); } return strings;
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} public static List safeList(List list) { return (null == list ? Collections.EMPTY_LIST : Collections.unmodifiableList(list)); } /** */ } } }
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} } } break; } } } } /** */ }
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} } } } /** * copy non-null two-dimensional String[][] * * @see extractOptions(String[], String[][]) */ public static String[][] copyStrings(String[][] in) { String[][] out = new String[in.length][]; for (int i = 0; i < out.length; i++) { out[i] = new String[in[i].length]; System.arraycopy(in[i], 0, out[i], 0, out[i].length); } return out; } /** * Extract options and arguments to input option list, returning remainder. * The input options will be nullified if not found. e.g., * * <pre> * String[] options = new String[][] { new String[] { &quot;-verbose&quot; }, new String[] { &quot;-classpath&quot;, null } };
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
* String[] args = extractOptions(args, options); * boolean verbose = null != options[0][0]; * boolean classpath = options[1][1]; * </pre> * * @param args the String[] input options * @param options the String[][]options to find in the input args - not null * for each String[] component the first subcomponent is the * option itself, and there is one String subcomponent for each * additional argument. * @return String[] of args remaining after extracting options to extracted */ public static String[] extractOptions(String[] args, String[][] options) { if (LangUtil.isEmpty(args) || LangUtil.isEmpty(options)) { return args; } BitSet foundSet = new BitSet(); String[] result = new String[args.length]; int resultIndex = 0; for (int j = 0; j < args.length; j++) { boolean found = false; for (int i = 0; !found && (i < options.length); i++) { String[] option = options[i]; LangUtil.throwIaxIfFalse(!LangUtil.isEmpty(option), "options"); String sought = option[0]; found = sought.equals(args[j]); if (found) { foundSet.set(i); int doMore = option.length - 1; if (0 < doMore) {
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
final int MAX = j + doMore; if (MAX >= args.length) { String s = "expecting " + doMore + " args after "; throw new IllegalArgumentException(s + args[j]); } for (int k = 1; k < option.length; k++) { option[k] = args[++j]; } } } } if (!found) { result[resultIndex++] = args[j]; } } for (int i = 0; i < options.length; i++) { if (!foundSet.get(i)) { options[i][0] = null; } } if (resultIndex < args.length) { String[] temp = new String[resultIndex]; System.arraycopy(result, 0, temp, 0, resultIndex); args = temp; } return args; }
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
/** */ } } }
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} } } } } } break; } } }
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} } } } } break; } } } }
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} } break; } } } } /** */
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} } } }
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} } } } } } } /** */
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} /** * Convert arrays safely. The number of elements in the result will be 1 * smaller for each element that is null or not assignable. This will use * sink if it has exactly the right size. The result will always have the * same component type as sink. * * @return an array with the same component type as sink containing any * assignable elements in source (in the same order). * @throws IllegalArgumentException if either is null */ public static Object[] safeCopy(Object[] source, Object[] sink) { final Class sinkType = (null == sink ? Object.class : sink.getClass().getComponentType()); final int sourceLength = (null == source ? 0 : source.length); final int sinkLength = (null == sink ? 0 : sink.length); final int resultSize; ArrayList result = null; if (0 == sourceLength) { resultSize = 0; } else { result = new ArrayList(sourceLength); for (int i = 0; i < sourceLength; i++) { if ((null != source[i]) && (sinkType.isAssignableFrom(source[i].getClass()))) { result.add(source[i]); } } resultSize = result.size(); } if (resultSize != sinkLength) { sink = (Object[]) Array.newInstance(sinkType, result.size());
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} if (0 < resultSize) { sink = result.toArray(sink); } return sink; } /** * @return a String with the unqualified class name of the class (or "null") */ public static String unqualifiedClassName(Class c) { if (null == c) { return "null"; } String name = c.getName(); int loc = name.lastIndexOf("."); if (-1 != loc) { name = name.substring(1 + loc); } return name; } /** * @return a String with the unqualified class name of the object (or * "null") */ public static String unqualifiedClassName(Object o) { return LangUtil.unqualifiedClassName(null == o ? null : o.getClass()); } public static String replace(String in, String sought, String replace) { if (LangUtil.isEmpty(in) || LangUtil.isEmpty(sought)) {
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
return in; } StringBuffer result = new StringBuffer(); final int len = sought.length(); int start = 0; int loc; while (-1 != (loc = in.indexOf(sought, start))) { result.append(in.substring(start, loc)); if (!LangUtil.isEmpty(replace)) { result.append(replace); } start = loc + len; } result.append(in.substring(start)); return result.toString(); } public static String toSizedString(long i, int width) { String result = "" + i; int size = result.length(); if (width > size) { final String pad = " "; final int padLength = pad.length(); if (width > padLength) { width = padLength; } int topad = width - size; result = pad.substring(0, topad) + result; } return result;
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} } i++; j++; break; } } }
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} /** * @return "({UnqualifiedExceptionClass}) {message}" */ public static String renderExceptionShort(Throwable e) { if (null == e) return "(Throwable) null"; return "(" + LangUtil.unqualifiedClassName(e) + ") " + e.getMessage(); } /** * Renders exception <code>t</code> after unwrapping and eliding any test * packages. * * @param t <code>Throwable</code> to print. * @see #maxStackTrace */ public static String renderException(Throwable t) { return renderException(t, true); } /** * Renders exception <code>t</code>, unwrapping, optionally eliding and * limiting total number of lines. * * @param t <code>Throwable</code> to print. * @param elide true to limit to 100 lines and elide test packages * @see StringChecker#TEST_PACKAGES */ public static String renderException(Throwable t, boolean elide) { if (null == t) return "null throwable";
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
t = unwrapException(t); StringBuffer stack = stackToString(t, false); if (elide) { elideEndingLines(StringChecker.TEST_PACKAGES, stack, 100); } return stack.toString(); } /** * Trim ending lines from a StringBuffer, clipping to maxLines and further * removing any number of trailing lines accepted by checker. * * @param checker returns true if trailing line should be elided. * @param stack StringBuffer with lines to elide * @param maxLines int for maximum number of resulting lines */ static void elideEndingLines(StringChecker checker, StringBuffer stack, int maxLines) { if (null == checker || (null == stack) || (0 == stack.length())) { return; } final LinkedList lines = new LinkedList(); StringTokenizer st = new StringTokenizer(stack.toString(), "\n\r"); while (st.hasMoreTokens() && (0 < --maxLines)) { lines.add(st.nextToken()); } st = null; String line; int elided = 0; while (!lines.isEmpty()) { line = (String) lines.getLast(); if (!checker.acceptString(line)) {
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
break; } else { elided++; lines.removeLast(); } } if ((elided > 0) || (maxLines < 1)) { final int EOL_LEN = EOL.length(); int totalLength = 0; while (!lines.isEmpty()) { totalLength += EOL_LEN + ((String) lines.getFirst()).length(); lines.removeFirst(); } if (stack.length() > totalLength) { stack.setLength(totalLength); if (elided > 0) { stack.append(" (... " + elided + " lines...)"); } } } } public static StringBuffer stackToString(Throwable throwable, boolean skipMessage) { if (null == throwable) { return new StringBuffer(); } StringWriter buf = new StringWriter(); PrintWriter writer = new PrintWriter(buf); if (!skipMessage) { writer.println(throwable.getMessage());
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} throwable.printStackTrace(writer); try { buf.close(); } catch (IOException ioe) { } ignored return buf.getBuffer(); } public static Throwable unwrapException(Throwable t) { Throwable current = t; Throwable next = null; while (current != null) { if (current instanceof InvocationTargetException) { next = ((InvocationTargetException) current).getTargetException(); } else if (current instanceof ClassNotFoundException) { next = ((ClassNotFoundException) current).getException(); } else if (current instanceof ExceptionInInitializerError) { next = ((ExceptionInInitializerError) current).getException(); } else if (current instanceof PrivilegedActionException) { next = ((PrivilegedActionException) current).getException(); } else if (current instanceof SQLException) { next = ((SQLException) current).getNextException(); }
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
if (null == next) { break; } else { current = next; next = null; } } return current; } /** * Replacement for Arrays.asList(..) which gacks on null and returns a List * in which remove is an unsupported operation. * * @param array the Object[] to convert (may be null) * @return the List corresponding to array (never null) */ public static List arrayAsList(Object[] array) { if ((null == array) || (1 > array.length)) { return Collections.EMPTY_LIST; } ArrayList list = new ArrayList(); list.addAll(Arrays.asList(array)); return list; } public static class StringChecker {
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
static StringChecker TEST_PACKAGES = new StringChecker(new String[] { "org.aspectj.testing", "org.eclipse.jdt.internal.junit", "junit.framework.", "org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" }); String[] infixes; StringChecker(String[] infixes) { this.infixes = infixes; } public boolean acceptString(String input) { boolean result = false; if (!LangUtil.isEmpty(input)) { for (int i = 0; !result && (i < infixes.length); i++) { result = (-1 != input.indexOf(infixes[i])); } } return result; }
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} /** * Gen classpath. * * @param bootclasspath * @param classpath * @param classesDir * @param outputJar * @return String combining classpath elements */ public static String makeClasspath( String bootclasspath, String classpath, String classesDir, String outputJar) { StringBuffer sb = new StringBuffer(); addIfNotEmpty(bootclasspath, sb, File.pathSeparator); addIfNotEmpty(classpath, sb, File.pathSeparator); if (!addIfNotEmpty(classesDir, sb, File.pathSeparator)) { addIfNotEmpty(outputJar, sb, File.pathSeparator); } return sb.toString(); } /** * @param input ignored if null * @param sink the StringBuffer to add input to - return false if null * @param delimiter the String to append to input when added - ignored if * empty * @return true if input + delimiter added to sink */ private static boolean addIfNotEmpty(String input, StringBuffer sink, String delimiter) { if (LangUtil.isEmpty(input) || (null == sink)) { return false;
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} sink.append(input); if (!LangUtil.isEmpty(delimiter)) { sink.append(delimiter); } return true; } /** * Create or initialize a process controller to run a process in another VM * asynchronously. * * @param controller the ProcessController to initialize, if not null * @param classpath * @param mainClass * @param args * @return initialized ProcessController */ public static ProcessController makeProcess(ProcessController controller, String classpath, String mainClass, String[] args) { File java = LangUtil.getJavaExecutable(); ArrayList cmd = new ArrayList(); cmd.add(java.getAbsolutePath()); cmd.add("-classpath"); cmd.add(classpath); cmd.add(mainClass); if (!LangUtil.isEmpty(args)) { cmd.addAll(Arrays.asList(args)); } String[] command = (String[]) cmd.toArray(new String[0]); if (null == controller) { controller = new ProcessController();
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} controller.init(command, mainClass); return controller; } /** */ } } /** * Find java executable File path from java.home system property. * * @return File associated with the java command, or null if not found. */ public static File getJavaExecutable() { String javaHome = null; File result = null;
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
try { javaHome = System.getProperty("java.home"); } catch (Throwable t) { ignore } if (null != javaHome) { File binDir = new File(javaHome, "bin"); if (binDir.isDirectory() && binDir.canRead()) { String[] execs = new String[] { "java", "java.exe" }; for (int i = 0; i < execs.length; i++) { result = new File(binDir, execs[i]); if (result.canRead()) { break; } } } } return result; } /** * */
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} } /** * Sleep until a particular time. * * @param time the long time in milliseconds to sleep until * @return true if delay succeeded, false if interrupted 100 times */ public static boolean sleepUntil(long time) { if (time == 0) { return true; } else if (time < 0) { throw new IllegalArgumentException("negative: " + time); } long curTime = System.currentTimeMillis(); for (int i = 0; (i < 100) && (curTime < time); i++) { try { Thread.sleep(time - curTime); } catch (InterruptedException e) { ignore } curTime = System.currentTimeMillis(); } return (curTime >= time); } /** * Handle an external process asynchrously. <code>start()</code> launches a
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
* main thread to wait for the process and pipes streams (in child threads) * through to the corresponding streams (e.g., the process System.err to * this System.err). This can complete normally, by exception, or on demand * by a client. Clients can implement <code>doCompleting(..)</code> to get * notice when the process completes. * <p> * The following sample code creates a process with a completion callback * starts it, and some time later retries the process. * * <pre> * LangUtil.ProcessController controller = new LangUtil.ProcessController() { * protected void doCompleting(LangUtil.ProcessController.Thrown thrown, int result) { * signal result * } * }; * controller.init(new String[] { &quot;java&quot;, &quot;-version&quot; }, &quot;java version&quot;); * controller.start(); * some time later... * retry... * if (!controller.completed()) { * controller.stop(); * controller.reinit(); * controller.start(); * } * </pre> * * <u>warning</u>: Currently this does not close the input or output * streams, since doing so prevents their use later. */ public static class ProcessController {
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
/* * XXX not verified thread-safe, but should be. Known problems: - user * stops (completed = true) then exception thrown from destroying * process (stop() expects !completed) ... */ private String[] command; private String[] envp; private String label; private boolean init; private boolean started; private boolean completed; private boolean userStopped; private Process process; private FileUtil.Pipe errStream; private FileUtil.Pipe outStream; private FileUtil.Pipe inStream; private ByteArrayOutputStream errSnoop; private ByteArrayOutputStream outSnoop; private int result; private Thrown thrown; public ProcessController() {
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} /** * Permit re-running using the same command if this is not started or if * completed. Can also call this when done with results to release * references associated with results (e.g., stack traces). */ public final void reinit() { if (!init) { throw new IllegalStateException("must init(..) before reinit()"); } if (started && !completed) { throw new IllegalStateException("not completed - do stop()"); } started = false; completed = false; result = Integer.MIN_VALUE; thrown = null; process = null; errStream = null; outStream = null; inStream = null; } public final void init(String classpath, String mainClass, String[] args) { init(LangUtil.getJavaExecutable(), classpath, mainClass, args); } public final void init(File java, String classpath, String mainClass, String[] args) { LangUtil.throwIaxIfNull(java, "java"); LangUtil.throwIaxIfNull(mainClass, "mainClass"); LangUtil.throwIaxIfNull(args, "args");
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
ArrayList cmd = new ArrayList(); cmd.add(java.getAbsolutePath()); cmd.add("-classpath"); cmd.add(classpath); cmd.add(mainClass); if (!LangUtil.isEmpty(args)) { cmd.addAll(Arrays.asList(args)); } init((String[]) cmd.toArray(new String[0]), mainClass); } public final void init(String[] command, String label) { this.command = (String[]) LangUtil.safeCopy(command, new String[0]); if (1 > this.command.length) { throw new IllegalArgumentException("empty command"); } this.label = LangUtil.isEmpty(label) ? command[0] : label; init = true; reinit(); } public final void setEnvp(String[] envp) { this.envp = (String[]) LangUtil.safeCopy(envp, new String[0]); if (1 > this.envp.length) { throw new IllegalArgumentException("empty envp"); } } public final void setErrSnoop(ByteArrayOutputStream snoop) { errSnoop = snoop; if (null != errStream) { errStream.setSnoop(errSnoop); }
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} public final void setOutSnoop(ByteArrayOutputStream snoop) { outSnoop = snoop; if (null != outStream) { outStream.setSnoop(outSnoop); } } /** * Start running the process and pipes asynchronously. * * @return Thread started or null if unable to start thread (results * available via <code>getThrown()</code>, etc.) */ public final Thread start() { if (!init) { throw new IllegalStateException("not initialized"); } synchronized (this) { if (started) { throw new IllegalStateException("already started"); } started = true; } try { process = Runtime.getRuntime().exec(command); } catch (IOException e) { stop(e, Integer.MIN_VALUE); return null; } errStream = new FileUtil.Pipe(process.getErrorStream(), System.err);
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
if (null != errSnoop) { errStream.setSnoop(errSnoop); } outStream = new FileUtil.Pipe(process.getInputStream(), System.out); if (null != outSnoop) { outStream.setSnoop(outSnoop); } inStream = new FileUtil.Pipe(System.in, process.getOutputStream()); Runnable processRunner = new Runnable() { public void run() { Throwable thrown = null; int result = Integer.MIN_VALUE; try { new Thread(errStream).start(); new Thread(outStream).start(); new Thread(inStream).start(); process.waitFor(); result = process.exitValue(); } catch (Throwable e) { thrown = e; } finally { stop(thrown, result); } } }; Thread result = new Thread(processRunner, label); result.start(); return result;
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} /** * Destroy any process, stop any pipes. This waits for the pipes to * clear (reading until no more input is available), but does not wait * for the input stream for the pipe to close (i.e., not waiting for * end-of-file on input stream). */ public final synchronized void stop() { if (completed) { return; } userStopped = true; stop(null, Integer.MIN_VALUE); } public final String[] getCommand() { String[] toCopy = command; if (LangUtil.isEmpty(toCopy)) { return new String[0]; } String[] result = new String[toCopy.length]; System.arraycopy(toCopy, 0, result, 0, result.length); return result; } public final boolean completed() { return completed; } public final boolean started() { return started; } public final boolean userStopped() {
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
return userStopped; } /** * Get any Throwable thrown. Note that the process can complete normally * (with a valid return value), at the same time the pipes throw * exceptions, and that this may return some exceptions even if the * process is not complete. * * @return null if not complete or Thrown containing exceptions thrown * by the process and streams. */ public final Thrown getThrown() { return makeThrown(null); } public final int getResult() { return result; } /** * Subclasses implement this to get synchronous notice of completion. * All pipes and processes should be complete at this time. To get the * exceptions thrown for the pipes, use <code>getThrown()</code>. If * there is an exception, the process completed abruptly (including * side-effects of the user halting the process). If * <code>userStopped()</code> is true, then some client asked that the * process be destroyed using <code>stop()</code>. Otherwise, the result * code should be the result value returned by the process. * * @param thrown same as <code>getThrown().fromProcess</code>. * @param result same as <code>getResult()</code> * @see getThrown()
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
* @see getResult() * @see stop() */ protected void doCompleting(Thrown thrown, int result) { } /** * Handle termination (on-demand, abrupt, or normal) by destroying * and/or halting process and pipes. * * @param thrown ignored if null * @param result ignored if Integer.MIN_VALUE */ private final synchronized void stop(Throwable thrown, int result) { if (completed) { throw new IllegalStateException("already completed"); } else if (null != this.thrown) { throw new IllegalStateException("already set thrown: " + thrown); } this.thrown = makeThrown(thrown); if (null != process) { process.destroy(); } if (null != inStream) { inStream.halt(false, true); inStream = null; } if (null != outStream) { outStream.halt(true, true); outStream = null;
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
} if (null != errStream) { errStream.halt(true, true); errStream = null; } if (Integer.MIN_VALUE != result) { this.result = result; } completed = true; doCompleting(this.thrown, result); } /** * Create snapshot of Throwable's thrown. * * @param thrown ignored if null or if this.thrown is not null */ private final synchronized Thrown makeThrown(Throwable processThrown) { if (null != thrown) { return thrown; } return new Thrown(processThrown, (null == outStream ? null : outStream.getThrown()), (null == errStream ? null : errStream.getThrown()), (null == inStream ? null : inStream.getThrown())); } public static class Thrown { public final Throwable fromProcess; public final Throwable fromErrPipe; public final Throwable fromOutPipe; public final Throwable fromInPipe; public final boolean thrown;
288,198
Bug 288198 LangUtils JVM version detection cannot handle Java 7
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: 1.6.4 The JVM detection in LangUtils is currently unable to handle Java7, whilst this is naturally an unreleased version of the JVM, the fix is trivial. Reproducible: Always Steps to Reproduce: Attempt to use the LangUtils java version support on java7
resolved fixed
b29f839
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-04T16:36:07Z
2009-09-01T01:53:20Z
util/src/org/aspectj/util/LangUtil.java
private Thrown(Throwable fromProcess, Throwable fromOutPipe, Throwable fromErrPipe, Throwable fromInPipe) { this.fromProcess = fromProcess; this.fromErrPipe = fromErrPipe; this.fromOutPipe = fromOutPipe; this.fromInPipe = fromInPipe; thrown = ((null != fromProcess) || (null != fromInPipe) || (null != fromOutPipe) || (null != fromErrPipe)); } public String toString() { StringBuffer sb = new StringBuffer(); append(sb, fromProcess, "process"); append(sb, fromOutPipe, " stdout"); append(sb, fromErrPipe, " stderr"); append(sb, fromInPipe, " stdin"); if (0 == sb.length()) { return "Thrown (none)"; } else { return sb.toString(); } } private void append(StringBuffer sb, Throwable thrown, String label) { if (null != thrown) { sb.append("from " + label + ": "); sb.append(LangUtil.renderExceptionShort(thrown)); sb.append(LangUtil.EOL); } } } } }
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
/* ******************************************************************* * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * PARC initial implementation * Alexandre Vasseur perClause support for @AJ aspects * ******************************************************************/ package org.aspectj.weaver.bcel; import java.io.File; import java.io.IOException; import java.lang.reflect.Modifier; import java.net.MalformedURLException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List;
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
import java.util.Map; import java.util.StringTokenizer; import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.classfile.ClassParser; import org.aspectj.apache.bcel.classfile.ConstantPool; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.generic.FieldInstruction; import org.aspectj.apache.bcel.generic.INVOKEINTERFACE; import org.aspectj.apache.bcel.generic.Instruction; import org.aspectj.apache.bcel.generic.InstructionHandle; import org.aspectj.apache.bcel.generic.InvokeInstruction; import org.aspectj.apache.bcel.generic.MULTIANEWARRAY; import org.aspectj.apache.bcel.generic.ObjectType; import org.aspectj.apache.bcel.generic.Type; import org.aspectj.apache.bcel.util.ClassLoaderReference; import org.aspectj.apache.bcel.util.ClassLoaderRepository; import org.aspectj.apache.bcel.util.ClassPath; import org.aspectj.apache.bcel.util.NonCachingClassLoaderRepository; import org.aspectj.apache.bcel.util.Repository; import org.aspectj.asm.AsmManager; import org.aspectj.asm.IRelationship; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessageHandler; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.Message; import org.aspectj.bridge.MessageUtil; import org.aspectj.bridge.WeaveMessage; import org.aspectj.weaver.Advice; import org.aspectj.weaver.AdviceKind; import org.aspectj.weaver.AnnotationAJ;
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
import org.aspectj.weaver.AnnotationOnTypeMunger; import org.aspectj.weaver.BCException; import org.aspectj.weaver.Checker; import org.aspectj.weaver.ICrossReferenceHandler; import org.aspectj.weaver.IWeavingSupport; import org.aspectj.weaver.Member; import org.aspectj.weaver.MemberImpl; import org.aspectj.weaver.MemberKind; import org.aspectj.weaver.NewParentTypeMunger; import org.aspectj.weaver.ReferenceType; import org.aspectj.weaver.ReferenceTypeDelegate; import org.aspectj.weaver.ResolvedMember; import org.aspectj.weaver.ResolvedMemberImpl; import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.ResolvedTypeMunger; import org.aspectj.weaver.Shadow; import org.aspectj.weaver.ShadowMunger; import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.World; import org.aspectj.weaver.loadtime.definition.Definition; import org.aspectj.weaver.loadtime.definition.DocumentParser; import org.aspectj.weaver.model.AsmRelationshipProvider; import org.aspectj.weaver.patterns.DeclareAnnotation; import org.aspectj.weaver.patterns.DeclareParents; import org.aspectj.weaver.patterns.ParserException; import org.aspectj.weaver.patterns.PatternParser; import org.aspectj.weaver.patterns.TypePattern; import org.aspectj.weaver.tools.Trace; import org.aspectj.weaver.tools.TraceFactory; public class BcelWorld extends World implements Repository {
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
private final ClassPathManager classPath; protected Repository delegate; private BcelWeakClassLoaderReference loaderRef; private final BcelWeavingSupport bcelWeavingSupport = new BcelWeavingSupport(); private boolean isXmlConfiguredWorld = false; private WeavingXmlConfig xmlConfiguration; private static Trace trace = TraceFactory.getTraceFactory().getTrace(BcelWorld.class); public BcelWorld() { this(""); } public BcelWorld(String cp) {
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
this(makeDefaultClasspath(cp), IMessageHandler.THROW, null); } public IRelationship.Kind determineRelKind(ShadowMunger munger) { AdviceKind ak = ((Advice) munger).getKind(); if (ak.getKey() == AdviceKind.Before.getKey()) return IRelationship.Kind.ADVICE_BEFORE; else if (ak.getKey() == AdviceKind.After.getKey()) return IRelationship.Kind.ADVICE_AFTER; else if (ak.getKey() == AdviceKind.AfterThrowing.getKey()) return IRelationship.Kind.ADVICE_AFTERTHROWING; else if (ak.getKey() == AdviceKind.AfterReturning.getKey()) return IRelationship.Kind.ADVICE_AFTERRETURNING; else if (ak.getKey() == AdviceKind.Around.getKey()) return IRelationship.Kind.ADVICE_AROUND; else if (ak.getKey() == AdviceKind.CflowEntry.getKey() || ak.getKey() == AdviceKind.CflowBelowEntry.getKey() || ak.getKey() == AdviceKind.InterInitializer.getKey() || ak.getKey() == AdviceKind.PerCflowEntry.getKey() || ak.getKey() == AdviceKind.PerCflowBelowEntry.getKey() || ak.getKey() == AdviceKind.PerThisEntry.getKey() || ak.getKey() == AdviceKind.PerTargetEntry.getKey() || ak.getKey() == AdviceKind.Softener.getKey() || ak.getKey() == AdviceKind.PerTypeWithinEntry.getKey()) { return null; } throw new RuntimeException("Shadow.determineRelKind: What the hell is it? " + ak); } @Override public void reportMatch(ShadowMunger munger, Shadow shadow) { if (getCrossReferenceHandler() != null) { getCrossReferenceHandler().addCrossReference(munger.getSourceLocation(), shadow.getSourceLocation(), determineRelKind(munger).getName(),
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
((Advice) munger).hasDynamicTests() ); } if (!getMessageHandler().isIgnoring(IMessage.WEAVEINFO)) { reportWeavingMessage(munger, shadow); } if (getModel() != null) { AsmRelationshipProvider.addAdvisedRelationship(getModelAsAsmManager(), shadow, munger); } } /* * Report a message about the advice weave that has occurred. Some messing about to make it pretty ! This code is just asking * for an NPE to occur ... */ private void reportWeavingMessage(ShadowMunger munger, Shadow shadow) { Advice advice = (Advice) munger; AdviceKind aKind = advice.getKind(); if (aKind == null || advice.getConcreteAspect() == null) { return; } if (!(aKind.equals(AdviceKind.Before) || aKind.equals(AdviceKind.After) || aKind.equals(AdviceKind.AfterReturning) || aKind.equals(AdviceKind.AfterThrowing) || aKind.equals(AdviceKind.Around) || aKind.equals(AdviceKind.Softener))) return;
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
if (shadow.getKind() == Shadow.SynchronizationUnlock) { if (advice.lastReportedMonitorExitJoinpointLocation == null) { advice.lastReportedMonitorExitJoinpointLocation = shadow.getSourceLocation(); } else { if (areTheSame(shadow.getSourceLocation(), advice.lastReportedMonitorExitJoinpointLocation)) { advice.lastReportedMonitorExitJoinpointLocation = null; return; } advice.lastReportedMonitorExitJoinpointLocation = shadow.getSourceLocation(); } } String description = advice.getKind().toString(); String advisedType = shadow.getEnclosingType().getName(); String advisingType = advice.getConcreteAspect().getName(); Message msg = null; if (advice.getKind().equals(AdviceKind.Softener)) { msg = WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_SOFTENS, new String[] { advisedType, beautifyLocation(shadow.getSourceLocation()), advisingType, beautifyLocation(munger.getSourceLocation()) }, advisedType, advisingType); } else { boolean runtimeTest = advice.hasDynamicTests(); String joinPointDescription = shadow.toString(); msg = WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_ADVISES, new String[] { joinPointDescription, advisedType, beautifyLocation(shadow.getSourceLocation()), description, advisingType, beautifyLocation(munger.getSourceLocation()), (runtimeTest ? " [with runtime test]" : "") }, advisedType, advisingType);
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
} getMessageHandler().handleMessage(msg); } private boolean areTheSame(ISourceLocation locA, ISourceLocation locB) { if (locA == null) return locB == null; if (locB == null) return false; if (locA.getLine() != locB.getLine()) return false; File fA = locA.getSourceFile(); File fB = locA.getSourceFile(); if (fA == null) return fB == null; if (fB == null) return false; return fA.getName().equals(fB.getName()); } /* * Ensure we report a nice source location - particular in the case where the source info is missing (binary weave). */ private String beautifyLocation(ISourceLocation isl) { StringBuffer nice = new StringBuffer(); if (isl == null || isl.getSourceFile() == null || isl.getSourceFile().getName().indexOf("no debug info available") != -1) { nice.append("no debug info available"); } else { int takeFrom = isl.getSourceFile().getPath().lastIndexOf('/'); if (takeFrom == -1) { takeFrom = isl.getSourceFile().getPath().lastIndexOf('\\');
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
} int binary = isl.getSourceFile().getPath().lastIndexOf('!'); if (binary != -1 && binary < takeFrom) { String pathToBinaryLoc = isl.getSourceFile().getPath().substring(0, binary + 1); if (pathToBinaryLoc.indexOf(".jar") != -1) { int lastSlash = pathToBinaryLoc.lastIndexOf('/'); if (lastSlash == -1) { lastSlash = pathToBinaryLoc.lastIndexOf('\\'); } nice.append(pathToBinaryLoc.substring(lastSlash + 1)); } } nice.append(isl.getSourceFile().getPath().substring(takeFrom + 1)); if (isl.getLine() != 0) nice.append(":").append(isl.getLine()); if (isl.getSourceFileName() != null) nice.append("(from " + isl.getSourceFileName() + ")"); } return nice.toString(); } private static List<String> makeDefaultClasspath(String cp) { List<String> classPath = new ArrayList<String>(); classPath.addAll(getPathEntries(cp)); classPath.addAll(getPathEntries(ClassPath.getClassPath())); return classPath; } private static List<String> getPathEntries(String s) {
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
List<String> ret = new ArrayList<String>(); StringTokenizer tok = new StringTokenizer(s, File.pathSeparator); while (tok.hasMoreTokens()) { ret.add(tok.nextToken()); } return ret; } public BcelWorld(List classPath, IMessageHandler handler, ICrossReferenceHandler xrefHandler) { this.classPath = new ClassPathManager(classPath, handler); setMessageHandler(handler); setCrossReferenceHandler(xrefHandler); delegate = this; } public BcelWorld(ClassPathManager cpm, IMessageHandler handler, ICrossReferenceHandler xrefHandler) { classPath = cpm; setMessageHandler(handler); setCrossReferenceHandler(xrefHandler); delegate = this; } /** * Build a World from a ClassLoader, for LTW support * * @param loader * @param handler * @param xrefHandler */ public BcelWorld(ClassLoader loader, IMessageHandler handler, ICrossReferenceHandler xrefHandler) {
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
classPath = null; loaderRef = new BcelWeakClassLoaderReference(loader); setMessageHandler(handler); setCrossReferenceHandler(xrefHandler); } public void ensureRepositorySetup() { if (delegate == null) { delegate = getClassLoaderRepositoryFor(loaderRef); } } public Repository getClassLoaderRepositoryFor(ClassLoaderReference loader) { if (bcelRepositoryCaching) { return new ClassLoaderRepository(loader); } else { return new NonCachingClassLoaderRepository(loader); } } public void addPath(String name) { classPath.addPath(name, this.getMessageHandler()); } public static Type makeBcelType(UnresolvedType type) { return Type.getType(type.getErasureSignature()); } static Type[] makeBcelTypes(UnresolvedType[] types) { Type[] ret = new Type[types.length]; for (int i = 0, len = types.length; i < len; i++) { ret[i] = makeBcelType(types[i]);
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
} return ret; } static String[] makeBcelTypesAsClassNames(UnresolvedType[] types) { String[] ret = new String[types.length]; for (int i = 0, len = types.length; i < len; i++) { ret[i] = types[i].getName(); } return ret; } public static UnresolvedType fromBcel(Type t) { return UnresolvedType.forSignature(t.getSignature()); } static UnresolvedType[] fromBcel(Type[] ts) { UnresolvedType[] ret = new UnresolvedType[ts.length]; for (int i = 0, len = ts.length; i < len; i++) { ret[i] = fromBcel(ts[i]); } return ret; } public ResolvedType resolve(Type t) { return resolve(fromBcel(t)); } @Override protected ReferenceTypeDelegate resolveDelegate(ReferenceType ty) { String name = ty.getName(); ensureAdvancedConfigurationProcessed(); JavaClass jc = lookupJavaClass(classPath, name); if (jc == null) { return null;
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
} else { return buildBcelDelegate(ty, jc, false); } } public BcelObjectType buildBcelDelegate(ReferenceType resolvedTypeX, JavaClass jc, boolean exposedToWeaver) { BcelObjectType ret = new BcelObjectType(resolvedTypeX, jc, exposedToWeaver); return ret; } private JavaClass lookupJavaClass(ClassPathManager classPath, String name) { if (classPath == null) { try { ensureRepositorySetup(); JavaClass jc = delegate.loadClass(name); if (trace.isTraceEnabled()) trace.event("lookupJavaClass", this, new Object[] { name, jc }); return jc; } catch (ClassNotFoundException e) { if (trace.isTraceEnabled()) trace.error("Unable to find class '" + name + "' in repository", e); return null; } } try { ClassPathManager.ClassFile file = classPath.find(UnresolvedType.forName(name)); if (file == null) return null; ClassParser parser = new ClassParser(file.getInputStream(), file.getPath()); JavaClass jc = parser.parse(); file.close(); return jc;
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
} catch (IOException ioe) { return null; } } public BcelObjectType addSourceObjectType(JavaClass jc) { BcelObjectType ret = null; String signature = UnresolvedType.forName(jc.getClassName()).getSignature(); Object fromTheMap = typeMap.get(signature); if (fromTheMap != null && !(fromTheMap instanceof ReferenceType)) { StringBuffer exceptionText = new StringBuffer(); exceptionText.append("Found invalid (not a ReferenceType) entry in the type map. "); exceptionText.append("Signature=[" + signature + "] Found=[" + fromTheMap + "] Class=[" + fromTheMap.getClass() + "]"); throw new BCException(exceptionText.toString()); } ReferenceType nameTypeX = (ReferenceType) fromTheMap; if (nameTypeX == null) { if (jc.isGeneric() && isInJava5Mode()) { nameTypeX = ReferenceType.fromTypeX(UnresolvedType.forRawTypeName(jc.getClassName()), this); ret = buildBcelDelegate(nameTypeX, jc, true); ReferenceType genericRefType = new ReferenceType(UnresolvedType.forGenericTypeSignature(signature, ret .getDeclaredGenericSignature()), this); nameTypeX.setDelegate(ret); genericRefType.setDelegate(ret); nameTypeX.setGenericType(genericRefType); typeMap.put(signature, nameTypeX); } else { nameTypeX = new ReferenceType(signature, this); ret = buildBcelDelegate(nameTypeX, jc, true); typeMap.put(signature, nameTypeX);
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
} } else { ret = buildBcelDelegate(nameTypeX, jc, true); } return ret; } void deleteSourceObjectType(UnresolvedType ty) { typeMap.remove(ty.getSignature()); } public static Member makeFieldJoinPointSignature(LazyClassGen cg, FieldInstruction fi) { ConstantPool cpg = cg.getConstantPool(); return MemberImpl.field(fi.getClassName(cpg), (fi.opcode == Constants.GETSTATIC || fi.opcode == Constants.PUTSTATIC) ? Modifier.STATIC : 0, fi.getName(cpg), fi .getSignature(cpg)); } public Member makeJoinPointSignatureFromMethod(LazyMethodGen mg, MemberKind kind) { Member ret = mg.getMemberView(); if (ret == null) { int mods = mg.getAccessFlags(); if (mg.getEnclosingClass().isInterface()) { mods |= Modifier.INTERFACE; } return new ResolvedMemberImpl(kind, UnresolvedType.forName(mg.getClassName()), mods, fromBcel(mg.getReturnType()), mg .getName(), fromBcel(mg.getArgumentTypes())); } else { return ret; } } public Member makeJoinPointSignatureForMonitorEnter(LazyClassGen cg, InstructionHandle h) { return MemberImpl.monitorEnter();
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
} public Member makeJoinPointSignatureForMonitorExit(LazyClassGen cg, InstructionHandle h) { return MemberImpl.monitorExit(); } public Member makeJoinPointSignatureForArrayConstruction(LazyClassGen cg, InstructionHandle handle) { Instruction i = handle.getInstruction(); ConstantPool cpg = cg.getConstantPool(); Member retval = null; if (i.opcode == Constants.ANEWARRAY) { Type ot = i.getType(cpg); UnresolvedType ut = fromBcel(ot); ut = UnresolvedType.makeArray(ut, 1); retval = MemberImpl.method(ut, Modifier.PUBLIC, ResolvedType.VOID, "<init>", new ResolvedType[] { ResolvedType.INT }); } else if (i instanceof MULTIANEWARRAY) { MULTIANEWARRAY arrayInstruction = (MULTIANEWARRAY) i; UnresolvedType ut = null; short dimensions = arrayInstruction.getDimensions(); ObjectType ot = arrayInstruction.getLoadClassType(cpg); if (ot != null) { ut = fromBcel(ot); ut = UnresolvedType.makeArray(ut, dimensions); } else { Type t = arrayInstruction.getType(cpg); ut = fromBcel(t); } ResolvedType[] parms = new ResolvedType[dimensions]; for (int ii = 0; ii < dimensions; ii++) parms[ii] = ResolvedType.INT; retval = MemberImpl.method(ut, Modifier.PUBLIC, ResolvedType.VOID, "<init>", parms);
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
} else if (i.opcode == Constants.NEWARRAY) { Type ot = i.getType(); UnresolvedType ut = fromBcel(ot); retval = MemberImpl.method(ut, Modifier.PUBLIC, ResolvedType.VOID, "<init>", new ResolvedType[] { ResolvedType.INT }); } else { throw new BCException("Cannot create array construction signature for this non-array instruction:" + i); } return retval; } public Member makeJoinPointSignatureForMethodInvocation(LazyClassGen cg, InvokeInstruction ii) { ConstantPool cpg = cg.getConstantPool(); String name = ii.getName(cpg); String declaring = ii.getClassName(cpg); UnresolvedType declaringType = null; String signature = ii.getSignature(cpg); int modifier = (ii instanceof INVOKEINTERFACE) ? Modifier.INTERFACE : (ii.opcode == Constants.INVOKESTATIC) ? Modifier.STATIC : (ii.opcode == Constants.INVOKESPECIAL && !name .equals("<init>")) ? Modifier.PRIVATE : 0; if (ii.opcode == Constants.INVOKESTATIC) { ResolvedType appearsDeclaredBy = resolve(declaring); for (Iterator iterator = appearsDeclaredBy.getMethods(); iterator.hasNext();) { ResolvedMember method = (ResolvedMember) iterator.next(); if (method.isStatic()) { if (name.equals(method.getName()) && signature.equals(method.getSignature())) {
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
declaringType = method.getDeclaringType(); break; } } } } if (declaringType == null) { if (declaring.charAt(0) == '[') declaringType = UnresolvedType.forSignature(declaring); else declaringType = UnresolvedType.forName(declaring); } return MemberImpl.method(declaringType, modifier, name, signature); } @Override public String toString() { StringBuffer buf = new StringBuffer(); buf.append("BcelWorld("); buf.append(")"); return buf.toString(); } /** * Retrieve a bcel delegate for an aspect - this will return NULL if the delegate is an EclipseSourceType and not a * BcelObjectType - this happens quite often when incrementally compiling. */ public static BcelObjectType getBcelObjectType(ResolvedType concreteAspect) { if (concreteAspect == null) { return null;
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
} if (!(concreteAspect instanceof ReferenceType)) { return null; } ReferenceTypeDelegate rtDelegate = ((ReferenceType) concreteAspect).getDelegate(); if (rtDelegate instanceof BcelObjectType) { return (BcelObjectType) rtDelegate; } else { return null; } } public void tidyUp() { classPath.closeArchives(); typeMap.report(); ResolvedType.resetPrimitives(); } public JavaClass findClass(String className) { return lookupJavaClass(classPath, className); } public JavaClass loadClass(String className) throws ClassNotFoundException { return lookupJavaClass(classPath, className); } public void storeClass(JavaClass clazz) { } public void removeClass(JavaClass clazz) { throw new RuntimeException("Not implemented");
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
} public JavaClass loadClass(Class clazz) throws ClassNotFoundException { throw new RuntimeException("Not implemented"); } public void clear() { delegate.clear(); } /** * The aim of this method is to make sure a particular type is 'ok'. Some operations on the delegate for a type modify it and * this method is intended to undo that... see pr85132 */ @Override public void validateType(UnresolvedType type) { ResolvedType result = typeMap.get(type.getSignature()); if (result == null) return; if (!result.isExposedToWeaver()) return; result.ensureConsistent();
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
} /** * Apply a single declare parents - return true if we change the type */ private boolean applyDeclareParents(DeclareParents p, ResolvedType onType) { boolean didSomething = false; List newParents = p.findMatchingNewParents(onType, true); if (!newParents.isEmpty()) { didSomething = true; BcelObjectType classType = BcelWorld.getBcelObjectType(onType); for (Iterator j = newParents.iterator(); j.hasNext();) { ResolvedType newParent = (ResolvedType) j.next(); onType.addParent(newParent); ResolvedTypeMunger newParentMunger = new NewParentTypeMunger(newParent); newParentMunger.setSourceLocation(p.getSourceLocation()); onType.addInterTypeMunger(new BcelTypeMunger(newParentMunger, getCrosscuttingMembersSet() .findAspectDeclaringParents(p))); } } return didSomething; } /**
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
* Apply a declare @type - return true if we change the type */ private boolean applyDeclareAtType(DeclareAnnotation decA, ResolvedType onType, boolean reportProblems) { boolean didSomething = false; if (decA.matches(onType)) { if (onType.hasAnnotation(decA.getAnnotation().getType())) { return false; } AnnotationAJ annoX = decA.getAnnotation(); boolean isOK = checkTargetOK(decA, onType, annoX); if (isOK) { didSomething = true; ResolvedTypeMunger newAnnotationTM = new AnnotationOnTypeMunger(annoX); newAnnotationTM.setSourceLocation(decA.getSourceLocation()); onType.addInterTypeMunger(new BcelTypeMunger(newAnnotationTM, decA.getAspect().resolve(this))); decA.copyAnnotationTo(onType); } } return didSomething; } /** * Checks for an @target() on the annotation and if found ensures it allows the annotation to be attached to the target type * that matched. */ private boolean checkTargetOK(DeclareAnnotation decA, ResolvedType onType, AnnotationAJ annoX) { if (annoX.specifiesTarget()) { if ((onType.isAnnotation() && !annoX.allowedOnAnnotationType()) || (!annoX.allowedOnRegularType())) { return false;
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
} } return true; } protected void weaveInterTypeDeclarations(ResolvedType onType) { List<DeclareParents> declareParentsList = getCrosscuttingMembersSet().getDeclareParents(); if (onType.isRawType()) { onType = onType.getGenericType(); } onType.clearInterTypeMungers(); List<DeclareParents> decpToRepeat = new ArrayList<DeclareParents>(); boolean aParentChangeOccurred = false; boolean anAnnotationChangeOccurred = false; for (Iterator<DeclareParents> i = declareParentsList.iterator(); i.hasNext();) { DeclareParents decp = i.next(); boolean typeChanged = applyDeclareParents(decp, onType); if (typeChanged) { aParentChangeOccurred = true; } else { if (!decp.getChild().isStarAnnotation()) decpToRepeat.add(decp); } }
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
for (Iterator i = getCrosscuttingMembersSet().getDeclareAnnotationOnTypes().iterator(); i.hasNext();) { DeclareAnnotation decA = (DeclareAnnotation) i.next(); boolean typeChanged = applyDeclareAtType(decA, onType, true); if (typeChanged) { anAnnotationChangeOccurred = true; } } while ((aParentChangeOccurred || anAnnotationChangeOccurred) && !decpToRepeat.isEmpty()) { anAnnotationChangeOccurred = aParentChangeOccurred = false; List<DeclareParents> decpToRepeatNextTime = new ArrayList<DeclareParents>(); for (Iterator<DeclareParents> iter = decpToRepeat.iterator(); iter.hasNext();) { DeclareParents decp = iter.next(); boolean typeChanged = applyDeclareParents(decp, onType); if (typeChanged) { aParentChangeOccurred = true; } else { decpToRepeatNextTime.add(decp); } } for (Iterator iter = getCrosscuttingMembersSet().getDeclareAnnotationOnTypes().iterator(); iter.hasNext();) { DeclareAnnotation decA = (DeclareAnnotation) iter.next(); boolean typeChanged = applyDeclareAtType(decA, onType, false); if (typeChanged) { anAnnotationChangeOccurred = true; } } decpToRepeat = decpToRepeatNextTime; } } @Override
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
public IWeavingSupport getWeavingSupport() { return bcelWeavingSupport; } @Override public void reportCheckerMatch(Checker checker, Shadow shadow) { IMessage iMessage = new Message(checker.getMessage(), shadow.toString(), checker.isError() ? IMessage.ERROR : IMessage.WARNING, shadow.getSourceLocation(), null, new ISourceLocation[] { checker.getSourceLocation() }, true, 0, -1, -1); getMessageHandler().handleMessage(iMessage); if (getCrossReferenceHandler() != null) { getCrossReferenceHandler() .addCrossReference( checker.getSourceLocation(), shadow.getSourceLocation(), (checker.isError() ? IRelationship.Kind.DECLARE_ERROR.getName() : IRelationship.Kind.DECLARE_WARNING .getName()), false); } if (getModel() != null) { AsmRelationshipProvider.addDeclareErrorOrWarningRelationship(getModelAsAsmManager(), shadow, checker); } } public AsmManager getModelAsAsmManager() { return (AsmManager) getModel(); } void raiseError(String message) { getMessageHandler().handleMessage(MessageUtil.error(message)); } /** * These are aop.xml files that can be used to alter the aspects that actually apply from those passed in - and also their scope * of application to other files in the system.
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
* * @param xmlFiles list of File objects representing any aop.xml files passed in to configure the build process */ public void setXmlFiles(List<File> xmlFiles) { if (!isXmlConfiguredWorld && !xmlFiles.isEmpty()) { raiseError("xml configuration files only supported by the compiler when -xmlConfigured option specified"); return; } if (!xmlFiles.isEmpty()) { xmlConfiguration = new WeavingXmlConfig(this); } for (File xmlfile : xmlFiles) { try { Definition d = DocumentParser.parse(xmlfile.toURI().toURL()); xmlConfiguration.add(d); } catch (MalformedURLException e) { raiseError("Unexpected problem processing XML config file '" + xmlfile.getName() + "' :" + e.getMessage()); } catch (Exception e) { raiseError("Unexpected problem processing XML config file '" + xmlfile.getName() + "' :" + e.getMessage()); } } } public void setXmlConfigured(boolean b) { this.isXmlConfiguredWorld = b; } @Override public boolean isXmlConfigured() { return isXmlConfiguredWorld && xmlConfiguration != null; } public WeavingXmlConfig getXmlConfiguration() {
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
return xmlConfiguration; } @Override public boolean isAspectIncluded(ResolvedType aspectType) { if (!isXmlConfigured()) { return true; } return xmlConfiguration.specifiesInclusionOfAspect(aspectType.getName()); } @Override public TypePattern getAspectScope(ResolvedType declaringType) { return xmlConfiguration.getScopeFor(declaringType.getName()); } /** * A WeavingXmlConfig is initially a collection of definitions from XML files - once the world is ready and weaving is running * it will initialize and transform those definitions into an optimized set of values (eg. resolve type patterns and string * names to real entities). It can then answer questions quickly: (1) is this aspect included in the weaving? (2) Is there a * scope specified for this aspect and does it include type X? * */ static class WeavingXmlConfig { private boolean initialized = false; private List<Definition> definitions = new ArrayList<Definition>(); private List<String> resolvedIncludedAspects = new ArrayList<String>(); private Map<String, TypePattern> scopes = new HashMap<String, TypePattern>(); private List<String> includedFastMatchPatterns = Collections.emptyList(); private List<TypePattern> includedPatterns = Collections.emptyList(); private List<String> excludedFastMatchPatterns = Collections.emptyList(); private List<TypePattern> excludedPatterns = Collections.emptyList(); private BcelWorld world;
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
public WeavingXmlConfig(BcelWorld bcelWorld) { this.world = bcelWorld; } public void add(Definition d) { definitions.add(d); } public void ensureInitialized() { if (!initialized) { try { resolvedIncludedAspects = new ArrayList<String>(); for (Definition definition : definitions) { List<String> aspectNames = definition.getAspectClassNames(); for (String name : aspectNames) { resolvedIncludedAspects.add(name); String scope = definition.getScopeForAspect(name); if (scope != null) { try { TypePattern scopePattern = new PatternParser(scope).parseTypePattern(); scopePattern.resolve(world); scopes.put(name, scopePattern); if (!world.getMessageHandler().isIgnoring(IMessage.INFO)) {
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
world.getMessageHandler().handleMessage( MessageUtil.info("Aspect '" + name + "' is scoped to apply against types matching pattern '" + scopePattern.toString() + "'")); } } catch (Exception e) { world.getMessageHandler().handleMessage( MessageUtil.error("Unable to parse scope as type pattern. Scope was '" + scope + "': " + e.getMessage())); } } } try { List<String> includePatterns = definition.getIncludePatterns(); if (includePatterns.size() > 0) { includedPatterns = new ArrayList<TypePattern>(); includedFastMatchPatterns = new ArrayList<String>(); } for (String includePattern : includePatterns) { if (includePattern.endsWith("..*")) { includedFastMatchPatterns.add(includePattern .substring(0, includePattern.length() - 2)); } else { TypePattern includedPattern = new PatternParser(includePattern).parseTypePattern(); includedPatterns.add(includedPattern); } } List<String> excludePatterns = definition.getExcludePatterns();
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
if (excludePatterns.size() > 0) { excludedPatterns = new ArrayList<TypePattern>(); excludedFastMatchPatterns = new ArrayList<String>(); } for (String excludePattern : excludePatterns) { if (excludePattern.endsWith("..*")) { excludedFastMatchPatterns.add(excludePattern .substring(0, excludePattern.length() - 2)); } else { TypePattern excludedPattern = new PatternParser(excludePattern).parseTypePattern(); excludedPatterns.add(excludedPattern); } } } catch (ParserException pe) { world.getMessageHandler().handleMessage( MessageUtil.error("Unable to parse type pattern: " + pe.getMessage())); } } } finally { initialized = true; } } } public boolean specifiesInclusionOfAspect(String name) { ensureInitialized(); return resolvedIncludedAspects.contains(name); } public TypePattern getScopeFor(String name) {
289,816
Bug 289816 Potentially unclosed stream in org.aspectj.weaver.bcel.BcelWorld
null
resolved fixed
67ffda8
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:05:59Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
return scopes.get(name); } public boolean excludesType(ResolvedType type) { String typename = type.getName(); boolean excluded = false; for (String excludedPattern : excludedFastMatchPatterns) { if (typename.startsWith(excludedPattern)) { excluded = true; break; } } if (!excluded) { for (TypePattern excludedPattern : excludedPatterns) { if (excludedPattern.matchesStatically(type)) { excluded = true; break; } } } return excluded; } } }
289,818
Bug 289818 Unclosed stream in org.aspectj.weaver.bcel.ExtensibleURLClassLoader
null
resolved fixed
4d200d1
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:07:29Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/ExtensibleURLClassLoader.java
/* ******************************************************************* * Copyright (c) 2004 IBM Corporation * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Matthew Webster, Adrian Colyer, * Martin Lippert initial implementation * ******************************************************************/ package org.aspectj.weaver.bcel; import java.io.IOException; import java.net.URL; import java.net.URLClassLoader; import java.security.CodeSource; import org.aspectj.util.FileUtil; import org.aspectj.weaver.UnresolvedType; public abstract class ExtensibleURLClassLoader extends URLClassLoader {
289,818
Bug 289818 Unclosed stream in org.aspectj.weaver.bcel.ExtensibleURLClassLoader
null
resolved fixed
4d200d1
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:07:29Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/ExtensibleURLClassLoader.java
private ClassPathManager classPath; public ExtensibleURLClassLoader (URL[] urls, ClassLoader parent) { super(urls,parent); try { classPath = new ClassPathManager(FileUtil.makeClasspath(urls),null); } catch (ExceptionInInitializerError ex) { ex.printStackTrace(System.out); throw ex; } } protected void addURL(URL url) { super.addURL(url); classPath.addPath(url.getPath(),null); } protected Class findClass(String name) throws ClassNotFoundException { try { byte[] bytes = getBytes(name); if (bytes != null) { return defineClass(name,bytes); } else { throw new ClassNotFoundException(name); } } catch (IOException ex) { throw new ClassNotFoundException(name);
289,818
Bug 289818 Unclosed stream in org.aspectj.weaver.bcel.ExtensibleURLClassLoader
null
resolved fixed
4d200d1
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-09-18T23:07:29Z
2009-09-18T07:46:40Z
weaver/src/org/aspectj/weaver/bcel/ExtensibleURLClassLoader.java
} } protected Class defineClass(String name, byte[] b, CodeSource cs) throws IOException { return defineClass(name, b, 0, b.length, cs); } protected byte[] getBytes (String name) throws IOException { byte[] b = null; ClassPathManager.ClassFile classFile = classPath.find(UnresolvedType.forName(name)); if (classFile != null) { b = FileUtil.readAsByteArray(classFile.getInputStream()); } return b; } private Class defineClass(String name, byte[] bytes ) throws IOException { String packageName = getPackageName(name); if (packageName != null) { Package pakkage = getPackage(packageName); if (pakkage == null) { definePackage(packageName,null,null,null,null,null,null,null); } } return defineClass(name, bytes, null); } private String getPackageName (String className) { int offset = className.lastIndexOf('.'); return (offset == -1)? null : className.substring(0,offset); } }
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
/******************************************************************************* * Copyright (c) 2005 Contributors. * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at * http:eclipse.org/legal/epl-v10.html * * Contributors: * initial implementation Alexandre Vasseur *******************************************************************************/ package org.aspectj.weaver.bcel; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.classfile.Attribute; import org.aspectj.apache.bcel.classfile.Constant;
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
import org.aspectj.apache.bcel.classfile.ConstantUtf8; import org.aspectj.apache.bcel.classfile.Field; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.classfile.LocalVariable; import org.aspectj.apache.bcel.classfile.LocalVariableTable; import org.aspectj.apache.bcel.classfile.Method; import org.aspectj.apache.bcel.classfile.annotation.AnnotationGen; import org.aspectj.apache.bcel.classfile.annotation.ArrayElementValue; import org.aspectj.apache.bcel.classfile.annotation.ClassElementValue; import org.aspectj.apache.bcel.classfile.annotation.ElementValue; import org.aspectj.apache.bcel.classfile.annotation.NameValuePair; import org.aspectj.apache.bcel.classfile.annotation.RuntimeAnnos; import org.aspectj.apache.bcel.classfile.annotation.RuntimeVisAnnos; import org.aspectj.apache.bcel.generic.Type; import org.aspectj.asm.AsmManager; import org.aspectj.asm.IHierarchy; import org.aspectj.asm.IProgramElement; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessageHandler; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.Message; import org.aspectj.bridge.MessageUtil; import org.aspectj.weaver.Advice; import org.aspectj.weaver.AdviceKind; import org.aspectj.weaver.AjAttribute; import org.aspectj.weaver.AjcMemberMaker; import org.aspectj.weaver.BindingScope; import org.aspectj.weaver.ISourceContext; import org.aspectj.weaver.MethodDelegateTypeMunger; import org.aspectj.weaver.NameMangler;
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
import org.aspectj.weaver.ReferenceType; import org.aspectj.weaver.ResolvedMember; import org.aspectj.weaver.ResolvedPointcutDefinition; import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.WeaverMessages; import org.aspectj.weaver.World; import org.aspectj.weaver.patterns.Bindings; import org.aspectj.weaver.patterns.DeclareErrorOrWarning; import org.aspectj.weaver.patterns.DeclareParents; import org.aspectj.weaver.patterns.DeclareParentsMixin; import org.aspectj.weaver.patterns.DeclarePrecedence; import org.aspectj.weaver.patterns.FormalBinding; import org.aspectj.weaver.patterns.IScope; import org.aspectj.weaver.patterns.ParserException; import org.aspectj.weaver.patterns.PatternParser; import org.aspectj.weaver.patterns.PerCflow; import org.aspectj.weaver.patterns.PerClause; import org.aspectj.weaver.patterns.PerFromSuper; import org.aspectj.weaver.patterns.PerObject; import org.aspectj.weaver.patterns.PerSingleton; import org.aspectj.weaver.patterns.PerTypeWithin; import org.aspectj.weaver.patterns.Pointcut; import org.aspectj.weaver.patterns.TypePattern; /** * Annotation defined aspect reader. Reads the Java 5 annotations and turns them into AjAttributes * * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> */ public class AtAjAttributes {
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
private final static List<AjAttribute> NO_ATTRIBUTES = Collections.emptyList(); private final static String[] EMPTY_STRINGS = new String[0]; private final static String VALUE = "value"; private final static String ARGNAMES = "argNames"; private final static String POINTCUT = "pointcut"; private final static String THROWING = "throwing"; private final static String RETURNING = "returning"; private final static String STRING_DESC = "Ljava/lang/String;"; /** * A struct that allows to add extra arguments without always breaking the API */ private static class AjAttributeStruct {
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
/** * The list of AjAttribute.XXX that we are populating from the @AJ read */ List<AjAttribute> ajAttributes = new ArrayList<AjAttribute>(); /** * The resolved type (class) for which we are reading @AJ for (be it class, method, field annotations) */ final ResolvedType enclosingType; final ISourceContext context; final IMessageHandler handler; public AjAttributeStruct(ResolvedType type, ISourceContext sourceContext, IMessageHandler messageHandler) { enclosingType = type; context = sourceContext; handler = messageHandler; } } /** * A struct when we read @AJ on method * * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> */ private static class AjAttributeMethodStruct extends AjAttributeStruct {
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
private String[] m_argumentNamesLazy = null; public String unparsedArgumentNames = null; final Method method; final BcelMethod bMethod; public AjAttributeMethodStruct(Method method, BcelMethod bMethod, ResolvedType type, ISourceContext sourceContext, IMessageHandler messageHandler) { super(type, sourceContext, messageHandler); this.method = method; this.bMethod = bMethod; } public String[] getArgumentNames() { if (m_argumentNamesLazy == null) { m_argumentNamesLazy = getMethodArgumentNames(method, unparsedArgumentNames, this); } return m_argumentNamesLazy; } } /** * A struct when we read @AJ on field */ private static class AjAttributeFieldStruct extends AjAttributeStruct {
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
final Field field; final BcelField bField; public AjAttributeFieldStruct(Field field, BcelField bField, ResolvedType type, ISourceContext sourceContext, IMessageHandler messageHandler) { super(type, sourceContext, messageHandler); this.field = field; this.bField = bField; } } /** * Annotations are RuntimeVisible only. This allow us to not visit RuntimeInvisible ones. * * @param attribute * @return true if runtime visible annotation */ public static boolean acceptAttribute(Attribute attribute) { return (attribute instanceof RuntimeVisAnnos); }
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
/** * Extract class level annotations and turn them into AjAttributes. * * @param javaClass * @param type * @param context * @param msgHandler * @return list of AjAttributes */ public static List readAj5ClassAttributes(AsmManager model, JavaClass javaClass, ReferenceType type, ISourceContext context, IMessageHandler msgHandler, boolean isCodeStyleAspect) { boolean ignoreThisClass = javaClass.getClassName().charAt(0) == 'o' && javaClass.getClassName().startsWith("org.aspectj.lang.annotation"); if (ignoreThisClass) { return NO_ATTRIBUTES; } boolean containsPointcut = false; boolean containsAnnotationClassReference = false; Constant[] cpool = javaClass.getConstantPool().getConstantPool(); for (int i = 0; i < cpool.length; i++) { Constant constant = cpool[i]; if (constant != null && constant.getTag() == Constants.CONSTANT_Utf8) { String constantValue = ((ConstantUtf8) constant).getValue(); if (constantValue.length() > 28 && constantValue.charAt(1) == 'o') { if (constantValue.startsWith("Lorg/aspectj/lang/annotation")) { containsAnnotationClassReference = true; if ("Lorg/aspectj/lang/annotation/DeclareAnnotation;".equals(constantValue)) { msgHandler.handleMessage(new Message( "Found @DeclareAnnotation while current release does not support it (see '" + type.getName() + "')", IMessage.WARNING, null, type.getSourceLocation()));
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} if ("Lorg/aspectj/lang/annotation/Pointcut;".equals(constantValue)) { containsPointcut = true; } } } } } if (!containsAnnotationClassReference) { return NO_ATTRIBUTES; } AjAttributeStruct struct = new AjAttributeStruct(type, context, msgHandler); Attribute[] attributes = javaClass.getAttributes(); boolean hasAtAspectAnnotation = false; boolean hasAtPrecedenceAnnotation = false; for (int i = 0; i < attributes.length; i++) { Attribute attribute = attributes[i]; if (acceptAttribute(attribute)) { RuntimeAnnos rvs = (RuntimeAnnos) attribute; if (!isCodeStyleAspect && !javaClass.isInterface()) { hasAtAspectAnnotation = handleAspectAnnotation(rvs, struct); hasAtPrecedenceAnnotation = handlePrecedenceAnnotation(rvs, struct); } break; }
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} if (hasAtPrecedenceAnnotation && !hasAtAspectAnnotation) { msgHandler.handleMessage(new Message("Found @DeclarePrecedence on a non @Aspect type '" + type.getName() + "'", IMessage.WARNING, null, type.getSourceLocation())); return NO_ATTRIBUTES; } if (!(hasAtAspectAnnotation || isCodeStyleAspect) && !containsPointcut) { return NO_ATTRIBUTES; }
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
for (int i = 0; i < javaClass.getMethods().length; i++) { Method method = javaClass.getMethods()[i]; if (method.getName().startsWith(NameMangler.PREFIX)) { continue; } AjAttributeMethodStruct mstruct = null; boolean processedPointcut = false; Attribute[] mattributes = method.getAttributes(); for (int j = 0; j < mattributes.length; j++) { Attribute mattribute = mattributes[j]; if (acceptAttribute(mattribute)) {
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
mstruct = new AjAttributeMethodStruct(method, null, type, context, msgHandler); processedPointcut = handlePointcutAnnotation((RuntimeAnnos) mattribute, mstruct); if (!processedPointcut) { processedPointcut = handleDeclareMixinAnnotation((RuntimeAnnos) mattribute, mstruct); } break; } } if (processedPointcut) { struct.ajAttributes.add(new AjAttribute.WeaverVersionInfo()); struct.ajAttributes.addAll(mstruct.ajAttributes); } } Field[] fs = javaClass.getFields(); for (int i = 0; i < fs.length; i++) { Field field = fs[i]; if (field.getName().startsWith(NameMangler.PREFIX)) { continue; } AjAttributeFieldStruct fstruct = new AjAttributeFieldStruct(field, null, type, context, msgHandler); Attribute[] fattributes = field.getAttributes();
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
for (int j = 0; j < fattributes.length; j++) { Attribute fattribute = fattributes[j]; if (acceptAttribute(fattribute)) { RuntimeAnnos frvs = (RuntimeAnnos) fattribute; if (handleDeclareErrorOrWarningAnnotation(model, frvs, fstruct) || handleDeclareParentsAnnotation(frvs, fstruct)) { if (!type.isAnnotationStyleAspect() && !isCodeStyleAspect) { msgHandler.handleMessage(new Message("Found @AspectJ annotations in a non @Aspect type '" + type.getName() + "'", IMessage.WARNING, null, type.getSourceLocation())); } } break; } } struct.ajAttributes.addAll(fstruct.ajAttributes); } return struct.ajAttributes; } /** * Extract method level annotations and turn them into AjAttributes. * * @param method * @param type * @param context * @param msgHandler * @return list of AjAttributes
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
*/ public static List<AjAttribute> readAj5MethodAttributes(Method method, BcelMethod bMethod, ResolvedType type, ResolvedPointcutDefinition preResolvedPointcut, ISourceContext context, IMessageHandler msgHandler) { if (method.getName().startsWith(NameMangler.PREFIX)) { return Collections.emptyList(); } AjAttributeMethodStruct struct = new AjAttributeMethodStruct(method, bMethod, type, context, msgHandler); Attribute[] attributes = method.getAttributes(); boolean hasAtAspectJAnnotation = false; boolean hasAtAspectJAnnotationMustReturnVoid = false; for (int i = 0; i < attributes.length; i++) { Attribute attribute = attributes[i]; try { if (acceptAttribute(attribute)) { RuntimeAnnos rvs = (RuntimeAnnos) attribute; hasAtAspectJAnnotationMustReturnVoid = hasAtAspectJAnnotationMustReturnVoid || handleBeforeAnnotation(rvs, struct, preResolvedPointcut); hasAtAspectJAnnotationMustReturnVoid = hasAtAspectJAnnotationMustReturnVoid || handleAfterAnnotation(rvs, struct, preResolvedPointcut);
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
hasAtAspectJAnnotationMustReturnVoid = hasAtAspectJAnnotationMustReturnVoid || handleAfterReturningAnnotation(rvs, struct, preResolvedPointcut, bMethod); hasAtAspectJAnnotationMustReturnVoid = hasAtAspectJAnnotationMustReturnVoid || handleAfterThrowingAnnotation(rvs, struct, preResolvedPointcut, bMethod); hasAtAspectJAnnotation = hasAtAspectJAnnotation || handleAroundAnnotation(rvs, struct, preResolvedPointcut); break; } } catch (ReturningFormalNotDeclaredInAdviceSignatureException e) { msgHandler.handleMessage(new Message(WeaverMessages.format(WeaverMessages.RETURNING_FORMAL_NOT_DECLARED_IN_ADVICE, e.getFormalName()), IMessage.ERROR, null, bMethod.getSourceLocation())); } catch (ThrownFormalNotDeclaredInAdviceSignatureException e) { msgHandler.handleMessage(new Message(WeaverMessages.format(WeaverMessages.THROWN_FORMAL_NOT_DECLARED_IN_ADVICE, e .getFormalName()), IMessage.ERROR, null, bMethod.getSourceLocation())); } } hasAtAspectJAnnotation = hasAtAspectJAnnotation || hasAtAspectJAnnotationMustReturnVoid; if (hasAtAspectJAnnotation && !type.isAspect()) { msgHandler.handleMessage(new Message("Found @AspectJ annotations in a non @Aspect type '" + type.getName() + "'", IMessage.WARNING, null, type.getSourceLocation())); } if (hasAtAspectJAnnotation && !struct.method.isPublic()) { msgHandler.handleMessage(new Message("Found @AspectJ annotation on a non public advice '" + methodToString(struct.method) + "'", IMessage.ERROR, null, type.getSourceLocation()));
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} if (hasAtAspectJAnnotation && struct.method.isStatic()) { msgHandler.handleMessage(MessageUtil.error("Advice cannot be declared static '" + methodToString(struct.method) + "'", type.getSourceLocation())); } if (hasAtAspectJAnnotationMustReturnVoid && !Type.VOID.equals(struct.method.getReturnType())) { msgHandler.handleMessage(new Message("Found @AspectJ annotation on a non around advice not returning void '" + methodToString(struct.method) + "'", IMessage.ERROR, null, type.getSourceLocation())); } return struct.ajAttributes; } /** * Extract field level annotations and turn them into AjAttributes. * * @param field * @param type * @param context * @param msgHandler
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
* @return list of AjAttributes, always empty for now */ public static List readAj5FieldAttributes(Field field, BcelField bField, ResolvedType type, ISourceContext context, IMessageHandler msgHandler) { return Collections.EMPTY_LIST; } /** * Read @Aspect * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleAspectAnnotation(RuntimeAnnos runtimeAnnotations, AjAttributeStruct struct) { AnnotationGen aspect = getAnnotation(runtimeAnnotations, AjcMemberMaker.ASPECT_ANNOTATION); if (aspect != null) { boolean extendsAspect = false; if (!"java.lang.Object".equals(struct.enclosingType.getSuperclass().getName())) { if (!struct.enclosingType.getSuperclass().isAbstract() && struct.enclosingType.getSuperclass().isAspect()) { reportError("cannot extend a concrete aspect", struct); return false; } extendsAspect = struct.enclosingType.getSuperclass().isAspect(); } NameValuePair aspectPerClause = getAnnotationElement(aspect, VALUE); final PerClause perClause; if (aspectPerClause == null) {
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
if (!extendsAspect) { perClause = new PerSingleton(); } else { perClause = new PerFromSuper(struct.enclosingType.getSuperclass().getPerClause().getKind()); } } else { String perX = aspectPerClause.getValue().stringifyValue(); if (perX == null || perX.length() <= 0) { perClause = new PerSingleton(); } else { perClause = parsePerClausePointcut(perX, struct); } } if (perClause == null) { return false; } else { perClause.setLocation(struct.context, -1, -1); struct.ajAttributes.add(new AjAttribute.WeaverVersionInfo()); AjAttribute.Aspect aspectAttribute = new AjAttribute.Aspect(perClause); struct.ajAttributes.add(aspectAttribute); FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; final IScope binding; binding = new BindingScope(struct.enclosingType, struct.context, bindings);
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
aspectAttribute.setResolutionScope(binding); return true; } } return false; } /** * Read a perClause, returns null on failure and issue messages * * @param perClauseString like "pertarget(.....)" * @param struct for which we are parsing the per clause * @return a PerClause instance */ private static PerClause parsePerClausePointcut(String perClauseString, AjAttributeStruct struct) { final String pointcutString; Pointcut pointcut = null; TypePattern typePattern = null; final PerClause perClause; if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERCFLOW.getName())) { pointcutString = PerClause.KindAnnotationPrefix.PERCFLOW.extractPointcut(perClauseString); pointcut = parsePointcut(pointcutString, struct, false); perClause = new PerCflow(pointcut, false); } else if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERCFLOWBELOW.getName())) { pointcutString = PerClause.KindAnnotationPrefix.PERCFLOWBELOW.extractPointcut(perClauseString); pointcut = parsePointcut(pointcutString, struct, false);
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
perClause = new PerCflow(pointcut, true); } else if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERTARGET.getName())) { pointcutString = PerClause.KindAnnotationPrefix.PERTARGET.extractPointcut(perClauseString); pointcut = parsePointcut(pointcutString, struct, false); perClause = new PerObject(pointcut, false); } else if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERTHIS.getName())) { pointcutString = PerClause.KindAnnotationPrefix.PERTHIS.extractPointcut(perClauseString); pointcut = parsePointcut(pointcutString, struct, false); perClause = new PerObject(pointcut, true); } else if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERTYPEWITHIN.getName())) { pointcutString = PerClause.KindAnnotationPrefix.PERTYPEWITHIN.extractPointcut(perClauseString); typePattern = parseTypePattern(pointcutString, struct); perClause = new PerTypeWithin(typePattern); } else if (perClauseString.equalsIgnoreCase(PerClause.SINGLETON.getName() + "()")) { perClause = new PerSingleton(); } else { reportError("@Aspect per clause cannot be read '" + perClauseString + "'", struct); return null; } if (!PerClause.SINGLETON.equals(perClause.getKind()) && !PerClause.PERTYPEWITHIN.equals(perClause.getKind()) && pointcut == null) { return null; } if (PerClause.PERTYPEWITHIN.equals(perClause.getKind()) && typePattern == null) { return null; }
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
return perClause; } /** * Read @DeclarePrecedence * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handlePrecedenceAnnotation(RuntimeAnnos runtimeAnnotations, AjAttributeStruct struct) { AnnotationGen aspect = getAnnotation(runtimeAnnotations, AjcMemberMaker.DECLAREPRECEDENCE_ANNOTATION); if (aspect != null) { NameValuePair precedence = getAnnotationElement(aspect, VALUE); if (precedence != null) { String precedencePattern = precedence.getValue().stringifyValue(); PatternParser parser = new PatternParser(precedencePattern); DeclarePrecedence ajPrecedence = parser.parseDominates(); struct.ajAttributes.add(new AjAttribute.DeclareAttribute(ajPrecedence)); return true; } } return false; }
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
/** * Read @DeclareParents * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleDeclareParentsAnnotation(RuntimeAnnos runtimeAnnotations, AjAttributeFieldStruct struct) { AnnotationGen decp = getAnnotation(runtimeAnnotations, AjcMemberMaker.DECLAREPARENTS_ANNOTATION); if (decp != null) { NameValuePair decpPatternNVP = getAnnotationElement(decp, VALUE); String decpPattern = decpPatternNVP.getValue().stringifyValue(); if (decpPattern != null) { TypePattern typePattern = parseTypePattern(decpPattern, struct);
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
ResolvedType fieldType = UnresolvedType.forSignature(struct.field.getSignature()).resolve( struct.enclosingType.getWorld()); if (fieldType.isInterface()) { TypePattern parent = parseTypePattern(fieldType.getName(), struct); FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings); List parents = new ArrayList(1); parents.add(parent); DeclareParents dp = new DeclareParents(typePattern, parents, false); dp.resolve(binding); typePattern = typePattern.resolveBindings(binding, Bindings.NONE, false, false); dp.setLocation(struct.context, -1, -1); struct.ajAttributes.add(new AjAttribute.DeclareAttribute(dp)); String defaultImplClassName = null; NameValuePair defaultImplNVP = getAnnotationElement(decp, "defaultImpl"); if (defaultImplNVP != null) { ClassElementValue defaultImpl = (ClassElementValue) defaultImplNVP.getValue();
279,298
Bug 279298 AspectJ LTW with Cobertura
null
resolved fixed
35a9649
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-10-22T23:26:14Z
2009-06-05T19:26:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
defaultImplClassName = UnresolvedType.forSignature(defaultImpl.getClassString()).getName(); if (defaultImplClassName.equals("org.aspectj.lang.annotation.DeclareParents")) { defaultImplClassName = null; } else { ResolvedType impl = struct.enclosingType.getWorld().resolve(defaultImplClassName, false); ResolvedMember[] mm = impl.getDeclaredMethods(); int implModifiers = impl.getModifiers(); boolean defaultVisibilityImpl = !(Modifier.isPrivate(implModifiers) || Modifier.isProtected(implModifiers) || Modifier.isPublic(implModifiers)); boolean hasNoCtorOrANoArgOne = true; ResolvedMember foundOneOfIncorrectVisibility = null; for (int i = 0; i < mm.length; i++) { ResolvedMember resolvedMember = mm[i]; if (resolvedMember.getName().equals("<init>")) { hasNoCtorOrANoArgOne = false; if (resolvedMember.getParameterTypes().length == 0) { if (defaultVisibilityImpl) { if (resolvedMember.isPublic() || resolvedMember.isDefault()) { hasNoCtorOrANoArgOne = true; } else { foundOneOfIncorrectVisibility = resolvedMember; } } else if (Modifier.isPublic(implModifiers)) { if (resolvedMember.isPublic()) { hasNoCtorOrANoArgOne = true; } else {