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

[WIP] Fix the null identifier issue in MigrateToV2 #632

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

GnsP
Copy link

@GnsP GnsP commented Apr 17, 2023

In case of optional arguments to directives, when the optional argument(s) is/are not provided, the parser parses these as null identifiers (incorrectly).

This was because of a bug in the MigrateToV2 class. In Java, the value null is stringified as "null" instead of "" when used in String.format . Therefore, when the method getNextToken returns null (this happens when we are trying to get an optional argument and there are no tokens left), and we use the null value in String.format to create the transformed / migrated directive string, we get a string with null substrings in it.

Example:

Consider the set-type directive. It expects 2 optional arguments scale and rounding-mode. When the directive set-type :col decimal is given, it should be transformed to set-type :col decimal (no change). But it incorrectly gets transformed to set-type :col decimal null null because of this issue.

JIRA: CDAP-20576

@GnsP GnsP changed the title Fix the null identifier issue in MigrateToV2 [WIP] Fix the null identifier issue in MigrateToV2 Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant