Skip to content

Commit

Permalink
🐳 chore: Upgrade Javet to v2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
caoccao committed Jun 29, 2023
1 parent 09baab3 commit 6314ae3
Show file tree
Hide file tree
Showing 70 changed files with 338 additions and 650 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ object Config {
const val COMMONS_LANG3 = "3.12.0"
const val COMMONS_TEXT = "1.10.0"
const val JACKSON = "2.15.2"
const val JAVET = "2.2.0"
const val JAVET = "2.2.1"
const val JUNIT = "5.9.1"
const val PICOCLI = "4.7.4"
const val SLF4J = "2.0.7"
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/com/caoccao/jaspiler/trees/JTAnnotatedType.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.caoccao.jaspiler.trees;

import com.caoccao.jaspiler.exceptions.JaspilerCheckedException;
import com.caoccao.jaspiler.utils.V8Register;
import com.caoccao.javet.interfaces.IJavetBiFunction;
import com.caoccao.javet.interfaces.IJavetUniFunction;
import com.caoccao.javet.values.V8Value;
Expand Down Expand Up @@ -87,8 +86,8 @@ public Kind getKind() {
public Map<String, IJavetUniFunction<String, ? extends V8Value, JaspilerCheckedException>> proxyGetStringGetterMap() {
if (stringGetterMap == null) {
super.proxyGetStringGetterMap();
V8Register.putStringGetter(stringGetterMap, PROPERTY_ANNOTATIONS, propertyName -> v8Runtime.toV8Value(getAnnotations()));
V8Register.putStringGetter(stringGetterMap, PROPERTY_UNDERLYING_TYPE, propertyName -> v8Runtime.toV8Value(getUnderlyingType()));
registerStringGetter(PROPERTY_ANNOTATIONS, propertyName -> v8Runtime.toV8Value(getAnnotations()));
registerStringGetter(PROPERTY_UNDERLYING_TYPE, propertyName -> v8Runtime.toV8Value(getUnderlyingType()));
}
return stringGetterMap;
}
Expand All @@ -97,10 +96,8 @@ public Kind getKind() {
public Map<String, IJavetBiFunction<String, V8Value, Boolean, JaspilerCheckedException>> proxyGetStringSetterMap() {
if (stringSetterMap == null) {
super.proxyGetStringSetterMap();
V8Register.putStringSetter(stringSetterMap, PROPERTY_ANNOTATIONS,
(propertyName, propertyValue) -> replaceAnnotations(annotations, propertyValue));
V8Register.putStringSetter(stringSetterMap, PROPERTY_UNDERLYING_TYPE,
(propertyName, propertyValue) -> replaceExpression(this::setUnderlyingType, propertyValue));
registerStringSetter(PROPERTY_ANNOTATIONS, (propertyName, propertyValue) -> replaceAnnotations(annotations, propertyValue));
registerStringSetter(PROPERTY_UNDERLYING_TYPE, (propertyName, propertyValue) -> replaceExpression(this::setUnderlyingType, propertyValue));
}
return stringSetterMap;
}
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/com/caoccao/jaspiler/trees/JTAnnotation.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.caoccao.jaspiler.exceptions.JaspilerCheckedException;
import com.caoccao.jaspiler.styles.IStyleWriter;
import com.caoccao.jaspiler.utils.ForEachUtils;
import com.caoccao.jaspiler.utils.V8Register;
import com.caoccao.javet.interfaces.IJavetBiFunction;
import com.caoccao.javet.interfaces.IJavetUniFunction;
import com.caoccao.javet.values.V8Value;
Expand Down Expand Up @@ -93,8 +92,8 @@ public Kind getKind() {
public Map<String, IJavetUniFunction<String, ? extends V8Value, JaspilerCheckedException>> proxyGetStringGetterMap() {
if (stringGetterMap == null) {
super.proxyGetStringGetterMap();
V8Register.putStringGetter(stringGetterMap, PROPERTY_ANNOTATION_TYPE, propertyName -> v8Runtime.toV8Value(getAnnotationType()));
V8Register.putStringGetter(stringGetterMap, PROPERTY_ARGUMENTS, propertyName -> v8Runtime.toV8Value(getArguments()));
registerStringGetter(PROPERTY_ANNOTATION_TYPE, propertyName -> v8Runtime.toV8Value(getAnnotationType()));
registerStringGetter(PROPERTY_ARGUMENTS, propertyName -> v8Runtime.toV8Value(getArguments()));
}
return stringGetterMap;
}
Expand All @@ -103,10 +102,8 @@ public Kind getKind() {
public Map<String, IJavetBiFunction<String, V8Value, Boolean, JaspilerCheckedException>> proxyGetStringSetterMap() {
if (stringSetterMap == null) {
super.proxyGetStringSetterMap();
V8Register.putStringSetter(stringSetterMap, PROPERTY_ANNOTATION_TYPE,
(propertyName, propertyValue) -> replaceTree(this::setAnnotationType, propertyValue));
V8Register.putStringSetter(stringSetterMap, PROPERTY_ARGUMENTS,
(propertyName, propertyValue) -> replaceExpressions(arguments, propertyValue));
registerStringSetter(PROPERTY_ANNOTATION_TYPE, (propertyName, propertyValue) -> replaceTree(this::setAnnotationType, propertyValue));
registerStringSetter(PROPERTY_ARGUMENTS, (propertyName, propertyValue) -> replaceExpressions(arguments, propertyValue));
}
return stringSetterMap;
}
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/com/caoccao/jaspiler/trees/JTArrayAccess.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.caoccao.jaspiler.trees;

import com.caoccao.jaspiler.exceptions.JaspilerCheckedException;
import com.caoccao.jaspiler.utils.V8Register;
import com.caoccao.javet.interfaces.IJavetBiFunction;
import com.caoccao.javet.interfaces.IJavetUniFunction;
import com.caoccao.javet.values.V8Value;
Expand Down Expand Up @@ -90,8 +89,8 @@ public Kind getKind() {
public Map<String, IJavetUniFunction<String, ? extends V8Value, JaspilerCheckedException>> proxyGetStringGetterMap() {
if (stringGetterMap == null) {
super.proxyGetStringGetterMap();
V8Register.putStringGetter(stringGetterMap, PROPERTY_EXPRESSION, propertyName -> v8Runtime.toV8Value(getExpression()));
V8Register.putStringGetter(stringGetterMap, PROPERTY_INDEX, propertyName -> v8Runtime.toV8Value(getIndex()));
registerStringGetter(PROPERTY_EXPRESSION, propertyName -> v8Runtime.toV8Value(getExpression()));
registerStringGetter(PROPERTY_INDEX, propertyName -> v8Runtime.toV8Value(getIndex()));
}
return stringGetterMap;
}
Expand All @@ -100,10 +99,8 @@ public Kind getKind() {
public Map<String, IJavetBiFunction<String, V8Value, Boolean, JaspilerCheckedException>> proxyGetStringSetterMap() {
if (stringSetterMap == null) {
super.proxyGetStringSetterMap();
V8Register.putStringSetter(stringSetterMap, PROPERTY_EXPRESSION,
(propertyName, propertyValue) -> replaceExpression(this::setExpression, propertyValue));
V8Register.putStringSetter(stringSetterMap, PROPERTY_INDEX,
(propertyName, propertyValue) -> replaceExpression(this::setIndex, propertyValue));
registerStringSetter(PROPERTY_EXPRESSION, (propertyName, propertyValue) -> replaceExpression(this::setExpression, propertyValue));
registerStringSetter(PROPERTY_INDEX, (propertyName, propertyValue) -> replaceExpression(this::setIndex, propertyValue));
}
return stringSetterMap;
}
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/caoccao/jaspiler/trees/JTArrayType.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.caoccao.jaspiler.trees;

import com.caoccao.jaspiler.exceptions.JaspilerCheckedException;
import com.caoccao.jaspiler.utils.V8Register;
import com.caoccao.javet.interfaces.IJavetBiFunction;
import com.caoccao.javet.interfaces.IJavetUniFunction;
import com.caoccao.javet.values.V8Value;
Expand Down Expand Up @@ -79,7 +78,7 @@ public Kind getKind() {
public Map<String, IJavetUniFunction<String, ? extends V8Value, JaspilerCheckedException>> proxyGetStringGetterMap() {
if (stringGetterMap == null) {
super.proxyGetStringGetterMap();
V8Register.putStringGetter(stringGetterMap, PROPERTY_TYPE, propertyName -> v8Runtime.toV8Value(getType()));
registerStringGetter(PROPERTY_TYPE, propertyName -> v8Runtime.toV8Value(getType()));
}
return stringGetterMap;
}
Expand All @@ -88,8 +87,7 @@ public Kind getKind() {
public Map<String, IJavetBiFunction<String, V8Value, Boolean, JaspilerCheckedException>> proxyGetStringSetterMap() {
if (stringSetterMap == null) {
super.proxyGetStringSetterMap();
V8Register.putStringSetter(stringSetterMap, PROPERTY_TYPE,
(propertyName, propertyValue) -> replaceExpression(this::setType, propertyValue));
registerStringSetter(PROPERTY_TYPE, (propertyName, propertyValue) -> replaceExpression(this::setType, propertyValue));
}
return stringSetterMap;
}
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/com/caoccao/jaspiler/trees/JTAssert.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.caoccao.jaspiler.trees;

import com.caoccao.jaspiler.exceptions.JaspilerCheckedException;
import com.caoccao.jaspiler.utils.V8Register;
import com.caoccao.javet.interfaces.IJavetBiFunction;
import com.caoccao.javet.interfaces.IJavetUniFunction;
import com.caoccao.javet.values.V8Value;
Expand Down Expand Up @@ -89,8 +88,8 @@ public Kind getKind() {
public Map<String, IJavetUniFunction<String, ? extends V8Value, JaspilerCheckedException>> proxyGetStringGetterMap() {
if (stringGetterMap == null) {
super.proxyGetStringGetterMap();
V8Register.putStringGetter(stringGetterMap, PROPERTY_CONDITION, propertyName -> v8Runtime.toV8Value(getCondition()));
V8Register.putStringGetter(stringGetterMap, PROPERTY_DETAIL, propertyName -> v8Runtime.toV8Value(getDetail()));
registerStringGetter(PROPERTY_CONDITION, propertyName -> v8Runtime.toV8Value(getCondition()));
registerStringGetter(PROPERTY_DETAIL, propertyName -> v8Runtime.toV8Value(getDetail()));
}
return stringGetterMap;
}
Expand All @@ -99,10 +98,8 @@ public Kind getKind() {
public Map<String, IJavetBiFunction<String, V8Value, Boolean, JaspilerCheckedException>> proxyGetStringSetterMap() {
if (stringSetterMap == null) {
super.proxyGetStringSetterMap();
V8Register.putStringSetter(stringSetterMap, PROPERTY_CONDITION,
(propertyName, propertyValue) -> replaceExpression(this::setCondition, propertyValue));
V8Register.putStringSetter(stringSetterMap, PROPERTY_DETAIL,
(propertyName, propertyValue) -> replaceExpression(this::setDetail, propertyValue));
registerStringSetter(PROPERTY_CONDITION, (propertyName, propertyValue) -> replaceExpression(this::setCondition, propertyValue));
registerStringSetter(PROPERTY_DETAIL, (propertyName, propertyValue) -> replaceExpression(this::setDetail, propertyValue));
}
return stringSetterMap;
}
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/com/caoccao/jaspiler/trees/JTAssign.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.caoccao.jaspiler.trees;

import com.caoccao.jaspiler.exceptions.JaspilerCheckedException;
import com.caoccao.jaspiler.utils.V8Register;
import com.caoccao.javet.interfaces.IJavetBiFunction;
import com.caoccao.javet.interfaces.IJavetUniFunction;
import com.caoccao.javet.values.V8Value;
Expand Down Expand Up @@ -89,8 +88,8 @@ public Kind getKind() {
public Map<String, IJavetUniFunction<String, ? extends V8Value, JaspilerCheckedException>> proxyGetStringGetterMap() {
if (stringGetterMap == null) {
super.proxyGetStringGetterMap();
V8Register.putStringGetter(stringGetterMap, PROPERTY_EXPRESSION, propertyName -> v8Runtime.toV8Value(getExpression()));
V8Register.putStringGetter(stringGetterMap, PROPERTY_VARIABLE, propertyName -> v8Runtime.toV8Value(getVariable()));
registerStringGetter(PROPERTY_EXPRESSION, propertyName -> v8Runtime.toV8Value(getExpression()));
registerStringGetter(PROPERTY_VARIABLE, propertyName -> v8Runtime.toV8Value(getVariable()));
}
return stringGetterMap;
}
Expand All @@ -99,10 +98,8 @@ public Kind getKind() {
public Map<String, IJavetBiFunction<String, V8Value, Boolean, JaspilerCheckedException>> proxyGetStringSetterMap() {
if (stringSetterMap == null) {
super.proxyGetStringSetterMap();
V8Register.putStringSetter(stringSetterMap, PROPERTY_EXPRESSION,
(propertyName, propertyValue) -> replaceExpression(this::setExpression, propertyValue));
V8Register.putStringSetter(stringSetterMap, PROPERTY_VARIABLE,
(propertyName, propertyValue) -> replaceExpression(this::setVariable, propertyValue));
registerStringSetter(PROPERTY_EXPRESSION, (propertyName, propertyValue) -> replaceExpression(this::setExpression, propertyValue));
registerStringSetter(PROPERTY_VARIABLE, (propertyName, propertyValue) -> replaceExpression(this::setVariable, propertyValue));
}
return stringSetterMap;
}
Expand Down
14 changes: 5 additions & 9 deletions src/main/java/com/caoccao/jaspiler/trees/JTAssignOp.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import com.caoccao.jaspiler.exceptions.JaspilerCheckedException;
import com.caoccao.jaspiler.exceptions.JaspilerNotSupportedException;
import com.caoccao.jaspiler.utils.V8Register;
import com.caoccao.javet.interfaces.IJavetBiFunction;
import com.caoccao.javet.interfaces.IJavetUniFunction;
import com.caoccao.javet.values.V8Value;
Expand Down Expand Up @@ -93,8 +92,8 @@ public Kind getKind() {
public Map<String, IJavetUniFunction<String, ? extends V8Value, JaspilerCheckedException>> proxyGetStringGetterMap() {
if (stringGetterMap == null) {
super.proxyGetStringGetterMap();
V8Register.putStringGetter(stringGetterMap, PROPERTY_EXPRESSION, propertyName -> v8Runtime.toV8Value(getExpression()));
V8Register.putStringGetter(stringGetterMap, PROPERTY_VARIABLE, propertyName -> v8Runtime.toV8Value(getVariable()));
registerStringGetter(PROPERTY_EXPRESSION, propertyName -> v8Runtime.toV8Value(getExpression()));
registerStringGetter(PROPERTY_VARIABLE, propertyName -> v8Runtime.toV8Value(getVariable()));
}
return stringGetterMap;
}
Expand All @@ -103,12 +102,9 @@ public Kind getKind() {
public Map<String, IJavetBiFunction<String, V8Value, Boolean, JaspilerCheckedException>> proxyGetStringSetterMap() {
if (stringSetterMap == null) {
super.proxyGetStringSetterMap();
V8Register.putStringSetter(stringSetterMap, PROPERTY_EXPRESSION,
(propertyName, propertyValue) -> replaceExpression(this::setExpression, propertyValue));
V8Register.putStringSetter(stringSetterMap, PROPERTY_KIND,
(propertyName, propertyValue) -> replaceKind(this::setKind, propertyValue));
V8Register.putStringSetter(stringSetterMap, PROPERTY_VARIABLE,
(propertyName, propertyValue) -> replaceExpression(this::setVariable, propertyValue));
registerStringSetter(PROPERTY_EXPRESSION, (propertyName, propertyValue) -> replaceExpression(this::setExpression, propertyValue));
registerStringSetter(PROPERTY_KIND, (propertyName, propertyValue) -> replaceKind(this::setKind, propertyValue));
registerStringSetter(PROPERTY_VARIABLE, (propertyName, propertyValue) -> replaceExpression(this::setVariable, propertyValue));
}
return stringSetterMap;
}
Expand Down
14 changes: 5 additions & 9 deletions src/main/java/com/caoccao/jaspiler/trees/JTBinary.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import com.caoccao.jaspiler.exceptions.JaspilerCheckedException;
import com.caoccao.jaspiler.exceptions.JaspilerNotSupportedException;
import com.caoccao.jaspiler.utils.V8Register;
import com.caoccao.javet.interfaces.IJavetBiFunction;
import com.caoccao.javet.interfaces.IJavetUniFunction;
import com.caoccao.javet.values.V8Value;
Expand Down Expand Up @@ -94,8 +93,8 @@ public Kind getKind() {
public Map<String, IJavetUniFunction<String, ? extends V8Value, JaspilerCheckedException>> proxyGetStringGetterMap() {
if (stringGetterMap == null) {
super.proxyGetStringGetterMap();
V8Register.putStringGetter(stringGetterMap, PROPERTY_LEFT_OPERAND, propertyName -> v8Runtime.toV8Value(getLeftOperand()));
V8Register.putStringGetter(stringGetterMap, PROPERTY_RIGHT_OPERAND, propertyName -> v8Runtime.toV8Value(getRightOperand()));
registerStringGetter(PROPERTY_LEFT_OPERAND, propertyName -> v8Runtime.toV8Value(getLeftOperand()));
registerStringGetter(PROPERTY_RIGHT_OPERAND, propertyName -> v8Runtime.toV8Value(getRightOperand()));
}
return stringGetterMap;
}
Expand All @@ -104,12 +103,9 @@ public Kind getKind() {
public Map<String, IJavetBiFunction<String, V8Value, Boolean, JaspilerCheckedException>> proxyGetStringSetterMap() {
if (stringSetterMap == null) {
super.proxyGetStringSetterMap();
V8Register.putStringSetter(stringSetterMap, PROPERTY_LEFT_OPERAND,
(propertyName, propertyValue) -> replaceExpression(this::setLeftOperand, propertyValue));
V8Register.putStringSetter(stringSetterMap, PROPERTY_KIND,
(propertyName, propertyValue) -> replaceKind(this::setKind, propertyValue));
V8Register.putStringSetter(stringSetterMap, PROPERTY_RIGHT_OPERAND,
(propertyName, propertyValue) -> replaceExpression(this::setRightOperand, propertyValue));
registerStringSetter(PROPERTY_LEFT_OPERAND, (propertyName, propertyValue) -> replaceExpression(this::setLeftOperand, propertyValue));
registerStringSetter(PROPERTY_KIND, (propertyName, propertyValue) -> replaceKind(this::setKind, propertyValue));
registerStringSetter(PROPERTY_RIGHT_OPERAND, (propertyName, propertyValue) -> replaceExpression(this::setRightOperand, propertyValue));
}
return stringSetterMap;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.caoccao.jaspiler.trees;

import com.caoccao.jaspiler.exceptions.JaspilerCheckedException;
import com.caoccao.jaspiler.utils.V8Register;
import com.caoccao.javet.interfaces.IJavetBiFunction;
import com.caoccao.javet.interfaces.IJavetUniFunction;
import com.caoccao.javet.values.V8Value;
Expand Down Expand Up @@ -79,7 +78,7 @@ public JTVariableDecl getVariable() {
public Map<String, IJavetUniFunction<String, ? extends V8Value, JaspilerCheckedException>> proxyGetStringGetterMap() {
if (stringGetterMap == null) {
super.proxyGetStringGetterMap();
V8Register.putStringGetter(stringGetterMap, PROPERTY_VARIABLE, propertyName -> v8Runtime.toV8Value(getVariable()));
registerStringGetter(PROPERTY_VARIABLE, propertyName -> v8Runtime.toV8Value(getVariable()));
}
return stringGetterMap;
}
Expand All @@ -88,8 +87,7 @@ public JTVariableDecl getVariable() {
public Map<String, IJavetBiFunction<String, V8Value, Boolean, JaspilerCheckedException>> proxyGetStringSetterMap() {
if (stringSetterMap == null) {
super.proxyGetStringSetterMap();
V8Register.putStringSetter(stringSetterMap, PROPERTY_VARIABLE,
(propertyName, propertyValue) -> replaceVariableDecl(this::setVariable, propertyValue));
registerStringSetter(PROPERTY_VARIABLE, (propertyName, propertyValue) -> replaceVariableDecl(this::setVariable, propertyValue));
}
return stringSetterMap;
}
Expand Down
Loading

0 comments on commit 6314ae3

Please sign in to comment.