Bug 380074 - Add doc for 'Detecting problems in Java code'
Summary: Add doc for 'Detecting problems in Java code'
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Doc (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.8 RC4   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords: Documentation
Depends on:
Blocks:
 
Reported: 2012-05-20 07:40 EDT by Deepak Azad CLA
Modified: 2012-06-07 10:14 EDT (History)
6 users (show)

See Also:
amj87.iitr: review? (amj87.iitr)
jarthana: review+


Attachments
Draft documentation (25.14 KB, patch)
2012-05-27 09:31 EDT, Stephan Herrmann CLA
no flags Details | Diff
Minor corrections (1.55 KB, patch)
2012-06-04 10:38 EDT, Jay Arthanareeswaran CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Deepak Azad CLA 2012-05-20 07:40:35 EDT
We should add the following topic 'Java development user guide > Tasks > Detecting problems in Java code' under which we can talk about Null Annotations, Resource leaks, Incomplete switch (?), anything else which can be non-obvious and where some guidance (e.g. last point from bug 378724 comment 0) and/or examples can aid the user.

Some of the content (at least the examples) should already be available in N&N docs and also some of our blog posts.

Stephan, you want to take this up?
Comment 1 Stephan Herrmann CLA 2012-05-20 12:18:31 EDT
Thanks for the heads up, I was already wondering, where to put such documentation. A new task heading definitely makes sense.

Thinking about null annotations I would probably better like a heading like "Improving Java code quality".

I hope I didn't promise more than I'm able to deliver in time, but I'll certainly do my best.
Comment 2 Deepak Azad CLA 2012-05-20 15:31:47 EDT
(In reply to comment #1)
Thanks Stephan!

> I would probably better like a heading like
> "Improving Java code quality".
That also works for me in place of 'Detecting problems in Java code'.
Comment 3 Ayushman Jain CLA 2012-05-23 08:31:40 EDT
Stephan, we're closing in on the RC2 build. Will it be possible for you to do the doc today? I'll do a quick review and we can release it in time for the build.
Comment 4 Stephan Herrmann CLA 2012-05-23 14:19:18 EDT
(In reply to comment #3)
> Stephan, we're closing in on the RC2 build. Will it be possible for you to do
> the doc today? I'll do a quick review and we can release it in time for the
> build.

Sorry, I wasn't aware of the deadline. Just yesterday I built the RC1 for Object Teams and RC2 is already closing, too??
I also lost half a day to the sudden death of a hard disk ...

I can start writing tonight, but I'd really like to spend a bit more time to provide some quality... hm ...
Comment 5 Ayushman Jain CLA 2012-05-23 14:54:51 EDT
(In reply to comment #4)
> (In reply to comment #3)
> > Stephan, we're closing in on the RC2 build. Will it be possible for you to do
> > the doc today? I'll do a quick review and we can release it in time for the
> > build.
> 
> Sorry, I wasn't aware of the deadline. Just yesterday I built the RC1 for
> Object Teams and RC2 is already closing, too??
> I also lost half a day to the sudden death of a hard disk ...
> 
> I can start writing tonight, but I'd really like to spend a bit more time to
> provide some quality... hm ...

Oh in that case lets not rush it. RC3 should be more convenient for this. Lets target early next week.
Comment 6 Stephan Herrmann CLA 2012-05-27 09:31:20 EDT
Created attachment 216332 [details]
Draft documentation

Here's a draft of (a) a general introduction and (b) an explanation of annotation based null analysis.
Comment 7 Stephan Herrmann CLA 2012-05-27 09:45:43 EDT
Considering the amount of discussion that has flown into these subjects over the last year it seems *a lot* has to be carefully explained.
Given the tight schedule (for which I apologize, should've started way earlier), I propose the following:
- For now focus on explaining what it *is*, rather than a full blown comprehensive tutorial on how to *use* (although the current draft already contains a few recommendations).
- Setup a new wiki page discussing methods how to make best use of these new features (like: migration strategies when adopting null annotations).
- Make a link from the help pages to the wiki pages.

Hopefully, during the Kepler cycle this wiki page(s) will mature and by then can be merged into the help system.

Please comment on the draft. It's already a bit lengthy but I feel that's the minimum level of detail we need to actually explain the feature.
I could probably use some more code examples, some pretty printing for the code examples etc.
I haven't yet checked HTML validity but hopefully this will be an easy task in the end, given that I'm now using the Web Page editor (rather than a plain text editor as I did before).
Comment 8 Deepak Azad CLA 2012-05-28 02:44:37 EDT
(In reply to comment #6)
> Created attachment 216332 [details] [diff]
> Draft documentation
> 
> Here's a draft of (a) a general introduction and (b) an explanation of
> annotation based null analysis.

Thanks Stephan! This already looks reasonably good, and I released it with a few minor corrections (spelling errors and incorrect links). We can continue to polish the released version...

(In reply to comment #7)
> - For now focus on explaining what it *is*, rather than a full blown
> comprehensive tutorial on how to *use* (although the current draft already
> contains a few recommendations).
Sure.

> - Make a link from the help pages to the wiki pages.
Not sure if we should link to the wiki pages from help. I am not aware of such a precedent in JDT. 

> I haven't yet checked HTML validity
I will run the chkpii tests and fix any problems that are discovered.
Comment 9 Deepak Azad CLA 2012-05-28 02:45:59 EDT
(In reply to comment #0)
> Resource leaks, Incomplete switch 
Stephan, in addition to polishing the page for null-annotations would you also have time to add doc for these two topics?
Comment 10 Ayushman Jain CLA 2012-05-28 04:43:53 EDT
(In reply to comment #6)
> Created attachment 216332 [details]
> Draft documentation
> 
> Here's a draft of (a) a general introduction and (b) an explanation of
> annotation based null analysis.

This doc is good for Juno. We can also add resource leak and swtch-case warning docs (not a comprehensive description though.)
I also noticed that the ref-preferences-errors-warnings page was missing the updated doc for switch-case warnings. I added that and released via commit d24dde6b74338cbff7b303640a57a2ea3b1e5a2a
Comment 11 Stephan Herrmann CLA 2012-05-28 17:42:52 EDT
(In reply to comment #8)
> (In reply to comment #6)
> ... and I released it with a few minor corrections 

That wasn't actually only helpful. I marked it as a draft because I was going
to continue working on it. I packed the local git repo on a stick so I can
work on it while travelling. Now we're getting out of sync, mh...
(don't tell me merging is *never* a problem with git :) )

Is there an urge to "test" this patch, to have it integrated in the build
right now?

> > - Make a link from the help pages to the wiki pages.
> Not sure if we should link to the wiki pages from help. I am not aware of such
> a precedent in JDT. 

May be the first time, yes. But I have the impression more help than just
the explanation we have now, is highly desirable. I would love to have
a prominent link to a wiki page, where people get the latest tips and
maybe can even contribute their experience. Why not from the help page?

I think many other projects are linking from help to their home pages
or the like. Any reasons not to do so?

As said, I see this as a temporary means until Kepler.

(In reply to comment #9)
> (In reply to comment #0)
> > Resource leaks, Incomplete switch 
> Stephan, in addition to polishing the page for null-annotations would you also
> have time to add doc for these two topics?

It's on my schedule for Wednesday.
Comment 12 Ayushman Jain CLA 2012-05-29 01:15:22 EDT
(In reply to comment #11)
> (In reply to comment #8)
> > (In reply to comment #6)
> > ... and I released it with a few minor corrections 
> 
> That wasn't actually only helpful. I marked it as a draft because I was going
> to continue working on it. I packed the local git repo on a stick so I can
> work on it while travelling. Now we're getting out of sync, mh...
> (don't tell me merging is *never* a problem with git :) )

Even my repo blew up yesterday coz i did a pull with the patch still in the workspace. Took away much of my time :(
Comment 13 Dani Megert CLA 2012-05-29 02:46:16 EDT
>> - Make a link from the help pages to the wiki pages.
> Not sure if we should link to the wiki pages from help. I am not aware of 
> such
> a precedent in JDT. 

I'm fine with a link to a wiki page which is in progress, but all current doc should be in Help and not on the wiki itself.
Comment 14 Deepak Azad CLA 2012-05-29 04:19:01 EDT
(In reply to comment #11)
> (In reply to comment #8)
> > (In reply to comment #6)
> > ... and I released it with a few minor corrections 
> 
> That wasn't actually only helpful. I marked it as a draft because I was going
> to continue working on it. I packed the local git repo on a stick so I can
> work on it while travelling. Now we're getting out of sync, mh...
> (don't tell me merging is *never* a problem with git :) )
> 
> Is there an urge to "test" this patch, to have it integrated in the build
> right now?
I thought it would easier for everyone involved to review and tweak it this way, plus having the doc in git makes it easier for me to test and fix chkpii problems. In any case, sorry for the inconvenience caused.
Comment 15 Stephan Herrmann CLA 2012-05-30 19:25:08 EDT
In commit 4dead014822ddfe231cc18386eb72149798f5717 I have pushed:
- polish regarding null annotations
- new page regarding resource leaks.
(HTML has been validated).

The null annotations page now has a link to http://wiki.eclipse.org/JDT_Core/Null_Analysis/Adopting_Null_Annotations where I've setup a stub for more hints.
I will also link this page from other locations, like e.g., the JDT FAQ.

(In reply to comment #13)
> I'm fine with a link to a wiki page which is in progress, but all current doc
> should be in Help and not on the wiki itself.

Yes, whatever we manage to do now goes into Help.

Still pending: completeness of switch statements. Scheduled for tomorrow.
Comment 16 Stephan Herrmann CLA 2012-05-31 09:17:51 EDT
In commit 1c108536e21f29fd94088b9dce2137a35cd8a3b4 I have pushed:
- new page regarding switch statements
- update batch compiler help regarding switch (and fixed table layout)

from my p.o.v. this concludes the scheduled work in this bug,
leaving the bug open for now to await review comments.
Comment 17 Srikanth Sankaran CLA 2012-05-31 09:19:09 EDT
Ayush may be offline a good part of next few days, Jay, could
you review the changes ? I also plan to do so.
Comment 18 Jay Arthanareeswaran CLA 2012-06-04 10:38:11 EDT
Created attachment 216771 [details]
Minor corrections

The documentations changes look good to me. Just a couple of very small corrections you might want to include.
Comment 19 Jay Arthanareeswaran CLA 2012-06-04 10:38:42 EDT
+1 from me
Comment 20 Stephan Herrmann CLA 2012-06-05 12:01:11 EDT
(In reply to comment #18)
> Created attachment 216771 [details]
> Minor corrections
> 
> The documentations changes look good to me. Just a couple of very small
> corrections you might want to include.

Released via commit 25885c43cf32bb2ba1b0c57a447e97e7583d8a2f

Closing.