org_eclipse_winery_model_adaptation_substitution_refinement_tests_TestRefinementTest_java
org.apache.xerces.impl.XMLEntityManager
public String setupCurrentEntity(String string, XMLInputSource xMLInputSource, boolean bl, boolean bl2) throws IOException, XNIException {
        String string2 = xMLInputSource.getPublicId();
        Object object = xMLInputSource.getSystemId();
        String string3 = xMLInputSource.getBaseSystemId();
        String string4 = xMLInputSource.getEncoding();
        boolean bl3 = string4 != null;
        Boolean bl4 = null;
        this.fTempByteBuffer = null;
        InputStream inputStream = null;
        Reader reader = xMLInputSource.getCharacterStream();
        Object object2 = XMLEntityManager.expandSystemId((String)object, string3, this.fStrictURI);
        if (string3 == null) {
            string3 = object2;
        }
        if (reader == null) {
            Object object3;
            inputStream = xMLInputSource.getByteStream();
            if (inputStream == null) {
                object3 = new URL((String)object2);
                URLConnection uRLConnection = ((URL)object3).openConnection();
                if (!(uRLConnection instanceof HttpURLConnection)) {
                    inputStream = uRLConnection.getInputStream();
                } else {
                    Object object4;
                    boolean bl5 = true;
                    if (xMLInputSource instanceof HTTPInputSource) {
                        object4 = (HttpURLConnection)uRLConnection;
                        HTTPInputSource hTTPInputSource = (HTTPInputSource)xMLInputSource;
                        Iterator iterator = hTTPInputSource.getHTTPRequestProperties();
                        while (iterator.hasNext()) {
                            Map.Entry entry = (Map.Entry)iterator.next();
                            ((URLConnection)object4).setRequestProperty((String)entry.getKey(), (String)entry.getValue());
                        }
                        bl5 = hTTPInputSource.getFollowHTTPRedirects();
                        if (!bl5) {
                            XMLEntityManager.setInstanceFollowRedirects((HttpURLConnection)object4, bl5);
                        }
                    }
                    inputStream = uRLConnection.getInputStream();
                    if (bl5 && !((String)(object4 = uRLConnection.getURL().toString())).equals(object2)) {
                        object = object4;
                        object2 = object4;
                    }
                }
            }
            inputStream = new RewindableInputStream(inputStream);
            if (string4 == null) {
                object3 = new byte[4];
                int n = 0;
                while (n < 4) {
                    object3[n] = (byte)inputStream.read();
                    ++n;
                }
                if (n == 4) {
                    Object[] objectArray = this.getEncodingName((byte[])object3, n);
                    string4 = (String)objectArray[0];
                    bl4 = (Boolean)objectArray[1];
                    inputStream.reset();
                    if (n > 2 && string4.equals("UTF-8")) {
                        int n2 = object3[0] & 0xFF;
                        int n3 = object3[1] & 0xFF;
                        int n4 = object3[2] & 0xFF;
                        if (n2 == 239 && n3 == 187 && n4 == 191) {
                            inputStream.skip(3L);
                        }
                    }
                    reader = this.createReader(inputStream, string4, bl4);
                } else {
                    reader = this.createReader(inputStream, string4, bl4);
                }
            } else if ((string4 = string4.toUpperCase(Locale.ENGLISH)).equals("UTF-8")) {
                object3 = new int[3];
                int n = 0;
                while (n < 3) {
                    object3[n] = inputStream.read();
                    if (object3[n] == -1) break;
                    ++n;
                }
                if (n == 3) {
                    if (object3[0] != 239 || object3[1] != 187 || object3[2] != 191) {
                        inputStream.reset();
                    }
                } else {
                    inputStream.reset();
                }
                reader = this.createReader(inputStream, string4, bl4);
            } else if (string4.equals("UTF-16")) {
                object3 = new int[4];
                int n = 0;
                while (n < 4) {
                    object3[n] = inputStream.read();
                    if (object3[n] == -1) break;
                    ++n;
                }
                inputStream.reset();
                String string5 = "UTF-16";
                if (n >= 2) {
                    Object object5 = object3[0];
                    Object object6 = object3[1];
                    if (object5 == 254 && object6 == 255) {
                        string5 = "UTF-16BE";
                        bl4 = Boolean.TRUE;
                    } else if (object5 == 255 && object6 == 254) {
                        string5 = "UTF-16LE";
                        bl4 = Boolean.FALSE;
                    } else if (n == 4) {
                        Object object7 = object3[2];
                        Object object8 = object3[3];
                        if (object5 == false && object6 == 60 && object7 == false && object8 == 63) {
                            string5 = "UTF-16BE";
                            bl4 = Boolean.TRUE;
                        }
                        if (object5 == 60 && object6 == false && object7 == 63 && object8 == false) {
                            string5 = "UTF-16LE";
                            bl4 = Boolean.FALSE;
                        }
                    }
                }
                reader = this.createReader(inputStream, string5, bl4);
            } else if (string4.equals("ISO-10646-UCS-4")) {
                object3 = new int[4];
                int n = 0;
                while (n < 4) {
                    object3[n] = inputStream.read();
                    if (object3[n] == -1) break;
                    ++n;
                }
                inputStream.reset();
                if (n == 4) {
                    if (object3[0] == false && object3[1] == false && object3[2] == false && object3[3] == 60) {
                        bl4 = Boolean.TRUE;
                    } else if (object3[0] == 60 && object3[1] == false && object3[2] == false && object3[3] == false) {
                        bl4 = Boolean.FALSE;
                    }
                }
                reader = this.createReader(inputStream, string4, bl4);
            } else if (string4.equals("ISO-10646-UCS-2")) {
                object3 = new int[4];
                int n = 0;
                while (n < 4) {
                    object3[n] = inputStream.read();
                    if (object3[n] == -1) break;
                    ++n;
                }
                inputStream.reset();
                if (n == 4) {
                    if (object3[0] == false && object3[1] == 60 && object3[2] == false && object3[3] == 63) {
                        bl4 = Boolean.TRUE;
                    } else if (object3[0] == 60 && object3[1] == false && object3[2] == 63 && object3[3] == false) {
                        bl4 = Boolean.FALSE;
                    }
                }
                reader = this.createReader(inputStream, string4, bl4);
            } else {
                reader = this.createReader(inputStream, string4, bl4);
            }
        }
        this.fReaderStack.push(reader);
        if (this.fCurrentEntity != null) {
            this.fEntityStack.push(this.fCurrentEntity);
        }
        this.fCurrentEntity = new ScannedEntity(string, new XMLResourceIdentifierImpl(string2, (String)object, string3, (String)object2), inputStream, reader, this.fTempByteBuffer, string4, bl, false, bl2);
        this.fCurrentEntity.setEncodingExternallySpecified(bl3);
        this.fEntityScanner.setCurrentEntity(this.fCurrentEntity);
        this.fResourceIdentifier.setValues(string2, (String)object, string3, (String)object2);
        return string4;
    }
 -> java.lang.String.length(): int -> java.lang.String.indexOf(int): int -> java.lang.String.lastIndexOf(int,int): int -> java.lang.String.lastIndexOf(int,int): int -> java.lang.String.lastIndexOf(int,int): int -> java.lang.String.length(): int -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.substring(int,int): java.lang.String -> java.lang.String.length(): int -> java.lang.String.trim(): java.lang.String -> java.lang.String.length(): int -> java.lang.String.charAt(int): char -> java.lang.String.length(): int -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.toLowerCase(): java.lang.String -> java.lang.String.length(): int -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.length(): int -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.substring(int,int): java.lang.String -> java.lang.String.length(): int -> java.io.InputStream.read(): int -> java.io.InputStream.read(): int -> java.io.InputStream.read(): int -> java.io.InputStream.read(): int -> java.io.InputStream.read(): int -> java.io.InputStream.read(): int -> java.io.InputStream.read(): int -> java.io.InputStream.read(): int -> java.io.InputStream.reset(): void -> java.lang.String.equals(java.lang.Object): boolean -> java.util.Hashtable.get(java.lang.Object): java.lang.Object -> java.util.Stack.push(java.lang.Object): java.lang.Object
 [CALL] [CALL] [EXIT] [CALL] [EXIT] [CALL] [EXIT] [CALL] [EXIT] [CALL] [EXIT] [CALL] [CALL] [CALL] [CALL] [CALL] -> java.lang.String.length(): int -> java.lang.String.indexOf(int): int -> java.lang.String.lastIndexOf(int,int): int -> java.lang.String.lastIndexOf(int,int): int -> java.lang.String.lastIndexOf(int,int): int [CALL] -> java.lang.String.length(): int -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.substring(int,int): java.lang.String -> java.lang.String.length(): int [CALL] [CALL] -> java.lang.String.trim(): java.lang.String -> java.lang.String.length(): int -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.length(): int -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] [EXIT] -> java.lang.String.toLowerCase(): java.lang.String [EXIT] [EXIT] -> java.lang.String.length(): int -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char [CALL] -> java.lang.String.length(): int [CALL] [EXIT] -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.charAt(int): char [CALL] [EXIT] -> java.lang.String.substring(int,int): java.lang.String [EXIT] [EXIT] [EXIT] [EXIT] [CALL] [EXIT] [CALL] [EXIT] -> java.lang.String.length(): int [EXIT] [EXIT] [CALL] [EXIT] [CALL] [EXIT] -> java.io.InputStream.read(): int [CALL] -> java.io.InputStream.read(): int [EXIT] -> java.io.InputStream.read(): int [CALL] -> java.io.InputStream.read(): int [EXIT] -> java.io.InputStream.read(): int [CALL] -> java.io.InputStream.read(): int [EXIT] -> java.io.InputStream.read(): int [CALL] -> java.io.InputStream.read(): int [EXIT] [CALL] [EXIT] -> java.io.InputStream.reset(): void [CALL] [EXIT] -> java.lang.String.equals(java.lang.Object): boolean [CALL] [CALL] [EXIT] [CALL] -> java.util.Hashtable.get(java.lang.Object): java.lang.Object [EXIT] [CALL] [EXIT] [CALL] [EXIT] [EXIT] -> java.util.Stack.push(java.lang.Object): java.lang.Object [CALL] [CALL] [EXIT] [EXIT] [CALL] [CALL] [EXIT] [CALL] [EXIT] [CALL] [CALL] [EXIT] [EXIT] [CALL] [EXIT] [EXIT] [CALL] [EXIT] [CALL] [EXIT] [CALL] [CALL] [EXIT] [EXIT] [EXIT]