protected GosuParser getOrCreateParser(CompiledGosuClassSymbolTable symbolTable) { if( _parser != null ){ return _parser; } else { GosuParser parser = createParser(symbolTable); if (CommonServices.getPlatformHelper().isInIDE()) { _parser = parser; } return parser; } }
SingleServingGosuClassLoader( GosuClassLoader parent ) { super( parent.getActualLoader() ); _parent = parent; if( CommonServices.getPlatformHelper().isInIDE() ) { //## todo: uncomment //throw new IllegalStateException( "Class loading with single-serving loader is probably wrong in the IDE" ); } }
private static Iterable<? extends IFile> getSchemaLocationsFiles(IModule module) { if (CommonServices.getPlatformHelper().isInIDE()) { module = TypeSystem.getGlobalModule(); } Set<IFile> result = new LinkedHashSet<IFile>(); result.addAll(findAllFiles("config/xml/schemalocations.xml", module.getRoots())); // XML module itself now has this file inside "sources path" result.addAll(findAllFiles("xml/schemalocations.xml", module.getSourcePath())); return result; }
@Override public final Set<String> getAllTypeNames() { if (_typeNames == null) { Set<String> names = shouldCacheTypeNames() ? loadTypeNames() : null; if (names != null) { _typeNames = names; } else { _typeNames = CommonServices.getPlatformHelper().isInIDE() ? new HashSet<String>( computeTypeNames() ) : new HashSet<String>( computeTypeNames() ); } } return _typeNames; }
private static boolean shouldReplaceAnyway(IJavaClassInfo cls, JavaClassIRType javaClassIRType) { return !CommonServices.getPlatformHelper().isInIDE() && !equal(javaClassIRType.getJavaClassInfo().getBackingClass().getClassLoader(), cls.getBackingClass().getClassLoader()); }
public static IJavaClassInfo getClassInfo( AsmClass cls, IModule module ) { if( isProxy( cls ) ) { return getJavaClassInfo( cls, module ); } else { if( !CommonServices.getPlatformHelper().isInIDE() ) { // Don't try to load from source unless we have to, this saves a load of time esp. for case // where we're loading an inner java class where replacing the '$' below with '.' we bascially // put the type system through a load of unnecessary work. IJavaClassInfo classInfo = getJavaClassInfo( cls, module ); if( classInfo != null ) { return classInfo; } } return getClassInfo( cls.getName().replace( '$', '.' ), module ); } }
private IJavaClassInfo getByClass( String className, IModule lookupModule, IModule actualModule ) { DefaultTypeLoader loader = (DefaultTypeLoader)lookupModule.getTypeLoaders( IDefaultTypeLoader.class ).get( 0 ); if( USE_ASM_LOADER && CommonServices.getPlatformHelper().isInIDE() ) { AsmClass theClass = loader.loadAsmClass( className ); if( theClass == null ) { return null; } return getJavaClassInfo( theClass, actualModule ); } else { Class theClass = loader.loadClass( className ); if( theClass == null ) { return null; } return getJavaClassInfo( theClass, actualModule ); } }
public static IJavaClassInfo getClassInfo(Class aClass, IModule gosuModule) { DefaultTypeLoader loader = (DefaultTypeLoader) gosuModule.getModuleTypeLoader().getDefaultTypeLoader(); if (isProxy(aClass)) { return loader.getJavaClassInfo( aClass, gosuModule ); } else if (aClass.isArray()) { IJavaClassInfo classInfo = getClassInfo(aClass.getComponentType(), gosuModule); IModule module = classInfo.getModule(); return loader.getJavaClassInfo(aClass, module); } else { if( !CommonServices.getPlatformHelper().isInIDE() ) { // Don't try to load from source unless we have to, this saves a load of time esp. for case // where we're loading an inner java class where replacing the '$' below with '.' we bascially // put the type system through a load of unnecessary work. IJavaClassInfo javaClassInfo = loader.getJavaClassInfo( aClass, gosuModule ); if (javaClassInfo != null) { return javaClassInfo; } } return getClassInfo(aClass.getName().replace('$', '.'), gosuModule); } }
public IJavaClassInfo resolveJavaClassInfo(String fullyQualifiedName) { if (!CommonServices.getPlatformHelper().isInIDE()) { return getByClass(fullyQualifiedName, _module, _module);
try { readSchema( _schemaEF, null, caches ); if (!CommonServices.getPlatformHelper().isInIDE()) { validate( caches );
private GosuParser makeParserForPhase() { createNewParseInfo(); CompiledGosuClassSymbolTable symbolTable = CompiledGosuClassSymbolTable.instance(); GosuParser parser = getOrCreateParser(symbolTable); ISource source = _sourceFileHandle.getSource(); parser.setScript(source); _parseInfo.updateSource(source.getSource()); if (CommonServices.getPlatformHelper().isInIDE()) { parser.setThrowParseExceptionForWarnings(true); parser.setDontOptimizeStatementLists(true); parser.setWarnOnCaseIssue(true); parser.setEditorParser(true); } assignTypeUsesMap( parser ); return parser; }
public IGosuClassInternal parseClass( String strQualifiedClassName, ISourceFileHandle sourceFile, boolean bThrowOnWarnings, boolean bFullyCompile ) throws ParseResultsException if (!CommonServices.getPlatformHelper().isInIDE()) { classLoader = GosuClassTypeLoader.getDefaultClassLoader(TypeSystem.getGlobalModule()); } else {
if( !ILanguageLevel.Util.STANDARD_GOSU() && !CommonServices.getPlatformHelper().isInIDE() )