Skip to content

Commit c56b00e

Browse files
committed
[ci] Remove new of primative as known
1 parent f0a7f6e commit c56b00e

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

src/test/java/org/apache/ibatis/binding/BindingTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void shouldFindPostsInList() {
123123
void shouldFindPostsInArray() {
124124
try (SqlSession session = sqlSessionFactory.openSession()) {
125125
BoundAuthorMapper mapper = session.getMapper(BoundAuthorMapper.class);
126-
Integer[] params = new Integer[] { 1, 3, 5 };
126+
Integer[] params = { 1, 3, 5 };
127127
List<Post> posts = mapper.findPostsInArray(params);
128128
assertEquals(3, posts.size());
129129
session.rollback();

src/test/java/org/apache/ibatis/cache/CacheKeyTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ void shouldDemonstrateEmptyAndNullKeysAreEqual() {
8181

8282
@Test
8383
void shouldTestCacheKeysWithBinaryArrays() {
84-
byte[] array1 = new byte[] { 1 };
85-
byte[] array2 = new byte[] { 1 };
84+
byte[] array1 = { 1 };
85+
byte[] array2 = { 1 };
8686
CacheKey key1 = new CacheKey(new Object[] { array1 });
8787
CacheKey key2 = new CacheKey(new Object[] { array2 });
8888
assertEquals(key1, key2);

src/test/java/org/apache/ibatis/mapping/BoundSqlTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void testHasAdditionalParameter() {
4141
bean.id = 1;
4242
boundSql.setAdditionalParameter("person", bean);
4343

44-
String[] array = new String[] { "User1", "User2" };
44+
String[] array = { "User1", "User2" };
4545
boundSql.setAdditionalParameter("array", array);
4646

4747
assertFalse(boundSql.hasAdditionalParameter("pet"));

src/test/java/org/apache/ibatis/submitted/blobtest/BlobTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void testInsertBlobThenSelectAll() {
5050
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
5151
BlobMapper blobMapper = sqlSession.getMapper(BlobMapper.class);
5252

53-
byte[] myblob = new byte[] { 1, 2, 3, 4, 5 };
53+
byte[] myblob = { 1, 2, 3, 4, 5 };
5454
BlobRecord blobRecord = new BlobRecord(1, myblob);
5555
int rows = blobMapper.insert(blobRecord);
5656
assertEquals(1, rows);
@@ -73,7 +73,7 @@ void testInsertBlobObjectsThenSelectAll() {
7373
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
7474
BlobMapper blobMapper = sqlSession.getMapper(BlobMapper.class);
7575

76-
Byte[] myblob = new Byte[] { 1, 2, 3, 4, 5 };
76+
Byte[] myblob = { 1, 2, 3, 4, 5 };
7777
BlobRecord blobRecord = new BlobRecord(1, myblob);
7878
int rows = blobMapper.insert(blobRecord);
7979
assertEquals(1, rows);

src/test/java/org/apache/ibatis/submitted/nested/NestedForEachTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void testSimpleSelect() {
6363
void testSimpleSelectWithPrimitives() {
6464
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
6565
Map<String, Object> parameter = new HashMap<>();
66-
int[] array = new int[] { 1, 3, 5 };
66+
int[] array = { 1, 3, 5 };
6767
parameter.put("ids", array);
6868

6969
List<Map<String, Object>> answer = sqlSession

src/test/java/org/apache/ibatis/type/ArrayTypeHandlerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void shouldFailForNonArrayParameter() {
7575
@Test
7676
public void shouldGetResultFromResultSetByName() throws Exception {
7777
when(rs.getArray("column")).thenReturn(mockArray);
78-
String[] stringArray = new String[] { "a", "b" };
78+
String[] stringArray = { "a", "b" };
7979
when(mockArray.getArray()).thenReturn(stringArray);
8080
assertEquals(stringArray, TYPE_HANDLER.getResult(rs, "column"));
8181
verify(mockArray).free();
@@ -92,7 +92,7 @@ public void shouldGetResultNullFromResultSetByName() throws Exception {
9292
@Test
9393
public void shouldGetResultFromResultSetByPosition() throws Exception {
9494
when(rs.getArray(1)).thenReturn(mockArray);
95-
String[] stringArray = new String[] { "a", "b" };
95+
String[] stringArray = { "a", "b" };
9696
when(mockArray.getArray()).thenReturn(stringArray);
9797
assertEquals(stringArray, TYPE_HANDLER.getResult(rs, 1));
9898
verify(mockArray).free();
@@ -109,7 +109,7 @@ public void shouldGetResultNullFromResultSetByPosition() throws Exception {
109109
@Test
110110
public void shouldGetResultFromCallableStatement() throws Exception {
111111
when(cs.getArray(1)).thenReturn(mockArray);
112-
String[] stringArray = new String[] { "a", "b" };
112+
String[] stringArray = { "a", "b" };
113113
when(mockArray.getArray()).thenReturn(stringArray);
114114
assertEquals(stringArray, TYPE_HANDLER.getResult(cs, 1));
115115
verify(mockArray).free();

src/test/java/org/apache/ibatis/type/BlobByteObjectArrayTypeHandlerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public void shouldSetParameter() throws Exception {
5252
@Override
5353
@Test
5454
public void shouldGetResultFromResultSetByName() throws Exception {
55-
byte[] byteArray = new byte[] { 1, 2 };
55+
byte[] byteArray = { 1, 2 };
5656
when(rs.getBlob("column")).thenReturn(blob);
5757
when(blob.length()).thenReturn((long) byteArray.length);
5858
when(blob.getBytes(1, 2)).thenReturn(byteArray);
@@ -70,7 +70,7 @@ public void shouldGetResultNullFromResultSetByName() throws Exception {
7070
@Override
7171
@Test
7272
public void shouldGetResultFromResultSetByPosition() throws Exception {
73-
byte[] byteArray = new byte[] { 1, 2 };
73+
byte[] byteArray = { 1, 2 };
7474
when(rs.getBlob(1)).thenReturn(blob);
7575
when(blob.length()).thenReturn((long) byteArray.length);
7676
when(blob.getBytes(1, 2)).thenReturn(byteArray);
@@ -87,7 +87,7 @@ public void shouldGetResultNullFromResultSetByPosition() throws Exception {
8787
@Override
8888
@Test
8989
public void shouldGetResultFromCallableStatement() throws Exception {
90-
byte[] byteArray = new byte[] { 1, 2 };
90+
byte[] byteArray = { 1, 2 };
9191
when(cs.getBlob(1)).thenReturn(blob);
9292
when(blob.length()).thenReturn((long) byteArray.length);
9393
when(blob.getBytes(1, 2)).thenReturn(byteArray);

src/test/java/org/apache/ibatis/type/ByteObjectArrayTypeHandlerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void shouldSetParameter() throws Exception {
3636
@Override
3737
@Test
3838
public void shouldGetResultFromResultSetByName() throws Exception {
39-
byte[] byteArray = new byte[] { 1, 2 };
39+
byte[] byteArray = { 1, 2 };
4040
when(rs.getBytes("column")).thenReturn(byteArray);
4141
assertThat(TYPE_HANDLER.getResult(rs, "column")).isEqualTo(new Byte[] { 1, 2 });
4242
verify(rs, never()).wasNull();
@@ -53,7 +53,7 @@ public void shouldGetResultNullFromResultSetByName() throws Exception {
5353
@Override
5454
@Test
5555
public void shouldGetResultFromResultSetByPosition() throws Exception {
56-
byte[] byteArray = new byte[] { 1, 2 };
56+
byte[] byteArray = { 1, 2 };
5757
when(rs.getBytes(1)).thenReturn(byteArray);
5858
assertThat(TYPE_HANDLER.getResult(rs, 1)).isEqualTo(new Byte[] { 1, 2 });
5959
verify(rs, never()).wasNull();
@@ -70,7 +70,7 @@ public void shouldGetResultNullFromResultSetByPosition() throws Exception {
7070
@Override
7171
@Test
7272
public void shouldGetResultFromCallableStatement() throws Exception {
73-
byte[] byteArray = new byte[] { 1, 2 };
73+
byte[] byteArray = { 1, 2 };
7474
when(cs.getBytes(1)).thenReturn(byteArray);
7575
assertThat(TYPE_HANDLER.getResult(cs, 1)).isEqualTo(new Byte[] { 1, 2 });
7676
verify(cs, never()).wasNull();

0 commit comments

Comments
 (0)