Skip to content

Commit

Permalink
[issue-2998] remove invalid check in isValidLabelValue (#3015)
Browse files Browse the repository at this point in the history
Co-authored-by: aias00 <[email protected]>
  • Loading branch information
pjfanning and Aias00 authored Jan 24, 2025
1 parent 95739d9 commit 2f3abfb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package org.apache.hertzbeat.collector.collect.http.promethus.exporter;

import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -419,7 +418,7 @@ private boolean isValidLabelNameContinuation(char c) {
* @return true/false
*/
private boolean isValidLabelValue(String s) {
return s != null && s.equals(new String(s.getBytes(StandardCharsets.UTF_8)));
return s != null;
}

private boolean isSum(String s) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package org.apache.hertzbeat.collector.collect.prometheus.parser;

import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
Expand Down Expand Up @@ -300,6 +299,6 @@ private static boolean isValidLabelNameContinuation(char c) {
* @return true/false
*/
private static boolean isValidLabelValue(String s) {
return s != null && s.equals(new String(s.getBytes(StandardCharsets.UTF_8)));
return s != null;
}
}

0 comments on commit 2f3abfb

Please sign in to comment.