-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
Fix type of constructor calls in noclasspathmode #4647
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8efa12b
lets see what fails
MartinWitt 89ad81a
up
MartinWitt 7c42a3e
up
MartinWitt e5e076d
up
MartinWitt 4046389
rename type
MartinWitt 9e6ae58
up
MartinWitt 66cfec8
checkstyle
MartinWitt 719015f
add reason field
MartinWitt 9c8f1d1
tabs
MartinWitt 2c12860
doc
MartinWitt 1991591
move package
MartinWitt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* SPDX-License-Identifier: (MIT OR CECILL-C) | ||
* | ||
* Copyright (C) 2006-2019 INRIA and contributors | ||
* | ||
* Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. | ||
*/ | ||
package spoon; | ||
|
||
/** | ||
* This annotation is used to mark a workaround for the lack of a correct classpath so called noclasspathmode. | ||
* <p> | ||
* Workarounds for missing informations are marked with this annotation. These methods are not part of the Spoon API and best effort. | ||
* With any new jdt version the workaround can be removed or no longer working. | ||
*/ | ||
public @interface NoClasspathWorkaround { | ||
/** | ||
* The reason why this workaround is needed. This is used for documentation purposes. | ||
* A link to the originale issue is sufficient. | ||
* @return the reason why this workaround is needed | ||
*/ | ||
String reason(); | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/spoon/experimental/NoClasspathWorkaround.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* SPDX-License-Identifier: (MIT OR CECILL-C) | ||
* | ||
* Copyright (C) 2006-2019 INRIA and contributors | ||
* | ||
* Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) of the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon. | ||
*/ | ||
package spoon.experimental; | ||
|
||
import spoon.support.Experimental; | ||
import spoon.support.Internal; | ||
|
||
/** | ||
* This annotation is used to mark a workaround for the lack of a correct classpath so called noclasspathmode. | ||
* <p> | ||
* Workarounds for missing informations are marked with this annotation. These methods are not part of the Spoon API and best effort. | ||
* With any new jdt version the workaround can be removed or no longer working. | ||
*/ | ||
@Experimental | ||
@Internal | ||
public @interface NoClasspathWorkaround { | ||
/** | ||
* The reason why this workaround is needed. This is used for documentation purposes. | ||
* A link to the originale issue is sufficient. | ||
* @return the reason why this workaround is needed | ||
*/ | ||
String reason(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/test/resources/constructorcall-type/ConstructorCallWithTypesNotOnClasspath.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class ConstructorCallWithTypesNotOnClasspath { | ||
public static void main(String[] args) { | ||
type.not.on.Classpath instanceOfTypeNotOnClasspath = null; | ||
new another.type.not.on.Classpath(instanceOfTypeNotOnClasspath); | ||
} | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate to come with yet another thing after not saying anything for so long, but should we not perhaps put this in the internal package? It seems like something we don't want to share with the world, but only use internally in Spoon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually,
spoon.testing.utils
is probably the place we want to put it, considering the naming of that package.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a testing package seems wrong for this. As this is not really related to testing or? An internal package, yes indeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea of what last week me was thinking. It was close to midnight so I suspect: not much.
Yes. That.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we do this in
spoon.experimental
and see if we have enough classes to create an internal package in the future?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MartinWitt Ugh, missed this comment.
But yes, sure. Essentially, if you put it anywhere where we can freely break it I'm satisfied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, I also had a lengthy summer vacation and enjoyed the nice weather.
I moved the class to the experimental package and added
Experimental
andInternal
. More evidence that we can and will break this annotation's package is not possible.