/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7029150
* @summary Test support for union types
* @library ../../../lib
*/
enum TestKind {
"VariableTree: E1 e",
"VariableTree: elem EXCEPTION_PARAMETER e",
"VariableTree: elem.type DECLARED",
"VariableTree: elem.type.elem CLASS E1",
"VariableTree: type DECLARED",
"VariableTree: type.elem CLASS E1",
"VariableTree: type.elem.type DECLARED"),
"VariableTree: E1 | E2 e",
"VariableTree: elem EXCEPTION_PARAMETER e",
"VariableTree: elem.type UNION Test.E1,Test.E2",
"VariableTree: elem.type.elem null",
"VariableTree: type UNION Test.E1,Test.E2",
"VariableTree: type.elem null"),
"VariableTree: E1 | EMissing e",
"VariableTree: elem EXCEPTION_PARAMETER e",
"VariableTree: elem.type UNION Test.E1,EMissing",
"VariableTree: elem.type.elem null",
"VariableTree: type UNION Test.E1,EMissing",
"VariableTree: type.elem null"),
"VariableTree: E1 | E2 e",
"VariableTree: elem EXCEPTION_PARAMETER e",
"VariableTree: elem.type UNION Test.E1,Test.E2",
"VariableTree: elem.type.elem null",
"VariableTree: type UNION Test.E1,Test.E2",
"VariableTree: type.elem null");
this.throwsTypes = throwsTypes;
this.catchTypes = catchTypes;
}
}
"class Test {\n"
+ " class E1 extends Exception { }\n"
+ " class E2 extends Exception { }\n"
+ " void doSomething() throws #T { }\n"
+ " void test() {\n"
+ " try {\n"
+ " doSomething();\n"
+ " } catch (#C e) {\n"
+ " }\n"
+ " }\n"
+ "}\n";
}
return template
}
}
TestUnionType p = new TestUnionType();
JavaCompiler.CompilationTask task = comp.getTask(null, null, null, options, null, Arrays.asList(fo));
if (!ok)
throw new Exception("compilation failed unexpectedly");
throw new Exception("unexpected output from test");
}
}
}
}
if (!roundEnv.processingOver()) {
}
}
return true;
}
}
TreePath p = getCurrentPath();
}
}
}
}
}
}
}
}
}
}