
Untitled
By: a guest on
Aug 22nd, 2012 | syntax:
None | size: 1.59 KB | hits: 3 | expires: Never
try {
URL url=new URL("foo");
} catch (MalformedURLException e) {
//throw new RuntimeException(e);
sneak(e);
}
StackTrace:
Exception in thread "main" java.net.MalformedURLException: no protocol: foo
at java.net.URL.<init>(URL.java:567)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at foo.Test.main(Test.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
invece di:
try {
URL url=new URL("foo");
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
Exception in thread "main" java.lang.RuntimeException: java.net.MalformedURLException: no protocol: foo
at foo.Test.main(Test.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.net.MalformedURLException: no protocol: foo
at java.net.URL.<init>(URL.java:567)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at foo.Test.main(Test.java:15)
... 5 more