Skip to content

life.qbic.datamodel.people.Address can contain null #55

@KochTobi

Description

@KochTobi

The Address class has a default constructor and can return null on values leading to NullPointerExceptions. Example for an address containing null below.

long imageId = imageInfo.getImageId();
ImagingHardware hardware =new SRMHardware.Builder("some objective", new Detector("dummy detector")).build();
Location dummyLocation = new Location("13", new Address());
Instrument dummyInstrument = new Instrument("test_manufacturer", "Donnerblitz 2001", "db-2001-hp.5", dummyLocation, "DUMMY", hardware);
omeroClient.associateInstrumentWithImage(dummyInstrument, imageId);

It would be better to set default values of empty Strings using the default constructor or a builder pattern to avoid Nullpointers from occurring in the DTO.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions