Explorar el Código

tests for pr108454, 'Waving' crash on a 1.5 java generics?

tags/preDefaultReweavable
acolyer hace 19 años
padre
commit
014c5c64b4

+ 12
- 3
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java Ver fichero

@@ -228,15 +228,24 @@ public class EclipseFactory {
arguments[i] = fromBinding(ptb.arguments[i]);
}
}
ResolvedType baseType = UnresolvedType.forName(getName(binding)).resolve(getWorld());
String baseTypeSignature = null;
ResolvedType baseType = getWorld().resolve(UnresolvedType.forName(getName(binding)),true);
if (baseType != ResolvedType.MISSING) {
// can legitimately be missing if a bound refers to a type we haven't added to the world yet...
if (!baseType.isGenericType() && arguments!=null) baseType = baseType.getGenericType();
baseTypeSignature = baseType.getErasureSignature();
} else {
baseTypeSignature = UnresolvedType.forName(getName(binding)).getSignature();
}
// Create an unresolved parameterized type. We can't create a resolved one as the
// act of resolution here may cause recursion problems since the parameters may
// be type variables that we haven't fixed up yet.
if (!baseType.isGenericType() && arguments!=null) baseType = baseType.getGenericType();
if (arguments==null) arguments=new UnresolvedType[0];
String parameterizedSig = ResolvedType.PARAMETERIZED_TYPE_IDENTIFIER+CharOperation.charToString(binding.genericTypeSignature()).substring(1);
return TypeFactory.createUnresolvedParameterizedType(parameterizedSig,baseType.getErasureSignature(),arguments);
return TypeFactory.createUnresolvedParameterizedType(parameterizedSig,baseTypeSignature,arguments);
}
// Convert the source type binding for a generic type into a generic UnresolvedType

+ 12
- 0
tests/bugs150/pr108054/ASequence.java Ver fichero

@@ -0,0 +1,12 @@
public abstract class ASequence <V, T extends ICounter<V> >
implements ISequence<V> {

}
aspect EnsureTypesUnpackedInWeaver {
before() : staticinitialization(*) && !within(EnsureTypesUnpackedInWeaver) {
System.out.println("hi");
}
}

+ 3
- 0
tests/bugs150/pr108054/ICounter.java Ver fichero

@@ -0,0 +1,3 @@
public interface ICounter<T> {

}

+ 3
- 0
tests/bugs150/pr108054/ISequence.java Ver fichero

@@ -0,0 +1,3 @@
public interface ISequence<V> {
}

+ 12
- 0
tests/bugs150/pr108054/pr108054.aj Ver fichero

@@ -0,0 +1,12 @@
interface ISequence<V> {
}

interface ICounter<T> {

}

abstract class ASequence <V, T extends ICounter<V> >
implements ISequence<V> {

}

+ 4
- 0
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java Ver fichero

@@ -309,6 +309,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testFieldAccessInsideITDM() {
runTest("itd field access inside itd method");
}

public void testTypeVarWithTypeVarBound() {
runTest("type variable with type variable bound");
}
// helper methods.....

+ 6
- 1
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml Ver fichero

@@ -362,7 +362,12 @@
<compile files="pr108377.aj"/>
<run class="pr108377"/>
</ajc-test>

<ajc-test dir="bugs150/pr108054" pr="108054" title="type variable with type variable bound">
<compile files="pr108054.aj" options="-1.5"/>
<compile files="ISequence.java,ICounter.java,ASequence.java" options="-1.5"/>
</ajc-test>
<!-- ============================================================================ -->
<!-- ============================================================================ -->

Cargando…
Cancelar
Guardar