]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java
another compiler warning about fixed non-translatable string
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / profiles / ProfileDetailFragment.java
index f300da5d0a166a0f1a9675f0c72c20737ddbfe6a..3560831e71945c81bfa12853787693036d119aea 100644 (file)
@@ -49,6 +49,7 @@ import net.ktnx.mobileledger.ui.HueRingDialog;
 import net.ktnx.mobileledger.ui.activity.ProfileDetailActivity;
 import net.ktnx.mobileledger.utils.Colors;
 
+import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 
 import java.net.MalformedURLException;
@@ -69,6 +70,8 @@ public class ProfileDetailFragment extends Fragment implements HueRingDialog.Hue
      * represents.
      */
     public static final String ARG_ITEM_ID = "item_id";
+    @NonNls
+    private static final String HTTPS_URL_START = "https://";
 
     /**
      * The dummy content this fragment is presenting.
@@ -112,8 +115,7 @@ public class ProfileDetailFragment extends Fragment implements HueRingDialog.Hue
                 mProfile.removeFromDB();
                 ArrayList<MobileLedgerProfile> oldList = Data.profiles.getValue();
                 if (oldList == null) throw new AssertionError();
-                ArrayList<MobileLedgerProfile> newList =
-                        (ArrayList<MobileLedgerProfile>) oldList.clone();
+                ArrayList<MobileLedgerProfile> newList = new ArrayList<>(oldList);
                 newList.remove(mProfile);
                 Data.profiles.setValue(newList);
                 if (mProfile.equals(Data.profile.getValue())) {
@@ -201,8 +203,7 @@ public class ProfileDetailFragment extends Fragment implements HueRingDialog.Hue
             mProfile.storeInDB();
             final ArrayList<MobileLedgerProfile> profiles = Data.profiles.getValue();
             if (profiles == null) throw new AssertionError();
-            ArrayList<MobileLedgerProfile> newList =
-                    (ArrayList<MobileLedgerProfile>) profiles.clone();
+            ArrayList<MobileLedgerProfile> newList = new ArrayList<>(profiles);
             newList.add(mProfile);
             Data.profiles.setValue(newList);
             MobileLedgerProfile.storeProfilesOrder();
@@ -276,7 +277,7 @@ public class ProfileDetailFragment extends Fragment implements HueRingDialog.Hue
         }
         else {
             profileName.setText("");
-            url.setText("https://");
+            url.setText(HTTPS_URL_START);
             postingPermitted.setChecked(true);
             useAuthentication.setChecked(false);
             authParams.setVisibility(View.GONE);