Skip to content

Commit bc32109

Browse files
committed
Fix SpotBugs AT_STALE_THREAD_WRITE_OF_PRIMITIVE in BoundedInputStream
- Note that BoundedInputStream.setPropagateClose(boolean) is deprecated - [ERROR] Medium: Shared primitive variable "propagateClose" in one thread may not yield the value of the most recent write from another thread [org.apache.commons.io.input.BoundedInputStream] At BoundedInputStream.java:[line 555] AT_STALE_THREAD_WRITE_OF_PRIMITIVE
1 parent ec1e822 commit bc32109

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ The <action> type attribute can be add,update,fix,remove.
6565
<action dev="ggregory" type="fix" due-to="Gary Gregory">Fix SpotBugs [ERROR] Medium: Shared primitive variable "atSlashCr" in one thread may not yield the value of the most recent write from another thread [org.apache.commons.io.input.UnixLineEndingInputStream] At UnixLineEndingInputStream.java:[line 124] AT_STALE_THREAD_WRITE_OF_PRIMITIVE.</action>
6666
<action dev="ggregory" type="fix" due-to="Gary Gregory">Fix SpotBugs [ERROR] Medium: Shared primitive variable "atSlashLf" in one thread may not yield the value of the most recent write from another thread [org.apache.commons.io.input.UnixLineEndingInputStream] At UnixLineEndingInputStream.java:[line 125] AT_STALE_THREAD_WRITE_OF_PRIMITIVE.</action>
6767
<action dev="ggregory" type="fix" due-to="Gary Gregory">Fix SpotBugs [ERROR] Medium: Shared primitive variable "closed" in one thread may not yield the value of the most recent write from another thread [org.apache.commons.io.input.ProxyInputStream] At ProxyInputStream.java:[line 233] AT_STALE_THREAD_WRITE_OF_PRIMITIVE.</action>
68+
<action dev="ggregory" type="fix" due-to="Gary Gregory">Fix SpotBugs [ERROR] Medium: Shared primitive variable "propagateClose" in one thread may not yield the value of the most recent write from another thread [org.apache.commons.io.input.BoundedInputStream] At BoundedInputStream.java:[line 555] AT_STALE_THREAD_WRITE_OF_PRIMITIVE.</action>
6869
<!-- ADD -->
6970
<action dev="ggregory" type="add" issue="IO-875" due-to="Pierre Baumard, Gary Gregory">Add and use org.apache.commons.io.file.CountingPathVisitor.accept(Path, BasicFileAttributes) #743.</action>
7071
<!-- UPDATE -->

src/main/java/org/apache/commons/io/input/BoundedInputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ public synchronized void reset() throws IOException {
551551
* @deprecated Use {@link AbstractBuilder#setPropagateClose(boolean)}.
552552
*/
553553
@Deprecated
554-
public void setPropagateClose(final boolean propagateClose) {
554+
public synchronized void setPropagateClose(final boolean propagateClose) {
555555
this.propagateClose = propagateClose;
556556
}
557557

0 commit comments

Comments
 (0)