On Thu, 31 Mar 2022 08:03:23 GMT, Andrey Turbanov wrote:
>> Method `Class.isAssignableFrom` is often used in form of:
>>
>> if (clazz.isAssignableFrom(obj.getClass())) {
>> Such condition could be simplified to more shorter and performarnt code
>>
>> if (clazz.isInstance(obj)) {
>>
On Thu, 31 Mar 2022 08:03:23 GMT, Andrey Turbanov wrote:
>> Method `Class.isAssignableFrom` is often used in form of:
>>
>> if (clazz.isAssignableFrom(obj.getClass())) {
>> Such condition could be simplified to more shorter and performarnt code
>>
>> if (clazz.isInstance(obj)) {
>>
On Thu, 31 Mar 2022 08:03:23 GMT, Andrey Turbanov wrote:
>> Method `Class.isAssignableFrom` is often used in form of:
>>
>> if (clazz.isAssignableFrom(obj.getClass())) {
>> Such condition could be simplified to more shorter and performarnt code
>>
>> if (clazz.isInstance(obj)) {
>>
On Tue, 10 May 2022 11:31:16 GMT, Andrey Turbanov wrote:
>> src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java line
>> 230:
>>
>>> 228: List l = new ArrayList<>();
>>> 229: for (Class c : categoryMap.keySet()) {
>>> 230: if
On Tue, 10 May 2022 11:10:50 GMT, Daniel Fuchs wrote:
>> Andrey Turbanov has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> 8280035: Use Class.isInstance instead of Class.isAssignableFrom where
>> applicable
>> apply suggestion to avoid
On Thu, 31 Mar 2022 08:03:23 GMT, Andrey Turbanov wrote:
>> Method `Class.isAssignableFrom` is often used in form of:
>>
>> if (clazz.isAssignableFrom(obj.getClass())) {
>> Such condition could be simplified to more shorter and performarnt code
>>
>> if (clazz.isInstance(obj)) {
>>
On Thu, 31 Mar 2022 08:03:23 GMT, Andrey Turbanov wrote:
>> Method `Class.isAssignableFrom` is often used in form of:
>>
>> if (clazz.isAssignableFrom(obj.getClass())) {
>> Such condition could be simplified to more shorter and performarnt code
>>
>> if (clazz.isInstance(obj)) {
>>
On Mon, 21 Feb 2022 12:16:53 GMT, Andrey Turbanov wrote:
>> I've stared at the javadoc for Class.isAssignableFrom and Class.isInstance
>> and if a non-null instance is used to get a non-null class they are PROBABLY
>> the same but it is far from clear. The implementations of both are at least
On Mon, 21 Feb 2022 12:16:53 GMT, Andrey Turbanov wrote:
> Method `isAssignableFrom` is opposite: it brings unnecessary complexity in
> the code. And it's easy to confuse orders of parameters. Even JBS confirms
> that:
Maybe we should add `Class::isSubclassOf(Class that)` that performs
On Mon, 17 Jan 2022 08:28:35 GMT, Erik Gahlin wrote:
>> src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java line 405:
>>
>>> 403: Object res = m.invoke(a, new Object[0]);
>>> 404: if (res instanceof Annotation[]) {
>>> 405:
On Thu, 20 Jan 2022 01:34:20 GMT, Phil Race wrote:
>In short I see insufficient value in the changes here and would prefer you
>drop the client part so I don't have to worry about it.
I think, usage of `isInstance` is much clear for most java developers. Everyone
knows about java _instanceof_
On Thu, 13 Jan 2022 08:25:22 GMT, Andrey Turbanov wrote:
> Method `Class.isAssignableFrom` is often used in form of:
>
> if (clazz.isAssignableFrom(obj.getClass())) {
> Such condition could be simplified to more shorter and performarnt code
>
> if (clazz.isInstance(obj)) {
>
>
On Thu, 13 Jan 2022 08:25:22 GMT, Andrey Turbanov wrote:
> Method `Class.isAssignableFrom` is often used in form of:
>
> if (clazz.isAssignableFrom(obj.getClass())) {
> Such condition could be simplified to more shorter and performarnt code
>
> if (clazz.isInstance(obj)) {
>
>
On Thu, 13 Jan 2022 08:39:04 GMT, Andrey Turbanov wrote:
>> Method `Class.isAssignableFrom` is often used in form of:
>>
>> if (clazz.isAssignableFrom(obj.getClass())) {
>> Such condition could be simplified to more shorter and performarnt code
>>
>> if (clazz.isInstance(obj)) {
>>
On Thu, 13 Jan 2022 08:25:22 GMT, Andrey Turbanov wrote:
> Method `Class.isAssignableFrom` is often used in form of:
>
> if (clazz.isAssignableFrom(obj.getClass())) {
> Such condition could be simplified to more shorter and performarnt code
>
> if (clazz.isInstance(obj)) {
>
>
Method `Class.isAssignableFrom` is often used in form of:
if (clazz.isAssignableFrom(obj.getClass())) {
Such condition could be simplified to more shorter and performarnt code
if (clazz.isInstance(obj)) {
Replacement is equivalent if it's known that `obj != null`.
In JDK codebase
16 matches
Mail list logo