Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@W-14781712 fix: added null checks #144

Merged
merged 4 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions docs/coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@
<artifactId>formula-engine-oracle-test</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.salesforce.formula</groupId>
<artifactId>formula-engine-mysql-test</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.salesforce.formula</groupId>
<artifactId>formula-engine-sqlserver-test</artifactId>
Expand Down Expand Up @@ -99,5 +94,15 @@
</dependency>
</dependencies>
</profile>
</profiles>
</project>
<profile>
<id>mysql-test</id>
<dependencies>
<dependency>
<groupId>com.salesforce.formula</groupId>
<artifactId>formula-engine-mysql-test</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ public WrongArgumentTypeException(String function, Type[] expectedInputTypes, Fo
super(createErrorMessage(function, expectedInputTypes, actual));

Token token = actual.getToken();
location = token.getColumn();
text = token.getText();
type = token.getType();
if(token != null) {
location = token.getColumn();
text = token.getText();
type = token.getType();
} else {
location = 0;
text = "";
type = 0;
}
}

private static String createErrorMessage(String function, Type[] expectedInputTypes, FormulaAST actual) {
Expand Down Expand Up @@ -63,9 +69,15 @@ public WrongArgumentTypeException(String function, Type[] expectedInputTypes, Fo
super(createErrorMessage(function, expectedInputTypes, columnType));

Token token = actual.getToken();
location = token.getColumn();
text = token.getText();
type = token.getType();
if(token != null) {
location = token.getColumn();
text = token.getText();
type = token.getType();
} else {
location = 0;
text = "";
type = 0;
}
}

private static String createErrorMessage(String function, Type[] expectedInputTypes, FormulaDataType columnType) {
Expand Down
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,9 @@
<module>impl</module>
<module>test-utils</module>
<module>oracle-test</module>
<module>mysql-test</module>
<!-- <module>mysql-test</module> -->
<!-- MYSQL tests having issues in handling regular expressions, so excluding these tests from maven build process-->
<!-- These tests can be executed by using the "mysql" profile e.g. `mvn -P mysql clean verify -B` -->
<module>sqlserver-test</module>
<module>sqlite-test</module>
<!-- <module>h2-test</module> -->
Expand All @@ -536,6 +538,12 @@
<module>google-test</module>
</modules>
</profile>
<profile>
<id>mysql</id>
<modules>
<module>mysql-test</module>
</modules>
</profile>
</profiles>

<reporting>
Expand Down
Loading