-
Notifications
You must be signed in to change notification settings - Fork 628
Closed
Description
Singleton detection seems to be over-eager. A bit of nest-private hierarchy, like demonstrated in https://github.com/opendaylight/yangtools/blob/2e257731e354e6cc2fd45a6f6eec79bd01490c07/common/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/CanonicalValueViolation.java triggers three singleton errors:
[ERROR] Medium: Instance-getter method of class using singleton design pattern (org.opendaylight.yangtools.yang.common.CanonicalValueViolation) is not synchronized. [org.opendaylight.yangtools.yang.common.CanonicalValueViolation] At CanonicalValueViolation.java:[line 98] SING_SINGLETON_GETTER_NOT_SYNCHRONIZED
[ERROR] Medium: Class (org.opendaylight.yangtools.yang.common.CanonicalValueViolation) using singleton design pattern has non-private constructor. [org.opendaylight.yangtools.yang.common.CanonicalValueViolation] At CanonicalValueViolation.java:[line 32] SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR
[ERROR] Medium: Class (org.opendaylight.yangtools.yang.common.CanonicalValueViolation) using singleton design pattern directly or indirectly implements Serializable interface. [org.opendaylight.yangtools.yang.common.CanonicalValueViolation] At CanonicalValueViolation.java:[lines 32-158] SING_SINGLETON_IMPLEMENTS_SE
The problem is that CanonicalValueViolation is assumed to be a singleton, whereas it only uses two constants for common instantiateions.
xzel23
Metadata
Metadata
Assignees
Labels
No labels