Skip to content
This repository has been archived by the owner on Mar 2, 2021. It is now read-only.

Commit

Permalink
Fix: String != "" but String.equals("")
Browse files Browse the repository at this point in the history
I hate you, Java.
  • Loading branch information
seawolf committed Apr 21, 2013
1 parent 9f57bc2 commit 49880ef
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/com/seawolfsanctuary/keepingtracks/ClassInfoActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ public void onClick(DialogInterface di, int btnClicked) {
}

private void updateNotes(String classNo, String value) {
UnitClass db_unitClass = new UnitClass(getApplicationContext());
UnitClass db_unitClass = new UnitClass(
getApplicationContext());
db_unitClass.open();
boolean success = false;
if (value.length() > 0) {
Expand All @@ -142,7 +143,8 @@ private void updateNotes(String classNo, String value) {
DialogInterface.OnClickListener editNotesListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface di, int btnClicked) {
String notes = "";
UnitClass db_unitClass = new UnitClass(getApplicationContext());
UnitClass db_unitClass = new UnitClass(
getApplicationContext());
db_unitClass.open();
Cursor c = db_unitClass.getUnitNotes(classNo);
if (c.moveToFirst()) {
Expand Down Expand Up @@ -238,7 +240,8 @@ protected Boolean doInBackground(Void... params) {
e.printStackTrace();
try {
File f = Helpers.fileAt(Helpers.dataDirectoryPath
+ "/class_photos/thumbs/", destination, false);
+ "/class_photos/thumbs/", destination,
false);
f.delete();
} catch (Exception x) {
// meh
Expand All @@ -252,7 +255,8 @@ protected Boolean doInBackground(Void... params) {

bundleDownloadURL = new URL(Helpers.classInfoPhotosURI);

targetDir = Helpers.dirAt(Helpers.dataDirectoryPath + "/class_photos", false);
targetDir = Helpers.dirAt(Helpers.dataDirectoryPath
+ "/class_photos", false);
for (int i = 0; i < data.size(); i++) {
String[] d = data.get(i);
String destination = d[0];
Expand Down Expand Up @@ -373,17 +377,11 @@ private ArrayList<ArrayList<String>> getData(ArrayList<String[]> entries) {
String[] entry = entries.get(i);
ArrayList<String> split = new ArrayList<String>();

if (entry.length < 7) {
String[] new_entry = new String[] { entry[0], entry[1],
entry[2], entry[3], entry[4], "", "" };
entry = new_entry;
}

if (entry[4] == "0000") {
if (entry[4].equals("0000")) {
entry[4] = getString(R.string.class_info_unknown);
}

if (entry[5] == "0000") {
if (entry[5].equals("0000")) {
entry[5] = getString(R.string.class_info_unknown);
}

Expand Down

0 comments on commit 49880ef

Please sign in to comment.