Buggy code:
public abstract class DefaultRmicAdapter implements RmicAdapter { private Rmic attributes ; private FileNameMapper mapper ; private static final Random RAND = new Random ( ) ; public static final String RMI_STUB_SUFFIX = "_Stub" ; public static final String RMI_SKEL_SUFFIX = "_Skel" ; public static final String RMI_TIE_SUFFIX = "_Tie" ; public static final String STUB_COMPAT = "-vcompat" ; public static final String STUB_1_1 = "-v1.1" ; public static final String STUB_1_2 = "-v1.2" ; public DefaultRmicAdapter ( ) { } public void setRmic ( final Rmic attributes ) { } public Rmic getRmic ( ) { } protected String getStubClassSuffix ( ) { } protected String getSkelClassSuffix ( ) { } protected String getTieClassSuffix ( ) { } public FileNameMapper getMapper ( ) { } public Path getClasspath ( ) { } protected Path getCompileClasspath ( ) { } protected Commandline setupRmicCommand ( ) { } protected Commandline setupRmicCommand ( String [ ] options ) { } protected String [ ] preprocessCompilerArgs ( String [ ] compilerArgs ) { } protected String [ ] filterJvmCompilerArgs ( String [ ] compilerArgs ) { } protected void logAndAddFilesToCompile ( Commandline cmd ) { } private class RmicFileNameMapper implements FileNameMapper { RmicFileNameMapper ( ) { } public void setFrom ( String s ) { } public void setTo ( String s ) { } public String [ ] mapFileName ( String name ) { if ( ( ( ( ( name == null ) || ( ! ( name . endsWith ( ".class" ) ) ) ) || ( name . endsWith ( ( ( getStubClassSuffix ( ) ) + ".class" ) ) ) ) || ( name . endsWith ( ( ( getSkelClassSuffix ( ) ) + ".class" ) ) ) ) || ( name . endsWith ( ( ( getTieClassSuffix ( ) ) + ".class" ) ) ) ) { return null ; } <START_BUG> String base = name . substring ( 0 , ( ( name . length ( ) ) - 6 ) ) ; <END_BUG> String classname = base . replace ( File . separatorChar , '.' ) ; if ( ( attributes . getVerify ( ) ) && ( ! ( attributes . isValidRmiRemote ( classname ) ) ) ) { return null ; } String [ ] target = new String [ ] { ( name + ".tmp." ) + ( DefaultRmicAdapter . RAND . nextLong ( ) ) } ; if ( ( ! ( attributes . getIiop ( ) ) ) && ( ! ( attributes . getIdl ( ) ) ) ) { if ( "1.2" . equals ( attributes . getStubVersion ( ) ) ) { target = new String [ ] { ( base + ( getStubClassSuffix ( ) ) ) + ".class" } ; } else { target = new String [ ] { ( base + ( getStubClassSuffix ( ) ) ) + ".class" , ( base + ( getSkelClassSuffix ( ) ) ) + ".class" } ; } } else if ( ! ( attributes . getIdl ( ) ) ) { int lastSlash = base . lastIndexOf ( File . separatorChar ) ; String dirname = "" ; int index = - 1 ; if ( lastSlash == ( - 1 ) ) { index = 0 ; } else { index = lastSlash + 1 ; dirname = base . substring ( 0 , index ) ; } String filename = base . substring ( index ) ; try { Class c = attributes . getLoader ( ) . loadClass ( classname ) ; if ( c . isInterface ( ) ) { target = new String [ ] { ( ( ( dirname + "_" ) + filename ) + ( getStubClassSuffix ( ) ) ) + ".class" } ; } else { Class interf = attributes . getRemoteInterface ( c ) ; String iName = interf . getName ( ) ; String iDir = "" ; int iIndex = - 1 ; int lastDot = iName . lastIndexOf ( "." ) ; if ( lastDot == ( - 1 ) ) { iIndex = 0 ; } else { iIndex = lastDot + 1 ; iDir = iName . substring ( 0 , iIndex ) ; iDir = iDir . replace ( '.' , File . separatorChar ) ; } target = new String [ ] { ( ( ( dirname + "_" ) + filename ) + ( getTieClassSuffix ( ) ) ) + ".class" , ( ( ( iDir + "_" ) + ( iName . substring ( iIndex ) ) ) + ( getStubClassSuffix ( ) ) ) + ".class" } ; } } catch ( ClassNotFoundException e ) { attributes . log ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>verify<seq2seq4repair_space>class<seq2seq4repair_space>" + classname ) + ".<seq2seq4repair_space>It<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>found." ) , MSG_WARN ) ; } catch ( NoClassDefFoundError e ) { attributes . log ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>verify<seq2seq4repair_space>class<seq2seq4repair_space>" + classname ) + ".<seq2seq4repair_space>It<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>defined." ) , MSG_WARN ) ; } catch ( Throwable t ) { attributes . log ( ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>verify<seq2seq4repair_space>class<seq2seq4repair_space>" + classname ) + ".<seq2seq4repair_space>Loading<seq2seq4repair_space>caused<seq2seq4repair_space>Exception:<seq2seq4repair_space>" ) + ( t . getMessage ( ) ) ) , MSG_WARN ) ; } } return target ; } } }

Fix:
String base = name . substring ( 0 , ( ( name . length ( ) ) - ( ".class" . length ( ) ) ) ) ;