Additional Java Hints - plugin detail

Adds additional Java hints

NetBeans Plugin - Additional Java Hints
Plugin owner: markiewb
Website: https://github.com/markiewb/nb-additional-hints
Added: 2013-03-07
License: CDDL-GPL-2-CP
Category: Refactoring
Downloaded: 6,424 times
Rating:
 4.49, by 5 users

Plugin Log Show log

Versions available

Download plugin   Download size: 0.12 MB   Last Update: 2017-01-14

This plugin is also available on the NetBeans Plugin Portal Update Center. Use 'Tools > Plugins' action from the NetBeans IDE main menu for convenient installation of this plugin


What's new in this version

1.6.1:

  • [Bugfix]: Fixed: Hints for converting ternary to if and back are missing


Verifications for NetBeans versions

8.2 verification PASSED See verification details
Download plugin   Download size: 0.12 MB   Last Update: 2017-01-14

This plugin is also available on the NetBeans Plugin Portal Update Center. Use 'Tools > Plugins' action from the NetBeans IDE main menu for convenient installation of this plugin


What's new in this version

1.6.1:

  • [Bugfix]: Fixed: Hints for converting ternary to if and back are missing


Verifications for NetBeans versions

8.1 verification PASSED See verification details


Introduction

Additional Java hints for NetBeans IDE

Supported Hints:

  • "Replace '+' with 'MessageFormat.format()'"
  • "Replace '+' with 'new StringBuilder().append()'"
  • "Replace '+' with 'String.format()'"
  • "Join literals"
  • "Copy joined literals to clipboard"
  • "Split at linebreaks"
  • "Split at caret" (since 1.1)
  • "Convert to assertTrue/assertFalse" (since 1.1)
  • "Support transformation to BigDecimal constants" (since 1.1)
  • "Remove "public abstract" modifiers from method declarations within interfaces" (since 1.1)
  • "Remove public/abstract/final modifiers from field declarations within interfaces" (since 1.2)
  • "Change modifiers" (since 1.2)
  • "Convert char to string and back" (since 1.2)
  • "Convert number in literal to number and back" (since 1.2)
  • "Convert to StringUtils.isBlank()/StringUtils.isNotBlank()/StringUtils.isEmpty()" (since 1.2)
  • "Convert from if/else to ternary and back" (since 1.2)
  • "Invert ternary if/else" (since 1.2)
  • "Report methods that have class name" (since 1.2, no transformation)
  • "Add "this." to methods and variables" (since 1.3, disabled by default)
  • "Replace with Optional.isPresent()/Convert return null to return Optional.empty()" (since 1.5)
  • "Replace with null-assignment to Optional with Optional.empty()| (since 1.6)
  • "Convert return xxx to return Optional.ofNullable(xxx)/Optional.of(xxx)/Optional.empty()| (since 1.6)
  • "Convert to assertNull" (since 1.6)
  • "Replace with org.junit.Assert" (since 1.6)

Example:

screenshot.png

Further information:

This plugin is orginally based on code from the "I18N Checker" plugin from Jan Lahoda. The original sourcecode can be found at http://hg.netbeans.org/main/contrib/file/tip/editor.hints.i18n

License remains CDDL-GPL-2-CP - http://www.netbeans.org/cddl-gplv2.html

Provide defects, request for enhancements and feedback at https://github.com/markiewb/nb-additional-hints/issues

Compatible to NetBeans 8.1 and higher

btn_donate_SM.gif

[ You have to be logged in to be able to comment. ]

User Comments

There are no comments yet.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo