Skip to content

Commit f581825

Browse files
committed
refine int cast long
1 parent f736e2c commit f581825

File tree

10 files changed

+12
-12
lines changed

10 files changed

+12
-12
lines changed

poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestSXSSFBugs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ void test62872() throws Exception {
185185
cell = row.createCell(j - 1);
186186

187187
//make some noise
188-
cell.setCellValue(new Date(i * TEN_MINUTES + (j * TEN_MINUTES) / COLUMN_COUNT));
188+
cell.setCellValue(new Date((long) i * TEN_MINUTES + (j * TEN_MINUTES) / COLUMN_COUNT));
189189
}
190190
i++;
191191
}

poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Notes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
2929
public final class Notes extends SheetContainer
3030
{
3131
private byte[] _header;
32-
private static long _type = 1008l;
32+
private static long _type = 1008L;
3333

3434
// Links to our more interesting children
3535
private NotesAtom notesAtom;

poi-scratchpad/src/main/java/org/apache/poi/hslf/record/NotesAtom.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
3535
public final class NotesAtom extends RecordAtom {
3636

3737
private byte[] _header;
38-
private static long _type = 1009l;
38+
private static long _type = 1009L;
3939

4040
private int slideID;
4141
private boolean followMasterObjects;

poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Slide.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
3131
public final class Slide extends SheetContainer
3232
{
3333
private byte[] _header;
34-
private static long _type = 1006l;
34+
private static long _type = 1006L;
3535

3636
// Links to our more interesting children
3737
private SlideAtom slideAtom;

poi-scratchpad/src/main/java/org/apache/poi/hslf/record/SlideAtom.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public final class SlideAtom extends RecordAtom {
3939
// private static final int MASTER_SLIDE_ID = 0x00000000;
4040

4141
private byte[] _header;
42-
private static long _type = 1007l;
42+
private static long _type = 1007L;
4343

4444
private int masterID;
4545
private int notesID;

poi-scratchpad/src/main/java/org/apache/poi/hslf/record/SlidePersistAtom.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public final class SlidePersistAtom extends RecordAtom {
3838
//arbitrarily selected; may need to increase
3939
private static final int MAX_RECORD_LENGTH = 32;
4040

41-
private static final long _type = 1011l;
41+
private static final long _type = 1011L;
4242
private static final int HAS_SHAPES_OTHER_THAN_PLACEHOLDERS = 4;
4343

4444
private static final int[] FLAGS_MASKS = { HAS_SHAPES_OTHER_THAN_PLACEHOLDERS };

poi-scratchpad/src/main/java/org/apache/poi/hsmf/datatypes/Chunks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public void record(Chunk chunk) {
195195
// Work out what MAPIProperty this corresponds to
196196
MAPIProperty prop = MAPIProperty.get(chunk.getChunkId());
197197
if (prop == MAPIProperty.UNKNOWN) {
198-
long id = (chunk.getChunkId() << 16) + (long)chunk.getType().getId();
198+
long id = ((long) chunk.getChunkId() << 16) + (long)chunk.getType().getId();
199199
prop = unknownProperties.get(id);
200200
if (prop == null) {
201201
prop = MAPIProperty.createCustom(chunk.getChunkId(), chunk.getType(), chunk.getEntryName());

poi-scratchpad/src/main/java/org/apache/poi/hsmf/datatypes/NameIdChunks.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ private long getStreamID(int propertyKind, int nameOffset, ClassID guid, int gui
229229
Consumer<String> propertyNameSetter, Consumer<Long> propertyNameCRC32Setter) {
230230
if (propertyKind == 0) {
231231
// numerical named property
232-
return 0x1000L + (nameOffset ^ (guidIndex << 1)) % 0x1F;
232+
return 0x1000L + (nameOffset ^ ((long) guidIndex << 1)) % 0x1F;
233233
}
234234

235235
// string named property
@@ -250,7 +250,7 @@ private long getStreamID(int propertyKind, int nameOffset, ClassID guid, int gui
250250
propertyNameCRC32Setter.accept(propertyNameCRC32);
251251
}
252252
}
253-
return 0x1000 + (propertyNameCRC32 ^ ((guidIndex << 1) | 1)) % 0x1F;
253+
return 0x1000 + (propertyNameCRC32 ^ (((long) guidIndex << 1) | 1)) % 0x1F;
254254
}
255255

256256
/**

poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestDocumentEncryptionAtom.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ public final class TestDocumentEncryptionAtom {
8989
@Test
9090
void recordType() throws IOException {
9191
DocumentEncryptionAtom dea1 = new DocumentEncryptionAtom(data_a, 0, data_a.length);
92-
assertEquals(12052l, dea1.getRecordType());
92+
assertEquals(12052L, dea1.getRecordType());
9393

9494
DocumentEncryptionAtom dea2 = new DocumentEncryptionAtom(data_b, 0, data_b.length);
95-
assertEquals(12052l, dea2.getRecordType());
95+
assertEquals(12052L, dea2.getRecordType());
9696

9797
assertEquals(199, data_a.length);
9898
assertEquals(198, data_b.length);

poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestExObjList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void testRealFile() throws Exception {
3939
// Get the ExObjList
4040
ExObjList exObjList = doc.getExObjList(false);
4141
assertNotNull(exObjList);
42-
assertEquals(1033l, exObjList.getRecordType());
42+
assertEquals(1033L, exObjList.getRecordType());
4343

4444
// Check the atom
4545
assertNotNull(exObjList.getExObjListAtom());

0 commit comments

Comments
 (0)