Skip to content

Commit 31b6853

Browse files
committed
SonarQube fixes.
1 parent 9f5b7fa commit 31b6853

22 files changed

Lines changed: 28 additions & 159 deletions

src/main/java/org/hdf5javalib/dataclass/HdfReference.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.hdf5javalib.dataclass;
22

33
import org.hdf5javalib.datatype.ReferenceDatatype;
4-
import org.hdf5javalib.hdffile.infrastructure.HdfGlobalHeap;
54

65
import java.nio.ByteBuffer;
76
import java.util.Arrays;
@@ -21,14 +20,6 @@ public HdfReference(byte[] bytes, ReferenceDatatype datatype) {
2120
this.datatype = datatype;
2221
}
2322

24-
public HdfReference(byte[] bytes, ReferenceDatatype datatype, HdfGlobalHeap globalHeap) {
25-
if (bytes == null || bytes.length == 0) throw new IllegalArgumentException("Bytes cannot be null or empty");
26-
if (datatype == null) throw new IllegalArgumentException("Datatype cannot be null");
27-
this.bytes = bytes;
28-
this.datatype = datatype;
29-
}
30-
31-
3223
public byte[] getBytes() {
3324
return bytes.clone();
3425
}
@@ -40,10 +31,6 @@ public ReferenceDatatype getDatatype() {
4031
@Override
4132
public String toString() {
4233
return datatype.toString(bytes);
43-
// StringBuilder sb = new StringBuilder();
44-
// for (byte b : bytes) sb.append(String.format("%02X", b));
45-
// String base = "Reference[" + ReferenceDatatype.getReferenceType(datatype.getClassBitField()).getDescription() + "]=" + sb;
46-
// return base;
4734
}
4835

4936
@Override

src/main/java/org/hdf5javalib/dataclass/reference/HdfAttributeReference.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.hdf5javalib.dataclass.reference;
22

33
import org.hdf5javalib.datatype.ReferenceDatatype;
4-
import org.hdf5javalib.hdfjava.HdfDataFile;
54
import org.hdf5javalib.utils.HdfDataHolder;
65

76
public class HdfAttributeReference implements HdfReferenceInstance {

src/main/java/org/hdf5javalib/dataclass/reference/HdfDatasetRegionReference.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import org.hdf5javalib.datatype.ReferenceDatatype;
66
import org.hdf5javalib.hdfjava.HdfBTree;
77
import org.hdf5javalib.hdfjava.HdfBTreeNode;
8-
import org.hdf5javalib.hdfjava.HdfDataFile;
98
import org.hdf5javalib.hdfjava.HdfDataObject;
109
import org.hdf5javalib.utils.HdfDataHolder;
1110

src/main/java/org/hdf5javalib/dataclass/reference/HdfObjectReference.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import org.hdf5javalib.hdffile.metadata.HdfSuperblock;
99
import org.hdf5javalib.hdfjava.HdfBTree;
1010
import org.hdf5javalib.hdfjava.HdfBTreeNode;
11-
import org.hdf5javalib.hdfjava.HdfDataFile;
1211
import org.hdf5javalib.hdfjava.HdfDataObject;
1312
import org.hdf5javalib.utils.HdfDataHolder;
1413

src/main/java/org/hdf5javalib/dataclass/reference/HdfReferenceInstance.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.hdf5javalib.dataclass.reference;
22

3-
import org.hdf5javalib.hdfjava.HdfDataFile;
43
import org.hdf5javalib.utils.HdfDataHolder;
54

65
public interface HdfReferenceInstance {

src/main/java/org/hdf5javalib/datatype/ArrayDatatype.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,6 @@ public <T> T getInstance(Class<T> clazz, byte[] bytes) {
211211
throw new UnsupportedOperationException("Unknown type: " + clazz);
212212
}
213213

214-
/**
215-
* Indicates whether a global heap is required for this datatype.
216-
*
217-
* @param required true if the global heap is required, false otherwise
218-
* @return false, as ArrayDatatype does not require a global heap
219-
*/
220-
@Override
221-
public boolean requiresGlobalHeap(boolean required) {
222-
return required || datatype.requiresGlobalHeap(required);
223-
}
224-
225214
/**
226215
* Converts the byte array to a string representation of the array elements.
227216
*

src/main/java/org/hdf5javalib/datatype/BitFieldDatatype.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,6 @@ public <T> T getInstance(Class<T> clazz, byte[] bytes) {
156156
throw new UnsupportedOperationException("Unknown type: " + clazz);
157157
}
158158

159-
/**
160-
* Indicates whether a global heap is required for this datatype.
161-
*
162-
* @param required true if the global heap is required, false otherwise
163-
* @return false, as BitFieldDatatype does not require a global heap
164-
*/
165-
@Override
166-
public boolean requiresGlobalHeap(boolean required) {
167-
return required || false;
168-
}
169-
170159
/**
171160
* Checks if the bitfield uses big-endian byte order.
172161
*

src/main/java/org/hdf5javalib/datatype/CompoundDatatype.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -322,20 +322,6 @@ public <T> T getInstance(Class<T> clazz, byte[] bytes) {
322322
throw new UnsupportedOperationException("Unknown type: " + clazz);
323323
}
324324

325-
/**
326-
* Indicates whether a global heap is required for this datatype.
327-
*
328-
* @param required true if the global heap is required for any member, false otherwise
329-
* @return true if any member requires a global heap, false otherwise
330-
*/
331-
@Override
332-
public boolean requiresGlobalHeap(boolean required) {
333-
for (CompoundMemberDatatype member : members) {
334-
required = member.requiresGlobalHeap(required);
335-
}
336-
return required;
337-
}
338-
339325
/**
340326
* Converts byte data to a POJO or record instance of the specified class using reflection.
341327
*

src/main/java/org/hdf5javalib/datatype/CompoundMemberDatatype.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -281,17 +281,6 @@ public <T> T getInstance(Class<T> clazz, byte[] bytes) {
281281
return datatype.getInstance(clazz, bytes);
282282
}
283283

284-
/**
285-
* Indicates whether a global heap is required for the member's base datatype.
286-
*
287-
* @param required true if the global heap is required, false otherwise
288-
* @return true if the base datatype requires a global heap, false otherwise
289-
*/
290-
@Override
291-
public boolean requiresGlobalHeap(boolean required) {
292-
return datatype.requiresGlobalHeap(required);
293-
}
294-
295284
/**
296285
* Sets the global heap for the member's base datatype.
297286
*

src/main/java/org/hdf5javalib/datatype/Datatype.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ public interface Datatype {
6565
*/
6666
<T> T getInstance(Class<T> clazz, byte[] bytes);
6767

68-
/**
69-
* Indicates whether the datatype requires a global heap.
70-
*
71-
* @param required true if the global heap is required, false otherwise
72-
* @return true if the datatype requires a global heap, false otherwise
73-
*/
74-
boolean requiresGlobalHeap(boolean required);
75-
7668
/**
7769
* Sets the global heap for the datatype.
7870
*

0 commit comments

Comments
 (0)