Merge

Wed, 08 May 2013 10:09:18 +0100

author
chegar
date
Wed, 08 May 2013 10:09:18 +0100
changeset 479
4fe1edbec7bc
parent 478
80161c61aa68
parent 465
fe4150590ee5
child 480
e9c924d3475c

Merge

     1.1 --- a/.hgtags	Tue Apr 30 11:53:51 2013 +0100
     1.2 +++ b/.hgtags	Wed May 08 10:09:18 2013 +0100
     1.3 @@ -209,3 +209,4 @@
     1.4  9583a6431596bac1959d2d8828f5ea217843dd12 jdk8-b85
     1.5  44a8ce4a759f2668ff434661a93ff462ea472478 jdk8-b86
     1.6  f1709874d55a06bc3d5dfa02dbcdfbc59f4cba34 jdk8-b87
     1.7 +4e3a881ebb1ee96ce0872508b0066d74f310dbfa jdk8-b88
     2.1 --- a/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/UnionGen.java	Tue Apr 30 11:53:51 2013 +0100
     2.2 +++ b/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/UnionGen.java	Wed May 08 10:09:18 2013 +0100
     2.3 @@ -1,5 +1,5 @@
     2.4  /*
     2.5 - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
     2.6 + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
     2.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.8   *
     2.9   * This code is free software; you can redistribute it and/or modify it
    2.10 @@ -258,6 +258,19 @@
    2.11    {
    2.12      Vector labels = vectorizeLabels (u.branches (), true);
    2.13  
    2.14 +    if (Util.javaName(utype).equals ("boolean")) {
    2.15 +        stream.println( "" ) ;
    2.16 +        stream.println( "  private void verifyDefault (boolean discriminator)" ) ;
    2.17 +        stream.println( "  {" ) ;
    2.18 +        if (labels.contains ("true"))
    2.19 +            stream.println ("    if ( discriminator )");
    2.20 +        else
    2.21 +            stream.println ("    if ( !discriminator )");
    2.22 +        stream.println( "        throw new org.omg.CORBA.BAD_OPERATION();" ) ;
    2.23 +        stream.println( "  }" ) ;
    2.24 +        return;
    2.25 +    }
    2.26 +
    2.27      stream.println( "" ) ;
    2.28      stream.println( "  private void verifyDefault( " + Util.javaName(utype) +
    2.29          " value )" ) ;
    2.30 @@ -763,7 +776,7 @@
    2.31              stream.println (indent + "if (" + disName + ')');
    2.32  
    2.33              if (firstBranch == null)
    2.34 -                stream.println (indent + "  throw new org.omg.CORBA.BAD_OPERATION ();");
    2.35 +                stream.println (indent + "  value._default(" + disName + ");");
    2.36              else {
    2.37                  stream.println (indent + '{');
    2.38                  index = readBranch (index, indent + "  ", firstBranch.typedef.name (),
    2.39 @@ -774,7 +787,7 @@
    2.40              stream.println (indent + "else");
    2.41  
    2.42              if (secondBranch == null)
    2.43 -                stream.println (indent + "  throw new org.omg.CORBA.BAD_OPERATION ();");
    2.44 +                stream.println (indent + "  value._default(" + disName + ");");
    2.45              else {
    2.46                  stream.println (indent + '{');
    2.47                  index = readBranch (index, indent + "  ", secondBranch.typedef.name (),
    2.48 @@ -924,23 +937,25 @@
    2.49          firstBranch = secondBranch;
    2.50          secondBranch = tmp;
    2.51        }
    2.52 -      stream.println (indent + "if (" + disName + ')');
    2.53 -      if (firstBranch == null)
    2.54 -        stream.println (indent + "  throw new org.omg.CORBA.BAD_OPERATION ();");
    2.55 -      else
    2.56 -      {
    2.57 -        stream.println (indent + '{');
    2.58 -        index = writeBranch (index, indent + "  ", name, firstBranch.typedef, stream);
    2.59 -        stream.println (indent + '}');
    2.60 -      }
    2.61 -      stream.println (indent + "else");
    2.62 -      if (secondBranch == null)
    2.63 -        stream.println (indent + "  throw new org.omg.CORBA.BAD_OPERATION ();");
    2.64 -      else
    2.65 -      {
    2.66 -        stream.println (indent + '{');
    2.67 -        index = writeBranch (index, indent + "  ", name, secondBranch.typedef, stream);
    2.68 -        stream.println (indent + '}');
    2.69 +      if (firstBranch != null && secondBranch != null) {
    2.70 +          stream.println (indent + "if (" + disName + ')');
    2.71 +          stream.println (indent + '{');
    2.72 +          index = writeBranch (index, indent + "  ", name, firstBranch.typedef, stream);
    2.73 +          stream.println (indent + '}');
    2.74 +          stream.println (indent + "else");
    2.75 +          stream.println (indent + '{');
    2.76 +          index = writeBranch (index, indent + "  ", name, secondBranch.typedef, stream);
    2.77 +          stream.println (indent + '}');
    2.78 +      } else if (firstBranch != null) {
    2.79 +          stream.println (indent + "if (" + disName + ')');
    2.80 +          stream.println (indent + '{');
    2.81 +          index = writeBranch (index, indent + "  ", name, firstBranch.typedef, stream);
    2.82 +          stream.println (indent + '}');
    2.83 +      } else {
    2.84 +          stream.println (indent + "if (!" + disName + ')');
    2.85 +          stream.println (indent + '{');
    2.86 +          index = writeBranch (index, indent + "  ", name, secondBranch.typedef, stream);
    2.87 +          stream.println (indent + '}');
    2.88        }
    2.89      }
    2.90      return index;

mercurial