Skip to content

Commit

Permalink
MSHADE-412 avoid possible NPE since rawString was added in SimpleRelo…
Browse files Browse the repository at this point in the history
…cator
  • Loading branch information
rmannibucau committed Mar 17, 2022
1 parent 0070183 commit 81a374b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public String relocatePath( String path )

public String relocateClass( String clazz )
{
return clazz.replaceFirst( pattern, shadedPattern );
return rawString ? clazz : clazz.replaceFirst( pattern, shadedPattern );
}

public String applyToSourceContent( String sourceContent )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
public class SimpleRelocatorTest
{

@Test
public void testNoNpeRelocateClass()
{
new SimpleRelocator( "foo", "bar", null, null, true ).relocateClass( "foo" );
}

@Test
public void testCanRelocatePath()
{
Expand Down

0 comments on commit 81a374b

Please sign in to comment.