Voldemort pissed Harry off one time to many, therefore his „Best girlfriend ever“ Hermione notifies the guild of evil masterminds on the misuse of the title „Dark Lord“ by Voldemort. Voldemort is tested by the guilds divisions and fails miserably. Meanwhile Harry gets annoyed by their representatives (such as Superman, X-Men, Powerpuff girls, Diana, Lex Luther, …) to join as a hero.
The story can be read online at FicWad or as PDF.
Sorting out Collections
The for-each loop introduced with 1.5 is very useful, unless you iterate over a collection to sort it out.
...
for (Iterator iterator = list.iterator(); iterator.hasNext();) {
if (condition) iterator.remove();
}
In most cases this woks well, but there is the corner-case where the backing collection does not support the remove operation. This is the case if the collection was an array that was converted through the Arrays class:
List list = Arrays.asList(array)
This produces a fixed size list. As it is impossible to remove an element from the array (and thus reducing its size) it is not possible to remove an element from the list. There is an easy workaround: Create a new dynamic List from the static List:
List list = new ArrayList(Arrays.asList(array))
Harry Potter and The Power He Has Not by Clell65619
Upon arriving at Platform 9 3/4 after their sixth year Voldemort inflicts a curse on Harry that transfers all magic to him. Hermione and Harry get together. He trains with the goblins and faces Voldemort down with their help by extracting all magic from him and decapitating. Then he blows everything up. On the face of it he is killed but comes back to Hermione as Marcus Steward.
The story is online at Ficwad or as PDF.
API Design with Eclipse
The design of the API of a class based on the visibility of its members is in Eclipse fairly easy thanks to the Outline view. One level up (the package level) there are no such nice hints for the visibility. Therefore I created a small plug-in that decorates Java classes in the package explorer view with the visibility icons. „API Design with Eclipse“ weiterlesen