Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix npe when has null value tag field in pojo#598

Closed
flashmouse wants to merge 1 commit intoinfluxdata:masterinfluxdata/influxdb-java:masterfrom
flashmouse:masterflashmouse/influxdb-java:masterCopy head branch name to clipboard
Closed

fix npe when has null value tag field in pojo#598
flashmouse wants to merge 1 commit intoinfluxdata:masterinfluxdata/influxdb-java:masterfrom
flashmouse:masterflashmouse/influxdb-java:masterCopy head branch name to clipboard

Conversation

@flashmouse
Copy link

use addFieldsFromPOJO method build point will cause npe when some tag field hasn't set any value.

@codecov-io
Copy link

codecov-io commented May 27, 2019

Codecov Report

Merging #598 into master will decrease coverage by 0.03%.
The diff coverage is 50%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #598      +/-   ##
============================================
- Coverage     88.19%   88.16%   -0.04%     
  Complexity      709      709              
============================================
  Files            69       69              
  Lines          2449     2450       +1     
  Branches        252      253       +1     
============================================
  Hits           2160     2160              
  Misses          204      204              
- Partials         85       86       +1
Impacted Files Coverage Δ Complexity Δ
src/main/java/org/influxdb/dto/Point.java 91.5% <50%> (-0.46%) 41 <0> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a56b279...d0fa413. Read the comment docs.


if (column.tag()) {
this.tags.put(fieldName, (String) fieldValue);
if (fieldValue != null && !((String) fieldValue).isEmpty()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand the null check, but why not adding if empty, that might be on pupose ?

Copy link
Author

Choose a reason for hiding this comment

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

sry I dont know what you mean exactly,can you give some code or example...

Copy link
Collaborator

Choose a reason for hiding this comment

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

the old behavior just added the value of the field, now it is only added if not empty ?? What is wrong with an empty value, this is a API breakage.

Copy link
Author

Choose a reason for hiding this comment

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

influx tag must be a string key and string value pair.if some field has column annotation :

  • This filed not a String value,I think it's just incorrect usage
  • This filed is a String value, but user havn't set or just give it "",i think we just need not to set this tag in Point.

if this field is an empty String,influxdb-java will also throw exception:
unable to parse 'example,tag1= value1=123i 1559035795995000000': missing tag value

Copy link
Author

@flashmouse flashmouse May 29, 2019

Choose a reason for hiding this comment

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

tag.getValue().replace("", "\\ ");

seems could resolved insert empty tag value.

Copy link
Author

Choose a reason for hiding this comment

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

hi @majst01 tell me if you have any idea, my application will use in production soon, i don't want to maintain another branch

Copy link

Choose a reason for hiding this comment

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

any news?

@codecov-commenter
Copy link

codecov-commenter commented May 27, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.16%. Comparing base (cf7a2da) to head (d0fa413).
⚠️ Report is 303 commits behind head on master.

Files with missing lines Patch % Lines
src/main/java/org/influxdb/dto/Point.java 50.00% 0 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #598      +/-   ##
============================================
- Coverage     88.19%   88.16%   -0.04%     
  Complexity      709      709              
============================================
  Files            69       69              
  Lines          2449     2450       +1     
  Branches        252      253       +1     
============================================
  Hits           2160     2160              
  Misses          204      204              
- Partials         85       86       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@flashmouse flashmouse closed this Jun 3, 2025
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.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.