From 6d76951686bfb8301129e5cca61772fb71a43cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=A6=D1=8B=D0=BF?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Thu, 26 Nov 2020 16:16:26 +0200 Subject: [PATCH] Remove unused package-private class o.s.w.u.p.SubSequence (cherry picked from commit 42216b77dfce376fd9c6843c63ad3be9a99f4b66) --- .../web/util/pattern/SubSequence.java | 64 ------------------- 1 file changed, 64 deletions(-) delete mode 100644 spring-web/src/main/java/org/springframework/web/util/pattern/SubSequence.java diff --git a/spring-web/src/main/java/org/springframework/web/util/pattern/SubSequence.java b/spring-web/src/main/java/org/springframework/web/util/pattern/SubSequence.java deleted file mode 100644 index f99c5ce082f..00000000000 --- a/spring-web/src/main/java/org/springframework/web/util/pattern/SubSequence.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2002-2017 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.web.util.pattern; - -/** - * Used to represent a subsection of an array, useful when wanting to pass that subset of data - * to another method (e.g. a java regex matcher) but not wanting to create a new string object - * to hold all that data. - * - * @author Andy Clement - * @since 5.0 - */ -class SubSequence implements CharSequence { - - private final char[] chars; - - private final int start; - - private final int end; - - - SubSequence(char[] chars, int start, int end) { - this.chars = chars; - this.start = start; - this.end = end; - } - - - @Override - public int length() { - return (this.end - this.start); - } - - @Override - public char charAt(int index) { - return this.chars[this.start + index]; - } - - @Override - public CharSequence subSequence(int start, int end) { - return new SubSequence(this.chars, this.start + start, this.start + end); - } - - - @Override - public String toString() { - return new String(this.chars, this.start, this.end - this.start); - } - -}