/*
* 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
/*
* Licensed Materials - Property of IBM
* RMI-IIOP v1.0
* Copyright IBM Corp. 1998 1999 All Rights Reserved
*
*/
/**
* A CompoundType is an abstract base class for all IIOP class and
* interface types.
*
* @author Bryan Atsatt
*/
protected boolean isCORBAObject = false;
protected boolean isIDLEntity = false;
protected boolean isAbstractBase = false;
protected boolean isValueBase = false;
protected boolean isCORBAUserException = false;
protected boolean isException = false;
protected boolean isCheckedException = false;
protected boolean isRemoteExceptionOrSubclass = false;
//_____________________________________________________________________
// Public Interfaces
//_____________________________________________________________________
/**
* Return true if this type implements
* org.omg.CORBA.Object.
*/
public boolean isCORBAObject () {
return isCORBAObject;
}
/**
* Return true if this type implements
* org.omg.CORBA.portable.IDLEntity.
*/
public boolean isIDLEntity () {
return isIDLEntity;
}
/**
* Return true if this type implements
* org.omg.CORBA.portable.ValueBase.
*/
public boolean isValueBase () {
return isValueBase;
}
/**
* Return true if this type is a CORBA
* abstract interface.
*/
public boolean isAbstractBase () {
return isAbstractBase;
}
/**
* Return true if this type is an exception.
*/
public boolean isException () {
return isException;
}
/**
* Return true if this type is a "checked" exception.
* Result if valid iff isException() returns true.
*/
public boolean isCheckedException () {
return isCheckedException;
}
/**
* Return true if this type is a java.rmi.RemoteException
* or one of its subclasses. Result if valid iff isException()
* returns true.
*/
public boolean isRemoteExceptionOrSubclass () {
return isRemoteExceptionOrSubclass;
}
/**
* Return true if this type is exactly
* org.omg.CORBA.UserException.
*/
public boolean isCORBAUserException () {
return isCORBAUserException;
}
/**
* Return true if this type implements
* isIDLEntity() && isException().
*/
public boolean isIDLEntityException () {
return isIDLEntity() && isException();
}
/**
* Return true if isIDLEntity() && !isValueBase()
* && !isAbstractBase() && !isCORBAObject()
* && !isIDLEntityException().
*/
public boolean isBoxed () {
return (isIDLEntity() && !isValueBase() &&
!isAbstractBase() && !isCORBAObject() &&
!isIDLEntityException());
}
/**
* If this type represents an exception, return the
* IDL name including the "Ex" mangling, otherwise
* return null.
*/
return idlExceptionName;
}
/**
* If this type represents an exception, return the
* qualified IDL name including the "Ex" mangling,
* otherwise return null.
* @param global If true, prepends "::".
*/
if (qualifiedIDLExceptionName != null &&
global &&
return IDL_NAME_SEPARATOR + qualifiedIDLExceptionName;
} else {
return qualifiedIDLExceptionName;
}
}
/**
* Return signature for this type (e.g. com.acme.Dynamite
* would return "com.acme.Dynamite", byte = "B")
*/
}
return sig;
}
/**
* Return the ClassDeclaration for this type.
*/
return classDecl;
}
/**
* Return the ClassDefinition for this type.
*/
return classDef;
}
/**
* Return the parent class of this type. Returns null if this
* type is an interface or if there is no parent.
*/
return null;
}
/**
* Return an array of interfaces directly implemented by this type.
* <p>
* The order of the array returned is arbitrary.
*/
if( interfaces != null ) {
}
return null;
}
/**
* Return an array of Type.Method objects representing all
* of the methods implemented directly by this type.
*/
}
return null;
}
/**
* Return an array of Type.Member objects representing all of
* the data members directly implemented by this interface.
*/
}
return null;
}
/**
* Create a CompoundType object for the given class.
*
* If the class is not a properly formed or if some other error occurs, the
* return value will be null, and errors will have been reported to the
* supplied BatchEnvironment.
*/
try {
} catch (ClassCastException e) {}
return result;
}
//_____________________________________________________________________
//_____________________________________________________________________
/**
* Release all resources.
*/
protected void destroy () {
if (!destroyed) {
super.destroy();
}
}
if (interfaces != null) {
}
interfaces = null;
}
}
}
}
}
/*
* Load a Class instance. Return null if fail.
*/
// To avoid getting out-of-date Class instances, and
// to ensure that there is an instance, we must compile
// any classes that we've seen and which are not yet
// compiled. We can't just compile this class, 'cuz it
// may have dependencies on classes which have not been
// compiled...
try {
}
env.flushErrors();
}
// Now try to get the Class...
// The outer try block is there for people who might want to use
// the compiler at run-time of their AS.
// They could set and use their own context class loader for loading
// classes directly.
try {
} catch(ClassNotFoundException cfe) {
try {
} catch (NullPointerException e) {
// This should never happen
} catch (ClassNotFoundException e) {
// Fall through to the next case (which is to look in the
// output directory for generated files)
}
}
/* This piece of code used to cause the compiler to ignore jar files
on its classpath
try {
ourClass = Util.loadClass(getQualifiedName(),null,null);
} catch (ClassNotFoundException e) {
} catch (LinkageError e) {
}
*/
// Try one last thing. If the class was compiled into
// a directory that's not in the classpath, the load
// will fail. Let's get the bits off the disk and load
// it directly...
}
}
try {
} catch (Exception e) {}
}
return ourClass;
}
// Print "extends XX"
boolean useQualifiedNames,
boolean useIDLNames,
boolean globalIDLNames) throws IOException {
writer.p(" extends ");
return true;
}
return false;
}
// Print "implements XX, YY"
boolean useQualifiedNames,
boolean useIDLNames,
boolean globalIDLNames) throws IOException {
if (isInterface()) {
adjective = " extends";
}
if (useIDLNames) {
adjective = ":";
}
if (!useIDLNames || (!interfaces[i].isType(TYPE_ANY) && !interfaces[i].isType(TYPE_CORBA_OBJECT))) {
if (i == 0) {
} else {
writer.p(", ");
}
}
}
}
// Print members
boolean useQualifiedNames,
boolean useIDLNames,
boolean globalIDLNames) throws IOException {
if (!members[i].isInnerClassDeclaration()) {
if (useIDLNames) {
} else {
}
writer.p(visibility);
writer.p(" ");
}
} else {
}
}
}
}
// Print methods
boolean useQualifiedNames,
boolean useIDLNames,
boolean globalIDLNames) throws IOException {
}
}
// Print a method...
boolean useQualifiedNames,
boolean useIDLNames,
boolean globalIDLNames) throws IOException {
// Write visibility...
writer.p(visibility);
writer.p(" ");
}
// Write return type...
// Write method name...
if (useIDLNames) {
} else {
}
// Write arguments...
writer.p(" (");
if (i > 0) {
writer.p(", ");
}
if (useIDLNames) {
writer.p("in ");
}
}
writer.p(")");
// Write exceptions...
if (isType(TYPE_IMPLEMENTATION)) {
} else {
}
if (i == 0) {
if (useIDLNames) {
writer.p(" raises (");
} else {
writer.p(" throws ");
}
} else {
writer.p(", ");
}
if (useIDLNames) {
if (useQualifiedNames) {
} else {
}
writer.p(" [a.k.a. ");
writer.p("]");
} else {
}
}
writer.p(")");
}
if (it.isInherited()) {
writer.p(" // Inherited from ");
}
}
/**
* Create a CompoundType instance for the given class. NOTE: This constructor
* is ONLY for SpecialClassType and SpecialInterfaceType.
*/
if (classDef.isInnerClass()) {
}
// Set special flags...
setFlags();
}
private void setFlags() {
try {
// Set our special interface flags...
isIDLEntity && // Implements IDLEntity.
!isValueBase && // Does not implement ValueBase.
!isCORBAObject; // Does not implement org.omg.CORBA.Object;
// Is this an exception?
// Yes...
isException = true;
// Is it a checked exception?
isCheckedException = false;
} else {
isCheckedException = true;
}
// Is it java.rmi.RemoteException or a subclass?
isRemoteExceptionOrSubclass = true;
} else {
isRemoteExceptionOrSubclass = false;
}
} else {
isException = false;
}
} catch (ClassNotFound e) {
classNotFound(stack,e);
}
}
/**
* Create a CompoundType instance for the given class. The resulting
* object is not yet completely initialized.
*/
int typeCode) {
if (classDef.isInnerClass()) {
}
// Set special flags...
setFlags();
// Set names...
try {
// These can fail if we get case-sensitive name matches...
// Is this an exception?
if (isException()) {
// Yes, so set our mangled exception names...
isException = true;
}
// Set interfaces, methods and members...
} catch (Exception e) {
throw new CompilerError("");
}
}
/**
* Initialize this instance.
*/
boolean quiet) {
boolean result = true;
// Initialize our arrays...
} else {
}
// Now set the idl names for each...
try {
} catch (Exception e) {
result = false;
}
} else {
}
// If we have any un-initialized inner classes, now is the time
// to init them...
if (members[i].isInnerClassDeclaration()) {
try {
} catch (CompilerError e) {
return false;
}
}
}
// Now set the idl names for each...
try {
} catch (Exception e) {
result = false;
}
} else {
}
// Set our repositoryID...
if (result) {
result = setRepositoryID();
}
return result;
}
/*
* Return Type or null if error. classDef may be null.
*/
// See if we can find this type in the cache. If so, return it...
return result;
}
// Gotta try with context...
return result;
}
// Gotta map it...
switch (typeCode) {
case TC_BOOLEAN:
case TC_BYTE:
case TC_CHAR:
case TC_SHORT:
case TC_INT:
case TC_LONG:
case TC_FLOAT:
case TC_DOUBLE:
{
// Primitive...
break;
}
case TC_ARRAY:
{
// Array.
break;
}
case TC_CLASS:
{
try {
// First, make sure we have the class definition...
}
// Is it an interface or a class?
if (theClass.isInterface()) {
// An interface. Is it a special case?
// No, does it implement java.rmi.Remote?
// Yep, so just see if we can create an instance of RemoteType
// from it...
// If we did not succeed AND we are in a value context, then
// go ahead and make an NC type out of it...
}
} else {
// Nope, is it an AbstractType?
// No, so treat it as a non-conforming interface type...
}
}
}
} else {
// A class. Is it a special case?
// Nope, does it implement java.rmi.Remote?
// Yep, so just see if we can create an instance of
// ImplementationType from it...
// If we did not succeed AND inValue is true, then
// go ahead and make an NC type out of it...
}
} else {
// No, does it implement Serializable?
// Yep, so just see if we can create an instance of ValueType
// from it...
}
// Treat it as a non-conforming class type...
}
}
}
}
} catch (ClassNotFound e) {
classNotFound(stack,e);
}
break;
}
default: throw new CompilerError("Unknown typecode (" + typeCode + ") for " + theType.getTypeSignature());
}
return result;
}
/*
* Check if exception is RemoteException or one of its parents.
*/
return true;
}
return false;
}
/*
* Check if method is conforming.
*/
throws ClassNotFound {
// Do we have one exception that is RemoteException or
// a superclass of RemoteException?
boolean haveRemote = false;
// Is it a conforming exception?
// Got it.
haveRemote = true;
break;
}
}
// Do we have our exception?
if (!haveRemote) {
// No, so report failure...
}
// Are any of the arguments exceptions which implement IDLEntity?
// If so, report failure...
if (noIDLEntity) {
noIDLEntity = false;
break;
}
}
}
return (haveRemote && noIDLEntity);
}
throws ClassNotFound {
}
if (type.isCompound()){
return true;
}
}
return false;
}
/**
* Convert all invalid types to valid ones.
*/
protected void swapInvalidTypes () {
// Walk all interfaces and check them...
}
}
// Update methods...
methods[i].swapInvalidTypes();
}
// Update members...
members[i].swapInvalidTypes();
}
}
/*
* Add matching types to list. Return true if this type has not
* been previously checked, false otherwise.
*/
// Check self.
// Have we been checked before?
if (result) {
// Nope, so walk parent(s) and check them...
}
// Walk all interfaces and check them...
//if (interfaces == null) System.out.println("NULL for " +getQualifiedName() + " interfaces");
// Now recurse and add it and any referenced types...
//if (interfaces[i] == null) System.out.println("NULL for " +getQualifiedName() + " interfaces[" + i + "]");
}
// Walk all methods and check arguments...
//if (methods == null) System.out.println("NULL for " +getQualifiedName() + " methods");
// Add return type...
//if (methods[i] == null) System.out.println("NULL for " +getQualifiedName() + " methods[" + i + "]");
//if (methods[i].getReturnType() == null) System.out.println("NULL for " +getQualifiedName() + methods[i]);
// Add args...
//if (args == null) System.out.println("NULL for " + getQualifiedName() + " args");
//if (arg == null) System.out.println("NULL for " + getQualifiedName() + " arg[" +j+"]");
// Add argument...
}
// Add exceptions...
//if (exceptions == null) System.out.println("NULL for " + getQualifiedName() + " exceptions");
// Add argument...
}
}
// Walk all members and add em...
//if (members == null) System.out.println("NULL for " +getQualifiedName() + " members");
//if (members[i] == null) System.out.println("NULL for " +getQualifiedName() + " members[" + i + "]");
//if (cType == null) System.out.println("NULL for " + getQualifiedName() + " cType");
// Add it...
}
}
return result;
}
/*
* Return true if theType is a conforming constant type.
*/
}
/*
* Return true if theType is a conforming constant type.
*/
// Constraint 3: Constants must be either primitives or String.
boolean result = true;
switch (typeCode) {
case TC_BOOLEAN:
case TC_BYTE:
case TC_CHAR:
case TC_SHORT:
case TC_INT:
case TC_LONG:
case TC_FLOAT:
case TC_DOUBLE: // Primitive, so OK...
{
break;
}
case TC_CLASS: // Must be java.lang.String
{
result = false;
}
break;
}
case TC_ARRAY: // Array constants are not allowed.
{
result = false;
break;
}
default:
}
return result;
}
/*
* Update any method from 'currentMethods' which is defined in a
* parent class so that it's 'declaredBy' field specifies the
* parent.
* @param current The class or interface to gather methods from.
* @param currentMethods The list into which to put the methods.
* for contraint 6.
* @param quiet true if silent errors.
* @param stack the context stack.
* @return currentMethods or null if failed a constraint check.
*/
boolean quiet,
throws ClassNotFound {
while (parentDecl != null) {
if ( currentID == idJavaLangObject ) break;
// Walk all members of this class and update any that
// already exist in currentMethods...
!member.isInitializer() &&
!member.isConstructor() &&
// It's a method. Is it valid?
try {
} catch (Exception e) {
// Don't report anything here, it's already been reported...
return null;
}
// Have we already seen it?
if (index >= 0) {
// Yes, so update it...
}
}
}
// Update parent and keep walking up the chain...
}
return currentMethods;
}
/*
* Add all of the public and protected methods defined in
* current (other than initializers) to allMethods. If a sub-interface
* re-declares an inherited method, it will not be added.
* @param current The class or interface to gather methods from.
* @param directMethods The list into which to put the methods.
* for contraint 6.
* @param quiet true if silent errors.
* @param stack the context stack.
* @return directMethods or null if failed a constraint check.
*/
boolean noMultiInheritedMethods,
boolean quiet,
throws ClassNotFound {
// Constraint 6: Multiple inherited interfaces may not
// declare the same method.
// We want to add members starting at the _least_ derived
// interfaces. To do so, recurse until we have no more
// interfaces...
return null;
}
}
// Walk all members of this interface, adding any unique methods
// other than initializers and private methods...
{
!member.isInitializer() &&
// It's a method. Is it valid?
try {
} catch (Exception e) {
// Don't report anything here, it's already been reported...
return null;
}
// Have we already seen it?
// Nope, so add it...
} else {
// Yes. This is an error unless we are looking at the
// target interface (or this is a ValueType). Are we?
// Nope. Say so and signal error by returning null..
// There are more legal cases to consider here.
// If the two methods belong to interfaces that inherit from each other
// then it is just a redefinition which is legal.
if ( current != existingMemberClassDef &&
{
//Identifier int1 = existingMethod.getEnclosing().getIdentifier();
//Identifier int2 = current.getName();
//String message = int1.toString() + " and " + int2.toString();
return null;
}
}
// Bug fix 5014329
// find a matching method.
// merge the two methods, such that the new method
// will contain only those exception that can be thrown
// by both these methods, not just one of them.
// replace the old method with the new.
}
}
}
return directMethods;
}
// This should really be a method on ClassDefinition, but it takes too long to change the shared source.
// Works for both, classes and interfaces.
return true;
return true;
}
return true;
}
return false;
}
/*
* Add all of the interfaces implemented directly by current
* to the list. Returns null if any are non-conforming.
*/
boolean allowNonConforming,
// Add all the interfaces of current...
// Is it a SpecialInterfaceType...
// No, is it Remote?
// Yes, so it must be a RemoteType.
} else {
// Then try Abstract...
// Must be non-conforming...
}
}
}
} else {
return null;
}
}
return list;
}
/*
* Add all of the interfaces implemented directly by current
* to the list.
*/
// Add all the interfaces of current...
// First try SpecialInterfaceType...
// Then try AbstractType...
// Then try NCInterfaceType...
}
}
} else {
return null;
}
}
return list;
}
/*
* Walk self, adding constants and data members.
* @return true if all conform, false otherwise.
*/
boolean onlyConformingConstants, // AND inner classes.
boolean quiet,
boolean result = true;
// Walk all members of this interface...
{
try {
// Prod it to setValue if it is a constant...
// Get the value, if any...
// We don't want to change the code in CharExpression,
// which is shared among tools, to return the right string
// in case the type is char, so we treat it special here.
} else {
}
}
// Are we supposed to allow only conforming constants?
// Yep, so check it...
result = false;
break;
}
}
// Make member and add to list...
try {
} catch (CompilerError e) {
result = false;
}
} catch (ClassNotFound e) {
classNotFound(stack,e);
result = false;
}
}
}
return result;
}
/*
* Walk self, adding constants.
* @return true if all conform, false otherwise.
*/
boolean quiet,
boolean result = true;
// Walk all members of this interface...
{
try {
// Prod it to setValue if it is a constant...
// Get the value, if any...
}
// Is it a constant?
// Yes, is it conforming?
if (!isConformingConstantType(member)) {
result = false;
break;
}
// Yes, so make a member and add to list...
try {
} catch (CompilerError e) {
result = false;
}
}
} catch (ClassNotFound e) {
classNotFound(stack,e);
result = false;
}
}
}
return result;
}
boolean quiet,
boolean result = true;
try {
try {
exceptions[i] = type;
} else {
result = false;
}
} catch (ClassCastException e1) {
} catch (NullPointerException e2) {
throw new CompilerError("Method: caught null pointer exception");
}
}
} catch (ClassNotFound e) {
result = false;
}
if (!result) {
throw new Exception();
}
// Remove any duplicates (javac seems to allow them, but rmic will
// generate bad ties)...
int dupCount = 0;
exceptions[j] = null;
dupCount++;
}
}
}
if (dupCount > 0) {
int offset = 0;
if (exceptions[i] != null) {
}
}
exceptions = temp;
}
return exceptions;
}
vis += "public";
prefix = " ";
} else if (member.isProtected()) {
vis += "protected";
prefix = " ";
vis += "private";
prefix = " ";
}
vis += "static";
prefix = " ";
}
vis += "final";
prefix = " ";
}
return vis;
}
boolean quiet,
boolean dataMember) {
return false;
}
return true;
}
//_____________________________________________________________________
// Inner Class "Method"
//_____________________________________________________________________
/**
* A CompoundType.Method object encapsulates IIOP-specific information
* about a particular method in the interface represented by the outer
* instance.
*/
/**
* Is this method inherited?
*/
public boolean isInherited () {
}
/**
* Is this method an attribute?
* Return true if getAttributeKind != ATTRIBUTE_NONE.
*/
public boolean isAttribute () {
return attributeKind != ATTRIBUTE_NONE;
}
/**
* Is this method a read-write attribute?
*/
public boolean isReadWriteAttribute () {
return attributeKind == ATTRIBUTE_IS_RW ||
}
/**
* Return the attribute kind.
*/
public int getAttributeKind() {
return attributeKind;
}
/**
* Return the attribute name. Will be null if
* attribute kind == ATTRIBUTE_NONE.
*/
return attributeName;
}
/**
* For kinds ATTRIBUTE_GET_RW or ATTRIBUTE_IS_RW, return
* the index of the matching ATTRIBUTE_SET method, and
* vice-versa. For all other cases, return -1.
*/
public int getAttributePairIndex() {
return attributePairIndex;
}
/**
* Return context element name.
*/
}
/**
* Equality check based on method signature.
*/
return false;
}
}
return true;
}
return false;
}
/**
* Return a new Method object that is a legal combination of
* this method object and another one.
*
* This requires determining the exceptions declared by the
* combined method, which must be only those exceptions
* that may thrown by both of the old methods.
*/
}
try {
} catch (ClassNotFound e) {
return null;
}
return merged;
}
/**
* Add to the supplied list all exceptions in the "from" array
* that are subclasses of an exception in the "with" array.
*/
private void collectCompatibleExceptions(
throws ClassNotFound {
if (exceptionDef.subClassOf(
with[j].getClassDeclaration())) {
break;
}
}
}
}
}
/**
* Return the compound type which contains this method.
*/
return enclosing;
}
/**
* Return the identifier for the class or interface which
* declares this method.
*/
return declaredBy;
}
/**
* Return the visibility (e.g. "public final") of this member.
*/
return vis;
}
/**
* Methods to check various attributes.
*/
public boolean isPublic() {
}
public boolean isProtected() {
}
public boolean isPrivate() {
}
public boolean isStatic() {
}
/**
* Return the name of this method.
*/
return name;
}
/**
* IDL_Naming
* Return the IDL name of this method.
*/
return idlName;
}
/**
* Return the type of this method.
*/
}
/**
* Return true if this is a constructor.
*/
public boolean isConstructor () {
return memberDef.isConstructor();
}
/**
* Return true if this is NOT a constructor && is not
* an attribute.
*/
public boolean isNormalMethod () {
}
/**
* Get the return type of this method. May be null.
*/
return returnType;
}
/**
* Return the argument types of this method.
*/
}
/**
* Return the names of the argument types of this method.
*/
return argumentNames;
}
/**
* Return the MemberDefinition from which this method was created.
*/
return memberDef;
}
/**
* Return an array of the exception classes declared to be
* thrown by this remote method.
*
* For methods with the same name and type signature inherited
* from multiple remote interfaces, the array will contain
* the set of exceptions declared in all of the interfaces'
* methods that can be legally thrown in each of them.
*/
}
/**
* Same as getExceptions(), except when method is in an
* ImplementationType and the exceptions list is narrower.
*/
}
/**
* Return an array containing only those exceptions which
* need to be caught. Removes java.rmi.RemoteException,
* java.lang.RuntimeException, java.lang.Error, and their
* subclasses, then removes any exceptions which are more
* derived than another in the list. Returns null if no
* exceptions need to be caught.
*/
try {
// First, remove RemoteException, RuntimeException, Error, and their subclasses...
newSize--;
}
}
// Now remove derived types...
newSize--;
}
}
}
}
} catch (ClassNotFound e) {
}
// Create new list if we removed anything...
int offset = 0;
}
}
}
return null;
} else {
return list;
}
}
/**
* Return an array containing only those exceptions which need to be
* handled explicitly by the stub. Removes java.lang.RuntimeException,
* java.lang.Error, and their subclasses, since these are all passed
* back as CORBA system exceptions. Also removes subclasses of
* java.rmi.RemoteException but not java.rmi.RemoteException itself,
* since this may need to be thrown by the stub.
*/
try {
newSize--;
}
}
} catch (ClassNotFound e) {
}
// Create new list if we removed anything...
int offset = 0;
}
}
}
return list;
}
/**
* Return the string representation of this method.
*/
// Add name...
// Add arguments...
if (i > 0) {
}
}
// Add exceptions...
if (i == 0) {
} else {
}
}
}
return stringRep;
}
/**
* Set attribute kind. May only be called during initialization.
*/
}
/**
* Set pair index. May only be called during initialization.
*/
}
/**
* Set attribute name. May only be called during initialization.
*/
}
/**
* Set the idl name. May only be called during initialization.
*/
}
/**
* Set the implExceptions array. May only be called during initialization.
*/
}
/**
* Set the declaredBy Identifier. May only be called during initialization.
*/
declaredBy = by;
}
/**
* Convert all invalid types to valid ones.
*/
protected void swapInvalidTypes () {
// Check return type...
}
// Check args...
}
}
// Check exceptions...
}
}
// Check implExceptions...
}
}
}
/**
* Release all resources.
*/
public void destroy () {
if (exceptions != null) {
exceptions[i] = null;
}
exceptions = null;
}
if (implExceptions != null) {
implExceptions[i] = null;
}
}
returnType = null;
}
}
if (argumentNames != null) {
argumentNames[i] = null;
}
}
declaredBy = null;
}
}
/**
* Make up an argument name for the given type.
*/
return "arg" + argNum;
}
/**
* Create a new Method object corresponding to the given
* method definition.
*/
boolean quiet,
boolean valid = true;
// Set name...
// Update the context...
// Set return type...
} else {
if (returnType == null ||
valid = false;
}
}
// Set arguments and argument names...
try {
} catch (Exception e) {
}
valid = false;
} else {
if (origArgNames != null) {
} else {
}
}
} else {
valid = false;
}
}
if (!valid) {
throw new Exception();
}
// Set exceptions...
try {
} catch (Exception e) {
throw new Exception();
}
}
/**
* Cloning is supported by returning a shallow copy of this object.
*/
try {
return super.clone();
} catch (CloneNotSupportedException e) {
throw new Error("clone failed");
}
}
}
//_____________________________________________________________________
// Inner Class "Member"
//_____________________________________________________________________
/**
* An CompoundType.Member object wraps a Type and a value representing
* a data member, including constants.
*/
/**
* Return context element name.
*/
}
/**
* Return the type of this member.
*/
return type;
}
/**
* Return the name of this member.
*/
return name;
}
/**
* IDL_Naming
* Return the IDL name of this member.
*/
return idlName;
}
/**
* Return the visibility (e.g. "public final") of this member.
*/
return vis;
}
/**
* Methods to check various attributes.
*/
public boolean isPublic() {
}
public boolean isPrivate() {
}
public boolean isStatic() {
}
public boolean isFinal() {
}
public boolean isTransient() {
if (forceTransient) return true;
return member.isTransient();
}
/**
* Return the value of this member. May be null.
*/
return value;
}
/**
* Return true if this member represents an inner class declaration,
* false otherwise.
*/
public boolean isInnerClassDeclaration() {
return innerClassDecl;
}
/**
* Return true if this member represents a constant.
*/
public boolean isConstant () {
return constant;
}
/**
* Return the string representation of this constant.
*/
}
return result;
}
/**
* Convert all invalid types to valid ones.
*/
protected void swapInvalidTypes () {
}
}
protected void setTransient() {
if (! isTransient()) {
forceTransient = true;
} else {
vis = "transient";
}
}
}
return member;
}
/**
* Release all resources.
*/
public void destroy () {
}
}
private boolean innerClassDecl;
private boolean constant;
private boolean forceTransient;
/**
* Create a new Member object.
*/
forceTransient = false;
// If we are not an inner class, finish initializing now.
// Otherwise, wait until outer class is finished, then
// call init to avoid potential recursion problems...
if (!innerClassDecl) {
}
}
constant = false;
// Add self to stack...
// Check for special contextCodes...
if (member.isVariable()) {
this.constant = true;
} else if (member.isTransient()) {
}
}
(!innerClassDecl &&
!member.isTransient() &&
throw new CompilerError("");
}
// Clean up primitive constant values...
}
}
}
}
}
}
/**
* Cloning is supported by returning a shallow copy of this object.
*/
try {
return super.clone();
} catch (CloneNotSupportedException e) {
throw new Error("clone failed");
}
}
}
}