Skip to content

Commit 44c3885

Browse files
committed
fix ecj warnings and style
1 parent e8ea8fd commit 44c3885

24 files changed

+108
-80
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/ArrayModuleBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ PArray arrayByteInitializer(VirtualFrame frame, LazyPythonClass cls, @SuppressWa
152152
}
153153

154154
@Specialization(guards = "isCharArray(typeCode)")
155-
PArray arrayCharInitializer(VirtualFrame frame, LazyPythonClass cls, @SuppressWarnings("unused") String typeCode, PSequence initializer,
155+
PArray arrayCharInitializer(LazyPythonClass cls, @SuppressWarnings("unused") String typeCode, PSequence initializer,
156156
@Cached SequenceNodes.GetSequenceStorageNode getSequenceStorageNode,
157157
@Cached SequenceStorageNodes.ToByteArrayNode toByteArrayNode) {
158158
byte[] byteArray = toByteArrayNode.execute(getSequenceStorageNode.execute(initializer));

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/CodecsModuleBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,13 +589,13 @@ abstract static class RawDecodeNode extends EncodeBaseNode {
589589
@Child private GetInternalByteArrayNode toByteArrayNode;
590590

591591
@Specialization
592-
Object decode(VirtualFrame frame, PIBytesLike bytes, @SuppressWarnings("unused") PNone errors) {
592+
Object decode(PIBytesLike bytes, @SuppressWarnings("unused") PNone errors) {
593593
String string = decodeBytes(getBytesBuffer(bytes), "strict");
594594
return factory().createTuple(new Object[]{string, string.length()});
595595
}
596596

597597
@Specialization(guards = {"isString(errors)"})
598-
Object decode(VirtualFrame frame, PIBytesLike bytes, Object errors,
598+
Object decode(PIBytesLike bytes, Object errors,
599599
@Cached("createClassProfile()") ValueProfile errorsTypeProfile) {
600600
Object profiledErrors = errorsTypeProfile.profile(errors);
601601
String string = decodeBytes(getBytesBuffer(bytes), profiledErrors.toString());

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PythonCextBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1976,7 +1976,7 @@ Object upcall(VirtualFrame frame, PythonModule cextModule, Object[] args, @Suppr
19761976
abstract static class UpcallLNode extends UpcallLandingNode {
19771977

19781978
@Specialization
1979-
long upcall(VirtualFrame frame, Object self, Object[] args, @SuppressWarnings("unused") PKeyword[] kwargs,
1979+
long upcall(VirtualFrame frame, @SuppressWarnings("unused") Object self, Object[] args, @SuppressWarnings("unused") PKeyword[] kwargs,
19801980
@Cached CExtNodes.CastToNativeLongNode asLongNode,
19811981
@Cached CExtNodes.ObjectUpcallNode upcallNode,
19821982
@Cached TransformExceptionToNativeNode transformExceptionToNativeNode) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/ZLibModuleBuiltins.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ private CastToIntegerFromIntNode getCastToIntNode() {
232232
}
233233

234234
@Specialization
235-
public long doit(VirtualFrame frame, Object data, @SuppressWarnings("unused") PNone value,
235+
public long doitNone(VirtualFrame frame, Object data, @SuppressWarnings("unused") PNone value,
236236
@Cached ToBytesNode toBytesNode) {
237237
return doCRC32(toBytesNode.execute(frame, data));
238238
}
@@ -245,7 +245,7 @@ private static long doCRC32(byte[] data) {
245245
}
246246

247247
@Specialization
248-
public long doit(VirtualFrame frame, Object data, long value,
248+
public long doitLong(VirtualFrame frame, Object data, long value,
249249
@Cached ToBytesNode toBytesNode) {
250250
// lost magnitude is ok here.
251251
int initValue = (int) value;
@@ -321,13 +321,13 @@ private static long doAdler32(byte[] data) {
321321
}
322322

323323
@Specialization
324-
public long doit(VirtualFrame frame, Object data, @SuppressWarnings("unused") PNone value,
324+
public long doitNone(VirtualFrame frame, Object data, @SuppressWarnings("unused") PNone value,
325325
@Cached ToBytesNode toBytesNode) {
326326
return doAdler32(toBytesNode.execute(frame, data));
327327
}
328328

329329
@Specialization
330-
public long doit(VirtualFrame frame, Object data, long value,
330+
public long doitLong(VirtualFrame frame, Object data, long value,
331331
@Cached ToBytesNode toBytesNode) {
332332
// lost magnitude is ok here.
333333
int initValue = (int) value;
@@ -560,13 +560,13 @@ private static byte[] compress(byte[] input, int level) {
560560
}
561561

562562
@Specialization
563-
public PBytes doit(PIBytesLike data, @SuppressWarnings("unused") PNone level) {
563+
public PBytes doitNone(PIBytesLike data, @SuppressWarnings("unused") PNone level) {
564564
byte[] array = getToArrayNode().execute(data.getSequenceStorage());
565565
return factory().createBytes(compress(array, -1));
566566
}
567567

568568
@Specialization
569-
public PBytes doit(PIBytesLike data, long level,
569+
public PBytes doitLong(PIBytesLike data, long level,
570570
@Cached("createBinaryProfile()") ConditionProfile wrongLevelProfile) {
571571
if (wrongLevelProfile.profile(level < -1 || 9 < level)) {
572572
throw raise(ZLibError, "Bad compression level");
@@ -636,12 +636,12 @@ public PBytes doit(PIBytesLike data, @SuppressWarnings("unused") PNone wbits, @S
636636
}
637637

638638
@Specialization
639-
public PBytes decompress(VirtualFrame frame, PIBytesLike data, byte wbits, int bufsize) {
640-
return decompress(frame, data, (long) wbits, bufsize);
639+
public PBytes decompress(PIBytesLike data, byte wbits, int bufsize) {
640+
return decompress(data, (long) wbits, bufsize);
641641
}
642642

643643
@Specialization
644-
public PBytes decompress(VirtualFrame frame, PIBytesLike data, long wbits, int bufsize) {
644+
public PBytes decompress(PIBytesLike data, long wbits, int bufsize) {
645645
// checking bufsize
646646
if (bufSizeProfile.profile(bufsize < 0)) {
647647
throw raise(ZLibError, "bufsize must be non-negative");

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/PEllipsis.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public int compareTo(Object o) {
6666
return this.hashCode() - o.hashCode();
6767
}
6868

69+
@Override
6970
@ExportMessage
7071
@SuppressWarnings("static-method")
7172
public LazyPythonClass getLazyPythonClass() {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/PNone.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ static boolean isNull(@SuppressWarnings("unused") PNone self) {
5959
return true;
6060
}
6161

62+
@Override
6263
@ExportMessage
6364
@SuppressWarnings("static-method")
6465
public LazyPythonClass getLazyPythonClass() {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/PNotImplemented.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public int compareTo(Object o) {
5050
return this.hashCode() - o.hashCode();
5151
}
5252

53+
@Override
5354
@ExportMessage
5455
@SuppressWarnings("static-method")
5556
public LazyPythonClass getLazyPythonClass() {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/PythonAbstractObject.java

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -584,11 +584,11 @@ public boolean isMapping(@Shared("thisObject") @Cached GetLazyClassNode getClass
584584

585585
@ExportMessage
586586
public boolean isSequenceType(
587-
@Shared("hasGetItemNode") @Cached LookupAttributeInMRONode.Dynamic hasGetItemNode,
588-
@Shared("hasLenNode") @Cached LookupAttributeInMRONode.Dynamic hasLenNode,
589-
@Shared("isLazyClass") @Cached("createBinaryProfile()") ConditionProfile isLazyClass,
590-
@Shared("lenProfile") @Cached("createBinaryProfile()") ConditionProfile lenProfile,
591-
@Shared("getItemProfile") @Cached("createBinaryProfile()") ConditionProfile getItemProfile) {
587+
@Shared("hasGetItemNode") @Cached LookupAttributeInMRONode.Dynamic hasGetItemNode,
588+
@Shared("hasLenNode") @Cached LookupAttributeInMRONode.Dynamic hasLenNode,
589+
@Shared("isLazyClass") @Cached("createBinaryProfile()") ConditionProfile isLazyClass,
590+
@Shared("lenProfile") @Cached("createBinaryProfile()") ConditionProfile lenProfile,
591+
@Shared("getItemProfile") @Cached("createBinaryProfile()") ConditionProfile getItemProfile) {
592592
if (isLazyClass.profile(this instanceof LazyPythonClass)) {
593593
LazyPythonClass type = (LazyPythonClass) this; // guaranteed to succeed because of guard
594594
if (lenProfile.profile(hasLenNode.execute(type, SpecialMethodNames.__LEN__) != PNone.NO_VALUE)) {
@@ -600,17 +600,18 @@ public boolean isSequenceType(
600600

601601
@ExportMessage
602602
public boolean isMappingType(
603-
@Shared("hasGetItemNode") @Cached LookupAttributeInMRONode.Dynamic hasGetItemNode,
604-
@Shared("hasLenNode") @Cached LookupAttributeInMRONode.Dynamic hasLenNode,
605-
@Shared("isLazyClass") @Cached("createBinaryProfile()") ConditionProfile isLazyClass,
606-
@Shared("lenProfile") @Cached("createBinaryProfile()") ConditionProfile lenProfile,
607-
@Shared("getItemProfile") @Cached("createBinaryProfile()") ConditionProfile getItemProfile,
608-
@Exclusive @Cached LookupAttributeInMRONode.Dynamic hasKeysNode,
609-
@Exclusive @Cached LookupAttributeInMRONode.Dynamic hasItemsNode,
610-
@Exclusive @Cached LookupAttributeInMRONode.Dynamic hasValuesNode,
611-
@Exclusive @Cached("createBinaryProfile()") ConditionProfile profile) {
603+
@Shared("hasGetItemNode") @Cached LookupAttributeInMRONode.Dynamic hasGetItemNode,
604+
@Shared("hasLenNode") @Cached LookupAttributeInMRONode.Dynamic hasLenNode,
605+
@Shared("isLazyClass") @Cached("createBinaryProfile()") ConditionProfile isLazyClass,
606+
@Shared("lenProfile") @Cached("createBinaryProfile()") ConditionProfile lenProfile,
607+
@Shared("getItemProfile") @Cached("createBinaryProfile()") ConditionProfile getItemProfile,
608+
@Exclusive @Cached LookupAttributeInMRONode.Dynamic hasKeysNode,
609+
@Exclusive @Cached LookupAttributeInMRONode.Dynamic hasItemsNode,
610+
@Exclusive @Cached LookupAttributeInMRONode.Dynamic hasValuesNode,
611+
@Exclusive @Cached("createBinaryProfile()") ConditionProfile profile) {
612612
if (isSequenceType(hasGetItemNode, hasLenNode, isLazyClass, lenProfile, getItemProfile)) {
613-
LazyPythonClass type = (LazyPythonClass) this; // guaranteed to succeed b/c it's a sequence type
613+
LazyPythonClass type = (LazyPythonClass) this; // guaranteed to succeed b/c it's a
614+
// sequence type
614615
return profile.profile(hasKeysNode.execute(type, SpecialMethodNames.KEYS) != PNone.NO_VALUE &&
615616
hasItemsNode.execute(type, SpecialMethodNames.ITEMS) != PNone.NO_VALUE &&
616617
hasValuesNode.execute(type, SpecialMethodNames.VALUES) != PNone.NO_VALUE);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/bytes/ByteArrayBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ protected boolean isPSequenceWithStorage(Object source) {
391391
@GenerateNodeFactory
392392
public abstract static class ByteArrayCopyNode extends PythonBuiltinNode {
393393
@Specialization
394-
public PByteArray copy(VirtualFrame frame, PByteArray byteArray,
394+
public PByteArray copy(PByteArray byteArray,
395395
@Cached GetLazyClassNode getClass,
396396
@Cached SequenceStorageNodes.ToByteArrayNode toByteArray) {
397397
return factory().createByteArray(getClass.execute(byteArray), toByteArray.execute(byteArray.getSequenceStorage()));

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/bytes/PByteArray.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public final void reverse() {
9898
}
9999

100100
@ExportMessage
101+
@SuppressWarnings("static-method")
101102
boolean isBuffer() {
102103
return true;
103104
}

0 commit comments

Comments
 (0)