updates after review #2206

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2018-02-28 16:02:47 +11:00
parent 0cfc25d4ed
commit 016c8076e0
3 changed files with 17 additions and 16 deletions

View File

@ -418,8 +418,8 @@ public class GZIPContentDecoder implements Destroyable
public void release(ByteBuffer buffer)
{
@SuppressWarnings("ReferenceEquality")
boolean isBufferEmpty = (buffer!=BufferUtil.EMPTY_BUFFER);
if (_pool!=null && isBufferEmpty)
boolean isTheEmptyBuffer = (buffer!=BufferUtil.EMPTY_BUFFER);
if (_pool!=null && isTheEmptyBuffer)
_pool.release(buffer);
}
}

View File

@ -452,13 +452,15 @@ public class ResponseWriter extends PrintWriter
}
@Override
public PrintWriter format(Locale l, String format, Object... args)
public PrintWriter format(Locale locale, String format, Object... args)
{
try
{
if(l==null)
l = _locale;
/* If the passed locale is null then
use any locale set on the response as the default. */
if(locale == null)
locale = _locale;
synchronized (lock)
{
@ -466,20 +468,19 @@ public class ResponseWriter extends PrintWriter
if(_formatter == null)
{
_formatter = new Formatter(this, l);
_formatter = new Formatter(this, locale);
}
else if(_formatter.locale() != null)
else if(_formatter.locale()==null)
{
if(!_formatter.locale().equals(l))
_formatter = new Formatter(this, l);
if(locale != null)
_formatter = new Formatter(this, locale);
}
else
else if (!_formatter.locale().equals(locale))
{
if(l != null)
_formatter = new Formatter(this, l);
_formatter = new Formatter(this, locale);
}
_formatter.format(l, format, args);
_formatter.format(locale, format, args);
}
}
catch (InterruptedIOException ex)

View File

@ -254,8 +254,8 @@ public class Fields implements Iterable<Fields.Field>
public boolean equals(Field that, boolean caseSensitive)
{
@SuppressWarnings("ReferenceEquality")
boolean isCurrentObject = (this == that);
if (isCurrentObject)
boolean isThisInstance = (this == that);
if (isThisInstance)
return true;
if (that == null)
return false;