< prev index next >
src/java.desktop/share/classes/javax/sound/sampled/BooleanControl.java
Print this page
rev 57600 : 8236980: toString() cleanup in JavaSound
Reviewed-by: XXX
*** 1,7 ****
/*
! * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 117,133 ****
public String getStateLabel(boolean state) {
return ((state == true) ? trueStateLabel : falseStateLabel);
}
/**
! * Provides a string representation of the control.
*
! * @return a string representation of the control
*/
@Override
public String toString() {
! return new String(super.toString() + " with current value: " + getStateLabel(getValue()));
}
/**
* An instance of the {@code BooleanControl.Type} class identifies one kind
* of boolean control. Static instances are provided for the common types.
--- 117,134 ----
public String getStateLabel(boolean state) {
return ((state == true) ? trueStateLabel : falseStateLabel);
}
/**
! * Returns a string representation of the boolean control.
*
! * @return a string representation of the boolean control
*/
@Override
public String toString() {
! return String.format("%s with current value: %s", super.toString(),
! getStateLabel(getValue()));
}
/**
* An instance of the {@code BooleanControl.Type} class identifies one kind
* of boolean control. Static instances are provided for the common types.
< prev index next >