Wednesday, March 21, 2012

Test your bugfix skills

Here is a bug. Find it:

        BufferedReader reader = request.getReader();
        StringBuilder requestSB = new StringBuilder();
        String requestStr;
        String line;
       
        while ((line = reader.readLine()) != null) {
          requestSB.append( line );
          requestSB.append( '\n' );
        }
        requestStr = requestSB.toString();


In which situations this bug appears?

No comments:

Post a Comment