system/src/sc/lang/java/ModelUtil.java
public static Object[] mergeTypesAndProperties(Object type, Object[] types, Object[] props) {
      ArrayList<Object> res = new ArrayList<Object>();
      if (props != null) {
         for (int i = 0; i < props.length; i++) {
            Object prop = props[i];
            if (prop instanceof Class || prop instanceof BodyTypeDeclaration)
               continue; // Objects already included above
            res.add(props[i]);
         }
      }
      if (types != null) {
         for (int i = 0; i < types.length; i++) {
            Object innerType = types[i];
            String innerTypeName = ModelUtil.getClassName(innerType);
            // If it's a compiled anonymous inner type, nothing we can do for it.
            if (Character.isDigit(innerTypeName.charAt(0)))
                 continue;
            Object mergedType = ModelUtil.getInnerType(type, innerTypeName, null);
            if (mergedType == null) {
               // Some inconsistency in how enum constants are treated here...
               mergedType = ModelUtil.getEnum(type, innerTypeName);
               if (mergedType == null)
                  System.err.println("*** can't find merged type!");
            }
            else
               types[i] = mergedType;
            res.add(types[i]);
         }
      }
      return res.toArray(new Object[res.size()]);
   }
/** Note: This merges the types but does not merge the properties.  Assumes that's been done in getMerged/DeclaredProperties */
This merges the types but does not merge the properties.  Assumes that's been done in getMerged/DeclaredProperties
This merges the types but does not merge the properties . Assumes that ' s been done in getMerged / DeclaredProperties
public static Object[] mergeTypesAndProperties(Object type, Object[] types, Object[] props) {
      ArrayList<Object> res = new ArrayList<Object>();
      if (props != null) {
         for (int i = 0; i < props.length; i++) {
            Object prop = props[i];
            if (prop instanceof Class || prop instanceof BodyTypeDeclaration)
               continue; 
            res.add(props[i]);
         }
      }
      if (types != null) {
         for (int i = 0; i < types.length; i++) {
            Object innerType = types[i];
            String innerTypeName = ModelUtil.getClassName(innerType);
            if (Character.isDigit(innerTypeName.charAt(0)))
                 continue;
            Object mergedType = ModelUtil.getInnerType(type, innerTypeName, null);
            if (mergedType == null) {
               mergedType = ModelUtil.getEnum(type, innerTypeName);
               if (mergedType == null)
                  System.err.println("*** can't find merged type!");
            }
            else
               types[i] = mergedType;
            res.add(types[i]);
         }
      }
      return res.toArray(new Object[res.size()]);
   }
public static Object [ ] mergeTypesAndProperties ( Object type , Object [ ] types , Object [ ] props ) { ArrayList < Object > res = new ArrayList < Object > ( ) ; if ( props != null ) { for ( int i = 0 ; i < props . length ; i ++ ) { Object prop = props [ i ] ; if ( prop instanceof Class || prop instanceof BodyTypeDeclaration ) continue ; res . add ( props [ i ] ) ; } } if ( types != null ) { for ( int i = 0 ; i < types . length ; i ++ ) { Object innerType = types [ i ] ; String innerTypeName = ModelUtil . getClassName ( innerType ) ; if ( Character . isDigit ( innerTypeName . charAt ( 0 ) ) ) continue ; Object mergedType = ModelUtil . getInnerType ( type , innerTypeName , null ) ; if ( mergedType == null ) { mergedType = ModelUtil . getEnum ( type , innerTypeName ) ; if ( mergedType == null ) System . err . println ( "*** can't find merged type!" ) ; } else types [ i ] = mergedType ; res . add ( types [ i ] ) ; } } return res . toArray ( new Object [ res . size ( ) ] ) ; }
Note: This merges the types but does not merge the properties.
Note : This merges the types but does not merge the properties .
// Objects already included above // If it's a compiled anonymous inner type, nothing we can do for it. // Some inconsistency in how enum constants are treated here...