All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.samples.java.ex.NSE_Sample Maven / Gradle / Ivy

Go to download

An auxiliary findbugs.sourceforge.net plugin for java bug detectors that fall outside the narrow scope of detectors to be packaged with the product itself.

There is a newer version: 7.6.8
Show newest version
package ex;
public class NSE_Sample {
    class One {
        private int o;

        @Override
        public boolean equals(Object that) {
            if (that instanceof One) {
                return o == ((One) that).o;
            } else if (that instanceof Two) {
                return o == ((Two) that).t;
            }

            return false;
        }
    }

    class Two {
        public int t;

        @Override
        public boolean equals(Object that) {
            if (that instanceof Two) {
                return t == ((Two) that).t;
            }

            return false;
        }
    }

    class Parent {
        private int o;

        @Override
        public boolean equals(Object that) {
            if (that instanceof Parent) {
                return o == ((Parent) that).o;
            } else if (that instanceof Two) {
                return o == ((Child) that).t;
            }

            return false;
        }
    }

    class Child extends Parent {
        public int t;

        @Override
        public boolean equals(Object that) {
            if (that instanceof Child) {
                return t == ((Child) that).t;
            }

            return false;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy