Buggy code:
public class ServerWorker { private String loginCode = "" ; private static volatile ServerWorker instance ; private ClientConnectionManager connectionManager ; private HttpParams connectionParameters ; private Map < UUID , ArrayList < BaseItem > > posts = new HashMap < UUID , ArrayList < BaseItem > > ( ) ; private ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock ( ) ; private final Lock read = readWriteLock . readLock ( ) ; private final Lock write = readWriteLock . writeLock ( ) ; private Map < UUID , ArrayList < BaseItem > > comments = new HashMap < UUID , ArrayList < BaseItem > > ( ) ; private ServerWorker ( ) { } public static ServerWorker Instance ( ) { } private void init ( ) { } public void clearSessionInfo ( ) throws Exception { } public HttpEntity getContentEntity ( String url ) throws Exception { } public InputStream getContentStream ( String url ) throws Exception { } public String getContent ( String url ) throws Exception { } public Pair < String , Header [ ] > login ( String url , String login , String password , String captcha , String loginCode ) throws IOException , ClientProtocolException { final HttpPost httpGet = new HttpPost ( url ) ; <START_BUG> String str = String . format ( "user=%s&pass=%s&captcha=%s&logincode=%s&save=1" , login , password , captcha , loginCode ) ; <END_BUG> final StringEntity se = new StringEntity ( str , HTTP . UTF_8 ) ; httpGet . setHeader ( "Content-Type" , "application//x-www-form-urlencoded" ) ; httpGet . setEntity ( se ) ; final HttpClient client = new org . apache . http . impl . client . DefaultHttpClient ( connectionManager , connectionParameters ) ; final HttpResponse response = client . execute ( httpGet ) ; return new Pair < String , Header [ ] > ( EntityUtils . toString ( response . getEntity ( ) , "UTF-8" ) , response . getAllHeaders ( ) ) ; } public byte [ ] getImage ( String url ) throws IOException , ClientProtocolException { } public String rateItem ( RateType type , String wtf , String id , RateValueType value ) throws IOException , ClientProtocolException { } public String postComment ( String wtf , String replyTo , String pid , String comment ) throws IOException , ClientProtocolException { } public String getLoginCode ( ) { } public void setLoginCode ( String loginCode ) { } public BaseItem getPostById ( UUID groupId , UUID id ) { } public ArrayList < BaseItem > getPostsById ( UUID groupId , boolean clone ) { } public static ArrayList < BaseItem > cloneList ( ArrayList < BaseItem > list ) { } public BaseItem getComment ( UUID groupId , UUID postId , UUID commentId ) { } public ArrayList < BaseItem > getComments ( UUID groupId , UUID postId ) { } public int addNewComment ( UUID groupId , UUID id , BaseItem item ) { } public void addNewComments ( UUID groupId , UUID id , ArrayList < BaseItem > items ) { } public void addNewPosts ( UUID groupId , ArrayList < BaseItem > posts ) { } public void addNewPost ( UUID groupId , BaseItem post ) { } public void clearCommentsById ( UUID id ) { } public void clearPostsById ( UUID groupId ) { } public void clearComments ( ) { } public void clearPosts ( ) { } }

Fix:
String str = String . format ( "user=%s&pass=%s&captcha=%s&logincode=%s&save=1" , URLEncoder . encode ( login ) , URLEncoder . encode ( password ) , captcha , loginCode ) ;