Java Code Examples for com.sun.java.util.jar.pack.ConstantPool.Entry#stringValue()

The following examples show how to use com.sun.java.util.jar.pack.ConstantPool.Entry#stringValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BandStructure.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
int encodeRef(Entry e, Index ix) {
    if (ix == null)
        throw new RuntimeException("null index for " + e.stringValue());
    int coding = ix.indexOf(e);
    if (verbose > 2)
        Utils.log.fine("putRef "+coding+" => "+e);
    return coding;
}
 
Example 2
Source File: BandStructure.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
static void printArrayTo(PrintStream ps, Entry[] cpMap, int start, int end, boolean showTags) {
    StringBuffer buf = new StringBuffer();
    int len = end-start;
    for (int i = 0; i < len; i++) {
        Entry e = cpMap[start+i];
        ps.print(start+i); ps.print("=");
        if (showTags) { ps.print(e.tag); ps.print(":"); }
        String s = e.stringValue();
        buf.setLength(0);
        for (int j = 0; j < s.length(); j++) {
            char ch = s.charAt(j);
            if (!(ch < ' ' || ch > '~' || ch == '\\')) {
                buf.append(ch);
            } else if (ch == '\\') {
                buf.append("\\\\");
            } else if (ch == '\n') {
                buf.append("\\n");
            } else if (ch == '\t') {
                buf.append("\\t");
            } else if (ch == '\r') {
                buf.append("\\r");
            } else {
                String str = "000"+Integer.toHexString(ch);
                buf.append("\\u").append(str.substring(str.length()-4));
            }
        }
        ps.println(buf);
    }
}
 
Example 3
Source File: BandStructure.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
int encodeRef(Entry e, Index ix) {
    if (ix == null)
        throw new RuntimeException("null index for " + e.stringValue());
    int coding = ix.indexOf(e);
    if (verbose > 2)
        Utils.log.fine("putRef "+coding+" => "+e);
    return coding;
}
 
Example 4
Source File: BandStructure.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
static void printArrayTo(PrintStream ps, Entry[] cpMap, int start, int end, boolean showTags) {
    StringBuffer buf = new StringBuffer();
    int len = end-start;
    for (int i = 0; i < len; i++) {
        Entry e = cpMap[start+i];
        ps.print(start+i); ps.print("=");
        if (showTags) { ps.print(e.tag); ps.print(":"); }
        String s = e.stringValue();
        buf.setLength(0);
        for (int j = 0; j < s.length(); j++) {
            char ch = s.charAt(j);
            if (!(ch < ' ' || ch > '~' || ch == '\\')) {
                buf.append(ch);
            } else if (ch == '\\') {
                buf.append("\\\\");
            } else if (ch == '\n') {
                buf.append("\\n");
            } else if (ch == '\t') {
                buf.append("\\t");
            } else if (ch == '\r') {
                buf.append("\\r");
            } else {
                String str = "000"+Integer.toHexString(ch);
                buf.append("\\u").append(str.substring(str.length()-4));
            }
        }
        ps.println(buf);
    }
}
 
Example 5
Source File: BandStructure.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
int encodeRef(Entry e, Index ix) {
    if (ix == null)
        throw new RuntimeException("null index for " + e.stringValue());
    int coding = ix.indexOf(e);
    if (verbose > 2)
        Utils.log.fine("putRef "+coding+" => "+e);
    return coding;
}
 
Example 6
Source File: BandStructure.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
static void printArrayTo(PrintStream ps, Entry[] cpMap, int start, int end, boolean showTags) {
    StringBuffer buf = new StringBuffer();
    int len = end-start;
    for (int i = 0; i < len; i++) {
        Entry e = cpMap[start+i];
        ps.print(start+i); ps.print("=");
        if (showTags) { ps.print(e.tag); ps.print(":"); }
        String s = e.stringValue();
        buf.setLength(0);
        for (int j = 0; j < s.length(); j++) {
            char ch = s.charAt(j);
            if (!(ch < ' ' || ch > '~' || ch == '\\')) {
                buf.append(ch);
            } else if (ch == '\\') {
                buf.append("\\\\");
            } else if (ch == '\n') {
                buf.append("\\n");
            } else if (ch == '\t') {
                buf.append("\\t");
            } else if (ch == '\r') {
                buf.append("\\r");
            } else {
                String str = "000"+Integer.toHexString(ch);
                buf.append("\\u").append(str.substring(str.length()-4));
            }
        }
        ps.println(buf);
    }
}
 
Example 7
Source File: BandStructure.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
int encodeRef(Entry e, Index ix) {
    if (ix == null)
        throw new RuntimeException("null index for " + e.stringValue());
    int coding = ix.indexOf(e);
    if (verbose > 2)
        Utils.log.fine("putRef "+coding+" => "+e);
    return coding;
}
 
