Java
Call to default 'toString()'
Warning
New
Last modified: 03 December 2024 Reports calls to toString()
that use the default implementation from java.lang.Object
.
The default implementation is rarely intended but may be used by accident.
Calls to toString()
on objects with java.lang.Object
, interface or abstract class type are ignored by this inspection.
Example:
class Bar {
void foo1(Bar bar) {
String s = bar.toString(); // warning
/* ... */
}
void foo2(Object obj) {
String s = obj.toString(); // no warning here
/* ... */
}
}
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
ObjectToString
Here you can find the description of settings available for the Call to default 'toString()' inspection, and the reference of their default values.
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Java, 243.23126 |
Thanks for your feedback!
Was this page helpful?