public final class org.apache.axiom.weaver.Weaver extends java.lang.Object
{
private static final org.apache.commons.logging.Log log;
private final org.apache.axiom.weaver.classio.ClassFetcher classFetcher;
private final org.apache.axiom.weaver.ImplementationClassNameMapper implementationClassNameMapper;
private final java.util.Map interfaceNodes;
private final java.util.Map implementationNodes;
private final java.util.Map mixinsByInterface;
private final com.github.veithen.jrel.association.MutableReferences nodes;
private int nextId;
public void <init>(java.lang.ClassLoader, org.apache.axiom.weaver.ImplementationClassNameMapper)
{
org.apache.axiom.weaver.Weaver v;
com.github.veithen.jrel.ReferenceHolder v;
org.apache.axiom.weaver.ImplementationClassNameMapper v;
com.github.veithen.jrel.association.ManyToOneAssociation v;
java.util.HashMap v, v, v;
com.github.veithen.jrel.AbstractBinaryRelation v;
java.lang.ClassLoader v;
org.apache.axiom.weaver.ClassFetcherImpl v;
v := @this: org.apache.axiom.weaver.Weaver;
v := @parameter: java.lang.ClassLoader;
v := @parameter: org.apache.axiom.weaver.ImplementationClassNameMapper;
specialinvoke v.<java.lang.Object: void <init>()>();
v = new java.util.HashMap;
specialinvoke v.<java.util.HashMap: void <init>()>();
v.<org.apache.axiom.weaver.Weaver: java.util.Map interfaceNodes> = v;
v = new java.util.HashMap;
specialinvoke v.<java.util.HashMap: void <init>()>();
v.<org.apache.axiom.weaver.Weaver: java.util.Map implementationNodes> = v;
v = new java.util.HashMap;
specialinvoke v.<java.util.HashMap: void <init>()>();
v.<org.apache.axiom.weaver.Weaver: java.util.Map mixinsByInterface> = v;
v = <org.apache.axiom.weaver.Relations: com.github.veithen.jrel.association.ManyToOneAssociation WEAVER>;
v = virtualinvoke v.<com.github.veithen.jrel.association.ManyToOneAssociation: com.github.veithen.jrel.AbstractBinaryRelation getConverse()>();
v = virtualinvoke v.<com.github.veithen.jrel.association.OneToManyAssociation: com.github.veithen.jrel.ReferenceHolder newReferenceHolder(java.lang.Object)>(v);
v.<org.apache.axiom.weaver.Weaver: com.github.veithen.jrel.association.MutableReferences nodes> = v;
v.<org.apache.axiom.weaver.Weaver: int nextId> = 1;
v = new org.apache.axiom.weaver.ClassFetcherImpl;
specialinvoke v.<org.apache.axiom.weaver.ClassFetcherImpl: void <init>(java.lang.ClassLoader)>(v);
v.<org.apache.axiom.weaver.Weaver: org.apache.axiom.weaver.classio.ClassFetcher classFetcher> = v;
v.<org.apache.axiom.weaver.Weaver: org.apache.axiom.weaver.ImplementationClassNameMapper implementationClassNameMapper> = v;
return;
}
public void loadWeavablePackage(java.lang.String)
{
java.util.List v;
org.apache.axiom.weaver.Weaver v;
java.util.Iterator v;
java.lang.Object v;
java.lang.String v;
org.apache.axiom.weaver.classio.ClassFetcher v;
boolean v;
v := @this: org.apache.axiom.weaver.Weaver;
v := @parameter: java.lang.String;
v = v.<org.apache.axiom.weaver.Weaver: org.apache.axiom.weaver.classio.ClassFetcher classFetcher>;
v = staticinvoke <org.apache.axiom.weaver.mixin.clazz.MixinFactory: java.util.List loadMixins(org.apache.axiom.weaver.classio.ClassFetcher,java.lang.String)>(v, v);
v = interfaceinvoke v.<java.util.List: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
specialinvoke v.<org.apache.axiom.weaver.Weaver: void addMixin(org.apache.axiom.weaver.mixin.Mixin)>(v);
goto label;
label:
return;
}
public void addMixin(org.apache.axiom.weaver.mixin.Mixin)
{
org.apache.axiom.weaver.Weaver v;
java.util.Map v;
org.apache.axiom.weaver.mixin.Mixin v;
java.lang.Class v;
java.lang.Object v;
java.util.function.Function v;
v := @this: org.apache.axiom.weaver.Weaver;
v := @parameter: org.apache.axiom.weaver.mixin.Mixin;
v = v.<org.apache.axiom.weaver.Weaver: java.util.Map mixinsByInterface>;
v = virtualinvoke v.<org.apache.axiom.weaver.mixin.Mixin: java.lang.Class getTargetInterface()>();
v = staticinvoke <org.apache.axiom.weaver.Weaver$lambda_addMixin_0__2: java.util.function.Function bootstrap$()>();
v = interfaceinvoke v.<java.util.Map: java.lang.Object computeIfAbsent(java.lang.Object,java.util.function.Function)>(v, v);
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>(v);
return;
}
private org.apache.axiom.weaver.InterfaceNode addInterface(java.lang.Class)
{
org.apache.axiom.weaver.InterfaceClassVisitor v;
com.github.veithen.jrel.collection.LinkedIdentityHashSet v, v, v;
java.util.Map v, v, v, v;
org.apache.axiom.weaver.classio.ClassFetcher v, v;
org.apache.axiom.weaver.MixinNode v;
boolean v, v;
org.apache.axiom.weaver.InterfaceNode v, v;
java.util.Set v;
java.util.Optional v;
com.github.veithen.jrel.association.MutableReferences v;
java.util.function.Supplier v;
int v, v, v, v;
java.lang.String v;
org.apache.axiom.weaver.ImplementationNode v;
org.apache.axiom.weaver.Weaver v;
java.util.Iterator v;
java.lang.Class[] v;
java.util.function.Consumer v;
java.lang.Class v, v;
java.lang.Object v, v, v;
v := @this: org.apache.axiom.weaver.Weaver;
v := @parameter: java.lang.Class;
v = v.<org.apache.axiom.weaver.Weaver: java.util.Map interfaceNodes>;
v = interfaceinvoke v.<java.util.Map: java.lang.Object get(java.lang.Object)>(v);
if v != null goto label;
v = v.<org.apache.axiom.weaver.Weaver: org.apache.axiom.weaver.classio.ClassFetcher classFetcher>;
v = staticinvoke <org.apache.axiom.weaver.mixin.factory.FactoryMixinFactory: java.util.Optional createFactoryMixin(org.apache.axiom.weaver.classio.ClassFetcher,java.lang.Class)>(v, v);
v = staticinvoke <org.apache.axiom.weaver.Weaver$addMixin__3: java.util.function.Consumer bootstrap$(org.apache.axiom.weaver.Weaver)>(v);
virtualinvoke v.<java.util.Optional: void ifPresent(java.util.function.Consumer)>(v);
v = new com.github.veithen.jrel.collection.LinkedIdentityHashSet;
specialinvoke v.<com.github.veithen.jrel.collection.LinkedIdentityHashSet: void <init>()>();
v = new com.github.veithen.jrel.collection.LinkedIdentityHashSet;
specialinvoke v.<com.github.veithen.jrel.collection.LinkedIdentityHashSet: void <init>()>();
v = virtualinvoke v.<java.lang.Class: java.lang.Class[] getInterfaces()>();
v = lengthof v;
v = 0;
label:
if v >= v goto label;
v = v[v];
v = specialinvoke v.<org.apache.axiom.weaver.Weaver: org.apache.axiom.weaver.InterfaceNode addInterface(java.lang.Class)>(v);
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>(v);
v = virtualinvoke v.<org.apache.axiom.weaver.InterfaceNode: java.util.Set getImplementations()>();
interfaceinvoke v.<java.util.Set: boolean addAll(java.util.Collection)>(v);
v = v + 1;
goto label;
label:
v = new org.apache.axiom.weaver.InterfaceClassVisitor;
specialinvoke v.<org.apache.axiom.weaver.InterfaceClassVisitor: void <init>()>();
v = v.<org.apache.axiom.weaver.Weaver: org.apache.axiom.weaver.classio.ClassFetcher classFetcher>;
v = virtualinvoke v.<java.lang.Class: java.lang.String getName()>();
interfaceinvoke v.<org.apache.axiom.weaver.classio.ClassFetcher: void fetch(java.lang.String,org.objectweb.asm.ClassVisitor)>(v, v);
v = new org.apache.axiom.weaver.InterfaceNode;
v = virtualinvoke v.<org.apache.axiom.weaver.InterfaceClassVisitor: boolean isSingleton()>();
specialinvoke v.<org.apache.axiom.weaver.InterfaceNode: void <init>(java.lang.Class,java.util.Set,boolean)>(v, v, v);
v = v;
v = v.<org.apache.axiom.weaver.Weaver: java.util.Map interfaceNodes>;
interfaceinvoke v.<java.util.Map: java.lang.Object put(java.lang.Object,java.lang.Object)>(v, v);
v = new com.github.veithen.jrel.collection.LinkedIdentityHashSet;
specialinvoke v.<com.github.veithen.jrel.collection.LinkedIdentityHashSet: void <init>()>();
v = v.<org.apache.axiom.weaver.Weaver: java.util.Map mixinsByInterface>;
v = interfaceinvoke v.<java.util.Map: java.lang.Object get(java.lang.Object)>(v);
if v == null goto label;
v = interfaceinvoke v.<java.util.Set: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = new org.apache.axiom.weaver.MixinNode;
specialinvoke v.<org.apache.axiom.weaver.MixinNode: void <init>(org.apache.axiom.weaver.mixin.Mixin,org.apache.axiom.weaver.InterfaceNode)>(v, v);
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>(v);
goto label;
label:
v = new org.apache.axiom.weaver.ImplementationNode;
v = v.<org.apache.axiom.weaver.Weaver: int nextId>;
v = v + 1;
v.<org.apache.axiom.weaver.Weaver: int nextId> = v;
v = staticinvoke <org.apache.axiom.weaver.Weaver$lambda_addInterface_1__4: java.util.function.Supplier bootstrap$(org.apache.axiom.weaver.Weaver,java.lang.Class)>(v, v);
specialinvoke v.<org.apache.axiom.weaver.ImplementationNode: void <init>(int,java.util.Set,org.apache.axiom.weaver.InterfaceNode,java.util.Set,java.util.function.Supplier)>(v, v, v, v, v);
v = v.<org.apache.axiom.weaver.Weaver: java.util.Map implementationNodes>;
interfaceinvoke v.<java.util.Map: java.lang.Object put(java.lang.Object,java.lang.Object)>(v, v);
v = v.<org.apache.axiom.weaver.Weaver: com.github.veithen.jrel.association.MutableReferences nodes>;
virtualinvoke v.<com.github.veithen.jrel.association.MutableReferences: boolean add(java.lang.Object)>(v);
label:
return v;
}
public void addInterfaceToImplement(java.lang.Class)
{
java.util.function.Consumer v;
org.apache.axiom.weaver.Weaver v;
org.apache.axiom.weaver.InterfaceNode v;
java.util.Set v;
java.lang.Class v;
v := @this: org.apache.axiom.weaver.Weaver;
v := @parameter: java.lang.Class;
v = specialinvoke v.<org.apache.axiom.weaver.Weaver: org.apache.axiom.weaver.InterfaceNode addInterface(java.lang.Class)>(v);
v = virtualinvoke v.<org.apache.axiom.weaver.InterfaceNode: java.util.Set getImplementations()>();
v = staticinvoke <org.apache.axiom.weaver.Weaver$requireImplementation__5: java.util.function.Consumer bootstrap$()>();
interfaceinvoke v.<java.util.Set: void forEach(java.util.function.Consumer)>(v);
return;
}
private void compact()
{
org.apache.axiom.weaver.Weaver v;
java.util.Iterator v;
java.lang.Object v;
com.github.veithen.jrel.association.MutableReferences v;
boolean v, v, v;
v := @this: org.apache.axiom.weaver.Weaver;
label:
v = 0;
v = v.<org.apache.axiom.weaver.Weaver: com.github.veithen.jrel.association.MutableReferences nodes>;
v = virtualinvoke v.<com.github.veithen.jrel.association.MutableReferences: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = virtualinvoke v.<org.apache.axiom.weaver.ImplementationNode: boolean compact()>();
v = v | v;
goto label;
label:
if v != 0 goto label;
return;
}
private void promoteCommonMixins()
{
org.apache.axiom.weaver.Weaver v;
java.util.Iterator v;
java.lang.Object v;
com.github.veithen.jrel.association.MutableReferences v;
boolean v, v, v;
v := @this: org.apache.axiom.weaver.Weaver;
label:
v = 0;
v = v.<org.apache.axiom.weaver.Weaver: com.github.veithen.jrel.association.MutableReferences nodes>;
v = virtualinvoke v.<com.github.veithen.jrel.association.MutableReferences: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = virtualinvoke v.<org.apache.axiom.weaver.ImplementationNode: boolean promoteCommonMixins()>();
v = v | v;
goto label;
label:
if v != 0 goto label;
return;
}
private void dump(java.lang.String, boolean)
{
org.apache.axiom.weaver.Weaver v;
java.util.Iterator v;
java.lang.Object v;
java.lang.StringBuilder v;
org.apache.commons.logging.Log v, v;
java.lang.String v, v;
com.github.veithen.jrel.association.MutableReferences v;
boolean v, v, v;
v := @this: org.apache.axiom.weaver.Weaver;
v := @parameter: java.lang.String;
v := @parameter: boolean;
v = <org.apache.axiom.weaver.Weaver: org.apache.commons.logging.Log log>;
v = interfaceinvoke v.<org.apache.commons.logging.Log: boolean isDebugEnabled()>();
if v == 0 goto label;
v = new java.lang.StringBuilder;
specialinvoke v.<java.lang.StringBuilder: void <init>(java.lang.String)>(v);
virtualinvoke v.<java.lang.StringBuilder: java.lang.StringBuilder append(java.lang.String)>("digraph G {\n  rankdir = BT;\n  node [shape=box];\n");
v = v.<org.apache.axiom.weaver.Weaver: com.github.veithen.jrel.association.MutableReferences nodes>;
v = virtualinvoke v.<com.github.veithen.jrel.association.MutableReferences: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
virtualinvoke v.<org.apache.axiom.weaver.ImplementationNode: void dump(java.lang.StringBuilder,boolean)>(v, v);
goto label;
label:
virtualinvoke v.<java.lang.StringBuilder: java.lang.StringBuilder append(java.lang.String)>("}");
v = <org.apache.axiom.weaver.Weaver: org.apache.commons.logging.Log log>;
v = virtualinvoke v.<java.lang.StringBuilder: java.lang.String toString()>();
interfaceinvoke v.<org.apache.commons.logging.Log: void debug(java.lang.Object)>(v);
label:
return;
}
public org.apache.axiom.weaver.mixin.ClassDefinition[] generate()
{
java.util.Map v;
boolean v, v, v;
java.util.Collection v, v;
java.util.Set v;
java.util.List v;
com.github.veithen.jrel.association.MutableReferences v, v, v, v, v;
org.apache.axiom.weaver.WeavingContextImpl v;
java.lang.Object[] v;
java.util.HashMap v, v;
java.util.function.Function v;
java.util.ArrayList v;
int v, v;
org.apache.axiom.weaver.Weaver v;
java.util.Iterator v, v, v;
java.util.function.Consumer v, v, v, v;
org.apache.axiom.weaver.mixin.ClassDefinition[] v;
java.lang.Object v, v, v, v;
v := @this: org.apache.axiom.weaver.Weaver;
specialinvoke v.<org.apache.axiom.weaver.Weaver: void dump(java.lang.String,boolean)>("Initial graph:\n", 0);
v = v.<org.apache.axiom.weaver.Weaver: com.github.veithen.jrel.association.MutableReferences nodes>;
v = staticinvoke <org.apache.axiom.weaver.Weaver$removeIfNotRequired__6: java.util.function.Consumer bootstrap$()>();
virtualinvoke v.<com.github.veithen.jrel.association.MutableReferences: void forEach(java.util.function.Consumer)>(v);
specialinvoke v.<org.apache.axiom.weaver.Weaver: void dump(java.lang.String,boolean)>("Graph after removing nodes that are not required:\n", 0);
v = new java.util.HashMap;
specialinvoke v.<java.util.HashMap: void <init>()>();
v = v.<org.apache.axiom.weaver.Weaver: com.github.veithen.jrel.association.MutableReferences nodes>;
v = virtualinvoke v.<com.github.veithen.jrel.association.MutableReferences: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = virtualinvoke v.<org.apache.axiom.weaver.ImplementationNode: java.util.Set getRequiredDescendantsOrSelf()>();
v = staticinvoke <org.apache.axiom.weaver.Weaver$lambda_generate_2__10: java.util.function.Function bootstrap$()>();
v = interfaceinvoke v.<java.util.Map: java.lang.Object computeIfAbsent(java.lang.Object,java.util.function.Function)>(v, v);
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>(v);
goto label;
label:
v = interfaceinvoke v.<java.util.Map: java.util.Collection values()>();
v = interfaceinvoke v.<java.util.Collection: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = interfaceinvoke v.<java.util.Set: int size()>();
if v <= 1 goto label;
staticinvoke <org.apache.axiom.weaver.ImplementationNode: void merge(java.util.Set)>(v);
goto label;
label:
specialinvoke v.<org.apache.axiom.weaver.Weaver: void dump(java.lang.String,boolean)>("Graph after merging nodes:\n", 0);
v = v.<org.apache.axiom.weaver.Weaver: com.github.veithen.jrel.association.MutableReferences nodes>;
v = staticinvoke <org.apache.axiom.weaver.Weaver$reduce__7: java.util.function.Consumer bootstrap$()>();
virtualinvoke v.<com.github.veithen.jrel.association.MutableReferences: void forEach(java.util.function.Consumer)>(v);
specialinvoke v.<org.apache.axiom.weaver.Weaver: void dump(java.lang.String,boolean)>("Graph after applying transitive reduction:\n", 0);
v = v.<org.apache.axiom.weaver.Weaver: com.github.veithen.jrel.association.MutableReferences nodes>;
v = staticinvoke <org.apache.axiom.weaver.Weaver$ensureSingleParent__8: java.util.function.Consumer bootstrap$()>();
virtualinvoke v.<com.github.veithen.jrel.association.MutableReferences: void forEach(java.util.function.Consumer)>(v);
specialinvoke v.<org.apache.axiom.weaver.Weaver: void dump(java.lang.String,boolean)>("Graph after removing multiple inheritance:\n", 0);
specialinvoke v.<org.apache.axiom.weaver.Weaver: void compact()>();
specialinvoke v.<org.apache.axiom.weaver.Weaver: void promoteCommonMixins()>();
specialinvoke v.<org.apache.axiom.weaver.Weaver: void compact()>();
specialinvoke v.<org.apache.axiom.weaver.Weaver: void dump(java.lang.String,boolean)>("Final graph:\n", 1);
v = new java.util.HashMap;
specialinvoke v.<java.util.HashMap: void <init>()>();
v = v.<org.apache.axiom.weaver.Weaver: java.util.Map interfaceNodes>;
v = interfaceinvoke v.<java.util.Map: java.util.Collection values()>();
v = staticinvoke <org.apache.axiom.weaver.Weaver$lambda_generate_3__9: java.util.function.Consumer bootstrap$(java.util.Map)>(v);
interfaceinvoke v.<java.util.Collection: void forEach(java.util.function.Consumer)>(v);
v = new org.apache.axiom.weaver.WeavingContextImpl;
specialinvoke v.<org.apache.axiom.weaver.WeavingContextImpl: void <init>(java.util.Map)>(v);
v = new java.util.ArrayList;
specialinvoke v.<java.util.ArrayList: void <init>()>();
v = v.<org.apache.axiom.weaver.Weaver: com.github.veithen.jrel.association.MutableReferences nodes>;
v = virtualinvoke v.<com.github.veithen.jrel.association.MutableReferences: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = virtualinvoke v.<org.apache.axiom.weaver.ImplementationNode: java.util.List toClassDefinitions(org.apache.axiom.weaver.mixin.WeavingContext)>(v);
interfaceinvoke v.<java.util.List: boolean addAll(java.util.Collection)>(v);
goto label;
label:
v = interfaceinvoke v.<java.util.List: int size()>();
v = newarray (org.apache.axiom.weaver.mixin.ClassDefinition)[v];
v = interfaceinvoke v.<java.util.List: java.lang.Object[] toArray(java.lang.Object[])>(v);
return v;
}
public java.lang.ClassLoader toClassLoader(java.lang.ClassLoader)
{
org.apache.axiom.weaver.Weaver v;
org.apache.axiom.weaver.mixin.ClassDefinition[] v;
org.apache.axiom.weaver.WeavingClassLoader v;
java.lang.ClassLoader v;
v := @this: org.apache.axiom.weaver.Weaver;
v := @parameter: java.lang.ClassLoader;
v = new org.apache.axiom.weaver.WeavingClassLoader;
v = virtualinvoke v.<org.apache.axiom.weaver.Weaver: org.apache.axiom.weaver.mixin.ClassDefinition[] generate()>();
specialinvoke v.<org.apache.axiom.weaver.WeavingClassLoader: void <init>(java.lang.ClassLoader,org.apache.axiom.weaver.mixin.ClassDefinition[])>(v, v);
return v;
}
static void <clinit>()
{
org.apache.commons.logging.Log v;
v = staticinvoke <org.apache.commons.logging.LogFactory: org.apache.commons.logging.Log getLog(java.lang.Class)>(class "Lorg/apache/axiom/weaver/Weaver;");
<org.apache.axiom.weaver.Weaver: org.apache.commons.logging.Log log> = v;
return;
}
}