OSDN Git Service

findbug fixes
authorMichael Chan <mchan@android.com>
Thu, 14 May 2009 23:09:13 +0000 (16:09 -0700)
committerMichael Chan <mchan@android.com>
Fri, 15 May 2009 01:26:11 +0000 (18:26 -0700)
modified:   src/com/android/calendar/AgendaActivity.java
modified:   src/com/android/calendar/AgendaAdapter.java
modified:   src/com/android/calendar/CalendarActivity.java
modified:   src/com/android/calendar/CalendarApplication.java
modified:   src/com/android/calendar/CalendarView.java
modified:   src/com/android/calendar/DeleteEventHelper.java
modified:   src/com/android/calendar/EditEvent.java
modified:   src/com/android/calendar/Event.java
modified:   src/com/android/calendar/EventInfoActivity.java
modified:   src/com/android/calendar/IcsImportActivity.java
modified:   src/com/android/calendar/MonthActivity.java
modified:   tests/src/com/android/calendar/FormatDateRangeTest.java
modified:   tests/src/com/android/calendar/WeekNumberTest.java

13 files changed:
src/com/android/calendar/AgendaActivity.java
src/com/android/calendar/AgendaAdapter.java
src/com/android/calendar/CalendarActivity.java
src/com/android/calendar/CalendarApplication.java
src/com/android/calendar/CalendarView.java
src/com/android/calendar/DeleteEventHelper.java
src/com/android/calendar/EditEvent.java
src/com/android/calendar/Event.java
src/com/android/calendar/EventInfoActivity.java
src/com/android/calendar/IcsImportActivity.java
src/com/android/calendar/MonthActivity.java
tests/src/com/android/calendar/FormatDateRangeTest.java
tests/src/com/android/calendar/WeekNumberTest.java

index 97a6e5a..9f5a53e 100644 (file)
@@ -204,7 +204,7 @@ public class AgendaActivity extends Activity implements ViewSwitcher.ViewFactory
 
         // Eliminate extra GCs during startup by setting the initial heap size to 4MB.
         // TODO: We should restore the old heap size once the activity reaches the idle state
-        long oldHeapSize = VMRuntime.getRuntime().setMinimumHeapSize(INITIAL_HEAP_SIZE);
+        VMRuntime.getRuntime().setMinimumHeapSize(INITIAL_HEAP_SIZE);
 
         setContentView(R.layout.agenda_activity);
 
index 1b93b7e..69649ea 100644 (file)
@@ -27,7 +27,7 @@ import android.widget.ResourceCursorAdapter;
 import android.widget.TextView;
 
 public class AgendaAdapter extends ResourceCursorAdapter {
-    static private String mNoTitleLabel; // todo update on locale change.
+    private String mNoTitleLabel;
     private Resources mResources;
     private int mDeclinedColor;
 
index e2621c6..f245c2b 100644 (file)
@@ -100,7 +100,7 @@ public class CalendarActivity extends Activity implements Navigator {
 
         // Eliminate extra GCs during startup by setting the initial heap size to 4MB.
         // TODO: We should restore the old heap size once the activity reaches the idle state
-        long oldHeapSize = VMRuntime.getRuntime().setMinimumHeapSize(INITIAL_HEAP_SIZE);
+        VMRuntime.getRuntime().setMinimumHeapSize(INITIAL_HEAP_SIZE);
 
         setDefaultKeyMode(DEFAULT_KEYS_SHORTCUT);
         mContentResolver = getContentResolver();
index a3dad95..424e422 100644 (file)
@@ -32,7 +32,7 @@ public class CalendarApplication extends Application {
      * points to the first element in the list (the most recently visited
      * screen).
      */
-    /* package */ class Screen {
+    static class Screen {
         public int id;
         public Screen next;
         public Screen previous;
index 38185a1..1614299 100644 (file)
@@ -103,7 +103,7 @@ public class CalendarView extends View
 
     private ContinueScroll mContinueScroll = new ContinueScroll();
 
-    private class DayHeader{
+    static private class DayHeader{
         int cell;
         String dateString;
     }
index d0693fa..bf27a9e 100644 (file)
@@ -52,8 +52,6 @@ import android.widget.Button;
  * {@link #delete()} multiple times).
  */
 public class DeleteEventHelper {
-    
-    private static final String TAG = "DeleteEventHelper";
     private final Activity mParent;
     private final ContentResolver mContentResolver;
     
index 1c69b65..86097d3 100644 (file)
@@ -350,7 +350,7 @@ public class EditEvent extends Activity implements View.OnClickListener,
         }
     }
 
-    private class CalendarsAdapter extends ResourceCursorAdapter {
+    static private class CalendarsAdapter extends ResourceCursorAdapter {
         public CalendarsAdapter(Context context, Cursor c) {
             super(context, R.layout.calendars_item, c);
             setDropDownViewResource(R.layout.calendars_dropdown_item);
index c15e5b5..9061cda 100644 (file)
@@ -113,7 +113,8 @@ public class Event implements Comparable, Cloneable {
     private static final int MIDNIGHT_IN_MINUTES = 24 * 60;
 
     @Override
-    public final Object clone() {
+    public final Object clone() throws CloneNotSupportedException {
+        super.clone();
         Event e = new Event();
 
         e.title = title;
index 48702bc..ec684a4 100644 (file)
@@ -547,7 +547,7 @@ public class EventInfoActivity extends Activity implements View.OnClickListener,
             values.put(Events.SELF_ATTENDEE_STATUS, status);
             
             // Create a recurrence exception
-            Uri newUri = cr.insert(Events.CONTENT_URI, values);
+            cr.insert(Events.CONTENT_URI, values);
         } finally {
             cursor.close();
         }
@@ -582,7 +582,6 @@ public class EventInfoActivity extends Activity implements View.OnClickListener,
             return;
         }
         Resources res = getResources();
-        ContentResolver cr = getContentResolver();
 
         String eventName = mEventCursor.getString(EVENT_INDEX_TITLE);
         if (eventName == null || eventName.length() == 0) {
index c4f5fde..c5a125d 100644 (file)
@@ -60,11 +60,9 @@ public class IcsImportActivity extends Activity {
         }
     }
 
-    private View mView;
     private Button mImportButton;
     private Button mCancelButton;
     private Spinner mCalendars;
-    private ImageView mCalendarIcon;
     private TextView mNumEvents;
 
     private ICalendar.Component mCalendar = null;
@@ -86,9 +84,7 @@ public class IcsImportActivity extends Activity {
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         setContentView(R.layout.ics_import_activity);
-        mView = findViewById(R.id.import_ics);
 
-        mCalendarIcon = (ImageView) findViewById(R.id.calendar_icon);
         mCalendars = (Spinner) findViewById(R.id.calendars);
         populateCalendars();
 
index 89b07ec..9bb8667 100644 (file)
@@ -195,7 +195,7 @@ public class MonthActivity extends Activity implements ViewSwitcher.ViewFactory,
 
         // Eliminate extra GCs during startup by setting the initial heap size to 4MB.
         // TODO: We should restore the old heap size once the activity reaches the idle state
-        long oldHeapSize = VMRuntime.getRuntime().setMinimumHeapSize(INITIAL_HEAP_SIZE);
+        VMRuntime.getRuntime().setMinimumHeapSize(INITIAL_HEAP_SIZE);
 
         setContentView(R.layout.month_activity);
         mContentResolver = getContentResolver();
index 6f0d775..548fc1c 100644 (file)
@@ -30,7 +30,7 @@ import java.util.Calendar;
  */
 public class FormatDateRangeTest extends AndroidTestCase {
 
-    private class DateTest {
+    static private class DateTest {
         public Time date1;
         public Time date2;
         public int flags;
index 6b3774b..01f5746 100644 (file)
@@ -29,7 +29,7 @@ import android.util.Log;
  */
 public class WeekNumberTest extends AndroidTestCase {
 
-    private class DateAndWeekNumber {
+    static private class DateAndWeekNumber {
         public Time date;
         public Time allDayDate;
         public int expectedWeekNumber;