Example 8
Source File: BandStructure.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
static void printArrayTo(PrintStream ps, Entry[] cpMap, int start, int end, boolean showTags) {
    StringBuffer buf = new StringBuffer();
    int len = end-start;
    for (int i = 0; i < len; i++) {
        Entry e = cpMap[start+i];
        ps.print(start+i); ps.print("=");
        if (showTags) { ps.print(e.tag); ps.print(":"); }
        String s = e.stringValue();
        buf.setLength(0);
        for (int j = 0; j < s.length(); j++) {
            char ch = s.charAt(j);
            if (!(ch < ' ' || ch > '~' || ch == '\\')) {
                buf.append(ch);
            } else if (ch == '\\') {
                buf.append("\\\\");
            } else if (ch == '\n') {
                buf.append("\\n");
            } else if (ch == '\t') {
                buf.append("\\t");
            } else if (ch == '\r') {
                buf.append("\\r");
            } else {
                String str = "000"+Integer.toHexString(ch);
                buf.append("\\u").append(str.substring(str.length()-4));
            }
        }
        ps.println(buf);
    }
}
 
Example 9
Source File: BandStructure.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
static void printArrayTo(PrintStream ps, Entry[] cpMap, int start, int end, boolean showTags) {
    StringBuffer buf = new StringBuffer();
    int len = end-start;
    for (int i = 0; i < len; i++) {
        Entry e = cpMap[start+i];
        ps.print(start+i); ps.print("=");
        if (showTags) { ps.print(e.tag); ps.print(":"); }
        String s = e.stringValue();
        buf.setLength(0);
        for (int j = 0; j < s.length(); j++) {
            char ch = s.charAt(j);
            if (!(ch < ' ' || ch > '~' || ch == '\\')) {
                buf.append(ch);
            } else if (ch == '\\') {
                buf.append("\\\\");
            } else if (ch == '\n') {
                buf.append("\\n");
            } else if (ch == '\t') {
                buf.append("\\t");
            } else if (ch == '\r') {
                buf.append("\\r");
            } else {
                String str = "000"+Integer.toHexString(ch);
                buf.append("\\u").append(str.substring(str.length()-4));
            }
        }
        ps.println(buf);
    }
}
 
Example 10
Source File: BandStructure.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
static void printArrayTo(PrintStream ps, Entry[] cpMap, int start, int end, boolean showTags) {
    StringBuffer buf = new StringBuffer();
    int len = end-start;
    for (int i = 0; i < len; i++) {
        Entry e = cpMap[start+i];
        ps.print(start+i); ps.print("=");
        if (showTags) { ps.print(e.tag); ps.print(":"); }
        String s = e.stringValue();
        buf.setLength(0);
        for (int j = 0; j < s.length(); j++) {
            char ch = s.charAt(j);
            if (!(ch < ' ' || ch > '~' || ch == '\\')) {
                buf.append(ch);
            } else if (ch == '\\') {
                buf.append("\\\\");
            } else if (ch == '\n') {
                buf.append("\\n");
            } else if (ch == '\t') {
                buf.append("\\t");
            } else if (ch == '\r') {
                buf.append("\\r");
            } else {
                String str = "000"+Integer.toHexString(ch);
                buf.append("\\u").append(str.substring(str.length()-4));
            }
        }
        ps.println(buf);
    }
}
 
Example 11
Source File: BandStructure.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
int encodeRef(Entry e, Index ix) {
    if (ix == null)
        throw new RuntimeException("null index for " + e.stringValue());
    int coding = ix.indexOf(e);
    if (verbose > 2)
        Utils.log.fine("putRef "+coding+" => "+e);
    return coding;
}
 
Example 12
Source File: BandStructure.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
int encodeRef(Entry e, Index ix) {
    if (ix == null)
        throw new RuntimeException("null index for " + e.stringValue());
    int coding = ix.indexOf(e);
    if (verbose > 2)
        Utils.log.fine("putRef "+coding+" => "+e);
    return coding;
}
 
Example 13
Source File: BandStructure.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
int encodeRef(Entry e, Index ix) {
    if (ix == null)
        throw new RuntimeException("null index for " + e.stringValue());
    int coding = ix.indexOf(e);
    if (verbose > 2)
        Utils.log.fine("putRef "+coding+" => "+e);
    return coding;
}
 
Example 14
Source File: BandStructure.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
static void printArrayTo(PrintStream ps, Entry[] cpMap, int start, int end, boolean showTags) {
    StringBuffer buf = new StringBuffer();
    int len = end-start;
    for (int i = 0; i < len; i++) {
        Entry e = cpMap[start+i];
        ps.print(start+i); ps.print("=");
        if (showTags) { ps.print(e.tag); ps.print(":"); }
        String s = e.stringValue();
        buf.setLength(0);
        for (int j = 0; j < s.length(); j++) {
            char ch = s.charAt(j);
            if (!(ch < ' ' || ch > '~' || ch == '\\')) {
                buf.append(ch);
            } else if (ch == '\\') {
                buf.append("\\\\");
            } else if (ch == '\n') {
                buf.append("\\n");
            } else if (ch == '\t') {
                buf.append("\\t");
            } else if (ch == '\r') {
                buf.append("\\r");
            } else {
                String str = "000"+Integer.toHexString(ch);
                buf.append("\\u").append(str.substring(str.length()-4));
            }
        }
        ps.println(buf);
    }
}
 
