system/src/sc/lang/java/IdentifierExpression.java
private boolean isStaticTarget(int ix) {
      if (idTypes == null || idTypes[ix] == null)
         return false;

      switch (idTypes[ix]) {
         // For components when we convert a new X to a newX method call - here we need to consider the relationship of the type to the current context
         case NewMethodInvocation:
            Object newType = boundTypes[ix];
            if (newType != null) {
               if (ModelUtil.getEnclosingType(newType) == null || ModelUtil.hasModifier(newType, "static"))
                  return true;
               return false;
            }
            break;
         case UnboundMethodName:
         case FieldName:
         case MethodInvocation:
         case RemoteMethodInvocation:
         case GetVariable:
         case IsVariable:
         case SetVariable:
         case GetSetMethodInvocation:
         case GetObjectMethodInvocation:
            Object type = boundTypes[ix];
            if (type == ArrayTypeDeclaration.LENGTH_FIELD) // We use this special case object since this length method is not available via reflection
               return false;
            if (type instanceof PropertyAssignment)
               type = ((PropertyAssignment) type).getPropertyDefinition();
            return type != null && ModelUtil.hasModifier(type, "static");
         case EnumName:
            return true;
         case BoundName:
            return true;
         case BoundObjectName:
         case ResolvedObjectName:
            if (boundTypes[ix] != null) {
               if (ModelUtil.hasModifier(boundTypes[ix], "static"))
                  return true;
               return boundTypes[ix] instanceof TypeDeclaration && ((TypeDeclaration) boundTypes[ix]).isStaticObject();
            }
            break;
      }
      return !isThisExpression();
   }
/** Returns true for a static field or method at the specific location in the identifiers list */
Returns true for a static field or method at the specific location in the identifiers list
Returns true for a static field or method at the specific location in the identifiers list
private boolean isStaticTarget(int ix) {
      if (idTypes == null || idTypes[ix] == null)
         return false;
      switch (idTypes[ix]) {
         case NewMethodInvocation:
            Object newType = boundTypes[ix];
            if (newType != null) {
               if (ModelUtil.getEnclosingType(newType) == null || ModelUtil.hasModifier(newType, "static"))
                  return true;
               return false;
            }
            break;
         case UnboundMethodName:
         case FieldName:
         case MethodInvocation:
         case RemoteMethodInvocation:
         case GetVariable:
         case IsVariable:
         case SetVariable:
         case GetSetMethodInvocation:
         case GetObjectMethodInvocation:
            Object type = boundTypes[ix];
            if (type == ArrayTypeDeclaration.LENGTH_FIELD) 
               return false;
            if (type instanceof PropertyAssignment)
               type = ((PropertyAssignment) type).getPropertyDefinition();
            return type != null && ModelUtil.hasModifier(type, "static");
         case EnumName:
            return true;
         case BoundName:
            return true;
         case BoundObjectName:
         case ResolvedObjectName:
            if (boundTypes[ix] != null) {
               if (ModelUtil.hasModifier(boundTypes[ix], "static"))
                  return true;
               return boundTypes[ix] instanceof TypeDeclaration && ((TypeDeclaration) boundTypes[ix]).isStaticObject();
            }
            break;
      }
      return !isThisExpression();
   }
private boolean isStaticTarget ( int ix ) { if ( idTypes == null || idTypes [ ix ] == null ) return false ; switch ( idTypes [ ix ] ) { case NewMethodInvocation : Object newType = boundTypes [ ix ] ; if ( newType != null ) { if ( ModelUtil . getEnclosingType ( newType ) == null || ModelUtil . hasModifier ( newType , "static" ) ) return true ; return false ; } break ; case UnboundMethodName : case FieldName : case MethodInvocation : case RemoteMethodInvocation : case GetVariable : case IsVariable : case SetVariable : case GetSetMethodInvocation : case GetObjectMethodInvocation : Object type = boundTypes [ ix ] ; if ( type == ArrayTypeDeclaration . LENGTH_FIELD ) return false ; if ( type instanceof PropertyAssignment ) type = ( ( PropertyAssignment ) type ) . getPropertyDefinition ( ) ; return type != null && ModelUtil . hasModifier ( type , "static" ) ; case EnumName : return true ; case BoundName : return true ; case BoundObjectName : case ResolvedObjectName : if ( boundTypes [ ix ] != null ) { if ( ModelUtil . hasModifier ( boundTypes [ ix ] , "static" ) ) return true ; return boundTypes [ ix ] instanceof TypeDeclaration && ( ( TypeDeclaration ) boundTypes [ ix ] ) . isStaticObject ( ) ; } break ; } return ! isThisExpression ( ) ; }
Returns true for a static field or method at the specific location in the identifiers list
Returns true for a static field or method at the specific location in the identifiers list
// For components when we convert a new X to a newX method call - here we need to consider the relationship of the type to the current context // We use this special case object since this length method is not available via reflection