[
https://issues.apache.org/jira/browse/FILEUPLOAD-323?focusedWorklogId=591434&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-591434
]
ASF GitHub Bot logged work on FILEUPLOAD-323:
---------------------------------------------
Author: ASF GitHub Bot
Created on: 30/Apr/21 10:26
Start Date: 30/Apr/21 10:26
Worklog Time Spent: 10m
Work Description: kinow commented on pull request #75:
URL: https://github.com/apache/commons-fileupload/pull/75#issuecomment-829999881
Hi @jochenw
I also don't have a strong preference. Most times I just try to remember to
read some code in the project I'm working on and mimic the code style.
I find SpotBugs/checkstyle/etc helpful when we find a set of rules that
allow you to spot simple mistakes, especially those that appear in PR's of
first-time contributors, and can be quickly spotted by CI. But agree that some
rules can be annoying (e.g. when you wrote a perfectly legible 121 characters
line, and checkstyle tells you to reduce in character or add a line break š¤·āāļø
).
I think this PR can be a good initial work for spotbugs. We can tweak it so
that it doesn't bother you and others when they need to work on the component,
whilst also helping you and other devs to keep the code uniform-ish, and filter
simple bugs in CI (i.e. feel free to suggest what rules are being helpful or
not, what to disable, etc).
Just my 0.02 cents :o)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 591434)
Time Spent: 1h 10m (was: 1h)
> Implement spotbugs
> ------------------
>
> Key: FILEUPLOAD-323
> URL: https://issues.apache.org/jira/browse/FILEUPLOAD-323
> Project: Commons FileUpload
> Issue Type: New Feature
> Reporter: Arturo Bernal
> Priority: Major
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> The idea it's useĀ spotbugsĀ in an intend of find or prevents bugs in Java code.
> This Jira it's for keep track and work in the implementations
> Ā
> Ā
> Need to check:
> {code:java}
> [INFO] BugInstance size is 12 [INFO] Error size is 0 [INFO] Total bugs: 12
> [ERROR] High: Found reliance on default encoding in
> org.apache.commons.fileupload2.MultipartStream.readHeaders():
> java.io.ByteArrayOutputStream.toString()
> [org.apache.commons.fileupload2.MultipartStream,
> org.apache.commons.fileupload2.MultipartStream] At MultipartStream.java:[line
> 592]Another occurrence at MultipartStream.java:[line 595] DM_DEFAULT_ENCODING
> [ERROR] Medium:
> org.apache.commons.fileupload2.MultipartStream.BOUNDARY_PREFIX should be
> package protected [org.apache.commons.fileupload2.MultipartStream] At
> MultipartStream.java:[line 205] MS_PKGPROTECT [ERROR] Medium:
> org.apache.commons.fileupload2.MultipartStream.FIELD_SEPARATOR should be
> package protected [org.apache.commons.fileupload2.MultipartStream] At
> MultipartStream.java:[line 194] MS_PKGPROTECT [ERROR] Medium:
> org.apache.commons.fileupload2.MultipartStream.HEADER_SEPARATOR should be
> package protected [org.apache.commons.fileupload2.MultipartStream] At
> MultipartStream.java:[line 188] MS_PKGPROTECT [ERROR] Medium:
> org.apache.commons.fileupload2.MultipartStream.STREAM_TERMINATOR should be
> package protected [org.apache.commons.fileupload2.MultipartStream] At
> MultipartStream.java:[line 200] MS_PKGPROTECT [ERROR] Medium:
> org.apache.commons.fileupload2.ParameterParser.parse(char[], int, int, char)
> may expose internal representation by storing an externally mutable object
> into ParameterParser.chars [org.apache.commons.fileupload2.ParameterParser]
> At ParameterParser.java:[line 302] EI_EXPOSE_REP2 [ERROR] High: Found
> reliance on default encoding in
> org.apache.commons.fileupload2.disk.DiskFileItem.getString(): new
> String(byte[]) [org.apache.commons.fileupload2.disk.DiskFileItem] At
> DiskFileItem.java:[line 360] DM_DEFAULT_ENCODING [ERROR] Medium:
> org.apache.commons.fileupload2.disk.DiskFileItem.get() may expose internal
> representation by returning DiskFileItem.cachedContent
> [org.apache.commons.fileupload2.disk.DiskFileItem] At DiskFileItem.java:[line
> 305] EI_EXPOSE_REP [ERROR] Medium: Exceptional return value of
> java.io.File.delete() ignored in
> org.apache.commons.fileupload2.disk.DiskFileItem.delete()
> [org.apache.commons.fileupload2.disk.DiskFileItem] At DiskFileItem.java:[line
> 432] RV_RETURN_VALUE_IGNORED_BAD_PRACTICE [ERROR] Medium: Exceptional return
> value of java.io.File.delete() ignored in
> org.apache.commons.fileupload2.disk.DiskFileItem.finalize()
> [org.apache.commons.fileupload2.disk.DiskFileItem] At DiskFileItem.java:[line
> 550] RV_RETURN_VALUE_IGNORED_BAD_PRACTICE [ERROR] Medium:
> org.apache.commons.fileupload2.jaksrvlt.JakSrvltFileUpload.parseRequest(HttpServletRequest)
> doesn't override method in superclass because parameter type
> jakarta.servlet.http.HttpServletRequest doesn't match superclass parameter
> type javax.servlet.http.HttpServletRequest
> [org.apache.commons.fileupload2.jaksrvlt.JakSrvltFileUpload] At
> JakSrvltFileUpload.java:[line 110] NM_WRONG_PACKAGE [ERROR] High: Found
> reliance on default encoding in
> org.apache.commons.fileupload2.util.Streams.asString(InputStream):
> java.io.ByteArrayOutputStream.toString()
> [org.apache.commons.fileupload2.util.Streams] At Streams.java:[line 142]
> DM_DEFAULT_ENCODING
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)