Skip to content

Commit 931923f

Browse files
committed
Minor reordering of methods
1 parent ab65d67 commit 931923f

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/main/java/com/fasterxml/jackson/core/StreamReadConstraints.java

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ public static final class Builder {
6262
*
6363
* @return this builder
6464
* @throws IllegalArgumentException if the maxNestingDepth is set to a negative value
65-
*
66-
* @since 2.15
6765
*/
6866
public Builder maxNestingDepth(final int maxNestingDepth) {
6967
if (maxNestingDepth < 0) {
@@ -81,8 +79,6 @@ public Builder maxNestingDepth(final int maxNestingDepth) {
8179
*
8280
* @return this builder
8381
* @throws IllegalArgumentException if the maxNumLen is set to a negative value
84-
*
85-
* @since 2.15
8682
*/
8783
public Builder maxNumberLength(final int maxNumLen) {
8884
if (maxNumLen < 0) {
@@ -106,8 +102,6 @@ public Builder maxNumberLength(final int maxNumLen) {
106102
*
107103
* @return this builder
108104
* @throws IllegalArgumentException if the maxStringLen is set to a negative value
109-
*
110-
* @since 2.15
111105
*/
112106
public Builder maxStringLength(final int maxStringLen) {
113107
if (maxStringLen < 0) {
@@ -144,7 +138,7 @@ public StreamReadConstraints build() {
144138
/**********************************************************************
145139
*/
146140

147-
StreamReadConstraints(final int maxNestingDepth, final int maxNumLen, final int maxStringLen) {
141+
protected StreamReadConstraints(final int maxNestingDepth, final int maxNumLen, final int maxStringLen) {
148142
_maxNestingDepth = maxNestingDepth;
149143
_maxNumLen = maxNumLen;
150144
_maxStringLen = maxStringLen;
@@ -204,7 +198,32 @@ public int getMaxStringLength() {
204198

205199
/*
206200
/**********************************************************************
207-
/* Convenience methods for validation
201+
/* Convenience methods for validation, document limits
202+
/**********************************************************************
203+
*/
204+
205+
/**
206+
* Convenience method that can be used to verify that the
207+
* nesting depth does not exceed the maximum specified by this
208+
* constraints object: if it does, a
209+
* {@link StreamConstraintsException}
210+
* is thrown.
211+
*
212+
* @param depth count of unclosed objects and arrays
213+
*
214+
* @throws StreamConstraintsException If depth exceeds maximum
215+
*/
216+
public void validateNestingDepth(int depth) throws StreamConstraintsException
217+
{
218+
if (depth > _maxNestingDepth) {
219+
throw new StreamConstraintsException(String.format("Depth (%d) exceeds the maximum allowed nesting depth (%d)",
220+
depth, _maxNestingDepth));
221+
}
222+
}
223+
224+
/*
225+
/**********************************************************************
226+
/* Convenience methods for validation, token lengths
208227
/**********************************************************************
209228
*/
210229

@@ -264,23 +283,4 @@ public void validateStringLength(int length) throws StreamConstraintsException
264283
length, _maxStringLen));
265284
}
266285
}
267-
268-
/**
269-
* Convenience method that can be used to verify that the
270-
* nesting depth does not exceed the maximum specified by this
271-
* constraints object: if it does, a
272-
* {@link StreamConstraintsException}
273-
* is thrown.
274-
*
275-
* @param depth count of unclosed objects and arrays
276-
*
277-
* @throws StreamConstraintsException If depth exceeds maximum
278-
*/
279-
public void validateNestingDepth(int depth) throws StreamConstraintsException
280-
{
281-
if (depth > _maxNestingDepth) {
282-
throw new StreamConstraintsException(String.format("Depth (%d) exceeds the maximum allowed nesting depth (%d)",
283-
depth, _maxNestingDepth));
284-
}
285-
}
286286
}

0 commit comments

Comments
 (0)