@ Override public void init ( ProcessingEnvironment procEnv ) { super . init ( procEnv ) ; String className = procEnv . getClass ( ) . getName ( ) ; if ( className . startsWith ( "org.eclipse.jdt." ) ) { errorToShow = "This version of disableCheckedExceptions is not compatible with eclipse. javac only; sorry." ; procEnv . getMessager ( ) . printMessage ( Kind . WARNING , errorToShow ) ; } else if ( ! procEnv . getClass ( ) . getName ( ) . equals ( "com.sun.tools.javac.processing.JavacProcessingEnvironment" ) ) { procEnv . getMessager ( ) . printMessage ( Kind . WARNING , "You aren't using a compiler based around javac v1.6, so disableCheckedExceptions will not work.\n" + "Your processor class is: " + className ) ; } else { new LiveInjector ( ) . inject ( ClassRootFinder . findClassRootOfClass ( DisableCheckedExceptionsAgent . class ) ) ; } }
Inject an agent if we re on a sun - esque JVM .