Fixed bug 465788: Update JDT Tips & Tricks for Mars (4.5)
diff --git a/bundles/org.eclipse.jdt.doc.user/reference/ref-java-editor-quickassist.htm b/bundles/org.eclipse.jdt.doc.user/reference/ref-java-editor-quickassist.htm
index c6d4ad3..41c32cd 100644
--- a/bundles/org.eclipse.jdt.doc.user/reference/ref-java-editor-quickassist.htm
+++ b/bundles/org.eclipse.jdt.doc.user/reference/ref-java-editor-quickassist.htm
@@ -3,7 +3,7 @@
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta name="copyright" content=
- "Copyright (c) IBM Corporation and others 2000, 2014. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." />
+ "Copyright (c) IBM Corporation and others 2000, 2015. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." />
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type=
"text/css" />
@@ -1268,6 +1268,42 @@
<tr>
<td class="c3" width="15%">
+ Convert to lambda expression
+ </td>
+ <td class="c4" width="34%">
+ <code>Consumer<Integer> c= System.out::println;</code>
+ </td>
+ <td class="c3">
+ >
+ </td>
+ <td class="c3" width="34%">
+ <code>Consumer<Integer> c= t -> System.out.println(t);</code>
+ </td>
+ <td class="c3" width="15%">
+ On method references (1.8 or higher)
+ </td>
+ </tr>
+
+ <tr>
+ <td class="c3" width="15%">
+ Convert to method reference
+ </td>
+ <td class="c4" width="34%">
+ <code>Consumer<Integer> c= t -> System.out.println(t);</code>
+ </td>
+ <td class="c3">
+ >
+ </td>
+ <td class="c3" width="34%">
+ <code>Consumer<Integer> c= System.out::println;</code>
+ </td>
+ <td class="c3" width="15%">
+ On lambda expressions (1.8 or higher)
+ </td>
+ </tr>
+
+ <tr>
+ <td class="c3" width="15%">
Change body expression to block
</td>
<td class="c4" width="34%">
@@ -1310,6 +1346,60 @@
<tr>
<td class="c3" width="15%">
+ Add inferred lambda parameter types
+ </td>
+ <td class="c4" width="34%">
+ <code>Consumer<Integer> c= t -> System.out.println(t);</code>
+ </td>
+ <td class="c3">
+ >
+ </td>
+ <td class="c3" width="34%">
+ <code>Consumer<Integer> c= (Integer t) -> System.out.println(t);</code>
+ </td>
+ <td class="c3" width="15%">
+ On lambda expressions with inferred parameter types (1.8 or higher)
+ </td>
+ </tr>
+
+ <tr>
+ <td class="c3" width="15%">
+ Add parentheses around lambda parameter
+ </td>
+ <td class="c4" width="34%">
+ <code>Consumer<Integer> c= t -> System.out.println(t);</code>
+ </td>
+ <td class="c3">
+ >
+ </td>
+ <td class="c3" width="34%">
+ <code>Consumer<Integer> c= (t) -> System.out.println(t);</code>
+ </td>
+ <td class="c3" width="15%">
+ On lambda expressions (1.8 or higher)
+ </td>
+ </tr>
+
+ <tr>
+ <td class="c3" width="15%">
+ Remove parentheses around lambda parameter
+ </td>
+ <td class="c4" width="34%">
+ <code>Consumer<Integer> c= (t) -> System.out.println(t);</code>
+ </td>
+ <td class="c3">
+ >
+ </td>
+ <td class="c3" width="34%">
+ <code>Consumer<Integer> c= t -> System.out.println(t);</code>
+ </td>
+ <td class="c3" width="15%">
+ On lambda expressions (1.8 or higher)
+ </td>
+ </tr>
+
+ <tr>
+ <td class="c3" width="15%">
Replace with getter and setter (Encapsulate Field)
</td>
<td class="c4" width="34%">
diff --git a/bundles/org.eclipse.jdt.doc.user/tips/images/annotate-map-return.png b/bundles/org.eclipse.jdt.doc.user/tips/images/annotate-map-return.png
new file mode 100644
index 0000000..64b6345
--- /dev/null
+++ b/bundles/org.eclipse.jdt.doc.user/tips/images/annotate-map-return.png
Binary files differ
diff --git a/bundles/org.eclipse.jdt.doc.user/tips/images/convert-to-lambda.png b/bundles/org.eclipse.jdt.doc.user/tips/images/convert-to-lambda.png
new file mode 100644
index 0000000..2404a91
--- /dev/null
+++ b/bundles/org.eclipse.jdt.doc.user/tips/images/convert-to-lambda.png
Binary files differ
diff --git a/bundles/org.eclipse.jdt.doc.user/tips/images/convert-to-method-reference.png b/bundles/org.eclipse.jdt.doc.user/tips/images/convert-to-method-reference.png
new file mode 100644
index 0000000..65daacb
--- /dev/null
+++ b/bundles/org.eclipse.jdt.doc.user/tips/images/convert-to-method-reference.png
Binary files differ
diff --git a/bundles/org.eclipse.jdt.doc.user/tips/jdt_tips.html b/bundles/org.eclipse.jdt.doc.user/tips/jdt_tips.html
index 42513af..2c5188e 100644
--- a/bundles/org.eclipse.jdt.doc.user/tips/jdt_tips.html
+++ b/bundles/org.eclipse.jdt.doc.user/tips/jdt_tips.html
@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
-<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2014. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
+<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2015. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
@@ -516,7 +516,7 @@
</td>
</tr>
<tr>
- <td width="20%" valign="top" align="left"><img src="images/new.png" alt=""><b>Create 'for' loops</b></td>
+ <td width="20%" valign="top" align="left"><b>Create 'for' loops</b></td>
<td width="80%" valign="top">A set of <b>Quick Assists (Ctrl+1)</b> can create <code>for</code> loops that iterate over a given expression.
<p>
For arrays:
@@ -539,7 +539,7 @@
</td>
</tr>
<tr>
- <td width="20%" valign="top" align="left"><img src="images/new.png" alt=""><b>Migrate anonymous class creations to lambda expressions and back</b></td>
+ <td width="20%" valign="top" align="left"><b>Migrate anonymous class creations to lambda expressions and back</b></td>
<td width="80%" valign="top">You can convert anonymous class creations to lambda expressions (and back) by invoking the <b>Quick Assists (Ctrl+1)</b>:
<ul>
<li>Convert to lambda expression</li>
@@ -554,6 +554,17 @@
</td>
</tr>
<tr>
+ <td width="20%" valign="top" align="left"><img src="images/new.png" alt=""><b>Migrate lambda expressions to method references and back</b></td>
+ <td width="80%" valign="top">You can convert lambda expressions to method references (and back) by invoking the <b>Quick Assists (Ctrl+1)</b>:
+ <ul>
+ <li>Convert to method reference
+ <p><img src="images/convert-to-method-reference.png" alt="t -> Integer.toHexString(t)"></p></li>
+ <li>Convert to lambda expression
+ <p><img src="images/convert-to-lambda.png" alt="Integer::toHexString"></p></li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
<td width="20%" valign="top" align="left"><b>More Quick Assists and Fixes</b><br>
</td>
<td width="80%" valign="top">Check out the <a
@@ -577,6 +588,19 @@
</td>
</tr>
<tr>
+ <td width="20%" valign="top" align="left"><img src="images/new.png" alt=""><b>Annotate command</b></td>
+ <td width="80%" valign="top">You can invoke <b>Annotate</b> command - either by using the context menu, or by pressing <b>Ctrl+1</b> - when browsing attached source code of a library
+ using the class file editor to annotate any type in the signature of a library method or field. Proposals will be offered for marking the selected type as <code>@NonNull</code> or <code>@Nullable</code>.
+ After selecting a proposal, the compiler will immediately leverage the new annotation for its null analysis.
+ <p><img src="images/annotate-map-return.png" alt=""></p>
+ <p>Two pre-requisites must be met for using this command:</p>
+ <ul>
+ <li>The project is configured to use annotation-based null analysis.</li>
+ <li>An existing workspace folder has been specified as the external annotation location for a given library.</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
<td width="20%" valign="top" align="left"><b>Content assist can insert
argument names automatically</b></td>
@@ -1315,7 +1339,7 @@
> Properties > Javadoc Location</b>).</td>
</tr>
<tr>
- <td width="20%" valign="top" align="left"><img src="images/new.png" alt=""><b>Find the method implemented by functional interface instances</b></td>
+ <td width="20%" valign="top" align="left"><b>Find the method implemented by functional interface instances</b></td>
<td valign="top" align="left" width="80%">To show the method implemented by functional interface instances, you can hover on:
<ul>
<li>'<code>-></code>' in a lambda expression</li>
@@ -2132,7 +2156,7 @@
Breakpoint </b>in the breakpoint context menu or by unchecking the
breakpoint in the <b>Breakpoints view</b>.
<p>You can also temporarily disable all breakpoints using the <b>Skip
- All Breakpoints</b> action in the <b>Breakpoints view</b> toolbar.
+ All Breakpoints (Ctrl+Alt+B)</b> action in the <b>Breakpoints view</b> toolbar.
This will tell the debugger to skip all breakpoints while maintaining
their current enabled state.</p>
<p><img src="images/org.eclipse.jdt.debug.ui/breakpoint_menu.png" alt="Disable Breakpoint action in the ruler context menu"></p>