mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-05 07:58:40 +00:00
4504275: CORBA boolean type unions do not generate compilable code from idlj
JLS doesn't allow boolean type in switch statement, hence substituted by if statement. Reviewed-by: lancea
This commit is contained in:
parent
662cdf0746
commit
83a4efe565
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -258,6 +258,19 @@ public class UnionGen implements com.sun.tools.corba.se.idl.UnionGen, JavaGenera
|
||||
{
|
||||
Vector labels = vectorizeLabels (u.branches (), true);
|
||||
|
||||
if (Util.javaName(utype).equals ("boolean")) {
|
||||
stream.println( "" ) ;
|
||||
stream.println( " private void verifyDefault (boolean discriminator)" ) ;
|
||||
stream.println( " {" ) ;
|
||||
if (labels.contains ("true"))
|
||||
stream.println (" if ( discriminator )");
|
||||
else
|
||||
stream.println (" if ( !discriminator )");
|
||||
stream.println( " throw new org.omg.CORBA.BAD_OPERATION();" ) ;
|
||||
stream.println( " }" ) ;
|
||||
return;
|
||||
}
|
||||
|
||||
stream.println( "" ) ;
|
||||
stream.println( " private void verifyDefault( " + Util.javaName(utype) +
|
||||
" value )" ) ;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user