typetools / checker-framework

Pluggable type-checking for Java
http://checkerframework.org/
Other
990 stars 347 forks source link

added annotations to ConcurrentHashMap.java from java 8 JDK #1145

Closed kanha95 closed 7 years ago

kanha95 commented 7 years ago

I have modified ConcurrentHashMap.java with all necessary annotations which will solve the issue "Nullness checker handling of ConcurrentHashMap" #1142

mernst commented 7 years ago

As part of this pull request, could you also commit a test case that would fail without the annotated library class but passes with the annotated library class?

mernst commented 7 years ago

What you have added is not a test. For example, there is no way to run it, so no way for it to fail or succeed. You need to add a file somewhere under checker/tests/, probably in checker/tests/nullness/.

kanha95 commented 7 years ago

why i got travis CI build failed mike?

mernst commented 7 years ago

Can you say what you have done so far to investigate the problem?

kanha95 commented 7 years ago

public class ConcurrentHashMap<K,V> extends AbstractMap<K,V> implements ConcurrentMap<K,V>, Serializable

This above line implements ConcurrentMap interface. I can't find the ConcurrentMap interface inside the checker-framework. I think this also needs to be added up.

wmdietlGC commented 7 years ago

Yes, you might need to add other classes as well. As pointed out in https://github.com/typetools/checker-framework/issues/1144 there are also concurrent collections other than maps that should be added.

mernst commented 7 years ago

The commit message should include "fixes #[ISSUENUMBER]", to make a connection between the pull request and the issue tracker.

kanha95 commented 7 years ago

done with all tests except the last one. it points out some "The ' characters around the executable and arguments are not part of the command". I googled it out and found that it's just a warning message .it does not affect the normal flow of the progam. Any suggestion? @mernst @wmdietlGC @wmdietl

wmdietlGC commented 7 years ago

[apply] Improper formatting: /checker-framework/checker/tests/nullness/ConcurrentHashMapTest.java

You need to properly format the source code. You should setup your build environment to prevent yourself from even committing code like this. Try running ant reformat.

kanha95 commented 7 years ago

@wmdietlGC i am formatting using netbeans default formatter. Still it's not getting accepted. I am new to this. so kindly suggest.

mernst commented 7 years ago

Werner said,

Try running ant reformat.

He gave a very concrete suggestion. You disregarded his suggestion and said:

i am formatting using netbeans default formatter. Still it's not getting accepted. I am new to this. so kindly suggest.

I don't know what else to suggest. When I tried ant reformat on your branch, it worked.

kanha95 commented 7 years ago

@wmdietlGC can you please help me in using the ant reformat command ? how to setup the build environment for this? i have never done this type of formatting before. so your help will be valuable to me. i read the manual but got confused. Thanks in advance.

mernst commented 7 years ago

From the command line, type ant reformat and then press the ENTER key.

kanha95 commented 7 years ago

@mernst got it...thanks...i messed up with few files. so i am closing this pull request. i will be up with a fresh new PR.