Unidata / netcdf-java

The Unidata netcdf-java library
https://docs.unidata.ucar.edu/netcdf-java/current/userguide/index.html
BSD 3-Clause "New" or "Revised" License
142 stars 69 forks source link

Compilation warnings #1379

Open simonff opened 3 weeks ago

simonff commented 3 weeks ago

Versions impacted by the bug

No response

What went wrong?

netcdf/cdm/core/src/main/java/ucar/ma2/Index.java:22: warning: [ClassInitializationDeadlock] Possible class initialization deadlock: Index0D is a subclass of the containing class Index public static final Index0D scalarIndexImmutable = new Index0D(); // immutable, so can be shared ^


netcdf/cdm/core/src/main/java/ucar/ma2/StructureData.java:73: warning: [ClassInitializationDeadlock] Possible class initialization deadlock: StructureDataW is a subclass of the containing class StructureData public static final StructureData EMPTY = new StructureDataW(StructureMembers.builder().setName("empty").build()); ^


netcdf/cdm/radial/src/main/java/ucar/nc2/iosp/nids/Nidsheader.java:654: warning: [ComparisonOutOfRange] shorts may have a value in the range -32768 to 32767; therefore, this comparison to 0x8000 will always evaluate to true if (Divlen_divider != 0x8000) { ^


netcdf/cdm/core/src/main/java/ucar/ma2/StructureMembers.java:363: error: [EqualsWrongThing] Suspicious comparison between getFullName() and getName() return getFullName().equals(other.getName()) && Objects.equals(getDescription(), other.getDescription()) ^

Relevant stack trace

No response

Relevant log messages

No response

If you have an example file that you can share, please attach it to this issue.

If so, may we include it in our test datasets to help ensure the bug does not return once fixed? Note: the test datasets are publicly accessible without restriction.

Yes

Code of Conduct