@@ -66,46 +66,31 @@ public void testAttributeSetFillValue() throws Exception {
6666 try (Context ctx = new Context ();
6767 Attribute a = new Attribute (ctx , "a2" , Datatype .TILEDB_INT32 )) {
6868
69- NativeArray arr = new NativeArray (ctx , 1 , Datatype .TILEDB_INT32 );
70-
71- arr .setItem (0 , 5 );
72-
73- a .setFillValue (arr , BigInteger .valueOf (arr .getNativeTypeSize () * arr .getSize ()));
69+ a .setFillValue (5 );
7470
7571 Assert .assertEquals (5 , a .getFillValue ().getFirst ());
7672 Assert .assertEquals (
77- BigInteger .valueOf (arr .getNativeTypeSize () * arr .getSize ()),
78- a .getFillValue ().getSecond ());
73+ BigInteger .valueOf (a .getType ().getNativeSize ()), a .getFillValue ().getSecond ());
7974 }
8075
8176 try (Context ctx = new Context ();
8277 Attribute a = new Attribute (ctx , "a2" , Datatype .TILEDB_INT64 )) {
8378
84- NativeArray arr = new NativeArray (ctx , 1 , Datatype .TILEDB_INT64 );
85-
86- arr .setItem (0 , 5L );
87-
88- a .setFillValue (arr , BigInteger .valueOf (arr .getNativeTypeSize () * arr .getSize ()));
79+ a .setFillValue (5L );
8980
9081 Assert .assertEquals (5L , a .getFillValue ().getFirst ());
9182 Assert .assertEquals (
92- BigInteger .valueOf (arr .getNativeTypeSize () * arr .getSize ()),
93- a .getFillValue ().getSecond ());
83+ BigInteger .valueOf (a .getType ().getNativeSize ()), a .getFillValue ().getSecond ());
9484 }
9585
9686 try (Context ctx = new Context ();
9787 Attribute a = new Attribute (ctx , "a2" , Datatype .TILEDB_CHAR )) {
9888
99- NativeArray arr = new NativeArray (ctx , 1 , Datatype .TILEDB_CHAR );
100-
101- arr .setItem (0 , "c" );
102-
103- a .setFillValue (arr , BigInteger .valueOf (arr .getNativeTypeSize () * arr .getSize ()));
89+ a .setFillValue ((byte ) 'c' );
10490
10591 Assert .assertEquals ((byte ) 'c' , a .getFillValue ().getFirst ());
10692 Assert .assertEquals (
107- BigInteger .valueOf (arr .getNativeTypeSize () * arr .getSize ()),
108- a .getFillValue ().getSecond ());
93+ BigInteger .valueOf (a .getType ().getNativeSize ()), a .getFillValue ().getSecond ());
10994 }
11095 }
11196
@@ -116,16 +101,11 @@ public void testAttributeSetFillValueNullable() throws Exception {
116101
117102 a .setNullable (true );
118103
119- NativeArray arr = new NativeArray (ctx , 1 , Datatype .TILEDB_INT32 );
120-
121- arr .setItem (0 , 5 );
122-
123- a .setFillValueNullable (
124- arr , BigInteger .valueOf (arr .getNativeTypeSize () * arr .getSize ()), true );
104+ a .setFillValueNullable (5 , true );
125105
126106 Assert .assertEquals (5 , a .getFillValueNullable ().getFirst ());
127107 Assert .assertEquals (
128- BigInteger .valueOf (arr . getNativeTypeSize () * arr . getSize ()),
108+ BigInteger .valueOf (a . getType (). getNativeSize ()),
129109 a .getFillValueNullable ().getSecond ().getFirst ());
130110
131111 Assert .assertEquals (true , a .getFillValueNullable ().getSecond ().getSecond ());
@@ -136,16 +116,11 @@ public void testAttributeSetFillValueNullable() throws Exception {
136116
137117 a .setNullable (true );
138118
139- NativeArray arr = new NativeArray (ctx , 1 , Datatype .TILEDB_INT64 );
140-
141- arr .setItem (0 , 5L );
142-
143- a .setFillValueNullable (
144- arr , BigInteger .valueOf (arr .getNativeTypeSize () * arr .getSize ()), false );
119+ a .setFillValueNullable (5L , false );
145120
146121 Assert .assertEquals (5L , a .getFillValueNullable ().getFirst ());
147122 Assert .assertEquals (
148- BigInteger .valueOf (arr . getNativeTypeSize () * arr . getSize ()),
123+ BigInteger .valueOf (a . getType (). getNativeSize ()),
149124 a .getFillValueNullable ().getSecond ().getFirst ());
150125
151126 Assert .assertEquals (false , a .getFillValueNullable ().getSecond ().getSecond ());
@@ -156,16 +131,11 @@ public void testAttributeSetFillValueNullable() throws Exception {
156131
157132 a .setNullable (true );
158133
159- NativeArray arr = new NativeArray (ctx , 1 , Datatype .TILEDB_CHAR );
160-
161- arr .setItem (0 , "c" );
162-
163- a .setFillValueNullable (
164- arr , BigInteger .valueOf (arr .getNativeTypeSize () * arr .getSize ()), false );
134+ a .setFillValueNullable ((byte ) 'c' , false );
165135
166136 Assert .assertEquals ((byte ) 'c' , a .getFillValueNullable ().getFirst ());
167137 Assert .assertEquals (
168- BigInteger .valueOf (arr . getNativeTypeSize () * arr . getSize ()),
138+ BigInteger .valueOf (a . getType (). getNativeSize ()),
169139 a .getFillValueNullable ().getSecond ().getFirst ());
170140
171141 Assert .assertEquals (false , a .getFillValueNullable ().getSecond ().getSecond ());
0 commit comments