Skip to content

Commit

Permalink
fixed possible NPE when writing an Is24CsvRecord
Browse files Browse the repository at this point in the history
The methods Is24CsvRecord.setAdressdruck(), Is24CsvRecord.setAktiv() & Is24CsvRecord.setProvisionpflichtig() only support primitive boolean parameters. This may lead to problems, when using this methods together with Boolean objects (java.lang.Boolean), that may also contain null values. In case of a parameter with null value, the method should set the default value specified by IS24-CSV.
  • Loading branch information
pinhead84 committed Aug 6, 2015
1 parent 0cde6b0 commit 65a5cac
Showing 1 changed file with 18 additions and 3 deletions.
Expand Up @@ -939,15 +939,25 @@ protected String parse( String value )
}

public void setAdressdruck( boolean value )
{
this.setAdressdruck( Boolean.valueOf( value ) );
}

public void setAdressdruck( Boolean value )
{
this.set( FIELD_ADRESSDRUCK,
Is24CsvFormat.printBoolean( value ) );
Is24CsvFormat.printBoolean( (value!=null)? value: false ) );
}

public void setAktiv( boolean value )
{
this.setAktiv( Boolean.valueOf( value ) );
}

public void setAktiv( Boolean value )
{
this.set( FIELD_STATUS,
(value)? "1": "0" );
(value || value==null)? "1": "0" );
}

public void setAnbieterObjektId( String value )
Expand Down Expand Up @@ -1343,9 +1353,14 @@ public void setProvision( String value )
}

public void setProvisionpflichtig( boolean value )
{
this.setProvisionpflichtig( Boolean.valueOf( value ) );
}

public void setProvisionpflichtig( Boolean value )
{
this.set( FIELD_PROVISIONPFLICHTIG,
Is24CsvFormat.printBoolean( value ) );
Is24CsvFormat.printBoolean( (value!=null)? value: false ) );
}

public void setProvisionshinweis( String value )
Expand Down

0 comments on commit 65a5cac

Please sign in to comment.