Skip to content

Commit

Permalink
Fixed "Configuration property 'trimHeaderLine' doesn't take any effect.
Browse files Browse the repository at this point in the history
  • Loading branch information
xeagle2 authored and tchemit committed Apr 14, 2018
1 parent 1a67fd0 commit 0d1586f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ public boolean isEmptyLineAfterHeader()
/**
* {@inheritDoc}
*/
public void setEmptyLineAfterHeader( boolean trimLine )
public void setEmptyLineAfterHeader( boolean emptyLine )
{
this.emptyLineAfterHeader = trimLine;
this.emptyLineAfterHeader = emptyLine;
}

/**
Expand All @@ -323,7 +323,7 @@ public boolean isTrimHeaderLine()
*/
public void setTrimHeaderLine( boolean trimLine )
{
this.emptyLineAfterHeader = trimLine;
this.trimHeaderLine = trimLine;
}

/**
Expand Down Expand Up @@ -429,7 +429,7 @@ public String boxComment( String header, boolean withTags )
}
for ( String line : header.split( "\\r?\\n" ) )
{
if ( trimHeaderLine )
if ( isTrimHeaderLine() )
{
StringBuilder lineBuffer = new StringBuilder();
lineBuffer.append( getCommentLinePrefix() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,15 @@ public void testUnboxComment()
Assert.assertEquals( header, unboxedHeader );
}

@Test
public void testSetTrimHeaderLine()
{
Assert.assertFalse(transformer.isTrimHeaderLine());

transformer.setTrimHeaderLine(true);
Assert.assertTrue(transformer.isTrimHeaderLine());
}

public static void assertEquals( FileHeader model, FileHeader model2 )
{
Assert.assertEquals( model.getDescription(), model2.getDescription() );
Expand Down

0 comments on commit 0d1586f

Please sign in to comment.