Skip to content
This repository was archived by the owner on Dec 23, 2023. It is now read-only.

Commit 329eeee

Browse files
committed
Update length limit for View.Name (#834)
(cherry picked from commit 7106a47)
1 parent 7ca44e7 commit 329eeee

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

api/src/main/java/io/opencensus/stats/View.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
@AutoValue
3939
public abstract class View {
4040

41-
@VisibleForTesting static final int NAME_MAX_LENGTH = 256;
41+
@VisibleForTesting static final int NAME_MAX_LENGTH = 255;
4242

4343
View() {}
4444

@@ -116,7 +116,7 @@ public abstract static class Name {
116116

117117
/**
118118
* Creates a {@code View.Name} from a {@code String}. Should be a ASCII string with a length no
119-
* greater than 256 characters.
119+
* greater than 255 characters.
120120
*
121121
* <p>Suggested format for name: {@code <web_host>/<path>}.
122122
*
@@ -126,7 +126,7 @@ public abstract static class Name {
126126
public static Name create(String name) {
127127
checkArgument(
128128
StringUtil.isPrintableString(name) && name.length() <= NAME_MAX_LENGTH,
129-
"Name should be a ASCII string with a length no greater than 256 characters.");
129+
"Name should be a ASCII string with a length no greater than 255 characters.");
130130
return new AutoValue_View_Name(name);
131131
}
132132
}

api/src/test/java/io/opencensus/stats/ViewTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public final class ViewTest {
4141

4242
@Test
4343
public void testConstants() {
44-
assertThat(View.NAME_MAX_LENGTH).isEqualTo(256);
44+
assertThat(View.NAME_MAX_LENGTH).isEqualTo(255);
4545
}
4646

4747
@Test

0 commit comments

Comments
 (0)