Skip to content

Commit

Permalink
fix StringIndexOutOfBoundsException
Browse files Browse the repository at this point in the history
  • Loading branch information
LabyStudio committed May 11, 2021
1 parent 71731fb commit 7b5c867
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -72,10 +72,13 @@ protected boolean hotswap( Project project, String classNameWithoutPackage, Stri
// Check if it's an inner class of the target class
if ( innerFullClassName.startsWith( classNameWithoutPackage + "$" ) ) {
String innerFileName = innerFullClassName.split( "\\$" )[1];
String innerClassName = className + "$" + innerFileName.substring( 0, innerFileName.lastIndexOf( ".class" ) );

// Compile the inner class of the target class
files.put( innerClassName, new HotSwapFile( fileInPackage ) );
if ( innerFileName.contains( ".class" ) ) {
String innerClassName = className + "$" + innerFileName.substring( 0, innerFileName.lastIndexOf( ".class" ) );

// Compile the inner class of the target class
files.put( innerClassName, new HotSwapFile( fileInPackage ) );
}
}
}
}
Expand Down

0 comments on commit 7b5c867

Please sign in to comment.