ReflectUtil.field( type.tsym.owner, "kind" ).get() == ReflectUtil.field( "com.sun.tools.javac.code.Kinds$Kind", "TYP" ).getStatic() )
? ReflectUtil.method( type, "unannotatedType" ).invoke().toString() : ReflectUtil.method( type, "cloneWithMetadata", ReflectUtil.type( "com.sun.tools.javac.code.TypeMetadata" ) ) .invoke( ReflectUtil.field( "com.sun.tools.javac.code.TypeMetadata", "EMPTY" ).getStatic() ).toString(); srcType = new SrcType( unannotatedType );
/** * @since 9 */ @Override public Location getLocationForModule( Location location, JavaFileObject fo ) throws IOException { if( fo instanceof GeneratedJavaStubFileObject && location == ReflectUtil.field( StandardLocation.class, "PATCH_MODULE_PATH" ).getStatic() ) { //System.err.println( "PATCH: " + fo.getName() ); return new ManPatchLocation( (GeneratedJavaStubFileObject)fo ); } return super.getLocationForModule( location, fo ); }
@SuppressWarnings("UnusedReturnValue") public static Object setFieldStatic_Object( Class receiver, String name, Object value ) { //noinspection ConstantConditions ReflectUtil.field( receiver, name ).setStatic( value ); return value; }
@Override public boolean hasLocation( Location location ) { return !JavacPlugin.IS_JAVA_8 && location == ReflectUtil.field( StandardLocation.class, "PATCH_MODULE_PATH" ).getStatic() || super.hasLocation( location ); }
@SuppressWarnings("UnusedReturnValue") public static Object setFieldStatic_Object( Class receiver, String name, Object value ) { //noinspection ConstantConditions ReflectUtil.field( receiver, name ).setStatic( value ); return value; }
private static FieldRef getFieldFromCache( Class cls, String name ) { Field field = getRawFieldFromCache( cls, name ); if( field != null ) { return new FieldRef( field ); } return null; }
private static FieldRef addFieldToCache( Class cls, Field f ) { setAccessible( f ); addRawFieldToCache( cls, f ); return new FieldRef( f ); }
public static Object getFieldStatic_Object( Class receiver, String name ) { //noinspection ConstantConditions return ReflectUtil.field( receiver, name ).getStatic(); }
/** * @since 9 */ @Override public Location getLocationForModule( Location location, String moduleName ) throws IOException { if( location == ReflectUtil.field( StandardLocation.class, "PATCH_MODULE_PATH" ).getStatic() ) { return new ManPatchModuleLocation( moduleName ); } return super.getLocationForModule( location, moduleName ); }
public static Object getFieldStatic_Object( Class receiver, String name ) { //noinspection ConstantConditions return ReflectUtil.field( receiver, name ).getStatic(); }