Skip to main content
assistive.skiplink.to.breadcrumbs
assistive.skiplink.to.header.menu
assistive.skiplink.to.action.menu
assistive.skiplink.to.quick.search
Log in
Confluence
Spaces
Hit enter to search
Help
Online Help
Keyboard Shortcuts
Feed Builder
What’s new
Available Gadgets
About Confluence
Log in
SEI CERT Oracle Coding Standard for Java
Pages
Boards
Space shortcuts
Dashboard
Secure Coding Home
Android
C
C++
Java
Perl
Page tree
Browse pages
Configure
Space tools
View Page
Page History
Page Information
View in Hierarchy
View Source
Export to PDF
Pages
Old Categories
5. Programmer Misconceptions
Page History
Versions Compared
Old Version
1
changes.mady.by.user
Carol J. Lallier
Saved on
Sep 28, 2014
compared with
New Version
2
changes.mady.by.user
Carol J. Lallier
Saved on
Sep 28, 2014
Next Change: Difference between versions 2 and 3
View Page History
Key
This line was added.
This line was removed.
Formatting was changed.
...
Misconceptions about Java APIs and language features
Assumptions and ambiguity-laced programs
Situations in which the programmer wanted to do one thing but ended up doing another
66. Do not assume that declaring a reference volatile guarantees safe publication of the members of the referenced object
67. Do not assume that the sleep(), yield(), or getState() methods provide synchronization semantics
68. Do not assume that the remainder operator always returns a nonnegative result for integral operands
69. Do not confuse abstract object equality with reference equality
70. Understand the differences between bitwise and logical operators
71. Understand how escape characters are interpreted when strings are loaded
72. Do not use overloaded methods to differentiate between runtime types
73. Never confuse the immutability of a reference with that of the referenced object
74. Use the serialization methods writeUnshared() and readUnshared() with care
75. Do not attempt to help the garbage collector by setting local reference variables to null
Overview
Content Tools
{"serverDuration": 66, "requestCorrelationId": "b062799982faaf7b"}