hoseindoost / decojer

Automatically exported from code.google.com/p/decojer
0 stars 0 forks source link

guava LocalCache - AccessQueue first load! #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
10.08.2013 22:12:46 org.decojer.cavaj.model.CU decompile
WARNUNG: Cannot transform 
'com.google.common.cache.LocalCache$AccessQueue$2.<init>(Lcom/google/common/cach
e/LocalCache$AccessQueue;Lcom/google/common/cache/LocalCache$ReferenceEntry;)V 
(ops: 7, regs: 3)'!
java.lang.AssertionError: <
    at org.decojer.cavaj.model.DU.parseMethodParamTs(DU.java:370)
    at org.decojer.cavaj.model.M.<init>(M.java:87)
    at org.decojer.cavaj.model.T.getM(T.java:651)

 static final class AccessQueue<K, V> extends AbstractQueue<ReferenceEntry<K, V>> {

runs into this:
    public T getSuperT() {
        if (this.superT == null && isUnresolvable()) {
            return null;
        }

superT is loaded in loader, but somewhere is it reset? then it's loaded by 
classloader and runs into this in ClassT - enclosingMethod:

            // TODO difficult...have only generic types here, not original descriptor
            this.enclosing = methodT.getM(enclosingMethod.getName(), "<TODO>");

Original issue reported on code.google.com by andrePan...@gmail.com on 10 Aug 2013 at 8:43

GoogleCodeExporter commented 8 years ago
Improved assert:
10.08.2013 22:43:58 org.decojer.cavaj.model.CU decompile
WARNUNG: Cannot transform 
'com.google.common.cache.LocalCache$AccessQueue$2.<init>(Lcom/google/common/cach
e/LocalCache$AccessQueue;Lcom/google/common/cache/LocalCache$ReferenceEntry;)V 
(ops: 7, regs: 3)'!
java.lang.AssertionError: Signature '<TODO>', pos 0, char: <
    at org.decojer.cavaj.model.DU.parseMethodParamTs(DU.java:371)

Original comment by andrePan...@gmail.com on 10 Aug 2013 at 8:44

GoogleCodeExporter commented 8 years ago
checked: we read the full type with proper super in ASM-reader

but it's a generic class,
maybe we reference the none-generic variant somewhere and this leads to double 
types, generic and pure?!

Original comment by andrePan...@gmail.com on 10 Aug 2013 at 8:48

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
name: com/google/common/cache/LocalCache$AccessQueue$2
access: 32
super: com/google/common/collect/AbstractSequentialIterator
signature: 
Lcom/google/common/collect/AbstractSequentialIterator<Lcom/google/common/cache/L
ocalCache$ReferenceEntry<TK;TV;>;>;

superS: 
com.google.common.collect.AbstractSequentialIterator<com.google.common.cache.Loc
alCache$ReferenceEntry<K,V>>

later resolving doesn't get same instance for same name!

next steps: check du.ts cache, something is off

Original comment by andrePan...@gmail.com on 10 Aug 2013 at 9:08

GoogleCodeExporter commented 8 years ago
this is the problem 1, double instance:

        if (enclosing != null) {
            // don't use getT() with cache, enclosing could be uncachable (like type var)
            // FIXME if enclosing is ParamT we get problematic names...special InnerT for this case?
            t = new ClassT(this, enclosing.getName() + "$"
                    + s.substring(start, c.pos).replace('/', '.'));
            ((ClassT) t).setEnclosingT(enclosing);
        } else {
            t = getT(s.substring(start, c.pos).replace('/', '.'));
        }

problem 2 is the missing reflective code...

Original comment by andrePan...@gmail.com on 12 Aug 2013 at 7:40

GoogleCodeExporter commented 8 years ago
fixed 1) enclosings can be ParamT, use getRawT() and again getT() to prevent 
double loads and improve compares

2: reflexive code for getM(class loader reflex) still open

Original comment by andrePan...@gmail.com on 12 Aug 2013 at 9:01

GoogleCodeExporter commented 8 years ago
questions:

what is classT.getName() with type params?

what is paramT.getName() with typeArgs?

what is paramT.classT.getName(), what is classT.enclosingT.getName()?

Original comment by andrePan...@gmail.com on 12 Aug 2013 at 9:37

GoogleCodeExporter commented 8 years ago
1) solved now:
paramT now always has name without <arguments>,
else getSimpleName() etc. will not work.

2) open, reflexive stuff

Original comment by andrePan...@gmail.com on 12 Aug 2013 at 11:29

GoogleCodeExporter commented 8 years ago
fully fixed, reflexive trick with private method for now

Original comment by andrePan...@gmail.com on 12 Aug 2013 at 2:47