Example 15
Source File: BandStructure.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
int encodeRef(Entry e, Index ix) {
    if (ix == null)
        throw new RuntimeException("null index for " + e.stringValue());
    int coding = ix.indexOf(e);
    if (verbose > 2)
        Utils.log.fine("putRef "+coding+" => "+e);
    return coding;
}
 
Example 16
Source File: BandStructure.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
static void printArrayTo(PrintStream ps, Entry[] cpMap, int start, int end, boolean showTags) {
    StringBuffer buf = new StringBuffer();
    int len = end-start;
    for (int i = 0; i < len; i++) {
        Entry e = cpMap[start+i];
        ps.print(start+i); ps.print("=");
        if (showTags) { ps.print(e.tag); ps.print(":"); }
        String s = e.stringValue();
        buf.setLength(0);
        for (int j = 0; j < s.length(); j++) {
            char ch = s.charAt(j);
            if (!(ch < ' ' || ch > '~' || ch == '\\')) {
                buf.append(ch);
            } else if (ch == '\\') {
                buf.append("\\\\");
            } else if (ch == '\n') {
                buf.append("\\n");
            } else if (ch == '\t') {
                buf.append("\\t");
            } else if (ch == '\r') {
                buf.append("\\r");
            } else {
                String str = "000"+Integer.toHexString(ch);
                buf.append("\\u").append(str.substring(str.length()-4));
            }
        }
        ps.println(buf);
    }
}
 
Example 17
Source File: BandStructure.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
static void printArrayTo(PrintStream ps, Entry[] cpMap, int start, int end, boolean showTags) {
    StringBuffer buf = new StringBuffer();
    int len = end-start;
    for (int i = 0; i < len; i++) {
        Entry e = cpMap[start+i];
        ps.print(start+i); ps.print("=");
        if (showTags) { ps.print(e.tag); ps.print(":"); }
        String s = e.stringValue();
        buf.setLength(0);
        for (int j = 0; j < s.length(); j++) {
            char ch = s.charAt(j);
            if (!(ch < ' ' || ch > '~' || ch == '\\')) {
                buf.append(ch);
            } else if (ch == '\\') {
                buf.append("\\\\");
            } else if (ch == '\n') {
                buf.append("\\n");
            } else if (ch == '\t') {
                buf.append("\\t");
            } else if (ch == '\r') {
                buf.append("\\r");
            } else {
                String str = "000"+Integer.toHexString(ch);
                buf.append("\\u").append(str.substring(str.length()-4));
            }
        }
        ps.println(buf);
    }
}
 
Example 18
Source File: BandStructure.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
static void printArrayTo(PrintStream ps, Entry[] cpMap, int start, int end, boolean showTags) {
    StringBuffer buf = new StringBuffer();
    int len = end-start;
    for (int i = 0; i < len; i++) {
        Entry e = cpMap[start+i];
        ps.print(start+i); ps.print("=");
        if (showTags) { ps.print(e.tag); ps.print(":"); }
        String s = e.stringValue();
        buf.setLength(0);
        for (int j = 0; j < s.length(); j++) {
            char ch = s.charAt(j);
            if (!(ch < ' ' || ch > '~' || ch == '\\')) {
                buf.append(ch);
            } else if (ch == '\\') {
                buf.append("\\\\");
            } else if (ch == '\n') {
                buf.append("\\n");
            } else if (ch == '\t') {
                buf.append("\\t");
            } else if (ch == '\r') {
                buf.append("\\r");
            } else {
                String str = "000"+Integer.toHexString(ch);
                buf.append("\\u").append(str.substring(str.length()-4));
            }
        }
        ps.println(buf);
    }
}
 
Example 19
Source File: BandStructure.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
int encodeRef(Entry e, Index ix) {
    if (ix == null)
        throw new RuntimeException("null index for " + e.stringValue());
    int coding = ix.indexOf(e);
    if (verbose > 2)
        Utils.log.fine("putRef "+coding+" => "+e);
    return coding;
}
 
Example 20
Source File: BandStructure.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
static void printArrayTo(PrintStream ps, Entry[] cpMap, int start, int end, boolean showTags) {
    StringBuffer buf = new StringBuffer();
    int len = end-start;
    for (int i = 0; i < len; i++) {
        Entry e = cpMap[start+i];
        ps.print(start+i); ps.print("=");
        if (showTags) { ps.print(e.tag); ps.print(":"); }
        String s = e.stringValue();
        buf.setLength(0);
        for (int j = 0; j < s.length(); j++) {
            char ch = s.charAt(j);
            if (!(ch < ' ' || ch > '~' || ch == '\\')) {
                buf.append(ch);
            } else if (ch == '\\') {
                buf.append("\\\\");
            } else if (ch == '\n') {
                buf.append("\\n");
            } else if (ch == '\t') {
                buf.append("\\t");
            } else if (ch == '\r') {
                buf.append("\\r");
            } else {
                String str = "000"+Integer.toHexString(ch);
                buf.append("\\u").append(str.substring(str.length()-4));
            }
        }
        ps.println(buf);
    }
}