system/src/sc/lang/java/BodyTypeDeclaration.java
public boolean needsSync() {
      // This is cached for two reasons - one because we call it over and over again in the JS processing and
      // also because it does not appear to work after we transform.  But we need the original value when processing
      // the JS instanceTemplate.
      if (cachedNeedsSync != null)
         return cachedNeedsSync;

      if (isEnumConstant()) {
         cachedNeedsSync = Boolean.FALSE;
         return false;
      }

      if (getSyncProperties() != null) {
         cachedNeedsSync = Boolean.TRUE;
         return true;
      }

      if (body != null) {
         for (int i = 0; i < body.size(); i++) {
            Statement st = body.get(i);
            if (st instanceof BodyTypeDeclaration && ((BodyTypeDeclaration) st).needsSync()) {
               cachedNeedsSync = Boolean.TRUE;
               return true;
            }
         }
      }
      if (hiddenBody != null) {
         for (int i = 0; i < hiddenBody.size(); i++) {
            Statement st = hiddenBody.get(i);
            if (st instanceof BodyTypeDeclaration && ((BodyTypeDeclaration) st).needsSync()) {
               cachedNeedsSync = Boolean.TRUE;
               return true;
            }
         }
      }

      Object derivedType = getDerivedTypeDeclaration();

      if (derivedType instanceof TypeDeclaration) {
         if (derivedType == this) {
            System.err.println("*** Recursive type!");
            return false;
         }

         TypeDeclaration derivedTD = (TypeDeclaration) derivedType;
         if (!isAnEnclosingType(derivedTD) && derivedTD.needsSync()) {
            cachedNeedsSync = Boolean.TRUE;
            return true;
         }
      }

      Object extType = isLayerType ? null : getExtendsTypeDeclaration();
      if (extType instanceof TypeDeclaration && extType != derivedType) {
         TypeDeclaration extTD = (TypeDeclaration) extType;
         if (!isAnEnclosingType(extTD) && extTD.needsSync()) {
            cachedNeedsSync = Boolean.TRUE;
            return true;
         }
      }
      cachedNeedsSync = Boolean.FALSE;
      return false;
   }
// To determine if this particular object needs synchronization, use getSyncProperties() != null.
To determine if this particular object needs synchronization, use getSyncProperties() != null.
To determine if this particular object needs synchronization use getSyncProperties () ! = null .
public boolean needsSync() {
      if (cachedNeedsSync != null)
         return cachedNeedsSync;
      if (isEnumConstant()) {
         cachedNeedsSync = Boolean.FALSE;
         return false;
      }
      if (getSyncProperties() != null) {
         cachedNeedsSync = Boolean.TRUE;
         return true;
      }
      if (body != null) {
         for (int i = 0; i < body.size(); i++) {
            Statement st = body.get(i);
            if (st instanceof BodyTypeDeclaration && ((BodyTypeDeclaration) st).needsSync()) {
               cachedNeedsSync = Boolean.TRUE;
               return true;
            }
         }
      }
      if (hiddenBody != null) {
         for (int i = 0; i < hiddenBody.size(); i++) {
            Statement st = hiddenBody.get(i);
            if (st instanceof BodyTypeDeclaration && ((BodyTypeDeclaration) st).needsSync()) {
               cachedNeedsSync = Boolean.TRUE;
               return true;
            }
         }
      }
      Object derivedType = getDerivedTypeDeclaration();
      if (derivedType instanceof TypeDeclaration) {
         if (derivedType == this) {
            System.err.println("*** Recursive type!");
            return false;
         }
         TypeDeclaration derivedTD = (TypeDeclaration) derivedType;
         if (!isAnEnclosingType(derivedTD) && derivedTD.needsSync()) {
            cachedNeedsSync = Boolean.TRUE;
            return true;
         }
      }
      Object extType = isLayerType ? null : getExtendsTypeDeclaration();
      if (extType instanceof TypeDeclaration && extType != derivedType) {
         TypeDeclaration extTD = (TypeDeclaration) extType;
         if (!isAnEnclosingType(extTD) && extTD.needsSync()) {
            cachedNeedsSync = Boolean.TRUE;
            return true;
         }
      }
      cachedNeedsSync = Boolean.FALSE;
      return false;
   }
public boolean needsSync ( ) { if ( cachedNeedsSync != null ) return cachedNeedsSync ; if ( isEnumConstant ( ) ) { cachedNeedsSync = Boolean . FALSE ; return false ; } if ( getSyncProperties ( ) != null ) { cachedNeedsSync = Boolean . TRUE ; return true ; } if ( body != null ) { for ( int i = 0 ; i < body . size ( ) ; i ++ ) { Statement st = body . get ( i ) ; if ( st instanceof BodyTypeDeclaration && ( ( BodyTypeDeclaration ) st ) . needsSync ( ) ) { cachedNeedsSync = Boolean . TRUE ; return true ; } } } if ( hiddenBody != null ) { for ( int i = 0 ; i < hiddenBody . size ( ) ; i ++ ) { Statement st = hiddenBody . get ( i ) ; if ( st instanceof BodyTypeDeclaration && ( ( BodyTypeDeclaration ) st ) . needsSync ( ) ) { cachedNeedsSync = Boolean . TRUE ; return true ; } } } Object derivedType = getDerivedTypeDeclaration ( ) ; if ( derivedType instanceof TypeDeclaration ) { if ( derivedType == this ) { System . err . println ( "*** Recursive type!" ) ; return false ; } TypeDeclaration derivedTD = ( TypeDeclaration ) derivedType ; if ( ! isAnEnclosingType ( derivedTD ) && derivedTD . needsSync ( ) ) { cachedNeedsSync = Boolean . TRUE ; return true ; } } Object extType = isLayerType ? null : getExtendsTypeDeclaration ( ) ; if ( extType instanceof TypeDeclaration && extType != derivedType ) { TypeDeclaration extTD = ( TypeDeclaration ) extType ; if ( ! isAnEnclosingType ( extTD ) && extTD . needsSync ( ) ) { cachedNeedsSync = Boolean . TRUE ; return true ; } } cachedNeedsSync = Boolean . FALSE ; return false ; }
To determine if this particular object needs synchronization, use getSyncProperties() != null.
To determine if this particular object needs synchronization use getSyncProperties () ! = null .
// This is cached for two reasons - one because we call it over and over again in the JS processing and // also because it does not appear to work after we transform.  But we need the original value when processing // the JS instanceTemplate.