¡@

Home 

java Programming Glossary: defensive

Considering object encapsulation, should getters return an immutable property?

http://stackoverflow.com/questions/114237/considering-object-encapsulation-should-getters-return-an-immutable-property

this question It's a matter of whether you should be defensive in your code. If you're the sole user of your class and you..

java dynamic array sizes?

http://stackoverflow.com/questions/1647260/java-dynamic-array-sizes

your private data member which leads to all sorts of defensive copying. Compare this to the List version class Myclass private..

Byte order mark screws up file reading in Java

http://stackoverflow.com/questions/1835430/byte-order-mark-screws-up-file-reading-in-java

bytes.length final byte result new byte length Make a defensive copy System.arraycopy bytes 0 result 0 length return result..

Is Catching a Null Pointer Exception a Code Smell?

http://stackoverflow.com/questions/2586290/is-catching-a-null-pointer-exception-a-code-smell

of reasons for the null pointer so we changed it to a defensive check for the one result. However catching NullPointerException.. to agree. An exception would probably be some specially defensive pieces of code which run pretty much random code from other.. much random code from other modules. Examples for such defensive structures would be the EDT ThreadPools Executors and plugin..

What is the security risk of object reflection?

http://stackoverflow.com/questions/3002904/what-is-the-security-risk-of-object-reflection

sealed and pass them around. This is for instance what defensive copying try to protect against. Type safety is also anyway threatened..

Struct like objects in Java

http://stackoverflow.com/questions/36701/struct-like-objects-in-java

class you might not see all possible actions. It's like defensive programming someday getters and setters may be helpful and it..

Copy an object in Java

http://stackoverflow.com/questions/475842/copy-an-object-in-java

Galaxy aGalaxy this aGalaxy.getMass aGalaxy.getName no defensive copies are created here since there are no mutable object fields..

Does this applet work in an Iced Tea JRE?

http://stackoverflow.com/questions/5356850/does-this-applet-work-in-an-iced-tea-jre

that are JEditorPane compatible. This applet loads in a defensive way in terms of the security environment in case the user has..

Displaying data from database in JTable

http://stackoverflow.com/questions/5357349/displaying-data-from-database-in-jtable

the result set takes virtually no time but I like being defensive here. On top of each column is a filter and an order by which..

Is it possible to detach Hibernate entity, so that changes to object are not automatically saved to database?

http://stackoverflow.com/questions/5800814/is-it-possible-to-detach-hibernate-entity-so-that-changes-to-object-are-not-aut

by calling Session.evict . Other options are create a defensive copy of your entity before translation of values or use a DTO..

How to create immutable objects in Java?

http://stackoverflow.com/questions/6305752/how-to-create-immutable-objects-in-java

still be mutable. ie private final Date imStillMutable See defensive copying or its cousin copy constructors for more info. no.1..

Fast CSV parsing

http://stackoverflow.com/questions/6857248/fast-csv-parsing