Use inline test expectations

This commit is contained in:
Tamas Vajk
2025-07-02 11:27:32 +02:00
parent 2cd0c64e41
commit a2d4f58af7
2 changed files with 8 additions and 7 deletions

View File

@@ -4,16 +4,16 @@ public class Test {
record T1() implements Serializable {
@Serial
private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0]; // NON_COMPLIANT
private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0]; // $ Alert
@Serial
private void writeObject(ObjectOutputStream out) throws IOException {} // NON_COMPLIANT
private void writeObject(ObjectOutputStream out) throws IOException {} // $ Alert
@Serial
private void readObject(ObjectOutputStream out) throws IOException {}// NON_COMPLIANT
private void readObject(ObjectOutputStream out) throws IOException {} // $ Alert
@Serial
private void readObjectNoData(ObjectOutputStream out) throws IOException { // NON_COMPLIANT
private void readObjectNoData(ObjectOutputStream out) throws IOException { // $ Alert
}
}
@@ -21,11 +21,11 @@ public class Test {
record T2() implements Externalizable {
@Override
public void writeExternal(ObjectOutput out) throws IOException { // NON_COMPLIANT
public void writeExternal(ObjectOutput out) throws IOException { // $ Alert
}
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { // NON_COMPLIANT
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { // $ Alert
}
}

View File

@@ -1 +1,2 @@
Violations of Best Practice/Records/UselessMembersOfTheRecordsClass.ql
query: Violations of Best Practice/Records/UselessMembersOfTheRecordsClass.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql