So I wrote a test case for the guava collections issue, thought I might try & tackle that? I think I'll need a few pointers first though...
Hi Graham. The main problem is that I'm not familiar with git, that's all. I tried checking it out on my home windows PC first, it took a while to figure it out (I had to install a piece of software from github) and when I got the code the project had maven errors so I gave up on using windows. I know maven, and I know what a time sink it can be fixing a build!
I think I see what you're saying - you want a general mechanism for telling MD about these safe patterns, and for it to be preconfigured for guava. That sounds sensible.I think I've already done what you said, and I've also tried using the "hardcoded exception" mechanism you mentioned in the original bug discussion, but it doesn't work as I expect. Have a look at the attachment & tell me why the 2nd test doesn't pass pls!
When you say "issue a pull request" does that mean check in in svn-speak?
Hi Martin,Answers inline.
On 17 September 2013 13:04, Martin Charlesworth <martincha...@gmail.com> wrote:
Hi Graham. The main problem is that I'm not familiar with git, that's all. I tried checking it out on my home windows PC first, it took a while to figure it out (I had to install a piece of software from github) and when I got the code the project had maven errors so I gave up on using windows. I know maven, and I know what a time sink it can be fixing a build!Sorry to hear about git problems. Unfortunately, I can't help you with git on Windows, been a Linux-only user for a few years now. It sounds like you have git running correctly now. We won't be doing anything fancy with git really, just commits and pushes. This may be helpful: https://git.wiki.kernel.org/index.php/GitSvnCrashCourse
Unfortunately I think there's an extra step that must be completed before building locally. See here: https://github.com/MutabilityDetector/MutabilityDetector/wiki/How-to-Contribute#building-codeIt involves installing a library used by MD, written by me, but not released to Maven Central. The instructions talk about running a shell script before invoking 'mvn test', but that obviously won't work on your Windows machine, instead try running:mvn install:install-file -Dfile=vendor/lib/main/asm-nonclassloadingsimpleverifier-1.0-SNAPSHOT.jar -DgroupId=org.mutabilitydetector -DartifactId=asm-nonclassloadingsimpleverifier -Dversion=1.0-SNAPSHOT -Dpackaging=jar
Then hopefully mvn test should work. If it's a different error that's the problem, I'd like to hear about it so we can fix it. Would you be able to provide the error output?I think I see what you're saying - you want a general mechanism for telling MD about these safe patterns, and for it to be preconfigured for guava. That sounds sensible.I think I've already done what you said, and I've also tried using the "hardcoded exception" mechanism you mentioned in the original bug discussion, but it doesn't work as I expect. Have a look at the attachment & tell me why the 2nd test doesn't pass pls!What you've done is a good start. It fails because MD doesn't realise that ImmutableList.of will return an immutable implementation of an abstract class. Unless MD can see that the class is concrete, then at runtime it could be any implementation, including, crucially, a mutable implementation.
See the class 'CollectionTypeWrappedInUnmodifiableIdiomChecker' for an idea of what will need to be configurable. Unfortunately it's not just as easy as declaring the type as immutable. MD will need to know that the return type of ImmutableList.of, and a host of others, returns a concrete immutable implementation. I've found it too hard to do this with automatic analysis correctly, so configuration is the way to go :-)
When you say "issue a pull request" does that mean check in in svn-speak?Not quite. A git 'push' is equivalent to a svn commit/check in. A pull request is a way to say 'On my fork, here are some diffs you should merge into your fork'. When it comes time for you to contribute code, you'll push the changes to your fork, then issue a pull request to me, and I will merge into my fork (which also happens to be the project's main fork). The easiest way I've found to do this is through GitHub's web interface. See here for a terse example, I can explain more if necessary. https://help.github.com/articles/creating-a-pull-requestGood start, seems you worked out MD's Configuration API. Was that from online docs or exploring the code in your IDE?
Hey Martin,
From the screenshot you showed, it looks like Maven has had a problem adding a source directory. The classes which are missing are 'benchmark' classes which have MD's analysis run against them in tests. They're not executed as tests, and definitely don't form part of the main code, so I put them in a different source directory, 'src/test/benchmarks'.
It seems like a Maven issue, are there any earlier errors, perhaps from the build-helper-plugin? If you could get the entire log of mvn test as a text file, that would be helpful*.
~ Graham
* I would use "mvn test > results.txt" on Linux, don't know how to do the equivalent on Windows. Mani, do you know?
--
You received this message because you are subscribed to a topic in the Google Groups "mutability-detector" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mutability-detector/ZY0efcQ2G58/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mutability-dete...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and all its topics, send an email to mutability-detector+unsub...@googlegroups.com.
today it builds! can't explain that. Though in eclipse I had to manually add the benchmarks folder to the build path as m2e doesn't seem to play nice with the build-helper-plugin, but now all my java errors are gone.BTW Graham - when you install git on windows you get "git bash" which is basically a bash shell with git in it, so you can use normal linux style redirection as you mentioned.right, now to look at some code!
--
You received this message because you are subscribed to the Google Groups "mutability-detector" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mutability-dete...@googlegroups.com.