Skip to content

Commit cb83ca6

Browse files
committed
Merge branch 'master' of github.com:HubSpot/jinjava into fix-render-filter-deferred-values
2 parents bd5326d + 0e5510e commit cb83ca6

54 files changed

Lines changed: 1761 additions & 152 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.build-jdk17

Whitespace-only changes.

.github/workflows/ci.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
java: [ 17 ]
10+
java: [ 17, 21, 25 ]
1111
name: jdk-${{ matrix.java }}
1212
steps:
1313
- uses: actions/checkout@v3
@@ -16,9 +16,19 @@ jobs:
1616
- uses: actions/setup-java@v3
1717
with:
1818
distribution: "temurin"
19-
java-version: ${{ matrix.java }}
19+
# The JDK listed last will be the default and what Maven runs with
20+
# https://github.com/marketplace/actions/setup-java-jdk#install-multiple-jdks
21+
java-version: |
22+
${{ matrix.java }}
23+
25
2024
cache: "maven"
2125
- name: "Build"
22-
run: mvn --batch-mode -no-transfer-progress -V verify
26+
run: |
27+
mvn \
28+
--batch-mode \
29+
-no-transfer-progress \
30+
-V \
31+
-Dproject.build.jdk.version=${{ matrix.java }} \
32+
verify
2333
env:
2434
JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED

