Skip to content

Commit ef84478

Browse files
committed
PDFBOX-5660: Sonar fix
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1924374 13f79535-47bb-0310-9956-ffa450edef68
1 parent 21b06b1 commit ef84478

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

fontbox/src/test/java/org/apache/fontbox/cmap/CMapStringsTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
package org.apache.fontbox.cmap;
1818

1919
import static org.junit.jupiter.api.Assertions.assertEquals;
20+
import static org.junit.jupiter.api.Assertions.assertNotSame;
2021
import static org.junit.jupiter.api.Assertions.assertNull;
2122
import static org.junit.jupiter.api.Assertions.assertSame;
22-
import static org.junit.jupiter.api.Assertions.assertTrue;
2323

2424
import java.nio.charset.StandardCharsets;
2525

@@ -125,22 +125,22 @@ void getByteValuesOneByte()
125125
assertSame(CMapStrings.getByteValue(minValueOneByte), CMapStrings
126126
.getByteValue(minValueOneByte));
127127
// the cached value isn't the same object than the given one
128-
assertTrue(minValueOneByte != CMapStrings.getByteValue(minValueOneByte));
128+
assertNotSame(minValueOneByte, CMapStrings.getByteValue(minValueOneByte));
129129

130130

131131
byte[] maxValueOneByte = new byte[] { (byte) 0xff };
132132
assertEquals(CMapStrings.getByteValue(maxValueOneByte),
133133
CMapStrings.getByteValue(maxValueOneByte));
134134
assertSame(CMapStrings.getByteValue(maxValueOneByte), CMapStrings
135135
.getByteValue(maxValueOneByte));
136-
assertTrue(maxValueOneByte != CMapStrings.getByteValue(maxValueOneByte));
136+
assertNotSame(maxValueOneByte, CMapStrings.getByteValue(maxValueOneByte));
137137

138138
byte[] anyValueOneByte = new byte[] { 98 };
139139
assertEquals(CMapStrings.getByteValue(anyValueOneByte),
140140
CMapStrings.getByteValue(anyValueOneByte));
141141
assertSame(CMapStrings.getByteValue(anyValueOneByte), CMapStrings
142142
.getByteValue(anyValueOneByte));
143-
assertTrue(anyValueOneByte != CMapStrings.getByteValue(anyValueOneByte));
143+
assertNotSame(anyValueOneByte, CMapStrings.getByteValue(anyValueOneByte));
144144
}
145145

146146
@Test
@@ -154,35 +154,35 @@ void getByteValuesTwoByte()
154154
assertSame(CMapStrings.getByteValue(minValueTwoByte), CMapStrings
155155
.getByteValue(minValueTwoByte));
156156
// the cached value isn't the same object than the given one
157-
assertTrue(minValueTwoByte != CMapStrings.getByteValue(minValueTwoByte));
157+
assertNotSame(minValueTwoByte, CMapStrings.getByteValue(minValueTwoByte));
158158

159159
byte[] maxValueTwoByte = new byte[] { (byte) 0xff, (byte) 0xff };
160160
assertEquals(CMapStrings.getByteValue(maxValueTwoByte),
161161
CMapStrings.getByteValue(maxValueTwoByte));
162162
assertSame(CMapStrings.getByteValue(maxValueTwoByte), CMapStrings
163163
.getByteValue(maxValueTwoByte));
164-
assertTrue(maxValueTwoByte != CMapStrings.getByteValue(maxValueTwoByte));
164+
assertNotSame(maxValueTwoByte, CMapStrings.getByteValue(maxValueTwoByte));
165165

166166
byte[] anyValueTwoByte1 = new byte[] { 0x62, 0x43 };
167167
assertEquals(CMapStrings.getByteValue(anyValueTwoByte1),
168168
CMapStrings.getByteValue(anyValueTwoByte1));
169169
assertSame(CMapStrings.getByteValue(anyValueTwoByte1), CMapStrings
170170
.getByteValue(anyValueTwoByte1));
171-
assertTrue(anyValueTwoByte1 != CMapStrings.getByteValue(anyValueTwoByte1));
171+
assertNotSame(anyValueTwoByte1, CMapStrings.getByteValue(anyValueTwoByte1));
172172

173173
byte[] anyValueTwoByte2 = new byte[] { (byte) 0xff, 0x43 };
174174
assertEquals(CMapStrings.getByteValue(anyValueTwoByte2),
175175
CMapStrings.getByteValue(anyValueTwoByte2));
176176
assertSame(CMapStrings.getByteValue(anyValueTwoByte2), CMapStrings
177177
.getByteValue(anyValueTwoByte2));
178-
assertTrue(anyValueTwoByte2 != CMapStrings.getByteValue(anyValueTwoByte2));
178+
assertNotSame(anyValueTwoByte2, CMapStrings.getByteValue(anyValueTwoByte2));
179179

180180
byte[] anyValueTwoByte3 = new byte[] { 0x38, (byte) 0xff };
181181
assertEquals(CMapStrings.getByteValue(anyValueTwoByte3),
182182
CMapStrings.getByteValue(anyValueTwoByte3));
183183
assertSame(CMapStrings.getByteValue(anyValueTwoByte3), CMapStrings
184184
.getByteValue(anyValueTwoByte3));
185-
assertTrue(anyValueTwoByte3 != CMapStrings.getByteValue(anyValueTwoByte3));
185+
assertNotSame(anyValueTwoByte3, CMapStrings.getByteValue(anyValueTwoByte3));
186186
}
187187

188188
@Test

0 commit comments

Comments
 (0)