1334
public void setAddress(Address address) {...}
}
However, the Customer Entity JavaBean is an unserialized object which can cause serialization
failure and crash the application when the J2EE container attempts to write the object to the
system. Session scoped objects must implement the Serializable interface to ensure that the
objects serialize properly.
Example Language: Java (Good)
public class Customer implements Serializable {...}
MemberOf Relationships
This MemberOf relationships table shows additional CWE Catgeories and Views that reference this
weakness as a member. This information is often useful in understanding where a weakness fits
within the context of external information sources.
Nature Type ID Name Page
MemberOf 998 SFP Secondary Cluster: Glitch in Computation 888 2419
MemberOf 1412 Comprehensive Categorization: Poor Coding Practices 1400 2538
Taxonomy Mappings
Mapped Taxonomy Name Node ID Fit Mapped Node Name
Software Fault Patterns SFP1 Glitch in computation
CWE-595: Comparison of Object References Instead of Object Contents
Weakness ID : 595
Structure : Simple
Abstraction : Variant
Description
The product compares object references instead of the contents of the objects themselves,
preventing it from detecting equivalent objects.
Extended Description
For example, in Java, comparing objects using == usually produces deceptive results, since the ==
operator compares object references rather than values; often, this means that using == for strings
is actually comparing the strings' references, not their values.
Relationships
The table(s) below shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOr and give insight to
similar items that may exist at higher and lower levels of abstraction. In addition, relationships such
as PeerOf and CanAlsoBe are defined to show similar weaknesses that may want to be explored.
Relevant to the view "Research Concepts" (CWE-1000)
Nature Type ID Name Page
ChildOf 1025 Comparison Using Wrong Factors 1868
ParentOf 597 Use of Wrong Operator in String Comparison 1337
Relevant to the view "CISQ Quality Measures (2020)" (CWE-1305)
Nature Type ID Name Page
ParentOf 597 Use of Wrong Operator in String Comparison 1337
CWE Version 4.14
CWE-595: Comparison of Object References Instead of Object Contents
CWE-595: Comparison of Object References Instead of Object Contents