private boolean isInnerToPrimaryManifold( String topLevel, String relativeInner ) { //noinspection unchecked Set<ITypeManifold> tms = getModule().findTypeManifoldsFor( topLevel, tm -> tm.getContributorKind() == ContributorKind.Primary && tm instanceof ResourceFileTypeManifold && ((ResourceFileTypeManifold)tm).isInnerType( topLevel, relativeInner ) ); return !tms.isEmpty(); }
private boolean isInnerToPrimaryManifold( String topLevel, String relativeInner ) { Set<ITypeManifold> tms = getModule().findTypeManifoldsFor( topLevel ); if( tms != null ) { for( ITypeManifold tm : tms ) { if( tm.getContributorKind() == ContributorKind.Primary && tm instanceof ResourceFileTypeManifold ) { return ((ResourceFileTypeManifold)tm).isInnerType( topLevel, relativeInner ); } } } return false; }
private boolean isCorrectModule( Location location, Iterable<JavaFileObject> patchableFiles, JavaFileObject file, String fqn ) { if( !(location instanceof ManPatchModuleLocation) ) { // not a ManPatchModuleLocation means not an extended class if( !JreUtil.isJava9Modular_compiler( _ctx ) ) { return true; } // true if type is not exclusively an extended type Set<ITypeManifold> typeManifoldsFor = getHost().getSingleModule().findTypeManifoldsFor( fqn ); return typeManifoldsFor.stream().anyMatch( tm -> tm.getContributorKind() == Primary ); } if( patchableFiles == null ) { return true; } String cname = inferBinaryName( location, file ); for( JavaFileObject f: patchableFiles ) { String name = inferBinaryName( location, f ); if( cname.equals( name) ) { return true; } } return false; }
@Override public void refreshedTypes( RefreshRequest request ) { super.refreshedTypes( request ); if( request.file == null ) { return; } for( ITypeManifold tm: ExtensionManifold.this.getModule().findTypeManifoldsFor( request.file ) ) { if( tm instanceof IExtensionClassProducer ) { for( String extended: ((IExtensionClassProducer)tm).getExtendedTypesForFile( request.file ) ) { refreshedType( extended, request ); } } } }
@Override public void refreshedTypes( RefreshRequest request ) { IModule refreshModule = request.module; if( refreshModule != null && refreshModule != getModule() ) { return; } super.refreshedTypes( request ); if( request.file == null ) { return; } //noinspection unchecked for( ITypeManifold tm: ExtensionManifold.this.getModule().findTypeManifoldsFor( request.file, tm -> tm instanceof IExtensionClassProducer ) ) { for( String extended: ((IExtensionClassProducer)tm).getExtendedTypesForFile( request.file ) ) { refreshedType( extended, request ); } } }
Set<ITypeManifold> sps = RuntimeManifoldHost.get().getSingleModule().findTypeManifoldsFor( strType ); if( !sps.isEmpty() )