Slides for presentation / demo for a basic introduction to writing custom detectors for FindBugs.
Talk was given at the London Java Community Unconference 2, 26th June 2010.
The example code that goes with the slides is here:
http://bit.ly/fb_demo.
24. … but it becomes relevant when your code runs in an IBM mainframe! The EBCDIC Issue What's EBCDIC? “ EBCDIC is not relevant to your life.” -Joel Spolsky
25.
26.
27.
28.
29.
30. Imagine you're sending bytes over the network and the client is expecting ISO8859-1 text:
31. On ASCII-compatible platforms , the code above sends the correct ISO8859-1 bytes for HELLO .
32. On z/OS , it sends data that ISO88591-decodes to: ÈÅÓÓÖ
33. The code should look something like: The EBCDIC Issue If you �Unicode, you’ll �����EBCDIC connection.getOutputStream().write( "HELLO" .getBytes()); connection.getOutputStream().write( "HELLO" .getBytes( " ISO8859-1 " ));
34.
35. Not a suitable solution if different libraries make different assumptions about the default.