You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sample code snippet throws FileNotFoundException. If the folder structure created manually (c:/app-classpath/sample/app) saveIn works successfully. I am not sure if this is a bug, should i create package structure manually?
Thanks
package sample.app;
import java.io.File;
import net.bytebuddy.ByteBuddy;
import net.bytebuddy.dynamic.DynamicType.Unloaded;
import net.bytebuddy.instrumentation.FixedValue;
import net.bytebuddy.instrumentation.method.matcher.MethodMatchers;
public class Sample {
public String test() {
return null;
}
public static void main(String[] args) throws Exception {
File file = new File("C:\\app-classpath");
file.mkdir();
ByteBuddy buddy = new ByteBuddy();
Unloaded<Sample> unloaded = buddy
.subclass(Sample.class)
.method(MethodMatchers.named("test"))
.intercept(FixedValue.value("test"))
.make();
unloaded.saveIn(file);
}
}
Exception Message:
Exception in thread "main" java.io.FileNotFoundException: C:\app-classpath\sample\app\Sample$ByteBuddy$314824326.class (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:206)
at java.io.FileOutputStream.<init>(FileOutputStream.java:156)
at net.bytebuddy.dynamic.DynamicType$Default.saveIn(DynamicType.java:1289)
at sample.app.Sample.main(Sample.java:25)
Environment:
Windows 8.1
Java 1.8.0_20-b26
The text was updated successfully, but these errors were encountered:
Hi,
The sample code snippet throws FileNotFoundException. If the folder structure created manually (c:/app-classpath/sample/app) saveIn works successfully. I am not sure if this is a bug, should i create package structure manually?
Thanks
Exception Message:
Environment:
Windows 8.1
Java 1.8.0_20-b26
The text was updated successfully, but these errors were encountered: