-
Notifications
You must be signed in to change notification settings - Fork 273
Add org.cprover.MustNotThrow method attribute #2308
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
Merged
smowton
merged 1 commit into
diffblue:develop
from
smowton:smowton/feature/must-not-throw-annotation
Jun 12, 2018
Merged
Changes from all commits
Commits
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
Binary file not shown.
This file contains hidden or 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,17 @@ | ||
public class Test { | ||
|
||
@org.cprover.MustNotThrow | ||
public static void mustNotThrow() { | ||
throw new RuntimeException("Oh dear"); | ||
} | ||
|
||
public static void main() { | ||
try { | ||
mustNotThrow(); | ||
} | ||
catch(Throwable e) { | ||
assert false; | ||
} | ||
} | ||
|
||
} |
Binary file added
BIN
+156 Bytes
jbmc/regression/jbmc/must-not-throw-annotation/org/cprover/MustNotThrow.class
Binary file not shown.
3 changes: 3 additions & 0 deletions
3
jbmc/regression/jbmc/must-not-throw-annotation/org/cprover/MustNotThrow.java
This file contains hidden or 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,3 @@ | ||
package org.cprover; | ||
|
||
public @interface MustNotThrow { } | ||
This file contains hidden or 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,8 @@ | ||
CORE | ||
Test.class | ||
--function Test.main | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^VERIFICATION SUCCESSFUL$ | ||
-- | ||
^warning: ignoring |
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -670,6 +670,7 @@ IREP_ID_ONE(bits_per_byte) | |
IREP_ID_TWO(C_abstract, #abstract) | ||
IREP_ID_ONE(synthetic) | ||
IREP_ID_ONE(interface) | ||
IREP_ID_TWO(C_must_not_throw, #must_not_throw) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For my own knowledge: What does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'comment', I suppose. |
||
|
||
// Projects depending on this code base that wish to extend the list of | ||
// available ids should provide a file local_irep_ids.h in their source tree and | ||
|
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.
Shouldn't this go in an actual org.cprover package? Does such a thing exist?
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.
It will, but this is just a test that if such a thing exists then it functions as intended. It's a "mini models library" if you like.
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.
The 'mini models library' is here: https://github.com/diffblue/java-models-library/tree/master/src/main/java/org/cprover
Please add it there. It will then be compiled into the org.cprover.jar
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.
And additionally, it should also be duplicated in models-library (until models-library moves to extending java-models-library).
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.
Huh? That's the real models lib, isn't it? My intent was to submit this to get the functionality in (with a minimal test that doesn't use the models lib, but just mocks up the relevant interface), then ask @allredj for the actual lib support.
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.
Where's the cycle? Repo one:
org.cprover
, repo two:core-models
depends onorg.cprover
. No need fororg.cprover
to know about the core models?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.
If you put it into its own repo then there is no cycle.
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.
Let's create a separate repo then. As @thk123 suggested, it might even make sense to put it on Maven Central repo, which avoids having a submodule in models-library and also makes it easier to use for JBMC users who want to hack their own models and harnesses.
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.
For the avoidance of doubt - this is out of scope for this PR right @peterschrammel? This is fine for now, and can be tidied up when the new repo is created?
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.
Yes.