Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for CtReceiverParameter in spoon model. #5674

Merged
merged 53 commits into from
Apr 3, 2024
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
f2510bf
Add support for CtReceiverParameter in spoon model.
MartinWitt Jan 30, 2024
1064eec
Update copyright headers in multiple files
MartinWitt Feb 17, 2024
abd67a5
Add receiver parameter visitation methods
MartinWitt Mar 10, 2024
3cdeccf
Update flake.lock file
MartinWitt Mar 10, 2024
54dd707
Implement CtReceiverParameter methods and add to DefaultCoreFactory
MartinWitt Mar 10, 2024
15a041b
lets try to not have a CtNamedElement
MartinWitt Mar 10, 2024
ac00804
Refactor ReceiverParameter setting and scanning
MartinWitt Mar 10, 2024
1c6dce8
Update ReceiverParameter handling and tests
MartinWitt Mar 10, 2024
9b1c37c
Add CtCasePattern, CtReceiverParameter and CtRecordPattern assert cla…
MartinWitt Mar 25, 2024
9759ed2
Improve ReceiverParameter handling in tests
MartinWitt Mar 25, 2024
703d9dd
Merge branch 'java17' into feat/java17/receiverparameter
MartinWitt Mar 25, 2024
168b08e
Refactor and clean-up the Spoon library classes
MartinWitt Mar 25, 2024
ac899ce
Add ReceiverParameter to CtExecutable and documentation
MartinWitt Mar 25, 2024
ec62d96
Update handling of CtReceiverParameter and implement code refactoring
MartinWitt Mar 25, 2024
f85b7d9
doc
MartinWitt Mar 25, 2024
2a3c052
doc
MartinWitt Mar 25, 2024
eedbdc9
maybe I am too stupid to read
MartinWitt Mar 25, 2024
25a2324
meta meta meta
MartinWitt Mar 25, 2024
445af0b
Update expected counts in CtScannerTest
MartinWitt Mar 26, 2024
1c0806e
Merge remote-tracking branch 'origin/java17' into feat/java17/receive…
MartinWitt Mar 26, 2024
6fc0a88
Normalize indentation in CtReceiverParameter.java
MartinWitt Mar 26, 2024
ad7c08a
up
MartinWitt Mar 26, 2024
5e0e872
up
MartinWitt Mar 26, 2024
2e56738
imports
MartinWitt Mar 28, 2024
b6b55de
Reorganize import statements across multiple files
MartinWitt Mar 28, 2024
b41e419
up
MartinWitt Mar 28, 2024
d383721
up
MartinWitt Mar 28, 2024
db9f45b
up
MartinWitt Mar 28, 2024
d86eb00
up
MartinWitt Mar 28, 2024
725e168
up
MartinWitt Mar 28, 2024
2ce4544
up
MartinWitt Mar 29, 2024
994d8f5
Update CtMethod.java
MartinWitt Mar 29, 2024
e6e4b7e
Update ExecutableFactory.java
MartinWitt Mar 29, 2024
b1a8574
Update DefaultJavaPrettyPrinter.java
MartinWitt Mar 29, 2024
cfd2f69
Update ParentExiter.java
MartinWitt Mar 29, 2024
a7900af
Update CtMethodImpl.java
MartinWitt Mar 29, 2024
f8f4b52
Update ExecutableFactory.java
MartinWitt Mar 29, 2024
fcb14f7
date import statements and optimize argument naming
MartinWitt Mar 29, 2024
6fdde39
Add inner class handling in receiver parameter test
MartinWitt Apr 1, 2024
ece9340
Reorganize import statements in Metamodel.java
MartinWitt Apr 1, 2024
59aaa76
Reorganize import statements in Metamodel.java
MartinWitt Apr 1, 2024
f771d56
Reorganize import statements in Metamodel.java
MartinWitt Apr 1, 2024
861fab5
up
MartinWitt Apr 1, 2024
71ea27b
Update src/main/java/spoon/reflect/visitor/ElementPrinterHelper.java
MartinWitt Apr 1, 2024
3e4112b
Update src/main/java/spoon/reflect/declaration/CtReceiverParameter.java
MartinWitt Apr 1, 2024
e8edd5d
Update SimpleReceiverParameter.java
MartinWitt Apr 1, 2024
7334c5e
Update InnerClassCtor.java
MartinWitt Apr 1, 2024
2abac1f
Update src/main/java/spoon/support/compiler/jdt/ParentExiter.java
MartinWitt Apr 1, 2024
f2848be
Update src/test/java/spoon/test/receiverparameter/ReceiverParameterTe…
MartinWitt Apr 1, 2024
184c2db
Update src/test/java/spoon/test/receiverparameter/ReceiverParameterTe…
MartinWitt Apr 1, 2024
42d5483
Update src/main/java/spoon/support/reflect/declaration/CtExecutableIm…
MartinWitt Apr 1, 2024
6f7d663
to tabs
MartinWitt Apr 1, 2024
0143126
Update src/test/java/spoon/test/receiverparameter/ReceiverParameterTe…
MartinWitt Apr 2, 2024
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
Prev Previous commit
Next Next commit
Improve ReceiverParameter handling in tests
This commit involves adding comments to clarify the contracts in ReceiverParameterTest.java for improved readability and understanding. It ensures that receiver parameters are correctly parsed and accessed from the model and constructors of inner classes can have receiver parameters with their outer class type.
MartinWitt committed Mar 25, 2024

Verified

This commit was signed with the committer’s verified signature.
MartinWitt Martin Wittlinger
commit 9759ed2cd83c6270b8b8aed628960452b77c0219
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ public class ReceiverParameterTest {
value = "src/test/resources/receiver/SimpleReceiverParameter.java"
)
void simpleParameter(CtModel model) {
// contract: receiver parameter is correctly parsed and can be accessed from the model
CtType<?> targetType = model.getAllTypes().iterator().next();
List<CtReceiverParameter> receiverParams = targetType.getElements(new TypeFilter<>(CtReceiverParameter.class));
assertEquals(1, receiverParams.size());
@@ -32,6 +33,7 @@ void simpleParameter(CtModel model) {
value = "src/test/resources/receiver/InnerClassCtor.java"
)
void innerClassCtor(CtModel model) {
// contract: constructor of inner class can have receiver parameter with their outer class type
CtType<?> targetType = model.getAllTypes().iterator().next();
List<CtReceiverParameter> receiverParams = targetType.getElements(new TypeFilter<>(CtReceiverParameter.class));
assertEquals(1, receiverParams.size());