tmysik commented on a change in pull request #2203:
URL: https://github.com/apache/netbeans/pull/2203#discussion_r443512492
##########
File path:
php/php.code.analysis/test/unit/src/org/netbeans/modules/php/analysis/parsers/PHPStanReportParserTest.java
##########
@@ -107,4 +114,13 @@ private FileObject getDataDir(String name) {
return dataDir.getFileObject(name);
}
+ private void fixContent(File file) throws Exception {
+ Path path = file.toPath();
+ Charset charset = StandardCharsets.UTF_8;
+ String content = new String(Files.readAllBytes(path), charset);
+ String workdirReplacement =
Matcher.quoteReplacement(getDataDir().getAbsolutePath());
+ content = content.replaceAll("%WORKDIR%", workdirReplacement);
Review comment:
Again - any reason why use regular expressions?
##########
File path:
php/php.code.analysis/test/unit/src/org/netbeans/modules/php/analysis/parsers/PHPStanReportParserTest.java
##########
@@ -107,4 +114,13 @@ private FileObject getDataDir(String name) {
return dataDir.getFileObject(name);
}
+ private void fixContent(File file) throws Exception {
+ Path path = file.toPath();
+ Charset charset = StandardCharsets.UTF_8;
+ String content = new String(Files.readAllBytes(path), charset);
+ String workdirReplacement =
Matcher.quoteReplacement(getDataDir().getAbsolutePath());
+ content = content.replaceAll("%WORKDIR%", workdirReplacement);
Review comment:
@KacerCZ Could you please fix this too? Thanks.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
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