Extra Hints - plugin detail

Extra hints for working with various standard library and 3rd-party library APIs

n/a
Plugin owner: dtrebbien
Website:
Added: 2017-12-14
License: Freeware
Category: Editing
Downloaded: 336 times
Rating:
 4.5, by 1 users

Plugin Log Show log

Versions available

Download plugin   Download size: 0.04 MB   Last Update: 2018-02-26

What's new in this version

If you find a bug or have any feedback, please send me an email: dtrebbien@gmail.com

Version 0.4.3 (February 25, 2018)

Bumped the expiration time.

This no-cost version is set to expire on September 1, 2018 at 12:01 a.m. UTC.

Version 0.4.2 (January 25, 2018)

Noted in automatic fix descriptions that the Reader (Writer) returned by Files.newBufferedReader() (.newBufferedWriter()) will throw an IOException when encountering malformed or unmappable data.

This no-cost version is set to expire on March 1, 2018 at 12:01 a.m. UTC.

Version 0.4.1 (January 10, 2018)

Fixed incorrect behavior of the Commons IO > Replace considered-deprecated Charset constants hint in cases where Charset constants are referenced via instances of org.apache.commons.io.Charsets or subtypes thereof.

This no-cost version is set to expire on March 1, 2018 at 12:01 a.m. UTC.

Version 0.4 (January 1, 2018)

  • Extended the Probable Bugs > Possible file or directory handle leak hint to examine other syntactic elements such as enhanced for loops. Also, an explanation for the warning is now provided in the warning message.
  • Fixed a NullPointerException issue in the Probable Bugs > Possible file or directory handle leak hint.
  • Implemented a work around for an issue with how type information for types involving wildcards is presented to the plugin by NetBeans' Hints API.

This no-cost version is set to expire on March 1, 2018 at 12:01 a.m. UTC.

Version 0.3 (December 27, 2017)

  • Added the Commons IO > Replace considered-deprecated Charset constants hint.
  • Added the Commons Lang > Guard against calling the unintended StringUtils split() or splitPreserveAllTokens() API hint.
  • Added the Probable Bugs > Possible file or directory handle leak hint.

This no-cost version is set to expire on March 1, 2018 at 12:01 a.m. UTC.

Version 0.2.1 (December 23, 2017)

Fixed an issue with the Guava > Replace considered-deprecated Charset constants hint, where some usages of com.google.common.base.Charsets would not be replaced.

This no-cost version is set to expire on March 1, 2018 at 12:01 a.m. UTC.

Version 0.2 (December 22, 2017)

  • Improved the Guava > Replace considered-deprecated Charset constants hint's ability to clean up unused imports of/from com.google.common.base.Charsets after refactoring.
  • Added the Commons IO > Replace new NullOutputStream instances with the singleton instance hint.
  • Added the Guava > Inefficient use of Joiner.join() or MapJoiner.join() hint.

This no-cost version is set to expire on March 1, 2018 at 12:01 a.m. UTC.

Version 0.1 (December 13, 2017)

First public release.

This no-cost version is set to expire on March 1, 2018 at 12:01 a.m. UTC.

Verifications for NetBeans versions

Plugin is not subject to any verification



Introduction

This plugin offers extra hints for code utilizing various standard library and 3rd-party library APIs.

Java Standard Library

Finds cases where java.nio.file.Files.newBufferedReader(), .newBufferedWriter(), .newByteChannel(), .newDirectoryStream(), .newInputStream(), and .newOutputStream() are being used in ways that might leak a directory or file handle at runtime.

Note: When rewriting to Files.newBufferedReader(), be aware that the Reader returned by that method will throw an IOException if malformed or unmappable byte sequences for the specified charset are encountered in the file. This is unlike the behavior of an InputStreamReader constructed from an InputStream and a Charset or charset name. See this comment and the next comment on JENKINS-49060, as well as JENKINS-49112. Similarly, when rewriting to Files.newBufferedWriter(), be aware that the Writer returned by that method will throw an IOException if a character cannot be encoded in the specified charset.

Commons IO

  • Replace considered-deprecated Charset constants within org.apache.commons.io.Charsets.
  • Replace new instances of org.apache.commons.io.output.NullOutputStream with the singleton instance.

Commons Lang

Guard against calling the unintended StringUtils.split() or .splitPreserveAllTokens() API.

Guava

  • Identify and rewrite certain inefficient calls to Joiner.join() and MapJoiner.join().
  • Replace considered-deprecated Charset constants within com.google.common.base.Charsets.

Tips:

  • The automatic fixes, if they need to introduce new import statements, refer to the Java "Imports" editor formatting preferences to determine where to place the new imports. For best refactoring results, be sure to configure your preferred "Import Layout".
  • Some hints support bulk refactoring via the Refactor > Inspect and Transform… menu item.

[ 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