Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 22nd, 2012  |  syntax: None  |  size: 1.59 KB  |  hits: 3  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  try {
  2.              URL url=new URL("foo");
  3. } catch (MalformedURLException e) {
  4.             //throw new RuntimeException(e);
  5.                 sneak(e);
  6. }
  7.  
  8. StackTrace:
  9.  
  10. Exception in thread "main" java.net.MalformedURLException: no protocol: foo
  11.         at java.net.URL.<init>(URL.java:567)
  12.         at java.net.URL.<init>(URL.java:464)
  13.         at java.net.URL.<init>(URL.java:413)
  14.         at foo.Test.main(Test.java:15)
  15.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  16.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  17.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  18.         at java.lang.reflect.Method.invoke(Method.java:597)
  19.         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
  20.  
  21. invece di:
  22.  
  23. try {
  24.              URL url=new URL("foo");
  25.          } catch (MalformedURLException e) {
  26.             throw new RuntimeException(e);
  27.  
  28.          }
  29.  
  30.  
  31. Exception in thread "main" java.lang.RuntimeException: java.net.MalformedURLException: no protocol: foo
  32.         at foo.Test.main(Test.java:17)
  33.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  34.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  35.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  36.         at java.lang.reflect.Method.invoke(Method.java:597)
  37.         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
  38. Caused by: java.net.MalformedURLException: no protocol: foo
  39.         at java.net.URL.<init>(URL.java:567)
  40.         at java.net.URL.<init>(URL.java:464)
  41.         at java.net.URL.<init>(URL.java:413)
  42.         at foo.Test.main(Test.java:15)
  43.         ... 5 more