< prev index next >
core/org.openjdk.jmc.agent/src/test/java/org/openjdk/jmc/agent/test/util/TestToolkit.java
Print this page
@@ -46,15 +46,15 @@
public final class TestToolkit {
public static final Random RND = new Random();
private TestToolkit() {
- throw new UnsupportedOperationException("Not to be instantiated."); //$NON-NLS-1$
+ throw new UnsupportedOperationException("Not to be instantiated.");
}
public static byte[] getByteCode(Class<?> c) throws IOException {
- InputStream is = c.getClassLoader().getResourceAsStream(c.getName().replace('.', '/') + ".class"); //$NON-NLS-1$
+ InputStream is = c.getClassLoader().getResourceAsStream(c.getName().replace('.', '/') + ".class");
return readFully(is, -1, true);
}
public static byte[] readFully(InputStream is, int length, boolean readAll) throws IOException {
byte[] output = {};
@@ -73,11 +73,11 @@
bytesToRead = output.length - pos;
}
int cc = is.read(output, pos, bytesToRead);
if (cc < 0) {
if (readAll && length != Integer.MAX_VALUE) {
- throw new EOFException("Detect premature EOF"); //$NON-NLS-1$
+ throw new EOFException("Detect premature EOF");
} else {
if (output.length != pos) {
output = Arrays.copyOf(output, pos);
}
break;
@@ -101,21 +101,21 @@
}
public static InputStream getProbesXML(String testName) {
try {
String s = readTemplate();
- s = s.replaceAll("%TEST_NAME%", testName); //$NON-NLS-1$
+ s = s.replaceAll("%TEST_NAME%", testName);
return new ByteArrayInputStream(s.getBytes());
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
private static String readTemplate() throws IOException {
- InputStream inputStream = InstrumentMe.class.getResourceAsStream("jfrprobes_template.xml"); //$NON-NLS-1$
+ InputStream inputStream = InstrumentMe.class.getResourceAsStream("jfrprobes_template.xml");
String s = readString(inputStream);
closeSilently(inputStream);
return s;
}
@@ -130,11 +130,11 @@
private static String readString(BufferedReader reader) throws IOException {
String s;
StringBuilder builder = new StringBuilder();
try {
while ((s = reader.readLine()) != null) {
- builder.append(s + "\r"); //$NON-NLS-1$
+ builder.append(s + "\r");
}
s = builder.toString();
} finally {
closeSilently(reader);
}
< prev index next >