Skip to content

HDDS-9411. Restrict FileInputStream/FileOutputStream import#10789

Merged
adoroszlai merged 1 commit into
apache:masterfrom
prathmesh12-coder:HDDS-9411
Jul 17, 2026
Merged

HDDS-9411. Restrict FileInputStream/FileOutputStream import#10789
adoroszlai merged 1 commit into
apache:masterfrom
prathmesh12-coder:HDDS-9411

Conversation

@prathmesh12-coder

@prathmesh12-coder prathmesh12-coder commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-9411

How was this patch tested?

  • Manual testing : 

    temporarily added these imports in a file , e.g. : hadoop-hdds/common/…/hdds/utils/IOUtils.java:
import java.io.FileInputStream;
import java.io.FileOutputStream;

build fails with below trace as expected:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.6.3:enforce (ban-imports) on project hdds-common: 
[ERROR] Rule 12: org.apache.maven.plugins.enforcer.RestrictImports failed with message:
[ERROR] 
[ERROR] Banned imports detected:
[ERROR] 
[ERROR] Reason: Classes (e.g. FileInputStream, FileOutputStream) overriding the Object.finalize() method will cause gc to run a much longer time
[ERROR]         in file:///Users/psapate/Desktop/open-source/ozone/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/utils/IOUtils.java
[ERROR]                 java.io.FileInputStream         (Line: 34, Matched by: java.io.FileInputStream)
[ERROR]                 java.io.FileOutputStream        (Line: 35, Matched by: java.io.FileOutputStream)

@prathmesh12-coder prathmesh12-coder changed the title HDDS-9411. Restrict FileInputStream/FileOutputStream import HDDS-9411. Restrict FileInputStream/FileOutputStream import Jul 17, 2026
@adoroszlai adoroszlai changed the title HDDS-9411. Restrict FileInputStream/FileOutputStream import HDDS-9411. Restrict FileInputStream/FileOutputStream import Jul 17, 2026
@adoroszlai
adoroszlai merged commit 1f51558 into apache:master Jul 17, 2026
43 of 47 checks passed
@adoroszlai

Copy link
Copy Markdown
Contributor

Thanks @prathmesh12-coder for the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants