Lint
This commit is contained in:
@ -58,7 +58,7 @@ class InitActivities {
|
||||
Util.d("MODEL" + ": " + Build.MODEL);
|
||||
Util.d("DISPLAY" + ": " + Build.DISPLAY);
|
||||
Util.d("VERSION" + ": " + Build.VERSION.RELEASE);
|
||||
Util.d("SDK" + ": " + Build.VERSION.SDK);
|
||||
Util.d("SDK" + ": " + Build.VERSION.SDK_INT);
|
||||
}
|
||||
|
||||
void initialize() {
|
||||
@ -234,7 +234,7 @@ class InitActivities {
|
||||
* and write back
|
||||
*
|
||||
* @param f relative to base dir
|
||||
* @param props local overrides or null
|
||||
* @param overrides local overrides or null
|
||||
*/
|
||||
public void mergeResourceToFile(int resID, String f, Properties overrides) {
|
||||
InputStream in = null;
|
||||
|
@ -99,7 +99,7 @@ public class AddressbookActivity extends I2PActivityBase
|
||||
// AddressbookFragment.OnAddressSelectedListener
|
||||
|
||||
public void onAddressSelected(CharSequence host) {
|
||||
if (getIntent().getAction() == Intent.ACTION_PICK) {
|
||||
if (Intent.ACTION_PICK.equals(getIntent().getAction())) {
|
||||
Intent result = new Intent();
|
||||
result.setData(Uri.parse("http://" + host));
|
||||
setResult(Activity.RESULT_OK, result);
|
||||
|
@ -34,14 +34,14 @@ public class AddressbookFragment extends ListFragment implements
|
||||
public static final String PRIVATE_BOOK = "privatehosts.txt";
|
||||
public static final String ADD_WIZARD_DATA = "add_wizard_data";
|
||||
|
||||
static final int ADD_WIZARD_REQUEST = 1;
|
||||
private static final int ADD_WIZARD_REQUEST = 1;
|
||||
|
||||
private static final int ROUTER_LOADER_ID = 1;
|
||||
private static final int PRIVATE_LOADER_ID = 2;
|
||||
|
||||
private boolean mOnActivityCreated;
|
||||
RouterContextProvider mRouterContextProvider;
|
||||
OnAddressSelectedListener mCallback;
|
||||
private RouterContextProvider mRouterContextProvider;
|
||||
private OnAddressSelectedListener mCallback;
|
||||
private AddressEntryAdapter mAdapter;
|
||||
private String mBook;
|
||||
private String mCurFilter;
|
||||
|
@ -16,8 +16,8 @@ import net.i2p.util.FileUtil;
|
||||
|
||||
public class AddressbookSettingsActivity extends Activity {
|
||||
|
||||
protected EditText text_content_subscriptions;
|
||||
protected Button btn_save_subscriptions;
|
||||
private EditText text_content_subscriptions;
|
||||
private Button btn_save_subscriptions;
|
||||
private String filename = "/addressbook/subscriptions.txt";
|
||||
private File i2pDir;
|
||||
|
||||
|
@ -168,7 +168,7 @@ public class LogFragment extends ListFragment implements
|
||||
if (loader.getId() == ("ERROR".equals(mLogLevel) ?
|
||||
LEVEL_ERROR : LEVEL_ALL)) {
|
||||
mAdapter.setData(data);
|
||||
String header = getHeader(data.size(), (mLogLevel == "ERROR"));
|
||||
String header = getHeader(data.size(), ("ERROR".equals(mLogLevel)));
|
||||
mHeaderView.setText(header);
|
||||
|
||||
if (isResumed()) {
|
||||
|
@ -1,7 +1,16 @@
|
||||
package net.i2p.android.router.netdb;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.TableRow;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.i2p.android.router.I2PFragmentBase;
|
||||
import net.i2p.android.router.R;
|
||||
@ -14,17 +23,8 @@ import net.i2p.data.Lease;
|
||||
import net.i2p.data.LeaseSet;
|
||||
import net.i2p.data.RouterAddress;
|
||||
import net.i2p.data.RouterInfo;
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.TableRow;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class NetDbDetailFragment extends I2PFragmentBase {
|
||||
public static final String IS_RI = "is_routerinfo";
|
||||
@ -131,7 +131,7 @@ public class NetDbDetailFragment extends I2PFragmentBase {
|
||||
|
||||
TableLayout stats = (TableLayout) getView().findViewById(R.id.ri_stats);
|
||||
Map<Object, Object> p = ri.getOptionsMap();
|
||||
for (Map.Entry<Object,Object> e : (Set<Map.Entry<Object,Object>>) p.entrySet()) {
|
||||
for (Map.Entry<Object,Object> e : p.entrySet()) {
|
||||
String key = (String)e.getKey();
|
||||
String val = (String)e.getValue();
|
||||
addTableRow(stats, DataHelper.stripHTML(key), DataHelper.stripHTML(val));
|
||||
@ -149,7 +149,7 @@ public class NetDbDetailFragment extends I2PFragmentBase {
|
||||
addTableRow(table, "cost", ""+cost);
|
||||
|
||||
Map<Object, Object> p = addr.getOptionsMap();
|
||||
for (Map.Entry<Object,Object> e : (Set<Map.Entry<Object,Object>>) p.entrySet()) {
|
||||
for (Map.Entry<Object,Object> e : p.entrySet()) {
|
||||
String key = (String)e.getKey();
|
||||
String val = (String)e.getValue();
|
||||
addTableRow(table, DataHelper.stripHTML(key), DataHelper.stripHTML(val));
|
||||
|
@ -31,7 +31,7 @@ public class NetDbEntry {
|
||||
}
|
||||
|
||||
public static NetDbEntry fromLeaseSet(RouterContext ctx, LeaseSet ls) {
|
||||
String nick = "";
|
||||
String nick;
|
||||
boolean local = false;
|
||||
boolean unpublished = false;
|
||||
Destination dest = ls.getDestination();
|
||||
@ -55,8 +55,8 @@ public class NetDbEntry {
|
||||
return new NetDbEntry(ls, nick, local, unpublished);
|
||||
}
|
||||
|
||||
public NetDbEntry(RouterInfo ri,
|
||||
boolean isUs, String country) {
|
||||
private NetDbEntry(RouterInfo ri,
|
||||
boolean isUs, String country) {
|
||||
mIsRI = true;
|
||||
mEntry = ri;
|
||||
|
||||
@ -67,8 +67,8 @@ public class NetDbEntry {
|
||||
mLocal = mUnpublished = false;
|
||||
}
|
||||
|
||||
public NetDbEntry(LeaseSet ls,
|
||||
String nick, boolean local, boolean unpublished) {
|
||||
private NetDbEntry(LeaseSet ls,
|
||||
String nick, boolean local, boolean unpublished) {
|
||||
mIsRI = false;
|
||||
mEntry = ls;
|
||||
|
||||
|
@ -1,14 +1,5 @@
|
||||
package net.i2p.android.router.netdb;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.i2p.android.router.I2PFragmentBase;
|
||||
import net.i2p.android.router.R;
|
||||
import net.i2p.android.router.I2PFragmentBase.RouterContextProvider;
|
||||
import net.i2p.android.router.I2PFragmentBase.RouterContextUser;
|
||||
import net.i2p.data.Hash;
|
||||
import net.i2p.router.RouterContext;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.ListFragment;
|
||||
@ -20,6 +11,14 @@ import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ListView;
|
||||
|
||||
import net.i2p.android.router.I2PFragmentBase;
|
||||
import net.i2p.android.router.I2PFragmentBase.RouterContextProvider;
|
||||
import net.i2p.android.router.R;
|
||||
import net.i2p.data.Hash;
|
||||
import net.i2p.router.RouterContext;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class NetDbListFragment extends ListFragment implements
|
||||
I2PFragmentBase.RouterContextUser,
|
||||
LoaderManager.LoaderCallbacks<List<NetDbEntry>> {
|
||||
@ -34,8 +33,8 @@ public class NetDbListFragment extends ListFragment implements
|
||||
private static final String STATE_ACTIVATED_POSITION = "activated_position";
|
||||
|
||||
private boolean mOnActivityCreated;
|
||||
RouterContextProvider mRouterContextProvider;
|
||||
OnEntrySelectedListener mEntrySelectedCallback;
|
||||
private RouterContextProvider mRouterContextProvider;
|
||||
private OnEntrySelectedListener mEntrySelectedCallback;
|
||||
private NetDbEntryAdapter mAdapter;
|
||||
private boolean mRouters;
|
||||
/**
|
||||
|
@ -22,7 +22,7 @@ import android.view.ViewGroup;
|
||||
|
||||
public class NetDbSummaryPagerFragment extends I2PFragmentBase implements
|
||||
LoaderManager.LoaderCallbacks<List<ObjectCounter<String>>> {
|
||||
NetDbPagerAdapter mNetDbPagerAdapter;
|
||||
private NetDbPagerAdapter mNetDbPagerAdapter;
|
||||
ViewPager mViewPager;
|
||||
|
||||
@Override
|
||||
|
@ -49,7 +49,7 @@ class LoadClientsJob extends JobImpl {
|
||||
getTiming().setStartAfter(getContext().clock().now() + LOAD_DELAY);
|
||||
}
|
||||
|
||||
public String getName() { return "Start Clients"; };
|
||||
public String getName() { return "Start Clients"; }
|
||||
|
||||
public void runJob() {
|
||||
Job j = new RunI2PTunnel(getContext());
|
||||
@ -83,7 +83,7 @@ class LoadClientsJob extends JobImpl {
|
||||
super(ctx);
|
||||
}
|
||||
|
||||
public String getName() { return "Start I2P Tunnel"; };
|
||||
public String getName() { return "Start I2P Tunnel"; }
|
||||
|
||||
public void runJob() {
|
||||
Util.d("Starting i2ptunnel");
|
||||
|
@ -1,12 +1,5 @@
|
||||
package net.i2p.android.router.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageInfo;
|
||||
@ -15,9 +8,16 @@ import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.util.OrderedProperties;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
public abstract class Util {
|
||||
private static final boolean _isEmulator = Build.MODEL.equals("sdk");
|
||||
|
||||
|
@ -22,7 +22,7 @@ import java.nio.channels.ServerSocketChannel;
|
||||
* @author str4d
|
||||
* @since 0.9.14
|
||||
*/
|
||||
public class DomainServerSocket extends ServerSocket {
|
||||
class DomainServerSocket extends ServerSocket {
|
||||
private final LocalServerSocket mLocalServerSocket;
|
||||
private final DomainSocketFactory mDomainSocketFactory;
|
||||
private volatile boolean mClosed;
|
||||
|
@ -22,7 +22,7 @@ import java.nio.channels.SocketChannel;
|
||||
* @author str4d
|
||||
* @since 0.9.14
|
||||
*/
|
||||
public class DomainSocket extends Socket {
|
||||
class DomainSocket extends Socket {
|
||||
private final LocalSocket mLocalSocket;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user