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

Fix wrong String comparison in EnclosedJsonRecordReader #88

Merged
merged 2 commits into from
Aug 11, 2015

Conversation

komamitsu
Copy link
Contributor

parser.getCurrentName() should be compared using String#equals.

@randallwhitman
Copy link
Contributor

By inspection/review, this patch looks correct.

@@ -77,7 +77,7 @@ public boolean next(LongWritable key, Text value) throws IOException {

token = parser.nextToken();

while (token != null && !(token == JsonToken.START_ARRAY && parser.getCurrentName() == "features")){
while (token != null && !(token == JsonToken.START_ARRAY && parser.getCurrentName().equals("features"))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch - will getCurrentName ever be null in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I added null check.

@climbage
Copy link
Member

@randallwhitman Looks good to me - merge?

@randallwhitman
Copy link
Contributor

Passes code review. Do we have any tests to run before merge? @climbage @smambrose

@randallwhitman
Copy link
Contributor

Thanks @komamitsu !

randallwhitman added a commit that referenced this pull request Aug 11, 2015
Fix wrong String comparison in EnclosedJsonRecordReader
@randallwhitman randallwhitman merged commit 106b1a7 into Esri:master Aug 11, 2015
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.

None yet

3 participants