CHANGES.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
# Jinjava Releases #
2+
### 2026-02-02 Version 2.8.3 ([Maven Central](https://search.maven.org/artifact/com.hubspot.jinjava/jinjava/2.8.3/jar)) ###
3+
* Disallow accessing properties on restricted classes while rendering through ForTag
4+
* Upgrade jackson to version 2.20
5+
* [Add performance optimization to chained filters](https://github.com/HubSpot/jinjava/pull/1274)
6+
7+
### 2026-02-02 Version 2.7.6 ([Maven Central](https://search.maven.org/artifact/com.hubspot.jinjava/jinjava/2.7.6/jar)) ###
8+
* Disallow accessing properties on restricted classes while rendering through ForTag
9+
* Upgrade jackson to version 2.20
10+
11+
### 2025-10-22 Version 2.8.2 ([Maven Central](https://search.maven.org/artifact/com.hubspot.jinjava/jinjava/2.8.2/jar)) ###
12+
* [Fix helper token escape handling and unescaping when unquoting strings](https://github.com/HubSpot/jinjava/pull/1263)
13+
14+
### 2025-09-30 Version 2.7.5 ([Maven Central](https://search.maven.org/artifact/com.hubspot.jinjava/jinjava/2.7.5/jar)) ###
15+
* Disallow accessing properties on restricted classes while rendering
16+
217
### 2025-09-16 Version 2.8.1 ([Maven Central](https://search.maven.org/artifact/com.hubspot.jinjava/jinjava/2.8.1/jar)) ###
318
* Disallow accessing properties on restricted classes while rendering
419
* [Make stack operations use AutoCloseable for safer usage with try-with-resources](https://github.com/HubSpot/jinjava/pull/1250)
20+
521
### 2025-05-05 Version 2.8.0 ([Maven Central](https://search.maven.org/artifact/com.hubspot.jinjava/jinjava/2.8.0/jar)) ###
622
* [Target Java 17](https://github.com/HubSpot/jinjava/pull/1238)
723
* [Implement PyMap#get with optional default](https://github.com/HubSpot/jinjava/pull/1233)

pom.xml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,26 @@
55
<parent>
66
<groupId>com.hubspot</groupId>
77
<artifactId>basepom</artifactId>
8-
<version>63.4</version>
8+
<version>65.1</version>
99
</parent>
1010

1111
<groupId>com.hubspot.jinjava</groupId>
1212
<artifactId>jinjava</artifactId>
13-
<version>2.8.1-SNAPSHOT</version>
13+
<version>2.8.3-SNAPSHOT</version>
1414

1515
<name>${project.groupId}:${project.artifactId}</name>
1616
<description>Jinja templating engine implemented in Java</description>
1717

1818
<properties>
1919
<project.build.targetJdk>17</project.build.targetJdk>
20-
<project.build.releaseJdk>17</project.build.releaseJdk>
20+
<hubspot.build.moved.after>1770136059427</hubspot.build.moved.after>
2121

2222
<dep.plugin.jacoco.version>0.8.3</dep.plugin.jacoco.version>
2323
<dep.plugin.javadoc.version>3.0.1</dep.plugin.javadoc.version>
2424
<dep.hubspot-immutables.version>1.9</dep.hubspot-immutables.version>
2525
<dep.algebra.version>1.5</dep.algebra.version>
26-
26+
<dep.mockito.version>5.20.0</dep.mockito.version>
27+
<dep.jackson.version>2.20.1</dep.jackson.version>
2728

2829
<basepom.test.add.opens>
2930
--add-opens=java.base/java.lang=ALL-UNNAMED
@@ -72,27 +73,27 @@
7273
<dependency>
7374
<groupId>com.fasterxml.jackson.core</groupId>
7475
<artifactId>jackson-annotations</artifactId>
75-
<version>2.14.0</version>
76+
<version>2.20</version>
7677
</dependency>
7778
<dependency>
7879
<groupId>com.fasterxml.jackson.core</groupId>
7980
<artifactId>jackson-databind</artifactId>
80-
<version>2.14.0</version>
81+
<version>${dep.jackson.version}</version>
8182
</dependency>
8283
<dependency>
8384
<groupId>com.fasterxml.jackson.core</groupId>
8485
<artifactId>jackson-core</artifactId>
85-
<version>2.14.0</version>
86+
<version>${dep.jackson.version}</version>
8687
</dependency>
8788
<dependency>
8889
<groupId>com.fasterxml.jackson.dataformat</groupId>
8990
<artifactId>jackson-dataformat-yaml</artifactId>
90-
<version>2.14.0</version>
91+
<version>${dep.jackson.version}</version>
9192
</dependency>
9293
<dependency>
9394
<groupId>com.fasterxml.jackson.datatype</groupId>
9495
<artifactId>jackson-datatype-jdk8</artifactId>
95-
<version>2.14.0</version>
96+
<version>${dep.jackson.version}</version>
9697
</dependency>
9798
<dependency>
9899
<groupId>com.hubspot.immutables</groupId>
@@ -181,6 +182,10 @@
181182
<groupId>ch.obermuhlner</groupId>
182183
<artifactId>big-math</artifactId>
183184
</dependency>
185+
<dependency>
186+
<groupId>com.google.errorprone</groupId>
187+
<artifactId>error_prone_annotations</artifactId>
188+
</dependency>
184189

185190
<dependency>
186191
<groupId>ch.qos.logback</groupId>
@@ -336,6 +341,18 @@
336341
<argLine>@{argLine} ${basepom.test.add.opens}</argLine>
337342
</configuration>
338343
</plugin>
344+
<plugin>
345+
<groupId>org.apache.maven.plugins</groupId>
346+
<artifactId>maven-compiler-plugin</artifactId>
347+
<configuration>
348+
<annotationProcessorPaths>
349+
<path>
350+
<groupId>org.immutables</groupId>
351+
<artifactId>value</artifactId>
352+
</path>
353+
</annotationProcessorPaths>
354+
</configuration>
355+
</plugin>
339356
</plugins>
340357
</build>
341358

src/main/java/com/hubspot/jinjava/JinjavaConfig.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public class JinjavaConfig {
8888
private final ExecutionMode executionMode;
8989
private final LegacyOverrides legacyOverrides;
9090
private final boolean enablePreciseDivideFilter;
91+
private final boolean enableFilterChainOptimization;
9192
private final ObjectMapper objectMapper;
9293

9394
private final Features features;
@@ -151,6 +152,7 @@ private JinjavaConfig(Builder builder) {
151152
legacyOverrides = builder.legacyOverrides;
152153
dateTimeProvider = builder.dateTimeProvider;
153154
enablePreciseDivideFilter = builder.enablePreciseDivideFilter;
155+
enableFilterChainOptimization = builder.enableFilterChainOptimization;
154156
objectMapper = setupObjectMapper(builder.objectMapper);
155157
objectUnwrapper = builder.objectUnwrapper;
156158
processors = builder.processors;
@@ -307,6 +309,10 @@ public boolean getEnablePreciseDivideFilter() {
307309
return enablePreciseDivideFilter;
308310
}
309311

312+
public boolean isEnableFilterChainOptimization() {
313+
return enableFilterChainOptimization;
314+
}
315+
310316
public DateTimeProvider getDateTimeProvider() {
311317
return dateTimeProvider;
312318
}
@@ -349,6 +355,7 @@ public static class Builder {
349355
private ExecutionMode executionMode = DefaultExecutionMode.instance();
350356
private LegacyOverrides legacyOverrides = LegacyOverrides.NONE;
351357
private boolean enablePreciseDivideFilter = false;
358+
private boolean enableFilterChainOptimization = false;
352359
private ObjectMapper objectMapper = null;
353360

354361
private ObjectUnwrapper objectUnwrapper = new JinjavaObjectUnwrapper();
@@ -520,6 +527,13 @@ public Builder withEnablePreciseDivideFilter(boolean enablePreciseDivideFilter)
520527
return this;
521528
}
522529

530+
public Builder withEnableFilterChainOptimization(
531+
boolean enableFilterChainOptimization
532+
) {
533+
this.enableFilterChainOptimization = enableFilterChainOptimization;
534+
return this;
535+
}
536+
523537
public Builder withObjectMapper(ObjectMapper objectMapper) {
524538
this.objectMapper = objectMapper;
525539
return this;

0 commit comments

Comments
 (0)