Skip to content

Conversation

@regisd
Copy link
Member

@regisd regisd commented Oct 6, 2018

From https://lgtm.com/projects/g/jflex-de/jflex/alerts/

  • Class Interval overrides equals but not hashCode.
  • Class IntCharSet overrides equals but not hashCode.
  • StateSet: equals() method does not seem to check argument type.
  • Main: array access might be out of bounds, as the index might be equal to the array length.
  • Main: This FileInputStream is not always closed on method exit.
  • Skeleton: This FileReader is not always closed on method exit.
  • Skeleton: The FileInputStream and FileOutputStream classes contains a finalizer method which will cause garbage collection pauses. See JDK-8080225 for details.

@regisd regisd added the code quality Code health and clean-up label Oct 6, 2018
@regisd regisd self-assigned this Oct 6, 2018
@regisd regisd added this to the 1.7.1 milestone Oct 6, 2018
@regisd regisd requested a review from lsf37 October 6, 2018 13:39
@regisd
Copy link
Member Author

regisd commented Oct 6, 2018

This pull request fixes 20 alerts when merging 7289a45 into ae6e502 - view on LGTM.com

fixed alerts:

  • 16 for Potential input resource leak
  • 2 for Inconsistent equals and hashCode
  • 1 for Equals method does not inspect argument type
  • 1 for Array index out of bounds

Comment posted by LGTM.com

The FileInputStream and FileOutputStream classes contains a finalizer method which will cause garbage collection pauses. See JDK-8080225 for details.

The FileReader and FileWriter constructors instantiate FileInputStream and FileOutputStream, again causing garbage collection issues while finalizer methods are called.

Use Files.newInputStream(Paths.get(fileName)) instead of new FileInputStream(fileName).
@regisd
Copy link
Member Author

regisd commented Oct 6, 2018

This pull request fixes 20 alerts when merging 5598dee into ae6e502 - view on LGTM.com

fixed alerts:

  • 16 for Potential input resource leak
  • 2 for Inconsistent equals and hashCode
  • 1 for Equals method does not inspect argument type
  • 1 for Array index out of bounds

Comment posted by LGTM.com

@regisd regisd changed the title Error-prones fixes Fix PMD violations Oct 6, 2018
@regisd
Copy link
Member Author

regisd commented Oct 6, 2018

This pull request fixes 20 alerts when merging 7c981c3 into ae6e502 - view on LGTM.com

fixed alerts:

  • 16 for Potential input resource leak
  • 2 for Inconsistent equals and hashCode
  • 1 for Equals method does not inspect argument type
  • 1 for Array index out of bounds

Comment posted by LGTM.com

@regisd regisd merged commit dedd074 into jflex-de:master Oct 6, 2018
@regisd regisd deleted the add-hashCode branch October 6, 2018 19:50
@regisd regisd mentioned this pull request Oct 10, 2018
This was referenced Oct 21, 2018
@lsf37 lsf37 modified the milestones: 1.7.1, 1.8.0 Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality Code health and clean-up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants