diff --git a/TracerOnJavassist/src/tracer/OutputStatementsGenerator.java b/TracerOnJavassist/src/tracer/OutputStatementsGenerator.java index 76682f7..700afcc 100644 --- a/TracerOnJavassist/src/tracer/OutputStatementsGenerator.java +++ b/TracerOnJavassist/src/tracer/OutputStatementsGenerator.java @@ -1,5 +1,7 @@ package tracer; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; import java.util.ArrayList; import javassist.CtBehavior; @@ -263,9 +265,13 @@ } public String generateInsertBeforeStatementsForClassDefinition(CtClass cc, CtConstructor classInitializer) throws NotFoundException { - String className = "\"" + cc.getName() + "\""; - String classPath = "\"" + cc.getURL().getPath() + "\""; - String loaderPath = "\"" + cc.getClassPool().getClassLoader().getResource("").getPath() + "\""; - return generator.generateInsertBeforeStatementsForClassDefinition(className, classPath, loaderPath); + try { + String className = "\"" + cc.getName() + "\""; + String classPath = "\"" + URLDecoder.decode(cc.getURL().getPath(), "UTF-8") + "\""; // �p�X�� URL encode �ɂȂ��Ă��邽�� + String loaderPath = "\"" + URLDecoder.decode(cc.getClassPool().getClassLoader().getResource("").getPath(), "UTF-8") + "\""; // �p�X�� URL encode �ɂȂ��Ă��邽�� + return generator.generateInsertBeforeStatementsForClassDefinition(className, classPath, loaderPath); + } catch (UnsupportedEncodingException e) { + return ""; + } } }