Lines 5347-5352
Link Here
|
5347 |
false /* skipJavac */); |
5347 |
false /* skipJavac */); |
5348 |
} |
5348 |
} |
5349 |
|
5349 |
|
|
|
5350 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=295260 |
5351 |
public void test0535_try_finally() { |
5352 |
this.runConformTest( |
5353 |
new String[] { |
5354 |
"X.java", |
5355 |
"public class X {\n" + |
5356 |
" public void test3(String[] args) {\n" + |
5357 |
" while (true) {\n" + |
5358 |
" Object a = null;\n" + |
5359 |
" try {\n" + |
5360 |
" a = new Object();\n" + |
5361 |
" } catch (Exception e) {\n" + |
5362 |
" } finally {\n" + |
5363 |
" if (a != null)\n" + |
5364 |
" a = null;\n" + // quiet |
5365 |
" }\n" + |
5366 |
" }\n" + |
5367 |
" }\n"+ |
5368 |
"}", |
5369 |
}, |
5370 |
""); |
5371 |
} |
5372 |
|
5350 |
// null analysis -- try/catch |
5373 |
// null analysis -- try/catch |
5351 |
public void test0550_try_catch() { |
5374 |
public void test0550_try_catch() { |
5352 |
this.runConformTest( |
5375 |
this.runConformTest( |
Lines 5859-5864
Link Here
|
5859 |
""); |
5882 |
""); |
5860 |
} |
5883 |
} |
5861 |
|
5884 |
|
|
|
5885 |
// null analysis - try/catch for checked exceptions |
5886 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=295260 |
5887 |
public void test0567_try_catch_checked_exception() { |
5888 |
this.runConformTest( |
5889 |
new String[] { |
5890 |
"X.java", |
5891 |
"import java.net.MalformedURLException;\n" + |
5892 |
"import java.net.URL;\n" + |
5893 |
"public class X {\n" + |
5894 |
" public void test1(String[] args) {\n" + |
5895 |
" URL[] urls = null;\n" + |
5896 |
" try {\n" + |
5897 |
" urls = new URL[args.length];\n" + |
5898 |
" for (int i = 0; i < args.length; i++)\n" + |
5899 |
" urls[i] = new URL(\"http\", \"\", -1, args[i]);\n" + |
5900 |
" }\n" + |
5901 |
" catch (MalformedURLException mfex) {\n" + |
5902 |
" urls = null;\n" + // quiet |
5903 |
" }\n" + |
5904 |
" }\n" + |
5905 |
"}", |
5906 |
}, |
5907 |
""); |
5908 |
} |
5909 |
|
5910 |
// null analysis - try/catch for checked exceptions with finally block |
5911 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=295260 |
5912 |
public void test0568_try_catch_checked_exception() { |
5913 |
this.runConformTest( |
5914 |
new String[] { |
5915 |
"X.java", |
5916 |
"import java.net.MalformedURLException;\n" + |
5917 |
"import java.net.URL;\n" + |
5918 |
"public class X {\n" + |
5919 |
" public void test1(String[] args) {\n" + |
5920 |
" URL[] urls = null;\n" + |
5921 |
" try {\n" + |
5922 |
" urls = new URL[args.length];\n" + |
5923 |
" for (int i = 0; i < args.length; i++)\n" + |
5924 |
" urls[i] = new URL(\"http\", \"\", -1, args[i]);\n" + |
5925 |
" }\n" + |
5926 |
" catch (MalformedURLException mfex) {\n" + |
5927 |
" urls = null;\n" + // quiet |
5928 |
" }\n" + |
5929 |
" finally{\n"+ |
5930 |
" System.out.println(\"complete\");\n" + |
5931 |
" }\n" + |
5932 |
" }\n" + |
5933 |
"}", |
5934 |
}, |
5935 |
""); |
5936 |
} |
5937 |
|
5862 |
// null analysis - throw |
5938 |
// null analysis - throw |
5863 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=201182 |
5939 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=201182 |
5864 |
public void test0595_throw() { |
5940 |
public void test0595_throw() { |