You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/01/25 17:56:55 UTC

[tomcat] 01/02: Refactor constants for default priority values

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 9437efd95b137b7bf41b498df444d54ce08fd68f
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jan 25 17:56:32 2023 +0000

    Refactor constants for default priority values
---
 java/org/apache/coyote/http2/Constants.java           | 3 ---
 java/org/apache/coyote/http2/Stream.java              | 4 ++--
 java/org/apache/tomcat/util/http/parser/Priority.java | 7 +++++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/coyote/http2/Constants.java b/java/org/apache/coyote/http2/Constants.java
index e1ee63bb34..26ddba1960 100644
--- a/java/org/apache/coyote/http2/Constants.java
+++ b/java/org/apache/coyote/http2/Constants.java
@@ -18,9 +18,6 @@ package org.apache.coyote.http2;
 
 public class Constants {
 
-    // Prioritisation
-    public static final int DEFAULT_URGENCY = 3;
-    public static final boolean DEFAULT_INCREMENTAL = false;
     // Range 0 to 7 inclusive
     public static final int URGENCY_RANGE = 8;
 
diff --git a/java/org/apache/coyote/http2/Stream.java b/java/org/apache/coyote/http2/Stream.java
index a0f997e13a..ae491f6339 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -97,8 +97,8 @@ class Stream extends AbstractNonZeroStream implements HeaderEmitter {
     private Object pendingWindowUpdateForStreamLock = new Object();
     private int pendingWindowUpdateForStream = 0;
 
-    private volatile int urgency = Constants.DEFAULT_URGENCY;
-    private volatile boolean incremental = Constants.DEFAULT_INCREMENTAL;
+    private volatile int urgency = Priority.DEFAULT_URGENCY;
+    private volatile boolean incremental = Priority.DEFAULT_INCREMENTAL;
 
 
     Stream(Integer identifier, Http2UpgradeHandler handler) {
diff --git a/java/org/apache/tomcat/util/http/parser/Priority.java b/java/org/apache/tomcat/util/http/parser/Priority.java
index 0690bd0c41..ce8ec3b8e0 100644
--- a/java/org/apache/tomcat/util/http/parser/Priority.java
+++ b/java/org/apache/tomcat/util/http/parser/Priority.java
@@ -29,9 +29,12 @@ import org.apache.tomcat.util.http.parser.StructuredField.SfListMember;
  */
 public class Priority {
 
+    public static final int DEFAULT_URGENCY = 3;
+    public static final boolean DEFAULT_INCREMENTAL = false;
+
     // Explicitly set the defaults as per RFC 9218
-    private int urgency = 3;
-    private boolean incremental = false;
+    private int urgency = DEFAULT_URGENCY;
+    private boolean incremental = DEFAULT_INCREMENTAL;
 
     public Priority() {
         // Default constructor is NO-OP.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org