Java Coding Guidelines

Java Coding Guidelines (Paperback)

By Fred Long Dhruv Mohindra Robert C , David Svoboda 
Publisher: Pearson
Edition: Paperback
Language: English
ISBN: 9332535965
EAN: 9789332535961
No. of Pages: 304
Binding: Paperback
Ships to India.


About the Book

Organizations worldwide rely on Java code to perform mission-critical tasks, and therefore that code must be reliable, robust, fast, maintainable, and secure.Java Coding Guidelines brings together expert guidelines, recommendations, and code examples to help you meet these demands.

Written by the same team that brought you The CERT Oracle Secure Coding Standard for Java,this guide extends that previous work's expert security advice to address many additional quality attributes.

You'll find 75 guidelines, each presented consistently and intuitively. For each guideline, conformance requirements are specified; for most, noncompliant code examples and compliant solutions are also offered. The authors explain when to apply each guideline and provide references to even more detailed information.

Reflecting pioneering research on Java security, Java Coding Guidelines offers updated techniques for protecting against both deliberate attacks and other unexpected events. You'll find best practices for improving code reliability and clarity, and a full chapter exposing common misunderstandings that lead to suboptimal code.


Chapter 1: Security 1. Limit the lifetime of sensitive data
2. Do not store unencrypted sensitive information on the client side
3. Provide sensitive mutable classes with unmodifiable wrappers
4. Ensure that security-sensitive methods are called with validated arguments
5. Prevent arbitrary file upload
6. Properly encode or escape output
7. Prevent code injection
8. Prevent XPath injection
9. Prevent LDAP injection
10. Do not use the clone() method to copy untrusted method parameters
11. Do not use Object.equals() to compare cryptographic keys
12. Do not use insecure or weak cryptographic algorithms
13. Store passwords using a hash function
14. Ensure that SecureRandom is properly seeded
15. Do not rely on methods that can be overridden by untrusted code
16. Avoid granting excess privileges
17. Minimize privileged code
18. Do not expose methods that use reduced-security checks to untrusted code
19. Define custom security permissions for fine-grained security
20. Create a secure sandbox using a security manager
21. Do not let untrusted code misuse privileges of callback methods
Chapter 2: Defensive Programming22. Minimize the scope of variables
23. Minimize the scope of the @SuppressWarnings annotation
24. Minimize the accessibility of classes and their members
25. Document thread-safety and use annotations where applicable
26. Always provide feedback about the resulting value of a method
27. Identify files using multiple file attributes
28. Do not attach significance to the ordinal associated with an enum
29. Be aware of numeric promotion behavior
30. Enable compile-time type checking of variable arity parameter types
31. Do not apply public final to constants whose value might change in later releases
32. Avoid cyclic dependencies between packages
33. Prefer user-defined exceptions over more general exception types
34. Try to gracefully recover from system errors
35. Carefully design interfaces before releasing them
36. Write garbage collection-friendly code
Chapter 3: Reliability37. Do not shadow or obscure identifiers in subscopes
38. Do not declare more than one variable per declaration
39. Use meaningful symbolic constants to represent literal values in program logic
40. Properly encode relationships in constant definitions
41. Return an empty array or collection instead of a null value for methods that return an array or collection
42. Use exceptions only for exceptional conditions
43. Use a try-with-resources statement to safely handle closeable resources
44. Do not use assertions to verify the absence of runtime errors
45. Use the same type for the second and third operands in conditional expressions
46. Do not serialize direct handles to system resources
47. Prefer using iterators over enumerations
48. Do not use direct buffers for short-lived, infrequently used objects
49. Remove short-lived objects from long-lived container objects
Chapter 4: Program Understandability 50. Be careful using visually misleading identifiers and literals
51. Avoid ambiguous overloading of variable arity methods
52. Avoid in-band error indicators
53. Do not perform assignments in conditional expressions
54. Use braces for the body of an if, for, or while statement
55. Do not place a semicolon immediately following an if, for, or while condition
56. Finish every set of statements associated with a case label with a break statement
57. Avoid inadvertent wrapping of loop counters
58. Use parentheses for precedence of operation
59. Do not make assumptions about file creation
60. Convert integers to floating-point for floating-point operations
61. Ensure that the clone() method calls super.clone()
62. Use comments consistently and in a readable fashion
63. Detect and remove superfluous code and values
64. Strive for logical completeness
65. Avoid ambiguous or confusing uses of overloading
Chapter 5: Programmer Misconceptions 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

