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
389,456
Bug 389456 NPE in EclipseTypeMunger.mungeNewMethod()
null
resolved fixed
b8ebdc3
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-09-20T20:38:35Z
2012-09-12T22:46:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java
mungeNewInnerClass(sourceType, onType, (NewMemberClassTypeMunger) munger, isExactTargetType); } else { throw new RuntimeException("unimplemented: " + munger.getKind()); } return true; } private boolean mungeNewMethod(SourceTypeBinding sourceType, ResolvedType onType, NewMethodTypeMunger munger, boolean isExactTargetType) { InterTypeMethodBinding binding = new InterTypeMethodBinding(world, munger, aspectType, sourceMethod); if (!isExactTargetType) { ResolvedMember existingMember = onType.lookupMemberIncludingITDsOnInterfaces(getSignature()); if (existingMember != null) { if (onType == existingMember.getDeclaringType() && Modifier.isFinal(munger.getSignature().getModifiers())) { MethodBinding offendingBinding = sourceType.getExactMethod(binding.selector, binding.parameters, sourceType.scope.compilationUnitScope()); sourceType.scope.problemReporter().finalMethodCannotBeOverridden(offendingBinding, binding); } findOrCreateInterTypeMemberFinder(sourceType); return false; } } if (sourceType.isInterface()) { boolean isAbstract = (binding.modifiers & ClassFileConstants.AccAbstract) != 0; binding.modifiers = (binding.modifiers & (ClassFileConstants.AccPublic | ClassFileConstants.AccProtected | ClassFileConstants.AccPrivate));
389,456
Bug 389456 NPE in EclipseTypeMunger.mungeNewMethod()
null
resolved fixed
b8ebdc3
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-09-20T20:38:35Z
2012-09-12T22:46:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java
if (isAbstract) { binding.modifiers |= ClassFileConstants.AccAbstract; } } if (munger.getSignature().isVarargsMethod()) { binding.modifiers |= ClassFileConstants.AccVarargs; } findOrCreateInterTypeMemberFinder(sourceType).addInterTypeMethod(binding); return true; } private boolean mungeNewInnerClass(SourceTypeBinding sourceType, ResolvedType onType, NewMemberClassTypeMunger munger, boolean isExactTargetType) { SourceTypeBinding aspectTypeBinding = (SourceTypeBinding) world.makeTypeBinding(aspectType); char[] mungerMemberTypeName = ("$" + munger.getMemberTypeName()).toCharArray(); ReferenceBinding innerTypeBinding = null; for (ReferenceBinding innerType : aspectTypeBinding.memberTypes) { char[] compounded = CharOperation.concatWith(innerType.compoundName, '.'); if (org.aspectj.org.eclipse.jdt.core.compiler.CharOperation.endsWith(compounded, mungerMemberTypeName)) { innerTypeBinding = innerType; break; } } if (innerTypeBinding instanceof UnresolvedReferenceBinding) { innerTypeBinding = (ReferenceBinding)BinaryTypeBinding.resolveType(innerTypeBinding, world.getLookupEnvironment(), true); }
389,456
Bug 389456 NPE in EclipseTypeMunger.mungeNewMethod()
null
resolved fixed
b8ebdc3
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-09-20T20:38:35Z
2012-09-12T22:46:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java
findOrCreateInterTypeMemberClassFinder(sourceType).addInterTypeMemberType(innerTypeBinding); return true; } private void mungeNewConstructor(SourceTypeBinding sourceType, NewConstructorTypeMunger munger) { if (shouldTreatAsPublic()) { MethodBinding binding = world.makeMethodBinding(munger.getSignature(), munger.getTypeVariableAliases()); findOrCreateInterTypeMemberFinder(sourceType).addInterTypeMethod(binding); TypeVariableBinding[] typeVariables = binding.typeVariables; for (int i = 0; i < typeVariables.length; i++) { TypeVariableBinding tv = typeVariables[i]; String name = new String(tv.sourceName); TypeVariableBinding[] tv2 = sourceMethod.binding.typeVariables; for (int j = 0; j < tv2.length; j++) { if (new String(tv2[j].sourceName).equals(name)) { typeVariables[i].declaringElement = binding; } } } for (int i = 0; i < typeVariables.length; i++) { if (typeVariables[i].declaringElement == null) { throw new RuntimeException("Declaring element not set"); } } } else { InterTypeMethodBinding binding = new InterTypeMethodBinding(world, munger, aspectType, sourceMethod); findOrCreateInterTypeMemberFinder(sourceType).addInterTypeMethod(binding); } }
389,456
Bug 389456 NPE in EclipseTypeMunger.mungeNewMethod()
null
resolved fixed
b8ebdc3
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-09-20T20:38:35Z
2012-09-12T22:46:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java
private void mungeNewField(SourceTypeBinding sourceType, NewFieldTypeMunger munger) { if (shouldTreatAsPublic() && !targetTypeX.isInterface()) { FieldBinding binding = world.makeFieldBinding(munger); findOrCreateInterTypeMemberFinder(sourceType).addInterTypeField(binding); } else { InterTypeFieldBinding binding = new InterTypeFieldBinding(world, munger, aspectType, sourceMethod); InterTypeMemberFinder finder = findOrCreateInterTypeMemberFinder(sourceType); if (finder.definesField(munger.getSignature().getName())) { munger.version = NewFieldTypeMunger.VersionOne; } finder.addInterTypeField(binding); } } private boolean shouldTreatAsPublic() { return Modifier.isPublic(munger.getSignature().getModifiers()); } private InterTypeMemberFinder findOrCreateInterTypeMemberFinder(SourceTypeBinding sourceType) { InterTypeMemberFinder finder = (InterTypeMemberFinder) sourceType.memberFinder; if (finder == null) { finder = new InterTypeMemberFinder(); sourceType.memberFinder = finder; finder.sourceTypeBinding = sourceType; } return finder; }
389,456
Bug 389456 NPE in EclipseTypeMunger.mungeNewMethod()
null
resolved fixed
b8ebdc3
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-09-20T20:38:35Z
2012-09-12T22:46:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java
private IntertypeMemberTypeFinder findOrCreateInterTypeMemberClassFinder(SourceTypeBinding sourceType) { IntertypeMemberTypeFinder finder = (IntertypeMemberTypeFinder) sourceType.typeFinder; if (finder == null) { finder = new IntertypeMemberTypeFinder(); sourceType.typeFinder = finder; finder.targetTypeBinding = sourceType; sourceType.tagBits &= ~TagBits.HasNoMemberTypes; } return finder; } public ISourceLocation getSourceLocation() { return sourceLocation; } public void setSourceLocation(ISourceLocation sourceLocation) { this.sourceLocation = sourceLocation; } /** * @return AbstractMethodDeclaration */ public AbstractMethodDeclaration getSourceMethod() { return sourceMethod; } public ConcreteTypeMunger parameterizedFor(ResolvedType target) { return new EclipseTypeMunger(world, munger.parameterizedFor(target), aspectType, sourceMethod); } public ConcreteTypeMunger parameterizeWith(Map m, World w) { return new EclipseTypeMunger(world, munger.parameterizeWith(m, w), aspectType, sourceMethod); } }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.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: * Alexandre Vasseur initial implementation * David Knibb weaving context enhancments * John Kew (vmware) caching hook *******************************************************************************/ package org.aspectj.weaver.loadtime; import java.io.*; import java.lang.reflect.InvocationTargetException;
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.security.ProtectionDomain; import java.util.*; import org.aspectj.bridge.AbortException; import org.aspectj.bridge.Constants; import org.aspectj.util.LangUtil; import org.aspectj.weaver.Lint; import org.aspectj.weaver.Lint.Kind; import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.World; import org.aspectj.weaver.bcel.BcelWeakClassLoaderReference; import org.aspectj.weaver.bcel.BcelWeaver; import org.aspectj.weaver.bcel.BcelWorld; import org.aspectj.weaver.bcel.Utility; import org.aspectj.weaver.loadtime.definition.Definition; import org.aspectj.weaver.loadtime.definition.DocumentParser; import org.aspectj.weaver.ltw.LTWWorld; import org.aspectj.weaver.patterns.PatternParser; import org.aspectj.weaver.patterns.TypePattern; import org.aspectj.weaver.tools.*; import org.aspectj.weaver.tools.cache.WeavedClassCache; /** * @author Alexandre Vasseur * @author Andy Clement * @author Abraham Nevado */ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
private final static String AOP_XML = Constants.AOP_USER_XML + ";" + Constants.AOP_AJC_XML + ";" + Constants.AOP_OSGI_XML; private boolean initialized; private List m_dumpTypePattern = new ArrayList(); private boolean m_dumpBefore = false; private boolean dumpDirPerClassloader = false; private boolean hasExcludes = false; private List<TypePattern> excludeTypePattern = new ArrayList<TypePattern>(); private List<String> excludeStartsWith = new ArrayList<String>(); private List<String> excludeStarDotDotStar = new ArrayList<String>(); private List<String> excludeExactName = new ArrayList<String>(); private List<String> excludeEndsWith = new ArrayList<String>(); private List<String[]> excludeSpecial = new ArrayList<String[]>(); private boolean hasIncludes = false; private List<TypePattern> includeTypePattern = new ArrayList<TypePattern>(); private List<String> m_includeStartsWith = new ArrayList<String>(); private List<String> includeExactName = new ArrayList<String>(); private boolean includeStar = false; private List<TypePattern> m_aspectExcludeTypePattern = new ArrayList<TypePattern>(); private List<String> m_aspectExcludeStartsWith = new ArrayList<String>(); private List<TypePattern> m_aspectIncludeTypePattern = new ArrayList<TypePattern>(); private List<String> m_aspectIncludeStartsWith = new ArrayList<String>(); private StringBuffer namespace; private IWeavingContext weavingContext; private List<ConcreteAspectCodeGen> concreteAspects = new ArrayList<ConcreteAspectCodeGen>(); private static Trace trace = TraceFactory.getTraceFactory().getTrace(ClassLoaderWeavingAdaptor.class); public ClassLoaderWeavingAdaptor() { super(); if (trace.isTraceEnabled()) { trace.enter("<init>", this); }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
if (trace.isTraceEnabled()) { trace.exit("<init>"); } } /** * We don't need a reference to the class loader and using it during construction can cause problems with recursion. It also * makes sense to supply the weaving context during initialization to. * * @deprecated */ public ClassLoaderWeavingAdaptor(final ClassLoader deprecatedLoader, final IWeavingContext deprecatedContext) { super(); if (trace.isTraceEnabled()) { trace.enter("<init>", this, new Object[] { deprecatedLoader, deprecatedContext }); } if (trace.isTraceEnabled()) { trace.exit("<init>"); } } class SimpleGeneratedClassHandler implements GeneratedClassHandler { private BcelWeakClassLoaderReference loaderRef; SimpleGeneratedClassHandler(ClassLoader loader) { loaderRef = new BcelWeakClassLoaderReference(loader); } /** * Callback when we need to define a Closure in the JVM * */ public void acceptClass(String name, byte[] bytes) { try {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
if (shouldDump(name.replace('/', '.'), false)) { dump(name, bytes, false); } } catch (Throwable throwable) { throwable.printStackTrace(); } if (activeProtectionDomain != null) { defineClass(loaderRef.getClassLoader(), name, bytes, activeProtectionDomain); } else { defineClass(loaderRef.getClassLoader(), name, bytes); } } } public void initialize(final ClassLoader classLoader, IWeavingContext context) { if (initialized) { return; } boolean success = true; this.weavingContext = context; if (weavingContext == null) { weavingContext = new DefaultWeavingContext(classLoader); } createMessageHandler(); this.generatedClassHandler = new SimpleGeneratedClassHandler(classLoader); List definitions = weavingContext.getDefinitions(classLoader, this); if (definitions.isEmpty()) { disable(); if (trace.isTraceEnabled()) { trace.exit("initialize", definitions); }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
return; } bcelWorld = new LTWWorld(classLoader, weavingContext, getMessageHandler(), null); weaver = new BcelWeaver(bcelWorld); success = registerDefinitions(weaver, classLoader, definitions); if (success) { weaver.prepareForWeave(); enable(); success = weaveAndDefineConceteAspects(); } if (success) { enable(); } else { disable(); bcelWorld = null; weaver = null; } if (WeavedClassCache.isEnabled()) { initializeCache(classLoader, getAspectClassNames(definitions), generatedClassHandler, getMessageHandler()); } initialized = true; if (trace.isTraceEnabled()) { trace.exit("initialize", isEnabled()); } } /** * Get the list of all aspects from the defintion list
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
* @param definitions * @return */ List<String> getAspectClassNames(List<Definition> definitions) { List<String> aspects = new LinkedList<String>(); for (Iterator<Definition> it = definitions.iterator(); it.hasNext(); ) { Definition def = it.next(); List<String> defAspects = def.getAspectClassNames(); if (defAspects != null) { aspects.addAll(defAspects); } } return aspects; } /** * Load and cache the aop.xml/properties according to the classloader visibility rules * * @param loader */ List<Definition> parseDefinitions(final ClassLoader loader) { if (trace.isTraceEnabled()) { trace.enter("parseDefinitions", this); } List<Definition> definitions = new ArrayList<Definition>(); try { info("register classloader " + getClassLoaderName(loader)); if (loader.equals(ClassLoader.getSystemClassLoader())) { String file = System.getProperty("aj5.def", null);
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
if (file != null) { info("using (-Daj5.def) " + file); definitions.add(DocumentParser.parse((new File(file)).toURL())); } } String resourcePath = System.getProperty("org.aspectj.weaver.loadtime.configuration", AOP_XML); if (trace.isTraceEnabled()) { trace.event("parseDefinitions", this, resourcePath); } StringTokenizer st = new StringTokenizer(resourcePath, ";"); while (st.hasMoreTokens()) { String nextDefinition = st.nextToken(); if (nextDefinition.startsWith("file:")) { try { String fpath = new URL(nextDefinition).getFile(); File configFile = new File(fpath); if (!configFile.exists()) { warn("configuration does not exist: " + nextDefinition); } else { definitions.add(DocumentParser.parse(configFile.toURL())); } } catch (MalformedURLException mue) { error("malformed definition url: " + nextDefinition); } } else { Enumeration<URL> xmls = weavingContext.getResources(nextDefinition); Set<URL> seenBefore = new HashSet<URL>(); while (xmls.hasMoreElements()) { URL xml = xmls.nextElement();
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
if (trace.isTraceEnabled()) { trace.event("parseDefinitions", this, xml); } if (!seenBefore.contains(xml)) { info("using configuration " + weavingContext.getFile(xml)); definitions.add(DocumentParser.parse(xml)); seenBefore.add(xml); } else { debug("ignoring duplicate definition: " + xml); } } } } if (definitions.isEmpty()) { info("no configuration found. Disabling weaver for class loader " + getClassLoaderName(loader)); } } catch (Exception e) { definitions.clear(); warn("parse definitions failed", e); } if (trace.isTraceEnabled()) { trace.exit("parseDefinitions", definitions); } return definitions; } private boolean registerDefinitions(final BcelWeaver weaver, final ClassLoader loader, List<Definition> definitions) { if (trace.isTraceEnabled()) { trace.enter("registerDefinitions", this, definitions); } boolean success = true;
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
try { registerOptions(weaver, loader, definitions); registerAspectExclude(weaver, loader, definitions); registerAspectInclude(weaver, loader, definitions); success = registerAspects(weaver, loader, definitions); registerIncludeExclude(weaver, loader, definitions); registerDump(weaver, loader, definitions); } catch (Exception ex) { trace.error("register definition failed", ex); success = false; warn("register definition failed", (ex instanceof AbortException) ? null : ex); } if (trace.isTraceEnabled()) { trace.exit("registerDefinitions", success); } return success; } private String getClassLoaderName(ClassLoader loader) { return weavingContext.getClassLoaderName(); } /** * Configure the weaver according to the option directives TODO av - don't know if it is that good to reuse, since we only allow * a small subset of options in LTW * * @param weaver * @param loader * @param definitions */ private void registerOptions(final BcelWeaver weaver, final ClassLoader loader, final List<Definition> definitions) { StringBuffer allOptions = new StringBuffer();
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
for (Definition definition : definitions) { allOptions.append(definition.getWeaverOptions()).append(' '); } Options.WeaverOption weaverOption = Options.parse(allOptions.toString(), loader, getMessageHandler()); World world = weaver.getWorld(); setMessageHandler(weaverOption.messageHandler); world.setXlazyTjp(weaverOption.lazyTjp); world.setXHasMemberSupportEnabled(weaverOption.hasMember); world.setTiming(weaverOption.timers, true); world.setOptionalJoinpoints(weaverOption.optionalJoinpoints); world.setPinpointMode(weaverOption.pinpoint); weaver.setReweavableMode(weaverOption.notReWeavable); world.performExtraConfiguration(weaverOption.xSet); world.setXnoInline(weaverOption.noInline); world.setBehaveInJava5Way(LangUtil.is15VMOrGreater()); world.setAddSerialVerUID(weaverOption.addSerialVersionUID); bcelWorld.getLint().loadDefaultProperties(); bcelWorld.getLint().adviceDidNotMatch.setKind(null); if (weaverOption.lintFile != null) { InputStream resource = null; try { resource = loader.getResourceAsStream(weaverOption.lintFile); Exception failure = null; if (resource != null) {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
try { Properties properties = new Properties(); properties.load(resource); world.getLint().setFromProperties(properties); } catch (IOException e) { failure = e; } } if (failure != null || resource == null) { warn("Cannot access resource for -Xlintfile:" + weaverOption.lintFile, failure); } } finally { try { resource.close(); } catch (Throwable t) { } } } if (weaverOption.lint != null) { if (weaverOption.lint.equals("default")) { bcelWorld.getLint().loadDefaultProperties(); } else { bcelWorld.getLint().setAll(weaverOption.lint); if (weaverOption.lint.equals("ignore")) {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
bcelWorld.setAllLintIgnored(); } } } } private void registerAspectExclude(final BcelWeaver weaver, final ClassLoader loader, final List<Definition> definitions) { String fastMatchInfo = null; for (Definition definition : definitions) { for (String exclude : definition.getAspectExcludePatterns()) { TypePattern excludePattern = new PatternParser(exclude).parseTypePattern(); m_aspectExcludeTypePattern.add(excludePattern); fastMatchInfo = looksLikeStartsWith(exclude); if (fastMatchInfo != null) { m_aspectExcludeStartsWith.add(fastMatchInfo); } } } } private void registerAspectInclude(final BcelWeaver weaver, final ClassLoader loader, final List<Definition> definitions) { String fastMatchInfo = null; for (Definition definition : definitions) { for (String include : definition.getAspectIncludePatterns()) { TypePattern includePattern = new PatternParser(include).parseTypePattern(); m_aspectIncludeTypePattern.add(includePattern); fastMatchInfo = looksLikeStartsWith(include); if (fastMatchInfo != null) { m_aspectIncludeStartsWith.add(fastMatchInfo); } }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
} } protected void lint(String name, String[] infos) { Lint lint = bcelWorld.getLint(); Kind kind = lint.getLintKind(name); kind.signal(infos, null, null); } @Override public String getContextId() { return weavingContext.getId(); } /** * Register the aspect, following include / exclude rules * * @param weaver * @param loader * @param definitions */ private boolean registerAspects(final BcelWeaver weaver, final ClassLoader loader, final List<Definition> definitions) { if (trace.isTraceEnabled()) { trace.enter("registerAspects", this, new Object[] { weaver, loader, definitions }); } boolean success = true; for (Definition definition : definitions) { for (String aspectClassName : definition.getAspectClassNames()) { if (acceptAspect(aspectClassName)) {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
info("register aspect " + aspectClassName); String requiredType = definition.getAspectRequires(aspectClassName); if (requiredType != null) { ((BcelWorld) weaver.getWorld()).addAspectRequires(aspectClassName, requiredType); } String definedScope = definition.getScopeForAspect(aspectClassName); if (definedScope != null) { ((BcelWorld) weaver.getWorld()).addScopedAspect(aspectClassName, definedScope); } weaver.addLibraryAspect(aspectClassName); if (namespace == null) { namespace = new StringBuffer(aspectClassName); } else { namespace = namespace.append(";").append(aspectClassName); } } else { lint("aspectExcludedByConfiguration", new String[] { aspectClassName, getClassLoaderName(loader) }); } } } for (Definition definition : definitions) { for (Definition.ConcreteAspect concreteAspect : definition.getConcreteAspects()) {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
if (acceptAspect(concreteAspect.name)) { info("define aspect " + concreteAspect.name); ConcreteAspectCodeGen gen = new ConcreteAspectCodeGen(concreteAspect, weaver.getWorld()); if (!gen.validate()) { error("Concrete-aspect '" + concreteAspect.name + "' could not be registered"); success = false; break; } ((BcelWorld) weaver.getWorld()).addSourceObjectType(Utility.makeJavaClass(concreteAspect.name, gen.getBytes()), true); concreteAspects.add(gen); weaver.addLibraryAspect(concreteAspect.name); if (namespace == null) { namespace = new StringBuffer(concreteAspect.name); } else { namespace = namespace.append(";" + concreteAspect.name); } } } } if (!success) { warn("failure(s) registering aspects. Disabling weaver for class loader " + getClassLoaderName(loader)); } else if (namespace == null) { success = false; info("no aspects registered. Disabling weaver for class loader " + getClassLoaderName(loader)); }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
if (trace.isTraceEnabled()) { trace.exit("registerAspects", success); } return success; } private boolean weaveAndDefineConceteAspects() { if (trace.isTraceEnabled()) { trace.enter("weaveAndDefineConceteAspects", this, concreteAspects); } boolean success = true; for (ConcreteAspectCodeGen gen : concreteAspects) { String name = gen.getClassName(); byte[] bytes = gen.getBytes(); try { byte[] newBytes = weaveClass(name, bytes, true); this.generatedClassHandler.acceptClass(name, newBytes); } catch (IOException ex) { trace.error("weaveAndDefineConceteAspects", ex); error("exception weaving aspect '" + name + "'", ex); } } if (trace.isTraceEnabled()) { trace.exit("weaveAndDefineConceteAspects", success); } return success; } /** * Register the include / exclude filters. We duplicate simple patterns in startWith filters that will allow faster matching * without ResolvedType *
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
* @param weaver * @param loader * @param definitions */ private void registerIncludeExclude(final BcelWeaver weaver, final ClassLoader loader, final List<Definition> definitions) { String fastMatchInfo = null; for (Definition definition : definitions) { for (Iterator<String> iterator1 = definition.getIncludePatterns().iterator(); iterator1.hasNext();) { hasIncludes = true; String include = iterator1.next(); fastMatchInfo = looksLikeStartsWith(include); if (fastMatchInfo != null) { m_includeStartsWith.add(fastMatchInfo); } else if (include.equals("*")) { includeStar = true; } else if ((fastMatchInfo = looksLikeExactName(include)) != null) { includeExactName.add(fastMatchInfo); } else { TypePattern includePattern = new PatternParser(include).parseTypePattern(); includeTypePattern.add(includePattern); } } for (Iterator<String> iterator1 = definition.getExcludePatterns().iterator(); iterator1.hasNext();) { hasExcludes = true; String exclude = iterator1.next(); fastMatchInfo = looksLikeStartsWith(exclude); if (fastMatchInfo != null) { excludeStartsWith.add(fastMatchInfo); } else if ((fastMatchInfo = looksLikeStarDotDotStarExclude(exclude)) != null) { excludeStarDotDotStar.add(fastMatchInfo);
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
} else if ((fastMatchInfo = looksLikeExactName(exclude)) != null) { excludeExactName.add(exclude); } else if ((fastMatchInfo = looksLikeEndsWith(exclude)) != null) { excludeEndsWith.add(fastMatchInfo); } else if (exclude .equals("org.codehaus.groovy..* && !org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController*")) { excludeSpecial.add(new String[] { "org.codehaus.groovy.", "org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController" }); } else { TypePattern excludePattern = new PatternParser(exclude).parseTypePattern(); excludeTypePattern.add(excludePattern); } } } } /** * Checks if the pattern looks like "*..*XXXX*" and if so returns XXXX. This will enable fast name matching of CGLIB exclusion * */ private String looksLikeStarDotDotStarExclude(String typePattern) { if (!typePattern.startsWith("*..*")) { return null; } if (!typePattern.endsWith("*")) { return null; }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
String subPattern = typePattern.substring(4, typePattern.length() - 1); if (hasStarDot(subPattern, 0)) { return null; } return subPattern.replace('$', '.'); } /** * Checks if the pattern looks like "com.foo.Bar" - an exact name */ private String looksLikeExactName(String typePattern) { if (hasSpaceAnnotationPlus(typePattern, 0) || typePattern.indexOf("*") != -1) { return null; } return typePattern.replace('$', '.'); } /** * Checks if the pattern looks like "*Exception" */ private String looksLikeEndsWith(String typePattern) { if (typePattern.charAt(0) != '*') { return null; } if (hasSpaceAnnotationPlus(typePattern, 1) || hasStarDot(typePattern, 1)) { return null; } return typePattern.substring(1).replace('$', '.'); } /** * Determine if something in the string is going to affect our ability to optimize. Checks for: ' ' '@' '+' */
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
private boolean hasSpaceAnnotationPlus(String string, int pos) { for (int i = pos, max = string.length(); i < max; i++) { char ch = string.charAt(i); if (ch == ' ' || ch == '@' || ch == '+') { return true; } } return false; } /** * Determine if something in the string is going to affect our ability to optimize. Checks for: '*' '.' */ private boolean hasStarDot(String string, int pos) { for (int i = pos, max = string.length(); i < max; i++) { char ch = string.charAt(i); if (ch == '*' || ch == '.') { return true; } } return false; } /** * Checks if the type pattern looks like "com.foo..*" */ private String looksLikeStartsWith(String typePattern) { if (hasSpaceAnnotationPlus(typePattern, 0) || typePattern.charAt(typePattern.length() - 1) != '*') { return null; }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
int length = typePattern.length(); if (typePattern.endsWith("..*") && length > 3) { if (typePattern.indexOf("..") == length - 3 && typePattern.indexOf('*') == length - 1) { return typePattern.substring(0, length - 2).replace('$', '.'); } } return null; } /** * Register the dump filter * * @param weaver * @param loader * @param definitions */ private void registerDump(final BcelWeaver weaver, final ClassLoader loader, final List<Definition> definitions) { for (Definition definition : definitions) { for (Iterator<String> iterator1 = definition.getDumpPatterns().iterator(); iterator1.hasNext();) { String dump = iterator1.next(); TypePattern pattern = new PatternParser(dump).parseTypePattern(); m_dumpTypePattern.add(pattern); } if (definition.shouldDumpBefore()) { m_dumpBefore = true; } if (definition.createDumpDirPerClassloader()) { dumpDirPerClassloader = true; }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
} } /** * Determine whether a type should be accepted for weaving, by checking it against any includes/excludes. * * @param className the name of the type to possibly accept * @param bytes the bytecode for the type (in case we need to look inside, eg. annotations) * @return true if it should be accepted for weaving */ @Override protected boolean accept(String className, byte[] bytes) { if (!hasExcludes && !hasIncludes) { return true; } String fastClassName = className.replace('/', '.'); for (String excludeStartsWithString : excludeStartsWith) { if (fastClassName.startsWith(excludeStartsWithString)) { return false; } } if (!excludeStarDotDotStar.isEmpty()) { for (String namePiece : excludeStarDotDotStar) { int index = fastClassName.lastIndexOf('.'); if (fastClassName.indexOf(namePiece, index + 1) != -1) { return false; } } }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
fastClassName = fastClassName.replace('$', '.'); if (!excludeEndsWith.isEmpty()) { for (String lastPiece : excludeEndsWith) { if (fastClassName.endsWith(lastPiece)) { return false; } } } if (!excludeExactName.isEmpty()) { for (String name : excludeExactName) { if (fastClassName.equals(name)) { return false; } } } if (!excludeSpecial.isEmpty()) { for (String[] entry : excludeSpecial) { String excludeThese = entry[0]; String exceptThese = entry[1]; if (fastClassName.startsWith(excludeThese) && !fastClassName.startsWith(exceptThese)) { return false; } } } /* * Bug 120363 If we have an exclude pattern that cannot be matched using "starts with" then we cannot fast accept */ boolean didSomeIncludeMatching = false; if (excludeTypePattern.isEmpty()) {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
if (includeStar) { return true; } if (!includeExactName.isEmpty()) { didSomeIncludeMatching = true; for (String exactname : includeExactName) { if (fastClassName.equals(exactname)) { return true; } } } boolean fastAccept = false; for (int i = 0; i < m_includeStartsWith.size(); i++) { didSomeIncludeMatching = true; fastAccept = fastClassName.startsWith(m_includeStartsWith.get(i)); if (fastAccept) { return true; } } if (includeTypePattern.isEmpty()) { return !didSomeIncludeMatching; } } boolean accept; try { ensureDelegateInitialized(className, bytes); ResolvedType classInfo = delegateForCurrentClass.getResolvedTypeX(); for (TypePattern typePattern : excludeTypePattern) {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
if (typePattern.matchesStatically(classInfo)) { return false; } } if (includeStar) { return true; } if (!includeExactName.isEmpty()) { didSomeIncludeMatching = true; for (String exactname : includeExactName) { if (fastClassName.equals(exactname)) { return true; } } } for (int i = 0; i < m_includeStartsWith.size(); i++) { didSomeIncludeMatching = true; boolean fastaccept = fastClassName.startsWith(m_includeStartsWith.get(i)); if (fastaccept) { return true; } } accept = !didSomeIncludeMatching; for (TypePattern typePattern : includeTypePattern) { accept = typePattern.matchesStatically(classInfo); if (accept) { break; }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
} } finally { this.bcelWorld.demote(); } return accept; } private boolean acceptAspect(String aspectClassName) { if (m_aspectExcludeTypePattern.isEmpty() && m_aspectIncludeTypePattern.isEmpty()) { return true; } String fastClassName = aspectClassName.replace('/', '.').replace('.', '$'); for (int i = 0; i < m_aspectExcludeStartsWith.size(); i++) { if (fastClassName.startsWith(m_aspectExcludeStartsWith.get(i))) { return false; } } for (int i = 0; i < m_aspectIncludeStartsWith.size(); i++) { if (fastClassName.startsWith(m_aspectIncludeStartsWith.get(i))) { return true; } } ResolvedType classInfo = weaver.getWorld().resolve(UnresolvedType.forName(aspectClassName), true);
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
for (Iterator iterator = m_aspectExcludeTypePattern.iterator(); iterator.hasNext();) { TypePattern typePattern = (TypePattern) iterator.next(); if (typePattern.matchesStatically(classInfo)) { return false; } } boolean accept = true; for (Iterator iterator = m_aspectIncludeTypePattern.iterator(); iterator.hasNext();) { TypePattern typePattern = (TypePattern) iterator.next(); accept = typePattern.matchesStatically(classInfo); if (accept) { break; } } return accept; } @Override protected boolean shouldDump(String className, boolean before) { if (before && !m_dumpBefore) { return false; } if (m_dumpTypePattern.isEmpty()) { return false; }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
ResolvedType classInfo = weaver.getWorld().resolve(UnresolvedType.forName(className), true); for (Iterator iterator = m_dumpTypePattern.iterator(); iterator.hasNext();) { TypePattern typePattern = (TypePattern) iterator.next(); if (typePattern.matchesStatically(classInfo)) { return true; } } return false; } @Override protected String getDumpDir() { if (dumpDirPerClassloader) { StringBuffer dir = new StringBuffer(); dir.append("_ajdump").append(File.separator).append(weavingContext.getId()); return dir.toString(); } else { return super.getDumpDir(); } } /* * shared classes methods */ /** * @return Returns the key. */ public String getNamespace() {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
if (namespace == null) { return ""; } else { return new String(namespace); } } /** * Check to see if any classes are stored in the generated classes cache. Then flush the cache if it is not empty * * @param className TODO * @return true if a class has been generated and is stored in the cache */ public boolean generatedClassesExistFor(String className) { if (className == null) { return !generatedClasses.isEmpty(); } else { return generatedClasses.containsKey(className); } } /** * Flush the generated classes cache */ public void flushGeneratedClasses() { generatedClasses = new HashMap(); } private Method defineClassMethod;
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
private Method defineClassWithProtectionDomainMethod; private void defineClass(ClassLoader loader, String name, byte[] bytes) { if (trace.isTraceEnabled()) { trace.enter("defineClass", this, new Object[] { loader, name, bytes }); } Object clazz = null; debug("generating class '" + name + "'"); try { if (defineClassMethod == null) { defineClassMethod = ClassLoader.class.getDeclaredMethod("defineClass", new Class[] { String.class, bytes.getClass(), int.class, int.class }); } defineClassMethod.setAccessible(true); clazz = defineClassMethod.invoke(loader, new Object[] { name, bytes, new Integer(0), new Integer(bytes.length) }); } catch (InvocationTargetException e) { if (e.getTargetException() instanceof LinkageError) { warn("define generated class failed", e.getTargetException()); } else { warn("define generated class failed", e.getTargetException()); } } catch (Exception e) { warn("define generated class failed", e); } if (trace.isTraceEnabled()) { trace.exit("defineClass", clazz); } } private void defineClass(ClassLoader loader, String name, byte[] bytes, ProtectionDomain protectionDomain) {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
if (trace.isTraceEnabled()) { trace.enter("defineClass", this, new Object[] { loader, name, bytes, protectionDomain }); } Object clazz = null; debug("generating class '" + name + "'"); try { if (defineClassWithProtectionDomainMethod == null) { defineClassWithProtectionDomainMethod = ClassLoader.class.getDeclaredMethod("defineClass", new Class[] { String.class, bytes.getClass(), int.class, int.class, ProtectionDomain.class }); } defineClassWithProtectionDomainMethod.setAccessible(true); clazz = defineClassWithProtectionDomainMethod.invoke(loader, new Object[] { name, bytes, Integer.valueOf(0), new Integer(bytes.length), protectionDomain }); } catch (InvocationTargetException e) { if (e.getTargetException() instanceof LinkageError) { warn("define generated class failed", e.getTargetException()); } else { warn("define generated class failed", e.getTargetException()); } } catch (Exception e) { warn("define generated class failed", e); } if (trace.isTraceEnabled()) { trace.exit("defineClass", clazz); } } }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/WeavingURLClassLoader.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 * Andy Clement * Abraham Nevado * ******************************************************************/ package org.aspectj.weaver.loadtime; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.security.CodeSource; import java.util.ArrayList; import java.util.HashMap;
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/WeavingURLClassLoader.java
import java.util.List; import java.util.Map; import java.util.StringTokenizer; import org.aspectj.bridge.AbortException; import org.aspectj.weaver.bcel.ExtensibleURLClassLoader; import org.aspectj.weaver.tools.Trace; import org.aspectj.weaver.tools.TraceFactory; import org.aspectj.weaver.tools.WeavingAdaptor; import org.aspectj.weaver.tools.WeavingClassLoader; public class WeavingURLClassLoader extends ExtensibleURLClassLoader implements WeavingClassLoader { public static final String WEAVING_CLASS_PATH = "aj.class.path"; public static final String WEAVING_ASPECT_PATH = "aj.aspect.path"; private URL[] aspectURLs; private WeavingAdaptor adaptor; private boolean initializingAdaptor; private Map generatedClasses = new HashMap(); private static Trace trace = TraceFactory.getTraceFactory().getTrace(WeavingURLClassLoader.class); /* * This constructor is needed when using "-Djava.system.class.loader". */ public WeavingURLClassLoader(ClassLoader parent) { this(getURLs(getClassPath()), getURLs(getAspectPath()), parent); } public WeavingURLClassLoader(URL[] urls, ClassLoader parent) { super(urls, parent); if (trace.isTraceEnabled()) trace.enter("<init>", this, new Object[] { urls, parent }); if (trace.isTraceEnabled())
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/WeavingURLClassLoader.java
trace.exit("<init>"); } public WeavingURLClassLoader(URL[] classURLs, URL[] aspectURLs, ClassLoader parent) { super(classURLs, parent); this.aspectURLs = aspectURLs; /* * If either we nor our parent is using an ASPECT_PATH use a new-style adaptor */ if (this.aspectURLs.length > 0 || getParent() instanceof WeavingClassLoader) { try { adaptor = new WeavingAdaptor(this); } catch (ExceptionInInitializerError ex) { ex.printStackTrace(System.out); throw ex; } } } private static String getAspectPath() { return System.getProperty(WEAVING_ASPECT_PATH, ""); } private static String getClassPath() { return System.getProperty(WEAVING_CLASS_PATH, ""); } private static URL[] getURLs(String path) { List urlList = new ArrayList(); for (StringTokenizer t = new StringTokenizer(path, File.pathSeparator); t.hasMoreTokens();) { File f = new File(t.nextToken().trim()); try {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/WeavingURLClassLoader.java
if (f.exists()) { URL url = f.toURL(); if (url != null) urlList.add(url); } } catch (MalformedURLException e) { } } URL[] urls = new URL[urlList.size()]; urlList.toArray(urls); return urls; } protected void addURL(URL url) { if (adaptor == null) { createAdaptor(); } adaptor.addURL(url); super.addURL(url); } /** * Override to weave class using WeavingAdaptor */ protected Class defineClass(String name, byte[] b, CodeSource cs) throws IOException { if (trace.isTraceEnabled()) trace.enter("defineClass", this, new Object[] { name, b, cs }); byte orig[] = b; if (!initializingAdaptor) {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/WeavingURLClassLoader.java
if (adaptor == null && !initializingAdaptor) { createAdaptor(); } try { b = adaptor.weaveClass(name, b, false); } catch (AbortException ex) { trace.error("defineClass", ex); throw ex; } catch (Throwable th) { trace.error("defineClass", th); } } Class clazz; try { clazz= super.defineClass(name, b, cs); } catch (Throwable th) { trace.error("Weaving class problem. Original class has been returned. The error was caused because of: " + th, th); clazz= super.defineClass(name, orig, cs); } if (trace.isTraceEnabled()) trace.exit("defineClass", clazz); return clazz; } private void createAdaptor() { DefaultWeavingContext weavingContext = new DefaultWeavingContext(this) { public String getClassLoaderName() { ClassLoader loader = getClassLoader();
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/WeavingURLClassLoader.java
return loader.getClass().getName(); } }; ClassLoaderWeavingAdaptor clwAdaptor = new ClassLoaderWeavingAdaptor(); initializingAdaptor = true; clwAdaptor.initialize(this, weavingContext); initializingAdaptor = false; adaptor = clwAdaptor; } /** * Override to find classes generated by WeavingAdaptor */ protected byte[] getBytes(String name) throws IOException { byte[] bytes = super.getBytes(name); if (bytes == null) { return (byte[]) generatedClasses.remove(name); } return bytes; } /** * Implement method from WeavingClassLoader */ public URL[] getAspectURLs() { return aspectURLs; } public void acceptClass(String name, byte[] bytes) { generatedClasses.put(name, bytes); }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
loadtime/src/org/aspectj/weaver/loadtime/WeavingURLClassLoader.java
} } } } } } } }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
org.aspectj.matcher/src/org/aspectj/weaver/tools/GeneratedClassHandler.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.tools; /** * Interface implemented by weaving class loaders to allow classes generated by * the weaving process to be defined. */ public interface GeneratedClassHandler { /** * Accept class generated by WeavingAdaptor. The class loader should store * the class definition in its local cache until called upon to load it. * @param name class name * @param bytes class definition */ public void acceptClass (String name, byte[] bytes); }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
/* ******************************************************************* * Copyright (c) 1999-2001 Xerox Corporation, * 2002 Palo Alto Research Center, Incorporated (PARC). * All rights reserved.
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
* 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: * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.util; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.lang.reflect.Array; import java.lang.reflect.InvocationTargetException; import java.security.PrivilegedActionException; import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; import java.util.BitSet; import java.util.Collection; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.StringTokenizer; /** * */ public class LangUtil {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
public static final String EOL; private static double vmVersion; static { StringWriter buf = new StringWriter(); PrintWriter writer = new PrintWriter(buf); writer.println(""); String eol = "\n"; try { buf.close(); StringBuffer sb = buf.getBuffer(); if (sb != null) { eol = buf.toString(); } } catch (Throwable t) { } EOL = eol; } static { try { String vm = System.getProperty("java.version"); if (vm == null) { vm = System.getProperty("java.runtime.version"); } if (vm == null) { vm = System.getProperty("java.vm.version"); } if (vm == null) { new RuntimeException( "System properties appear damaged, cannot find: java.version/java.runtime.version/java.vm.version") .printStackTrace(System.err);
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
vmVersion = 1.5; } else { try { String versionString = vm.substring(0, 3); Double temp = new Double(Double.parseDouble(versionString)); vmVersion = temp.floatValue(); } catch (Exception e) { vmVersion = 1.4; } } } catch (Throwable t) { new RuntimeException( "System properties appear damaged, cannot find: java.version/java.runtime.version/java.vm.version", t) .printStackTrace(System.err); vmVersion = 1.5; } } public static boolean is13VMOrGreater() { return 1.3 <= vmVersion; } public static boolean is14VMOrGreater() { return 1.4 <= vmVersion; } public static boolean is15VMOrGreater() { return 1.5 <= vmVersion; } public static boolean is16VMOrGreater() { return 1.6 <= vmVersion; } public static boolean is17VMOrGreater() {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
return 1.7 <= vmVersion; } /** * Shorthand for "if null, throw IllegalArgumentException" * * @throws IllegalArgumentException "null {name}" if o is null */ public static final void throwIaxIfNull(final Object o, final String name) { if (null == o) { String message = "null " + (null == name ? "input" : name); throw new IllegalArgumentException(message); } } /** * Shorthand for "if not null or not assignable, throw IllegalArgumentException" * * @param c the Class to check - use null to ignore type check * @throws IllegalArgumentException "null {name}" if o is null */ public static final void throwIaxIfNotAssignable(final Object ra[], final Class<?> c, final String name) { throwIaxIfNull(ra, name); String label = (null == name ? "input" : name); for (int i = 0; i < ra.length; i++) { if (null == ra[i]) { String m = " null " + label + "[" + i + "]"; throw new IllegalArgumentException(m); } else if (null != c) { Class<?> actualClass = ra[i].getClass(); if (!c.isAssignableFrom(actualClass)) { String message = label + " not assignable to " + c.getName();
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
throw new IllegalArgumentException(message); } } } } /** * Shorthand for "if not null or not assignable, throw IllegalArgumentException" * * @throws IllegalArgumentException "null {name}" if o is null */ public static final void throwIaxIfNotAssignable(final Object o, final Class<?> c, final String name) { 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); } } } /** */
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
} } } /** * Shorthand for "if false, throw IllegalArgumentException" * * @throws IllegalArgumentException "{message}" if test is false */ 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)); }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
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]); } /** * 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<String> 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]; }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
StringTokenizer st = new StringTokenizer(classpath, File.pathSeparator); ArrayList<String> result = new ArrayList<String>(st.countTokens()); while (st.hasMoreTokens()) { String entry = st.nextToken(); if (!LangUtil.isEmpty(entry)) { result.add(entry); } } return (String[]) result.toArray(new String[0]); } /** * 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.
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
* 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<String> anySplit(String input, String delim) { if (null == input) { return Collections.emptyList(); } ArrayList<String> result = new ArrayList<String>(); 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<String> strings(String text) { if (LangUtil.isEmpty(text)) { return Collections.emptyList();
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
} List<String> strings = new ArrayList<String>(); StringTokenizer tok = new StringTokenizer(text); while (tok.hasMoreTokens()) { strings.add(tok.nextToken()); } return strings; } public static <T> List<T> safeList(List<T> list) { return (null == list ? Collections.<T>emptyList() : Collections.unmodifiableList(list)); } /** */ } }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
} } } } break; } } } } /**
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
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;
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
} /** * 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 } }; * 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];
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
found = sought.equals(args[j]); if (found) { foundSet.set(i); int doMore = option.length - 1; if (0 < doMore) { 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);
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
args = temp; } return args; } /** */ } } }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
} } } } } } break;
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
} } } } } } } } break; }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
} } } } } break; } } } } /**
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
*/ } } } }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
} } } } } } } /** */
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
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<Object> result = null; if (0 == sourceLength) { resultSize = 0; } else { result = new ArrayList<Object>(sourceLength); for (int i = 0; i < sourceLength; i++) { if ((null != source[i]) && (sinkType.isAssignableFrom(source[i].getClass()))) { result.add(source[i]); } } resultSize = result.size(); }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
if (resultSize != sinkLength) { sink = (Object[]) Array.newInstance(sinkType, result.size()); } 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) {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
if (LangUtil.isEmpty(in) || LangUtil.isEmpty(sought)) { 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; }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
return result; } } i++; j++; break; } } }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
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";
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
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<String> lines = new LinkedList<String>(); 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();
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
if (!checker.acceptString(line)) { 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) {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
writer.println(throwable.getMessage()); } 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(); }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
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<Object> arrayAsList(Object[] array) { if ((null == array) || (1 > array.length)) { return Collections.emptyList(); } ArrayList<Object> list = new ArrayList<Object>(); list.addAll(Arrays.asList(array)); return list; } public static class StringChecker {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
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; } } /** * Gen classpath. *
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
* @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; } sink.append(input); if (!LangUtil.isEmpty(delimiter)) { sink.append(delimiter); }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
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<String> cmd = new ArrayList<String>(); 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(); } controller.init(command, mainClass); return controller; } /**
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
*/ } } /** * 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; try { javaHome = System.getProperty("java.home"); } catch (Throwable t) { ignore }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
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; } /** * */ } } /** * Sleep until a particular time.
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
* * @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 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. *
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
* <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 { /* * 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;
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
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() { } /** * 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;
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
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"); ArrayList<String> cmd = new ArrayList<String>(); 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) {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
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); } } 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"); }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
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); 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) {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
thrown = e; } finally { stop(thrown, result); } } }; Thread result = new Thread(processRunner, label); result.start(); return result; } /** * 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; }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
public final boolean completed() { return completed; } public final boolean started() { return started; } public final boolean userStopped() { 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>
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
util/src/org/aspectj/util/LangUtil.java
* @see getThrown() * @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;
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
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;
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
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); } } } } }
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.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, John Kew (caching) * Martin Lippert initial implementation * ******************************************************************/ package org.aspectj.weaver.tools; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintWriter; import java.net.URL; import java.net.URLClassLoader; import java.security.ProtectionDomain; import java.util.*; import org.aspectj.bridge.AbortException; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessage.Kind; import org.aspectj.bridge.IMessageContext; import org.aspectj.bridge.IMessageHandler; import org.aspectj.bridge.IMessageHolder;
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
import org.aspectj.bridge.Message; import org.aspectj.bridge.MessageHandler; import org.aspectj.bridge.MessageUtil; import org.aspectj.bridge.MessageWriter; import org.aspectj.bridge.Version; import org.aspectj.bridge.WeaveMessage; import org.aspectj.util.FileUtil; import org.aspectj.util.LangUtil; import org.aspectj.weaver.IClassFileProvider; import org.aspectj.weaver.IUnwovenClassFile; import org.aspectj.weaver.IWeaveRequestor; import org.aspectj.weaver.World; import org.aspectj.weaver.bcel.BcelObjectType; import org.aspectj.weaver.bcel.BcelWeaver; import org.aspectj.weaver.bcel.BcelWorld; import org.aspectj.weaver.bcel.UnwovenClassFile; import org.aspectj.weaver.tools.cache.CachedClassEntry; import org.aspectj.weaver.tools.cache.CachedClassReference; import org.aspectj.weaver.tools.cache.WeavedClassCache; /** * This adaptor allows the AspectJ compiler to be embedded in an existing system to facilitate load-time weaving. It provides an * interface for a weaving class loader to provide a classpath to be woven by a set of aspects. A callback is supplied to allow a * class loader to define classes generated by the compiler during the weaving process. * <p> * A weaving class loader should create a <code>WeavingAdaptor</code> before any classes are defined, typically during construction. * The set of aspects passed to the adaptor is fixed for the lifetime of the adaptor although the classpath can be augmented. A * system property can be set to allow verbose weaving messages to be written to the console. * */ public class WeavingAdaptor implements IMessageContext {
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
/** * System property used to turn on verbose weaving messages */ public static final String WEAVING_ADAPTOR_VERBOSE = "aj.weaving.verbose"; public static final String SHOW_WEAVE_INFO_PROPERTY = "org.aspectj.weaver.showWeaveInfo"; public static final String TRACE_MESSAGES_PROPERTY = "org.aspectj.tracing.messages"; private boolean enabled = false; protected boolean verbose = getVerbose(); protected BcelWorld bcelWorld; protected BcelWeaver weaver; private IMessageHandler messageHandler; private WeavingAdaptorMessageHolder messageHolder; private boolean abortOnError = false; protected GeneratedClassHandler generatedClassHandler; protected Map<String, IUnwovenClassFile> generatedClasses = new HashMap<String, IUnwovenClassFile>(); public BcelObjectType delegateForCurrentClass; protected ProtectionDomain activeProtectionDomain; private boolean haveWarnedOnJavax = false; protected WeavedClassCache cache; private int weavingSpecialTypes = 0; private static final int INITIALIZED = 0x1; private static final int WEAVE_JAVA_PACKAGE = 0x2; private static final int WEAVE_JAVAX_PACKAGE = 0x4; private static Trace trace = TraceFactory.getTraceFactory().getTrace(WeavingAdaptor.class);
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
protected WeavingAdaptor() { } /** * Construct a WeavingAdaptor with a reference to a weaving class loader. The adaptor will automatically search the class loader * hierarchy to resolve classes. The adaptor will also search the hierarchy for WeavingClassLoader instances to determine the * set of aspects to be used for weaving. * * @param loader instance of <code>ClassLoader</code> */ public WeavingAdaptor(WeavingClassLoader loader) { generatedClassHandler = loader; init((ClassLoader)loader, getFullClassPath((ClassLoader) loader), getFullAspectPath((ClassLoader) loader)); } /** * Construct a WeavingAdaptor with a reference to a <code>GeneratedClassHandler</code>, a full search path for resolving classes * and a complete set of aspects. The search path must include classes loaded by the class loader constructing the * WeavingAdaptor and all its parents in the hierarchy. * * @param handler <code>GeneratedClassHandler</code> * @param classURLs the URLs from which to resolve classes * @param aspectURLs the aspects used to weave classes defined by this class loader */ public WeavingAdaptor(GeneratedClassHandler handler, URL[] classURLs, URL[] aspectURLs) { generatedClassHandler = handler; init(null, FileUtil.makeClasspath(classURLs), FileUtil.makeClasspath(aspectURLs)); } protected List<String> getFullClassPath(ClassLoader loader) { List<String> list = new LinkedList<String>();
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
for (; loader != null; loader = loader.getParent()) { if (loader instanceof URLClassLoader) { URL[] urls = ((URLClassLoader) loader).getURLs(); list.addAll(0, FileUtil.makeClasspath(urls)); } else { warn("cannot determine classpath"); } } list.addAll(0, makeClasspath(System.getProperty("sun.boot.class.path"))); return list; } private List<String> getFullAspectPath(ClassLoader loader) { List<String> list = new LinkedList<String>(); for (; loader != null; loader = loader.getParent()) { if (loader instanceof WeavingClassLoader) { URL[] urls = ((WeavingClassLoader) loader).getAspectURLs(); list.addAll(0, FileUtil.makeClasspath(urls)); } } return list; } private static boolean getVerbose() { try { return Boolean.getBoolean(WEAVING_ADAPTOR_VERBOSE); } catch (Throwable t) { return false; } } /**
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
* Initialize the WeavingAdapter * @param loader ClassLoader used by this adapter; which can be null * @param classPath classpath of this adapter * @param aspectPath list of aspect paths */ private void init(ClassLoader loader, List<String> classPath, List<String> aspectPath) { abortOnError = true; createMessageHandler(); info("using classpath: " + classPath); info("using aspectpath: " + aspectPath); bcelWorld = new BcelWorld(classPath, messageHandler, null); bcelWorld.setXnoInline(false); bcelWorld.getLint().loadDefaultProperties(); if (LangUtil.is15VMOrGreater()) { bcelWorld.setBehaveInJava5Way(true); } weaver = new BcelWeaver(bcelWorld); registerAspectLibraries(aspectPath); initializeCache(loader, aspectPath, null, getMessageHandler()); enabled = true; } /** * If the cache is enabled, initialize it and swap out the existing classhandler * for the caching one - * * @param loader classloader for this adapter, may be null * @param aspects List of strings representing aspects managed by the adapter; these could be urls or classnames * @param existingClassHandler current class handler * @param myMessageHandler current message handler */
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
protected void initializeCache(ClassLoader loader, List<String> aspects, GeneratedClassHandler existingClassHandler, IMessageHandler myMessageHandler) { if (WeavedClassCache.isEnabled()) { cache = WeavedClassCache.createCache(loader, aspects, existingClassHandler, myMessageHandler); if (cache != null) { this.generatedClassHandler = cache.getCachingClassHandler(); } } } protected void createMessageHandler() { messageHolder = new WeavingAdaptorMessageHolder(new PrintWriter(System.err)); messageHandler = messageHolder; if (verbose) { messageHandler.dontIgnore(IMessage.INFO); } if (Boolean.getBoolean(SHOW_WEAVE_INFO_PROPERTY)) { messageHandler.dontIgnore(IMessage.WEAVEINFO); } info("AspectJ Weaver Version " + Version.text + " built on " + Version.time_text); } protected IMessageHandler getMessageHandler() { return messageHandler; } public IMessageHolder getMessageHolder() { return messageHolder; } protected void setMessageHandler(IMessageHandler mh) { if (mh instanceof ISupportsMessageContext) { ISupportsMessageContext smc = (ISupportsMessageContext) mh; smc.setMessageContext(this);
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
} if (mh != messageHolder) { messageHolder.setDelegate(mh); } messageHolder.flushMessages(); } protected void disable() { if (trace.isTraceEnabled()) { trace.enter("disable", this); } enabled = false; messageHolder.flushMessages(); if (trace.isTraceEnabled()) { trace.exit("disable"); } } protected void enable() { enabled = true; messageHolder.flushMessages(); } protected boolean isEnabled() { return enabled; } /** * Appends URL to path used by the WeavingAdptor to resolve classes * * @param url to be appended to search path */ public void addURL(URL url) { File libFile = new File(url.getPath());
389,967
Bug 389967 Weaved aspects mechanism does not take into account modified classes
The current caching mechanism assumes that if the same class is encountered then its cached weaved version can be used. However, the mechanism uses only the (fully qualified) class name to identify the class and does not take into account the fact that the class bytes may have changed (e.g., the user re-compiled and re-deployed some changes to the same class).
resolved fixed
9a3cc2b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-10-01T20:22:37Z
2012-09-20T05:46:40Z
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
try { weaver.addLibraryJarFile(libFile); } catch (IOException ex) { warn("bad library: '" + libFile + "'"); } } /** * Weave a class using aspects previously supplied to the adaptor. * * @param name the name of the class * @param bytes the class bytes * @return the woven bytes * @exception IOException weave failed */ public byte[] weaveClass(String name, byte[] bytes) throws IOException { return weaveClass(name, bytes, false); } private ThreadLocal<Boolean> weaverRunning = new ThreadLocal<Boolean>() { @Override protected Boolean initialValue() { return Boolean.FALSE; } }; /** * Weave a class using aspects previously supplied to the adaptor. * * @param name the name of the class * @param bytes the class bytes * @param mustWeave if true then this class *must* get woven (used for concrete aspects generated from XML)