implicit anonymous class parameter Permanently deleted user 创建于 2009年04月28日 17:33 IntelliJ IDE SettingsEditor | Colors & Fonts | JavaAllows a color to be set for "Implicit anonymous class parameter"What is that?
Hello Ted,
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!"
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;
}