Remove redundant initializers

captchafix
Florens Douwes 11 years ago
parent 9d0d730084
commit 62b3a94963
  1. 4
      Clover/app/src/main/java/org/floens/chan/core/manager/ThreadManager.java
  2. 2
      Clover/app/src/main/java/org/floens/chan/core/net/ChanReaderRequest.java
  3. 2
      Clover/app/src/main/java/org/floens/chan/ui/ScrollerRunnable.java
  4. 2
      Clover/app/src/main/java/org/floens/chan/ui/adapter/PinnedAdapter.java
  5. 2
      Clover/app/src/main/java/org/floens/chan/ui/fragment/PostRepliesFragment.java
  6. 2
      Clover/app/src/main/java/org/floens/chan/ui/fragment/ThreadFragment.java
  7. 4
      Clover/app/src/main/java/org/floens/chan/utils/IOUtils.java
  8. 2
      Clover/app/src/main/java/org/floens/chan/utils/ImageDecoder.java
  9. 2
      Clover/app/src/main/java/org/floens/chan/utils/ImageSaver.java

@ -433,7 +433,7 @@ public class ThreadManager implements Loader.LoaderListener {
private void showPostReply(PostLinkable linkable) { private void showPostReply(PostLinkable linkable) {
String value = linkable.value; String value = linkable.value;
Post post = null; Post post;
try { try {
// Get post id // Get post id
@ -542,7 +542,7 @@ public class ThreadManager implements Loader.LoaderListener {
dialog.dismiss(); dialog.dismiss();
if (response.isNetworkError || response.isUserError) { if (response.isNetworkError || response.isUserError) {
int resId = 0; int resId;
if (response.isTooSoonError) { if (response.isTooSoonError) {
resId = R.string.delete_too_soon; resId = R.string.delete_too_soon;

@ -68,7 +68,7 @@ public class ChanReaderRequest extends JsonReaderRequest<List<Post>> {
@Override @Override
public List<Post> readJson(JsonReader reader) { public List<Post> readJson(JsonReader reader) {
List<Post> list = new ArrayList<>(); List<Post> list;
if (loadable.isBoardMode()) { if (loadable.isBoardMode()) {
list = loadBoard(reader); list = loadBoard(reader);

@ -46,7 +46,7 @@ public class ScrollerRunnable implements Runnable {
final int firstPos = mList.getFirstVisiblePosition(); final int firstPos = mList.getFirstVisiblePosition();
final int lastPos = firstPos + mList.getChildCount() - 1; final int lastPos = firstPos + mList.getChildCount() - 1;
int viewTravelCount = 0; int viewTravelCount;
if (position <= firstPos) { if (position <= firstPos) {
viewTravelCount = firstPos - position + 1; viewTravelCount = firstPos - position + 1;
mMode = MOVE_UP_POS; mMode = MOVE_UP_POS;

@ -48,7 +48,7 @@ public class PinnedAdapter extends ArrayAdapter<Pin> {
public View getView(int position, View convertView, ViewGroup parent) { public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout view = null; LinearLayout view;
final Pin item = getItem(position); final Pin item = getItem(position);

@ -115,7 +115,7 @@ public class PostRepliesFragment extends DialogFragment {
ArrayAdapter<Post> adapter = new ArrayAdapter<Post>(getActivity(), 0) { ArrayAdapter<Post> adapter = new ArrayAdapter<Post>(getActivity(), 0) {
@Override @Override
public View getView(int position, View convertView, ViewGroup parent) { public View getView(int position, View convertView, ViewGroup parent) {
PostView postView = null; PostView postView;
if (convertView instanceof PostView) { if (convertView instanceof PostView) {
postView = (PostView) convertView; postView = (PostView) convertView;
} else { } else {

@ -248,7 +248,7 @@ public class ThreadFragment extends Fragment implements ThreadManager.ThreadMana
} }
private String getLoadErrorText(VolleyError error) { private String getLoadErrorText(VolleyError error) {
String errorMessage = "error"; String errorMessage;
if ((error instanceof NoConnectionError) || (error instanceof NetworkError)) { if ((error instanceof NoConnectionError) || (error instanceof NetworkError)) {
errorMessage = getActivity().getString(R.string.thread_load_failed_network); errorMessage = getActivity().getString(R.string.thread_load_failed_network);

@ -48,7 +48,7 @@ public class IOUtils {
* @throws IOException * @throws IOException
*/ */
public static void copy(InputStream is, OutputStream os) throws IOException { public static void copy(InputStream is, OutputStream os) throws IOException {
int read = 0; int read;
byte[] buffer = new byte[4096]; byte[] buffer = new byte[4096];
while ((read = is.read(buffer)) != -1) { while ((read = is.read(buffer)) != -1) {
os.write(buffer, 0, read); os.write(buffer, 0, read);
@ -60,7 +60,7 @@ public class IOUtils {
public static void copy(Reader input, Writer output) throws IOException { public static void copy(Reader input, Writer output) throws IOException {
char[] buffer = new char[4096]; char[] buffer = new char[4096];
int read = 0; int read;
while ((read = input.read(buffer)) != -1) { while ((read = input.read(buffer)) != -1) {
output.write(buffer, 0, read); output.write(buffer, 0, read);
} }

@ -67,7 +67,7 @@ public class ImageDecoder {
public static Bitmap decode(byte[] data, int maxWidth, int maxHeight) { public static Bitmap decode(byte[] data, int maxWidth, int maxHeight) {
BitmapFactory.Options decodeOptions = new BitmapFactory.Options(); BitmapFactory.Options decodeOptions = new BitmapFactory.Options();
Bitmap bitmap = null; Bitmap bitmap;
// If we have to resize this image, first get the natural bounds. // If we have to resize this image, first get the natural bounds.
decodeOptions.inJustDecodeBounds = true; decodeOptions.inJustDecodeBounds = true;

@ -69,7 +69,7 @@ public class ImageSaver {
finalFolder.mkdirs(); finalFolder.mkdirs();
for (Uri uri : list) { for (Uri uri : list) {
DownloadManager.Request request = null; DownloadManager.Request request;
try { try {
request = new DownloadManager.Request(uri); request = new DownloadManager.Request(uri);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {

Loading…
Cancel
Save