/*
 * Decompiled with CFR 0_110.
 * 
 * Could not load the following classes:
 *  java.lang.Class
 *  java.lang.Float
 *  java.lang.Integer
 *  java.lang.Object
 *  java.lang.String
 *  java.lang.Throwable
 *  java.lang.ref.WeakReference
 *  java.lang.reflect.Constructor
 *  java.util.Map
 */
package org.dom4j.tree;

import java.lang.ref.WeakReference;
import java.lang.reflect.Constructor;
import java.util.Map;
import org.dom4j.Namespace;
import org.dom4j.tree.ConcurrentReaderHashMap;

public class NamespaceCache {
    private static final String CONCURRENTREADERHASHMAP_CLASS = "EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap";
    protected static Map cache;
    protected static Map noPrefixCache;

    static {
        try {
            Class class_ = Class.forName((String)"java.util.concurrent.ConcurrentHashMap");
            Class[] arrclass = new Class[]{Integer.TYPE, Float.TYPE, Integer.TYPE};
            Constructor constructor = class_.getConstructor(arrclass);
            Object[] arrobject = new Object[]{new Integer(11), new Float(0.75f), new Integer(1)};
            cache = (Map)constructor.newInstance(arrobject);
            Object[] arrobject2 = new Object[]{new Integer(11), new Float(0.75f), new Integer(1)};
            noPrefixCache = (Map)constructor.newInstance(arrobject2);
        }
        catch (Throwable var0_5) {
            try {
                Class class_ = Class.forName((String)"EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap");
                cache = (Map)class_.newInstance();
                noPrefixCache = (Map)class_.newInstance();
            }
            catch (Throwable var1_7) {
                cache = new ConcurrentReaderHashMap();
                noPrefixCache = new ConcurrentReaderHashMap();
            }
        }
    }

    protected Namespace createNamespace(String string2, String string3) {
        return new Namespace(string2, string3);
    }

    /*
     * Enabled aggressive block sorting
     * Enabled unnecessary exception pruning
     * Enabled aggressive exception aggregation
     */
    public Namespace get(String string2) {
        Map map;
        WeakReference weakReference = (WeakReference)noPrefixCache.get((Object)string2);
        Namespace namespace = null;
        if (weakReference != null && (namespace = (Namespace)weakReference.get()) != null) {
            return namespace;
        }
        Map map2 = map = noPrefixCache;
        synchronized (map2) {
            WeakReference weakReference2 = (WeakReference)noPrefixCache.get((Object)string2);
            if (weakReference2 != null) {
                namespace = (Namespace)weakReference2.get();
            }
            if (namespace == null) {
                namespace = this.createNamespace("", string2);
                noPrefixCache.put((Object)string2, (Object)new WeakReference((Object)namespace));
            }
            return namespace;
        }
    }

    /*
     * Enabled aggressive block sorting
     * Enabled unnecessary exception pruning
     * Enabled aggressive exception aggregation
     */
    public Namespace get(String string2, String string3) {
        Map map = this.getURICache(string3);
        WeakReference weakReference = (WeakReference)map.get((Object)string2);
        Namespace namespace = null;
        if (weakReference != null && (namespace = (Namespace)weakReference.get()) != null) {
            return namespace;
        }
        Map map2 = map;
        synchronized (map2) {
            WeakReference weakReference2 = (WeakReference)map.get((Object)string2);
            if (weakReference2 != null) {
                namespace = (Namespace)weakReference2.get();
            }
            if (namespace == null) {
                namespace = this.createNamespace(string2, string3);
                map.put((Object)string2, (Object)new WeakReference((Object)namespace));
            }
            return namespace;
        }
    }

    /*
     * Exception decompiling
     */
    protected Map getURICache(String var1) {
        // This method has failed to decompile.  When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
        // java.util.ConcurrentModificationException
        // java.util.LinkedList$ReverseLinkIterator.next(LinkedList.java:217)
        // org.benf.cfr.reader.bytecode.analysis.structured.statement.Block.extractLabelledBlocks(Block.java:212)
        // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement$LabelledBlockExtractor.transform(Op04StructuredStatement.java:485)
        // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.transform(Op04StructuredStatement.java:639)
        // org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.insertLabelledBlocks(Op04StructuredStatement.java:649)
        // org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:816)
        // org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:220)
        // org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:165)
        // org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:91)
        // org.benf.cfr.reader.entities.Method.analyse(Method.java:354)
        // org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:751)
        // org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:683)
        // org.benf.cfr.reader.Main.doJar(Main.java:128)
        // com.njlabs.showjava.processor.JavaExtractor$1.run(JavaExtractor.java:84)
        // java.lang.Thread.run(Thread.java:818)
        throw new IllegalStateException("Decompilation failed");
    }
}

