Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public class MostSimpleInner {

public static class MyInnerClass {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
record Mapping(String from, String to) {

Mapping {
// compact constructor!
from = "abc";
to = "def";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import java.lang.Object;

public class OuterClass {

final record MyRecord(String test) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//https://mikemybytes.com/2022/02/16/java-records-and-compact-constructors/
record // package-private
Name(// package-private
String name) {

// fails with: 'invalid canonical constructor in record Name
// (attempting to assign stronger access privileges;
// was package)'
private Name(String name) {
this.name = name;
}

static Name of(String name) {
return new Name(name);
}
}

record Point(int x, int y) {

Point(int x, int y) {
// boring!
this.x = x;
this.y = y;
}

Point(int x) {
// a bit weird...
// ... but perfectly fine for the compiler
this(x, 0);
}

Point() {
// fails with: 'constructor is not canonical, so its first
// statement must invoke another constructor'
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
record Point3d(int x, int y, int z) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
record MyRecord(String test) {

public int hashCode() {
return 0;
}

public boolean equals(Object obj) {
return obj instanceof MyRecord;
}

public String test() {
return "";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public record SimpleRecord(/*@ nullable */ String name) implements Serializable {

SimpleRecord(String name) {
this.name = name;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
public class Test {

public static int abc;

static {
// should be resolved to 2
abc = 1 + 1;
}

public int memberVar;

{
memberVar = 42;
}
}

public class SubClass extends Test {

public int memberVar;

{
memberVar = 41;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
public class Test {

public static int abc;

static {
// should be resolved to 2
abc = 1 + 1;
}

public int memberVar;

{
memberVar = 42;
}
}

public class SubClass extends Test {

public int memberVar;

{
memberVar = 41;
}
}
24 changes: 24 additions & 0 deletions key.core/pipelineTests/simple/expected/05_JMLTransformer/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
public class Test {

public static int abc;

static {
// should be resolved to 2
abc = 1 + 1;
}

public int memberVar;

{
memberVar = 42;
}
}

public class SubClass extends Test {

public int memberVar;

{
memberVar = 41;
}
}
24 changes: 24 additions & 0 deletions key.core/pipelineTests/simple/expected/06_JmlDocRemoval/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
public class Test {

public static int abc;

static {
// should be resolved to 2
abc = 1 + 1;
}

public int memberVar;

{
memberVar = 42;
}
}

public class SubClass extends Test {

public int memberVar;

{
memberVar = 41;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
public class Test {

public static int abc;

static {
// should be resolved to 2
abc = 1 + 1;
}

public int memberVar;

{
memberVar = 42;
}

@javax.annotation.processing.Generated()
static private boolean $classInitializationInProgress;

@javax.annotation.processing.Generated()
static private boolean $classErroneous;

@javax.annotation.processing.Generated()
static private boolean $classInitialized;

@javax.annotation.processing.Generated()
static private boolean $classPrepared;

@javax.annotation.processing.Generated()
static public model boolean $staticInv;

@javax.annotation.processing.Generated()
static public model boolean $staticInv_free;
}

public class SubClass extends Test {

public int memberVar;

{
memberVar = 41;
}

@javax.annotation.processing.Generated()
static private boolean $classInitializationInProgress;

@javax.annotation.processing.Generated()
static private boolean $classErroneous;

@javax.annotation.processing.Generated()
static private boolean $classInitialized;

@javax.annotation.processing.Generated()
static private boolean $classPrepared;

@javax.annotation.processing.Generated()
static public model boolean $staticInv;

@javax.annotation.processing.Generated()
static public model boolean $staticInv_free;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
public class Test {

public static int abc;

static {
// should be resolved to 2
abc = 1 + 1;
}

public int memberVar;

{
memberVar = 42;
}

@javax.annotation.processing.Generated()
static private boolean $classInitializationInProgress;

@javax.annotation.processing.Generated()
static private boolean $classErroneous;

@javax.annotation.processing.Generated()
static private boolean $classInitialized;

@javax.annotation.processing.Generated()
static private boolean $classPrepared;

@javax.annotation.processing.Generated()
static public model boolean $staticInv;

@javax.annotation.processing.Generated()
static public model boolean $staticInv_free;

public static Test $allocate();
}

public class SubClass extends Test {

public int memberVar;

{
memberVar = 41;
}

@javax.annotation.processing.Generated()
static private boolean $classInitializationInProgress;

@javax.annotation.processing.Generated()
static private boolean $classErroneous;

@javax.annotation.processing.Generated()
static private boolean $classInitialized;

@javax.annotation.processing.Generated()
static private boolean $classPrepared;

@javax.annotation.processing.Generated()
static public model boolean $staticInv;

@javax.annotation.processing.Generated()
static public model boolean $staticInv_free;

public static SubClass $allocate();
}
Loading
Loading