[
https://issues.apache.org/jira/browse/FLINK-25517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated FLINK-25517:
-----------------------------------
Labels: pull-request-available (was: )
> Extract duplicate code in JarFileChecker
> ----------------------------------------
>
> Key: FLINK-25517
> URL: https://issues.apache.org/jira/browse/FLINK-25517
> Project: Flink
> Issue Type: Improvement
> Components: Build System / CI
> Reporter: Wenjun Ruan
> Priority: Minor
> Labels: pull-request-available
>
> Hi community,
> I find there are some code in JarFileChecker.java can be extracted to a
> method.
> For example:
>
> {code:java}
> // code placeholder
> Files.walk(path)
> .filter(file -> file.toString().endsWith(".jar"))
> .collect(Collectors.toList())
> may be better to:
> return Files.walk(path)
> .filter(JarFileChecker::isJarFile)
> .collect(Collectors.toList());{code}
>
> {code:java}
> // code placeholder
> !getFileName(path).startsWith("license")
> !getFileName(path).startsWith("notice")
> !getFileName(path).endsWith(".ftl")
> may be better to:
> !fileNameStartsWith(path, "license")
> !fileNameStartsWith(path, "notice")
> !fileNameEndWith(path, ".ftl"){code}
> This is not a must, but I think this change may make the code cleaner.
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)