From e10ecab76fbe008a3d00f4d317c41f560f5a0925 Mon Sep 17 00:00:00 2001 From: Zhuo Chen Date: Tue, 21 Nov 2017 13:16:33 -0500 Subject: [PATCH] Chanage error format. --- tests/binaryOpRefine/BinaryOpRefinement.java | 6 +++--- tests/casting/ErrorCasting.java | 16 ++++++++-------- tests/noc-examples/NOCE4InputStream.java | 2 +- tests/noc-examples/NOCE4Reader.java | 2 +- tests/read-typeHierarchy/TypeHierarchy.java | 8 ++++---- tests/teamed-quiz/BadParser.java | 4 ++-- tests/wtfCodeSOD061102/WTFCodeSOD061102.java | 8 ++++---- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/binaryOpRefine/BinaryOpRefinement.java b/tests/binaryOpRefine/BinaryOpRefinement.java index 5ac69da..80dd016 100644 --- a/tests/binaryOpRefine/BinaryOpRefinement.java +++ b/tests/binaryOpRefine/BinaryOpRefinement.java @@ -17,7 +17,7 @@ void testLessThan(Reader in) throws IOException { if (buff < 0) { ; } - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) cur = (char) buff; } while (true); } @@ -30,7 +30,7 @@ void testGreaterThanOrEqual(Reader in) throws IOException { } while ((buff = in.read()) > 0) { - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) cur = (char) buff; // this is because although the casting is safe, // 0x00 byte or 0x0000 char is still missed @@ -58,7 +58,7 @@ void testEqualTo(Reader in) throws IOException { if (buff == -1) { ; } - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) cur = (char) buff; } while (true); } diff --git a/tests/casting/ErrorCasting.java b/tests/casting/ErrorCasting.java index 6df411f..8469635 100644 --- a/tests/casting/ErrorCasting.java +++ b/tests/casting/ErrorCasting.java @@ -14,31 +14,31 @@ public class ErrorCasting { public void readCharMethod(@UnsafeRead int unsafeReadBuff, int unknownInt) { int bar = unknownInt = unsafeReadBuff; - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) char unSafeChar_1 = (char) bar; - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) byte unsafeByte_1 = (byte) bar; int foo = unsafeReadBuff = unsafeReadBuff; - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) char unSafeChar_2 = (char) foo; - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) byte unsafeByte_2 = (byte) foo; } @SuppressWarnings("unused") public void postPreIncrementDecrement(@UnsafeRead int inbuff, int unknownInt) { - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) char unknownSafetyChar_1 = (char) (inbuff++); // postIncrement would return original value of inbuff, unsafe char unknownSafetyChar_2 = (char) (++inbuff); // Should cast up to UnknownSafety, OK - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) char unknownSafetyChar_3 = (char) (inbuff--); // postDecrement would return original value of inbuff, unsafe char unknownSafetyChar_4 = (char) (--inbuff); // Should cast up to UnknownSafety, OK - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) byte unknownSafetyByte_1 = (byte) (inbuff++); // postIncrement would return original value of inbuff, unsafe byte unknownSafetyByte_2 = (byte) (++inbuff); // Should cast up to UnknownSafety, OK - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) byte unknownSafetyByte_3 = (byte) (inbuff--); // postDecrement would return original value of inbuff, unsafe byte unknownSafetyByte_4 = (byte) (--inbuff); // Should cast up to UnknownSafety, OK } diff --git a/tests/noc-examples/NOCE4InputStream.java b/tests/noc-examples/NOCE4InputStream.java index c9cab3b..22884cd 100644 --- a/tests/noc-examples/NOCE4InputStream.java +++ b/tests/noc-examples/NOCE4InputStream.java @@ -10,7 +10,7 @@ public void unsafeWayOfCasting() throws IOException { InputStream in = new FileInputStream("afile"); @SuppressWarnings("unused") byte data; - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) while ((data = (byte) in.read()) != -1) { //... } diff --git a/tests/noc-examples/NOCE4Reader.java b/tests/noc-examples/NOCE4Reader.java index 5311194..5e962ba 100644 --- a/tests/noc-examples/NOCE4Reader.java +++ b/tests/noc-examples/NOCE4Reader.java @@ -9,7 +9,7 @@ public void unsafeWayOfCasting() throws IOException { Reader in = new FileReader("afile"); @SuppressWarnings("unused") char data; - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) while ((data = (char) in.read()) != -1) { //... } diff --git a/tests/read-typeHierarchy/TypeHierarchy.java b/tests/read-typeHierarchy/TypeHierarchy.java index 39a0f1c..433f0e0 100644 --- a/tests/read-typeHierarchy/TypeHierarchy.java +++ b/tests/read-typeHierarchy/TypeHierarchy.java @@ -23,16 +23,16 @@ public class TypeHierarchy { void testMethod(int i, @UnsafeRead int unsafeRead, @SafeRead int safeRead, @SafetyBottom int safetyBottom) { - //:: error: (assignment.type.incompatible) + // :: error: (assignment.type.incompatible) unsafeRead = i; // ERROR: violate type rule UnsafeRead <: UnknownSafety - //:: error: (assignment.type.incompatible) + // :: error: (assignment.type.incompatible) safeRead = unsafeRead; // ERROR: violate type rule SafeRead <: UnsafeRead - //:: error: (assignment.type.incompatible) + // :: error: (assignment.type.incompatible) safetyBottom = safeRead; // ERROR: violate type rule SafetyBottom <: SafeRead - //:: error: (assignment.type.incompatible) + // :: error: (assignment.type.incompatible) safetyBottom = 1; // ERROR: violate type rule SafetyBottom <: UnknownSafetyLiterals int a = unsafeRead; // OK: UnsafeRead <: UnknownSafety diff --git a/tests/teamed-quiz/BadParser.java b/tests/teamed-quiz/BadParser.java index 4236354..feb966a 100644 --- a/tests/teamed-quiz/BadParser.java +++ b/tests/teamed-quiz/BadParser.java @@ -19,7 +19,7 @@ public String getContent() throws IOException { String output = ""; int data; while ((data = i.read()) > 0) { - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) output += (char) data; } return output; @@ -30,7 +30,7 @@ public String getContentWithoutUnicode() throws IOException { int data; while ((data = i.read()) > 0) { if (data < 0x80) { - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) output += (char) data; } } diff --git a/tests/wtfCodeSOD061102/WTFCodeSOD061102.java b/tests/wtfCodeSOD061102/WTFCodeSOD061102.java index c922969..5f90a62 100644 --- a/tests/wtfCodeSOD061102/WTFCodeSOD061102.java +++ b/tests/wtfCodeSOD061102/WTFCodeSOD061102.java @@ -10,25 +10,25 @@ public void test(boolean _validConnection, InputStream _inputStream) throws IOEx while (true) { char _char; _stringBuffer.append( - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) _char = (char)_inputStream.read()); if (_char == -1) { break; } else if (_char == '\r') { _stringBuffer.append( - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) _char = (char)_inputStream.read()); if (_char == -1) { break; } else if (_char == '\n') { _stringBuffer.append( - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) _char = (char)_inputStream.read()); if (_char == -1) { break; } else if (_char == '\r') { _stringBuffer.append( - //:: error: (cast.unsafe) + // :: error: (cast.unsafe) _char = (char)_inputStream.read()); if (_char == -1) { break;