About the Author

Fred Longis a senior lecturer in the Department of Computer Science, Aberystwyth University, in the United Kingdom. He is chairman of the British Computer Society's Mid-Wales Branch. Fred has been a visiting scientist at the Software Engineering Institute (SEI) since 1992. Recently, his research has involved the investigation of vulnerabilities in Java.

show moreless


Title: Java Coding Guidelines
Publisher: Pearson
Author: Fred Long Dhruv Mohindra Robert C , David Svoboda
Edition: Paperback
Language: English
ISBN: 9332535965
EAN: 9789332535961
No. of Pages: 304
Binding: Paperback


  • The book summary and image may be of a different edition or binding of the same title.
  • Book reviews are added by registered customers. They need not necessarily buy book.
  • These books are NOT available for reading online or for free download in PDF or ebook format.
  • Price can change due to reprinting, price change by publisher or sourcing cost change for imported books.
  • is the biggest online bookstore in India for sale of books at best price - fiction, literature, audiobooks, study guides, novels, story books, rare books, textbooks and books by popular authors. These are available in various editions and bindings e.g. paperback and at best discount.
  • For the imported title, once the order gets placed ,it can’t be cancelled

Great Value

Safe Payment

Shop With

24/7 Help Center

Free & Easy Return

Get Discounts & Offers
Stay Connected

Popular Searches on

Online Shopping: Deal of The Day / Hot Deals / Best Deals / Offers

Apple iPhones: Iphone Xs Max / Iphone Xs / Iphone XR / iPhone 8 / iPhone 8 / iPhone 7 / iPhone 7 Plus / iPhone 6s / iPhone 5s

Mobile Phones:Unboxed Mobiles / Apple Mobiles / Samsung Mobiles / Micromax Mobiles / Sony Mobiles / Intex Mobiles / Latest Mobiles / Smartphones / 4G Phones / 3G Phones

Computers:Dell Laptops / Lenovo Laptops / Acer Laptops / HP Laptops / External Hard Disks / Pen Drives / Monitors / Softwares / Printers

Appliances:Air Conditioners / Air Coolers / Refrigerators / Geysers / Room Heaters / Immersion Rod / Water Purifiers / Washing Machines / Microwaves & OTG / Air Purifier

Electronics: Tablets / Cameras / Headphones / Power Bank / LED TVs / Gaming Consoles / Speakers / Tablet Accessories / Memory Cards

Men's Clothing: Shirts / T-Shirts / Tracksuits / Trousers / Ethnic Wear / Men's Denim / Cargo Shorts / Tees & Polos / Suits & Blazer

Women's Clothing: Dress Materials / Salwar Suits / Women Sarees / Kurtas & Kurtis / Leggings / Lingerie / Night Suits & Nighties / Women Shorts / Tops

Fashion:Men's Shoes / Women's Footwear / Fastrack Watches / Titan Watches / Timex Watches / Bags / Jewellery / Fastrack Sunglasses / Perfumes & Deodorants / Fashion Accessories

Buy Books Online:Best Sellers Books / Business Books / History and Politics / Academic and Professional / Competitive Exams / Biographies and Autobiographies

Best Ecommerce Platform:Online Store Builder / Create Online Store / Best Ecommerce Solutions / Sell Online / Ecommerce Marketing Blog

Ecommerce Website Templates:Free Website Templates / Free Logo Design / SEO Audit Report / Theme Store / Wordpress Themes / Web & App Development Company

Copyright © 2007-2019 and Affiliates
Site is up