Skip to content

Commit b4797d9

Browse files
committed
Remove method 'SequenceStorage.append'.
1 parent 8959815 commit b4797d9

File tree

14 files changed

+0
-129
lines changed

14 files changed

+0
-129
lines changed

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/runtime/SequenceStorageTests.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,6 @@ public void objectsInsert() {
101101
assertEquals(7, store.length());
102102
}
103103

104-
@Test
105-
public void objectAppend() {
106-
ObjectSequenceStorage store = new ObjectSequenceStorage(getObjectValues());
107-
store.append(42);
108-
assertEquals(42, store.getItemNormalized(6));
109-
assertEquals(7, store.length());
110-
}
111-
112104
/**
113105
* IntSequenceStorage tests.
114106
*/
@@ -167,13 +159,4 @@ public void intInsert() throws SequenceStoreException {
167159
assertEquals(6, store.getItemNormalized(6));
168160
assertEquals(7, store.length());
169161
}
170-
171-
@Test
172-
public void intAppend() throws SequenceStoreException {
173-
IntSequenceStorage store = new IntSequenceStorage(getIntValues());
174-
store.append(42);
175-
assertEquals(42, store.getItemNormalized(6));
176-
assertEquals(7, store.length());
177-
}
178-
179162
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/BoolSequenceStorage.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,6 @@ public int indexOfBool(boolean value) {
280280
return -1;
281281
}
282282

283-
@Override
284-
public void append(Object value) throws SequenceStoreException {
285-
if (value instanceof Boolean) {
286-
appendBool((boolean) value);
287-
} else {
288-
throw new SequenceStoreException(value);
289-
}
290-
}
291-
292283
public void appendBool(boolean value) {
293284
ensureCapacity(length + 1);
294285
values[length] = value;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/ByteSequenceStorage.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import java.util.Arrays;
3232

3333
import com.oracle.graal.python.PythonLanguage;
34-
import com.oracle.graal.python.builtins.objects.ints.PInt;
3534
import com.oracle.graal.python.runtime.sequence.SequenceUtil;
3635
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
3736

@@ -378,25 +377,6 @@ public int indexOfInt(int value) {
378377
return -1;
379378
}
380379

381-
@Override
382-
public void append(Object value) throws SequenceStoreException {
383-
if (value instanceof Integer) {
384-
appendInt((int) value);
385-
} else if (value instanceof Long) {
386-
appendLong((long) value);
387-
} else if (value instanceof PInt) {
388-
try {
389-
appendInt(((PInt) value).intValueExact());
390-
} catch (ArithmeticException e) {
391-
throw new SequenceStoreException(value);
392-
}
393-
} else if (value instanceof Byte) {
394-
appendByte((byte) value);
395-
} else {
396-
throw new SequenceStoreException(value);
397-
}
398-
}
399-
400380
public void appendLong(long value) {
401381
if (value < 0 || value >= 256) {
402382
throw new SequenceStoreException(value);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/CharSequenceStorage.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,6 @@ public int index(Object value) {
139139
throw new UnsupportedOperationException();
140140
}
141141

142-
@Override
143-
public void append(Object value) throws SequenceStoreException {
144-
throw new UnsupportedOperationException();
145-
}
146-
147142
@Override
148143
public void reverse() {
149144
throw new UnsupportedOperationException();

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/DoubleSequenceStorage.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,6 @@ public int indexOfDouble(double value) {
283283
return -1;
284284
}
285285

286-
@Override
287-
public void append(Object value) throws SequenceStoreException {
288-
if (value instanceof Double) {
289-
appendDouble((double) value);
290-
} else {
291-
throw new SequenceStoreException(value);
292-
}
293-
}
294-
295286
public void appendDouble(double value) {
296287
ensureCapacity(length + 1);
297288
values[length] = value;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/EmptySequenceStorage.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,6 @@ public Object popInBound(int idx) {
156156
return new UnsupportedOperationException();
157157
}
158158

159-
@Override
160-
public void append(Object value) throws SequenceStoreException {
161-
throw new SequenceStoreException(value);
162-
}
163-
164159
@Override
165160
public void reverse() {
166161
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/IntSequenceStorage.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,6 @@ public int indexOfInt(int value) {
287287
return -1;
288288
}
289289

290-
@Override
291-
public void append(Object value) throws SequenceStoreException {
292-
if (value instanceof Integer) {
293-
appendInt((int) value);
294-
} else {
295-
throw new SequenceStoreException(value);
296-
}
297-
}
298-
299290
public void appendInt(int value) {
300291
ensureCapacity(length + 1);
301292
values[length] = value;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/ListSequenceStorage.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -313,21 +313,6 @@ public int indexOfList(PList value) {
313313
return -1;
314314
}
315315

316-
@Override
317-
public void append(Object value) throws SequenceStoreException {
318-
if (value instanceof PList) {
319-
SequenceStorage list = ((PList) value).getSequenceStorage();
320-
if (list instanceof ListSequenceStorage && ((ListSequenceStorage) list).getKind() == kind)
321-
appendList((PList) value);
322-
else if (list.getClass() == kind)
323-
appendList((PList) value);
324-
else
325-
throw new SequenceStoreException(value);
326-
} else
327-
throw new SequenceStoreException(value);
328-
329-
}
330-
331316
public void appendList(PList value) {
332317
ensureCapacity(length + 1);
333318
values[length] = value;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/LongSequenceStorage.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -295,18 +295,6 @@ public int indexOfLong(long value) {
295295
return -1;
296296
}
297297

298-
@Override
299-
public void append(Object val) throws SequenceStoreException {
300-
Object value = (val instanceof Integer) ? BigInteger.valueOf((int) val).longValue() : val;
301-
value = (val instanceof BigInteger) ? ((BigInteger) val).longValue() : value;
302-
303-
if (value instanceof Long) {
304-
appendLong((long) value);
305-
} else {
306-
throw new SequenceStoreException(value);
307-
}
308-
}
309-
310298
public void appendLong(long value) {
311299
ensureCapacity(length + 1);
312300
values[length] = value;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/NativeSequenceStorage.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,6 @@ public Object popInBound(int idx) {
174174
throw new AssertionError("should not reach");
175175
}
176176

177-
@Override
178-
public void append(Object value) throws SequenceStoreException {
179-
throw new AssertionError("should not reach");
180-
}
181-
182177
@Override
183178
public void reverse() {
184179
throw new AssertionError("should not reach");

0 commit comments

Comments
 (0)