Skip to content

GIAI Builder returns null when input RFID tag is not valid #10

Open
@yolave

Description

@yolave

When using org.epctagcoder.parse.GIAI.ParseGIAI.Builder() to create a new instance, setting an invalid RFID tag in the method org.epctagcoder.parse.GIAI.ParseGIAI.ChoiceStep.withRFIDTag(String) produces a NullPointerException when finally calling org.epctagcoder.parse.GIAI.ParseGIAI.BuildStep.build() method.

For example, the following snippet will fail:

ParseGIAI.Builder()
.withRFIDTag("anyNonComplaintValue").build()
 .getGIAI() 

Instead of null, the org.epctagcoder.parse.GIAI.ParseGIAI.BuildStep.build() method might throw a ParseException (or any other dedicated exception) or even better, it could return a java.util.Optional to be easier to check the result of the parsing.

Thank you for this awesome library!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions