matthiasblaesing commented on code in PR #9278:
URL: https://github.com/apache/netbeans/pull/9278#discussion_r2942502665
##########
php/php.project/src/org/netbeans/modules/php/project/ui/customizer/PhpProjectProperties.java:
##########
@@ -813,7 +813,7 @@ void saveProperties() throws IOException {
} else {
charsetName =
ProjectPropertiesSupport.getEncoding(project);
}
- FileUtil.copy(new
ByteArrayInputStream(changedLicensePathContent.getBytes(charsetName)), out);
+ new
ByteArrayInputStream(changedLicensePathContent.getBytes(charsetName)).transferTo(out);
Review Comment:
```suggestion
out.write(changedLicensePathContent.getBytes(charsetName));
```
##########
java/java.source/src/org/netbeans/modules/java/classfile/CodeGenerator.java:
##########
@@ -272,7 +272,7 @@ public void run(WorkingCopy wc) throws Exception {
}
out = result[0].getOutputStream();
try {
- FileUtil.copy(new
ByteArrayInputStream(r.getResultingSource(file).getBytes(StandardCharsets.UTF_8)),
out);
+ new
ByteArrayInputStream(r.getResultingSource(file).getBytes(StandardCharsets.UTF_8)).transferTo(out);
Review Comment:
```suggestion
out.write(r.getResultingSource(file).getBytes(StandardCharsets.UTF_8));
```
##########
java/java.source/src/org/netbeans/modules/java/classfile/CodeGenerator.java:
##########
@@ -143,7 +143,7 @@ public static FileObject generateCode(final ClasspathInfo
cpInfo, final ElementH
OutputStream out = file.getOutputStream();
try {
- FileUtil.copy(new
ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)), out); //NOI18N
+ new
ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)).transferTo(out);
Review Comment:
```suggestion
out.write("".getBytes(StandardCharsets.UTF_8));
```
##########
java/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/J2SEProjectProperties.java:
##########
@@ -471,7 +471,7 @@ public void save() {
}
OutputStream out = fo.getOutputStream();
try {
- FileUtil.copy(new
ByteArrayInputStream(CHANGED_LICENSE_PATH_CONTENT.getBytes()), out);
+ new
ByteArrayInputStream(CHANGED_LICENSE_PATH_CONTENT.getBytes()).transferTo(out);
Review Comment:
```suggestion
out.write(CHANGED_LICENSE_PATH_CONTENT.getBytes());
```
##########
ide/web.browser.api/src/org/netbeans/modules/web/browser/spi/ExternalModificationsSupport.java:
##########
@@ -112,7 +112,7 @@ private static void updateFileObject(FileObject
modifiedFile, String content) {
lock = modifiedFile.lock();
os = modifiedFile.getOutputStream(lock);
// TODO: is encoding going to be OK?? what encoding CDT sends the
file in??
- FileUtil.copy(new ByteArrayInputStream(content.getBytes()), os);
+ new ByteArrayInputStream(content.getBytes()).transferTo(os);
Review Comment:
```suggestion
os.write(content.getBytes());
```
##########
java/maven/src/org/netbeans/modules/maven/customizer/LicenseHeaderPanelProvider.java:
##########
@@ -105,7 +105,7 @@ public void performOperation(POMModel model) {
if (fo.isData()) {
OutputStream out = fo.getOutputStream();
try {
- FileUtil.copy(new
ByteArrayInputStream(licenseContent.getBytes()), out);
+ new
ByteArrayInputStream(licenseContent.getBytes()).transferTo(out);
Review Comment:
```suggestion
out.write(licenseContent.getBytes());
```
##########
platform/core.startup/test/unit/src/org/netbeans/core/startup/layers/DelayFSEventsTest.java:
##########
@@ -122,11 +122,11 @@ private File createModuleJar(String manifest) throws
IOException {
File l3 = new File(new File(new File(getDataDir(), "layers"), "data"),
"layer3.xml");
InputStream is = new FileInputStream(l3);
- FileUtil.copy( is, os );
+ is.transferTo(os );
Review Comment:
```suggestion
is.transferTo(os);
```
##########
platform/core.startup/test/unit/src/org/netbeans/core/startup/layers/DelayFSEventsTest.java:
##########
@@ -122,11 +122,11 @@ private File createModuleJar(String manifest) throws
IOException {
File l3 = new File(new File(new File(getDataDir(), "layers"), "data"),
"layer3.xml");
InputStream is = new FileInputStream(l3);
- FileUtil.copy( is, os );
+ is.transferTo(os );
is.close();
os.putNextEntry(new
JarEntry("org/netbeans/core/startup/layers/DelayFSInstaller.class"));
is =
DelayFSEventsTest.class.getResourceAsStream("DelayFSInstaller.class");
- FileUtil.copy (is, os);
+ is.transferTo (os);
Review Comment:
```suggestion
is.transferTo(os);
```
##########
java/java.j2semodule/src/org/netbeans/modules/java/j2semodule/ui/customizer/J2SEModularProjectProperties.java:
##########
@@ -471,7 +471,7 @@ public void save() {
}
OutputStream out = fo.getOutputStream();
try {
- FileUtil.copy(new
ByteArrayInputStream(CHANGED_LICENSE_PATH_CONTENT.getBytes()), out);
+ new
ByteArrayInputStream(CHANGED_LICENSE_PATH_CONTENT.getBytes()).transferTo(out);
Review Comment:
```suggestion
out.write(CHANGED_LICENSE_PATH_CONTENT.getBytes());
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists