implicit anonymous class parameter

IntelliJ IDE Settings

Editor | Colors & Fonts | Java

Allows a color to be set for "Implicit anonymous class parameter"

What is that?

2 comments
Comment actions Permalink

Hello Ted,

IntelliJ IDE Settings

Editor | Colors & Fonts | Java

Allows a color to be set for "Implicit anonymous class parameter"

What is that?


That's a local variable which is used by an anonymous or local class inside
the method and thus becomes a field of the anonymous class.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

In the following Android Studio code, the variable "commandBytes" is colored as an "implicit anonymous class parameter". Can you explain?

public boolean writeCommand( byte[] commandBytes ) {
if( writeCommandInProgress.compareAndSet( false, true ) ) {
writeSubscription = bleDevice
.establishConnection( asBleServiceRef, false )
.flatMap( rxBleConnection -> rxBleConnection.writeCharacteristic( asInputCharId, commandBytes) )
.subscribe(
characteristicValue -> {
writeCommandInProgress.set( false );
if( !Arrays.equals( characteristicValue, commandBytes ) )
Log.d( LOG_TAG, "Data read back from writeCommand() doesn't match input");
},
throwable -> Log.d( LOG_TAG, "Error in writeCommand: " + commandBytes.toString() + "; " + throwable.getMessage() )
);
return true;
} else return false;
}
0

Please sign in to leave a comment.