Skip to content

Commit 1d4d291

Browse files
jaredstehlerjasmith-hs
authored andcommitted
Merge pull request #1245 from HubSpot/js-basepom-63
bump basepom to 63, add required pom metadata fields
1 parent d243da5 commit 1d4d291

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.7.5-SNAPSHOT</version>
14+
15+
<name>${project.groupId}:${project.artifactId}</name>
1416
<description>Jinja templating engine implemented in Java</description>
1517

1618
<properties>
@@ -329,6 +331,13 @@
329331

330332
<url>https://github.com/HubSpot/jinjava</url>
331333

334+
<licenses>
335+
<license>
336+
<name>The Apache License, Version 2.0</name>
337+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
338+
</license>
339+
</licenses>
340+
332341
<developers>
333342
<developer>
334343
<id>jaredstehler</id>
@@ -349,7 +358,7 @@
349358

350359
<profiles>
351360
<profile>
352-
<id>basepom.oss-release</id>
361+
<id>basepom.central-release</id>
353362
<properties>
354363
<basepom.check.skip-pom-lint>true</basepom.check.skip-pom-lint>
355364
<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
@@ -59,7 +59,6 @@
5959
import com.hubspot.jinjava.util.RenderLimitUtils;
6060
import com.hubspot.jinjava.util.Variable;
6161
import com.hubspot.jinjava.util.WhitespaceUtils;
62-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
6362
import java.io.IOException;
6463
import java.util.ArrayList;
6564
import java.util.Collection;
@@ -526,10 +525,6 @@ private boolean isEagerExtendsTag(TagNode node) {
526525
);
527526
}
528527

529-
@SuppressFBWarnings(
530-
justification = "Iterables#getFirst DOES allow null for default value",
531-
value = "NP_NONNULL_PARAM_VIOLATION"
532-
)
533528
private void resolveBlockStubs(OutputList output, Stack<String> blockNames) {
534529
for (BlockPlaceholderOutputNode blockPlaceholder : output.getBlocks()) {
535530
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
@@ -26,6 +26,7 @@
2626
import java.util.Map.Entry;
2727
import java.util.Optional;
2828
import java.util.StringJoiner;
29+
import java.util.concurrent.atomic.AtomicBoolean;
2930
import java.util.concurrent.atomic.AtomicInteger;
3031
import java.util.function.Function;
3132
import java.util.function.Supplier;
@@ -36,7 +37,7 @@
3637
public class EagerMacroFunction extends MacroFunction {
3738

3839
private AtomicInteger callCount = new AtomicInteger();
39-
private boolean reconstructing = false;
40+
private AtomicBoolean reconstructing = new AtomicBoolean();
4041

4142
public EagerMacroFunction(
4243
List<Node> content,
@@ -68,7 +69,7 @@ public Object doEvaluate(
6869
List<Object> varArgs
6970
) {
7071
JinjavaInterpreter interpreter = JinjavaInterpreter.getCurrent();
71-
if (reconstructing) {
72+
if (reconstructing.get()) {
7273
Optional<String> importFile = getImportFile(interpreter);
7374
try (InterpreterScopeClosable c = interpreter.enterScope()) {
7475
EagerExecutionResult result = eagerEvaluateInDeferredExecutionMode(
@@ -266,7 +267,7 @@ public String reconstructImage(String fullName) {
266267
return "";
267268
} else {
268269
try (InterpreterScopeClosable c = interpreter.enterScope()) {
269-
reconstructing = true;
270+
reconstructing.set(true);
270271
String evaluation = (String) evaluate(
271272
getArguments().stream().map(arg -> DeferredMacroValueImpl.instance()).toArray()
272273
);
@@ -284,7 +285,7 @@ public String reconstructImage(String fullName) {
284285
}
285286
result.append(super.reconstructImage());
286287
} finally {
287-
reconstructing = false;
288+
reconstructing.set(false);
288289
interpreter
289290
.getContext()
290291
.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)