Skip to content

Commit 6824e4b

Browse files
committed
small refactoring
1 parent 4972f68 commit 6824e4b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/main/java/com/igormaznitsa/jcp/expression/functions/FunctionBINFILE.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static Type find(@Nullable final String name) {
6464
if (name != null) {
6565
final String normalized = name.toLowerCase(Locale.ENGLISH).trim();
6666
for (final Type t : values()) {
67-
if (name.startsWith(t.name)) {
67+
if (normalized.startsWith(t.name)) {
6868
result = t;
6969
break;
7070
}

src/main/java/com/igormaznitsa/jcp/maven/PreprocessorMojo.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737

3838
import com.igormaznitsa.meta.annotation.MustNotContainNull;
3939
import static com.igormaznitsa.meta.common.utils.Assertions.assertNotNull;
40+
import org.apache.commons.lang3.StringUtils;
41+
import com.igormaznitsa.meta.common.utils.Assertions;
4042

4143
/**
4244
* The Mojo makes preprocessing of defined or project root source folders and place result in defined or predefined folder, also it can replace the source folder for a maven
@@ -390,7 +392,7 @@ private String makeSourceRootList() {
390392
getLog().debug("Can't find source folder : "+srcRoot);
391393
}
392394

393-
String textToAppend = null;
395+
String textToAppend;
394396

395397
if (folderPresented) {
396398
textToAppend = srcRoot;
@@ -515,7 +517,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
515517

516518
boolean skipPreprocessing = false;
517519

518-
if (sourceFoldersInPreprocessingFormat == null || sourceFoldersInPreprocessingFormat.isEmpty()) {
520+
if (StringUtils.isEmpty(sourceFoldersInPreprocessingFormat)) {
519521
if (isIgnoreMissingSources()) {
520522
getLog().warn("Source folders are not provided, preprocessing is skipped.");
521523
skipPreprocessing = true;
@@ -526,7 +528,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
526528

527529
if (!skipPreprocessing) {
528530
try {
529-
context = makePreprocessorContext(sourceFoldersInPreprocessingFormat);
531+
context = makePreprocessorContext(Assertions.assertNotNull(sourceFoldersInPreprocessingFormat));
530532
}
531533
catch (Exception ex) {
532534
final PreprocessorException pp = PreprocessorException.extractPreprocessorException(ex);

0 commit comments

Comments
 (0)