Skip to content

Commit 75303dd

Browse files
authored
Change order of arguments to IOContext constructor (group config objects together) (#1071)
1 parent f558181 commit 75303dd

File tree

1 file changed

+23
-27
lines changed

1 file changed

+23
-27
lines changed

src/main/java/com/fasterxml/jackson/core/io/IOContext.java

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -125,26 +125,6 @@ public class IOContext
125125
/**********************************************************************
126126
*/
127127

128-
/**
129-
* Main constructor to use.
130-
*
131-
* @param src constraints for streaming reads
132-
* @param swc constraints for streaming writes
133-
* @param br BufferRecycler to use, if any ({@code null} if none)
134-
* @param contentRef Input source reference for location reporting
135-
* @param managedResource Whether input source is managed (owned) by Jackson library
136-
*
137-
* @since 2.16
138-
* @deprecated Since 2.16, use {@link #IOContext(StreamReadConstraints, StreamWriteConstraints, BufferRecycler,
139-
* ContentReference, boolean, ErrorReportConfiguration)} instead.
140-
*/
141-
@Deprecated
142-
public IOContext(StreamReadConstraints src, StreamWriteConstraints swc, BufferRecycler br,
143-
ContentReference contentRef, boolean managedResource)
144-
{
145-
this(src, swc, br, contentRef, managedResource, ErrorReportConfiguration.defaults());
146-
}
147-
148128
/**
149129
* Main constructor to use.
150130
*
@@ -157,46 +137,62 @@ public IOContext(StreamReadConstraints src, StreamWriteConstraints swc, BufferRe
157137
*
158138
* @since 2.16
159139
*/
160-
public IOContext(StreamReadConstraints src, StreamWriteConstraints swc, BufferRecycler br,
161-
ContentReference contentRef, boolean managedResource, ErrorReportConfiguration erc)
140+
public IOContext(StreamReadConstraints src, StreamWriteConstraints swc, ErrorReportConfiguration erc,
141+
BufferRecycler br, ContentReference contentRef, boolean managedResource)
162142
{
163143
_streamReadConstraints = src;
164144
_streamWriteConstraints = swc;
145+
_errorReportConfiguration = erc;
165146
_bufferRecycler = br;
166147
_contentReference = contentRef;
167148
_sourceRef = contentRef.getRawContent();
168149
_managedResource = managedResource;
169-
_errorReportConfiguration = erc;
170150
}
171151

172152
/**
153+
* Deprecated legacy constructor.
154+
*
173155
* @param src constraints for streaming reads
174156
* @param br BufferRecycler to use, if any ({@code null} if none)
175157
* @param contentRef Input source reference for location reporting
176158
* @param managedResource Whether input source is managed (owned) by Jackson library
177159
*
178160
* @since 2.15
179-
* @deprecated Since 2.16. Use {@link #IOContext(StreamReadConstraints, StreamWriteConstraints, BufferRecycler,
180-
* ContentReference, boolean, ErrorReportConfiguration)} instead.
161+
* @deprecated Since 2.16. Use {@link #IOContext(StreamReadConstraints, StreamWriteConstraints,
162+
* ErrorReportConfiguration, BufferRecycler, ContentReference, boolean)} instead.
181163
*/
182164
@Deprecated
183165
public IOContext(StreamReadConstraints src, BufferRecycler br,
184166
ContentReference contentRef, boolean managedResource)
185167
{
186-
this(src, StreamWriteConstraints.defaults(), br, contentRef, managedResource, ErrorReportConfiguration.defaults());
168+
this(src, StreamWriteConstraints.defaults(), ErrorReportConfiguration.defaults(),
169+
br, contentRef, managedResource);
170+
}
171+
172+
@Deprecated // In 2.16: remove ASAP
173+
public IOContext(StreamReadConstraints src, StreamWriteConstraints swc,
174+
BufferRecycler br, ContentReference contentRef, boolean managedResource)
175+
{
176+
this(src, swc, ErrorReportConfiguration.defaults(),
177+
br, contentRef, managedResource);
187178
}
188179

189180
/**
181+
* Deprecated legacy constructor.
182+
*
190183
* @param br BufferRecycler to use, if any ({@code null} if none)
191184
* @param contentRef Input source reference for location reporting
192185
* @param managedResource Whether input source is managed (owned) by Jackson library
193186
*
194187
* @since 2.13
188+
* @deprecated Since 2.15. Use {@link #IOContext(StreamReadConstraints, StreamWriteConstraints,
189+
* ErrorReportConfiguration, BufferRecycler, ContentReference, boolean)} instead.
195190
*/
196191
@Deprecated // since 2.15
197192
public IOContext(BufferRecycler br, ContentReference contentRef, boolean managedResource)
198193
{
199-
this(null, null, br, contentRef, managedResource);
194+
this(StreamReadConstraints.defaults(), StreamWriteConstraints.defaults(), ErrorReportConfiguration.defaults(),
195+
br, contentRef, managedResource);
200196
}
201197

202198
@Deprecated // since 2.13

0 commit comments

Comments
 (0)