Skip to content

Commit 3c3ecc2

Browse files
authored
Merge pull request #1245 from HubSpot/js-basepom-63
bump basepom to 63, add required pom metadata fields
2 parents d15d7c0 + ddd2cdf commit 3c3ecc2

File tree

6 files changed

+27
-16
lines changed

6 files changed

+27
-16
lines changed

pom.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
<parent>
66
<groupId>com.hubspot</groupId>
77
<artifactId>basepom</artifactId>
8-
<version>59.11</version>
8+
<version>63.4</version>
99
</parent>
1010

1111
<groupId>com.hubspot.jinjava</groupId>
1212
<artifactId>jinjava</artifactId>
1313
<version>2.8.1-SNAPSHOT</version>
14+
15+
<name>${project.groupId}:${project.artifactId}</name>
1416
<description>Jinja templating engine implemented in Java</description>
1517

1618
<properties>
@@ -339,6 +341,13 @@
339341

340342
<url>https://github.com/HubSpot/jinjava</url>
341343

344+
<licenses>
345+
<license>
346+
<name>The Apache License, Version 2.0</name>
347+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
348+
</license>
349+
</licenses>
350+
342351
<developers>
343352
<developer>
344353
<id>jaredstehler</id>
@@ -359,7 +368,7 @@
359368

360369
<profiles>
361370
<profile>
362-
<id>basepom.oss-release</id>
371+
<id>basepom.central-release</id>
363372
<properties>
364373
<basepom.check.skip-pom-lint>true</basepom.check.skip-pom-lint>
365374
<basepom.check.skip-dependency-management>true</basepom.check.skip-dependency-management>

src/main/java/com/hubspot/jinjava/el/ext/ExtendedScanner.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.hubspot.jinjava.el.ext;
22

33
import de.odysseus.el.tree.impl.Scanner;
4+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
45
import java.lang.reflect.Field;
56
import java.lang.reflect.InvocationTargetException;
67
import java.lang.reflect.Method;
@@ -58,6 +59,10 @@ protected boolean isWhitespace(char c) {
5859
}
5960
}
6061

62+
@SuppressFBWarnings(
63+
value = "HSM_HIDING_METHOD",
64+
justification = "Purposefully overriding to use static method instance of this class."
65+
)
6166
protected static void addKeyToken(Token token) {
6267
try {
6368
ADD_KEY_TOKEN_METHOD.invoke(null, token);

src/main/java/com/hubspot/jinjava/interpret/JinjavaInterpreter.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
import com.hubspot.jinjava.util.RenderLimitUtils;
6262
import com.hubspot.jinjava.util.Variable;
6363
import com.hubspot.jinjava.util.WhitespaceUtils;
64-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
6564
import java.io.IOException;
6665
import java.util.ArrayList;
6766
import java.util.Collection;
@@ -541,10 +540,6 @@ private boolean isEagerExtendsTag(TagNode node) {
541540
);
542541
}
543542

544-
@SuppressFBWarnings(
545-
justification = "Iterables#getFirst DOES allow null for default value",
546-
value = "NP_NONNULL_PARAM_VIOLATION"
547-
)
548543
private void resolveBlockStubs(OutputList output, Stack<String> blockNames) {
549544
for (BlockPlaceholderOutputNode blockPlaceholder : output.getBlocks()) {
550545
if (!blockNames.contains(blockPlaceholder.getBlockName())) {

src/main/java/com/hubspot/jinjava/lib/filter/AbstractFilter.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.hubspot.jinjava.doc.annotations.JinjavaParam;
2222
import com.hubspot.jinjava.interpret.InvalidInputException;
2323
import com.hubspot.jinjava.interpret.JinjavaInterpreter;
24-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
2524
import java.math.BigDecimal;
2625
import java.util.ArrayList;
2726
import java.util.Arrays;
@@ -69,10 +68,6 @@ public Object filter(Object var, JinjavaInterpreter interpreter, String... args)
6968
return filter(var, interpreter, args, Collections.emptyMap());
7069
}
7170

72-
@SuppressFBWarnings(
73-
value = "UC_USELESS_OBJECT",
74-
justification = "FB bug prevents forEach() method call counting `namedArgs` as used (fixed in next release)"
75-
)
7671
public Object filter(
7772
Object var,
7873
JinjavaInterpreter interpreter,

src/main/java/com/hubspot/jinjava/lib/fn/eager/EagerMacroFunction.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.util.Map.Entry;
2929
import java.util.Optional;
3030
import java.util.StringJoiner;
31+
import java.util.concurrent.atomic.AtomicBoolean;
3132
import java.util.concurrent.atomic.AtomicInteger;
3233
import java.util.function.Function;
3334
import java.util.function.Supplier;
@@ -38,7 +39,7 @@
3839
public class EagerMacroFunction extends MacroFunction {
3940

4041
private AtomicInteger callCount = new AtomicInteger();
41-
private boolean reconstructing = false;
42+
private AtomicBoolean reconstructing = new AtomicBoolean();
4243

4344
public EagerMacroFunction(
4445
List<Node> content,
@@ -70,7 +71,7 @@ public Object doEvaluate(
7071
List<Object> varArgs
7172
) {
7273
JinjavaInterpreter interpreter = JinjavaInterpreter.getCurrent();
73-
if (reconstructing) {
74+
if (reconstructing.get()) {
7475
try (
7576
InterpreterScopeClosable c = interpreter.enterScope();
7677
AutoCloseableImpl<Optional<String>> importFile = getImportFileWithWrapper(
@@ -282,7 +283,7 @@ public String reconstructImage(String fullName) {
282283
}
283284

284285
try (InterpreterScopeClosable c = interpreter.enterScope()) {
285-
reconstructing = true;
286+
reconstructing.set(true);
286287
String evaluation = (String) evaluate(
287288
getArguments().stream().map(arg -> DeferredMacroValueImpl.instance()).toArray()
288289
);
@@ -300,7 +301,7 @@ public String reconstructImage(String fullName) {
300301
}
301302
result.append(super.reconstructImage());
302303
} finally {
303-
reconstructing = false;
304+
reconstructing.set(false);
304305
interpreter
305306
.getContext()
306307
.put(Context.DEFERRED_IMPORT_RESOURCE_PATH_KEY, currentDeferredImportResource);

src/main/java/com/hubspot/jinjava/mode/NonRevertingEagerExecutionMode.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
package com.hubspot.jinjava.mode;
22

3+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
4+
35
public class NonRevertingEagerExecutionMode extends EagerExecutionMode {
46

57
private static final ExecutionMode INSTANCE = new NonRevertingEagerExecutionMode();
68

79
protected NonRevertingEagerExecutionMode() {}
810

11+
@SuppressFBWarnings(
12+
value = "HSM_HIDING_METHOD",
13+
justification = "Purposefully overriding to return static instance of this class."
14+
)
915
public static ExecutionMode instance() {
1016
return INSTANCE;
1117
}

0 commit comments

Comments
 (0)