| 148 | * |
| 149 | */ |
| 150 | public static class CompiledCode extends SimpleJavaFileObject { |
| 151 | private ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
| 152 | private String className; |
| 153 | |
| 154 | public CompiledCode(String className) throws Exception { |
| 155 | super(new URI(className), Kind.CLASS); |
| 156 | this.className = className; |
| 157 | } |
| 158 | |
| 159 | public String getClassName() { |
| 160 | return className; |
| 161 | } |
| 162 | |
| 163 | @Override |
| 164 | public OutputStream openOutputStream() throws IOException { |
| 165 | return baos; |
| 166 | } |
| 167 | |
| 168 | public byte[] getByteCode() { |
| 169 | return baos.toByteArray(); |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | |
| 174 | public static class DynamicClassLoader extends ClassLoader { |
nothing calls this directly
no outgoing calls
no test coverage detected