INRIA / INRIA/spoon

Record implementing an interface incorrectly printed

Open
#4,186 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2k
Forks
392
Avg merge
11h 24m
Merged PRs (30d)
36

Description

Hello,
I'm trying to apply a refactor using Spoon and there seem to be an issue when a record implements an interface.

The following code:

```
public class RecordTest {

public record SimpleRecord(int a) implements Supplier {

@Override
public Object get() {
return null;
}
}
}
```

Gets printed incorrectly (the interface disappeared and the method is now in parent class):
```

public class RecordTest {

public record SimpleRecord(int a) {

}

@Override
public Object get() {
return null;
}
}
```

And when using Snipper (note the missing } at the end):

```
public class RecordTest {

public record SimpleRecord(int a) implements Supplier {

@Override
public Object get() {
return null;
}
}

```

Is this a known issue?
Records are fairly new so it's good to see Spoon starting to support them!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.