Fix AsyncDatabaseConnector warnings

This commit is contained in:
Przemek Grondek 2014-08-17 13:10:01 +02:00
parent b52e80f776
commit db3361b390

View file

@ -17,6 +17,7 @@ import java.util.List;
/** /**
* Created by nerull7 on 07.07.14. * Created by nerull7 on 07.07.14.
* Database connector using Async calls
*/ */
public class AsyncDatabaseConnector { public class AsyncDatabaseConnector {
public static final String ACTION_LOGIN = "login"; public static final String ACTION_LOGIN = "login";
@ -123,7 +124,6 @@ public class AsyncDatabaseConnector {
Downloader downloader = new Downloader(new Downloader.OnFinishedListener() { Downloader downloader = new Downloader(new Downloader.OnFinishedListener() {
@Override @Override
public void onFinished(String data, String error) { public void onFinished(String data, String error) {
List<String>list = null;
boolean listenerData; boolean listenerData;
if(data == null) { if(data == null) {
listenerData = false; listenerData = false;
@ -180,12 +180,12 @@ public class AsyncDatabaseConnector {
JSONArray newValuesJSON = new JSONArray(); JSONArray newValuesJSON = new JSONArray();
String request; String request;
for(int i=0;i<header.size();i++){ for (String aHeader : header) {
headerJSON.put(header.get(i)); headerJSON.put(aHeader);
} }
for(int i=0;i<newValues.size();i++){ for (String newValue : newValues) {
newValuesJSON.put(newValues.get(i)); newValuesJSON.put(newValue);
} }
if(oldValues!=null){ if(oldValues!=null){
@ -296,7 +296,7 @@ public class AsyncDatabaseConnector {
BufferedReader reader = null; BufferedReader reader = null;
try { try {
reader = new BufferedReader(new InputStreamReader(in)); reader = new BufferedReader(new InputStreamReader(in));
String line = ""; String line;
while ((line = reader.readLine()) != null) { while ((line = reader.readLine()) != null) {
streamOutput += line; streamOutput += line;
} }