Skip to content

Commit

Permalink
Minor tweaking
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Aug 22, 2023
1 parent cd4bcb4 commit 830a9b8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main/java/com/fasterxml/jackson/core/JsonFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -2138,13 +2138,23 @@ protected JsonGenerator _decorate(JsonGenerator g) {
*/
public BufferRecycler _getBufferRecycler()
{
return _getBufferRecyclerPool().acquireBufferRecycler(this);
}

/**
* Accessor for getting access to {@link BufferRecyclerPool} for getting
* {@link BufferRecycler} instance to use.
*
* @since 2.16
*/
public BufferRecyclerPool _getBufferRecyclerPool() {
// 23-Apr-2015, tatu: Let's allow disabling of buffer recycling
// scheme, for cases where it is considered harmful (possibly
// on Android, for example)
if (!Feature.USE_THREAD_LOCAL_FOR_BUFFER_RECYCLING.enabledIn(_factoryFeatures)) {
return new BufferRecycler();
return BufferRecyclers.nopRecyclerPool();
}
return _bufferRecyclerPool.acquireBufferRecycler(this);
return _bufferRecyclerPool;
}

/**
Expand Down

0 comments on commit 830a9b8

Please sign in to comment.