зеркало из https://github.com/mozilla/gecko-dev.git
Bug 722439 - Fix compiler warnings using javac 1.7. r=Cwiiis
This commit is contained in:
Родитель
28c8d7cd46
Коммит
b58cc079f3
|
@ -438,6 +438,7 @@ public class AwesomeBar extends Activity implements GeckoEventListener {
|
|||
title = cursor.getString(cursor.getColumnIndexOrThrow(URLColumns.TITLE));
|
||||
} else {
|
||||
// The history list is backed by a SimpleExpandableListAdapter
|
||||
@SuppressWarnings("rawtypes")
|
||||
Map map = (Map) selectedItem;
|
||||
title = (String) map.get(URLColumns.TITLE);
|
||||
}
|
||||
|
@ -477,7 +478,7 @@ public class AwesomeBar extends Activity implements GeckoEventListener {
|
|||
b = cursor.getBlob(cursor.getColumnIndexOrThrow(URLColumns.FAVICON));
|
||||
title = cursor.getString(cursor.getColumnIndexOrThrow(URLColumns.TITLE));
|
||||
} else if (mContextMenuSubject instanceof Map) {
|
||||
Map map = (Map)mContextMenuSubject;
|
||||
@SuppressWarnings("rawtypes") Map map = (Map)mContextMenuSubject;
|
||||
id = -1;
|
||||
url = (String)map.get(URLColumns.URL);
|
||||
b = (byte[]) map.get(URLColumns.FAVICON);
|
||||
|
|
|
@ -315,12 +315,20 @@ public class AwesomeBarTabs extends TabHost {
|
|||
}
|
||||
}
|
||||
|
||||
private class HistoryQueryTask extends AsyncTask<Void, Void, Pair<List,List>> {
|
||||
private static class GroupList extends LinkedList<Map<String,String>> {
|
||||
private static final long serialVersionUID = 0L;
|
||||
}
|
||||
|
||||
private static class ChildrenList extends LinkedList<Map<String,Object>> {
|
||||
private static final long serialVersionUID = 0L;
|
||||
}
|
||||
|
||||
private class HistoryQueryTask extends AsyncTask<Void, Void, Pair<GroupList,List<ChildrenList>>> {
|
||||
private static final long MS_PER_DAY = 86400000;
|
||||
private static final long MS_PER_WEEK = MS_PER_DAY * 7;
|
||||
|
||||
protected Pair<List,List> doInBackground(Void... arg0) {
|
||||
Pair<List,List> result = null;
|
||||
protected Pair<GroupList,List<ChildrenList>> doInBackground(Void... arg0) {
|
||||
Pair<GroupList, List<ChildrenList>> result = null;
|
||||
ContentResolver resolver = mContext.getContentResolver();
|
||||
Cursor cursor = BrowserDB.getRecentHistory(resolver, MAX_RESULTS);
|
||||
|
||||
|
@ -333,9 +341,9 @@ public class AwesomeBarTabs extends TabHost {
|
|||
|
||||
// Split the list of urls into separate date range groups
|
||||
// and show it in an expandable list view.
|
||||
List<List<Map<String,?>>> childrenLists = null;
|
||||
List<Map<String,?>> children = null;
|
||||
List<Map<String,?>> groups = null;
|
||||
List<ChildrenList> childrenLists = null;
|
||||
ChildrenList children = null;
|
||||
GroupList groups = null;
|
||||
HistorySection section = null;
|
||||
|
||||
// Move cursor before the first row in preparation
|
||||
|
@ -351,10 +359,10 @@ public class AwesomeBarTabs extends TabHost {
|
|||
HistorySection itemSection = getSectionForTime(time, today);
|
||||
|
||||
if (groups == null)
|
||||
groups = new LinkedList<Map<String,?>>();
|
||||
groups = new GroupList();
|
||||
|
||||
if (childrenLists == null)
|
||||
childrenLists = new LinkedList<List<Map<String,?>>>();
|
||||
childrenLists = new LinkedList<ChildrenList>();
|
||||
|
||||
if (section != itemSection) {
|
||||
if (section != null) {
|
||||
|
@ -363,7 +371,7 @@ public class AwesomeBarTabs extends TabHost {
|
|||
}
|
||||
|
||||
section = itemSection;
|
||||
children = new LinkedList<Map<String,?>>();
|
||||
children = new ChildrenList();
|
||||
}
|
||||
|
||||
children.add(createHistoryItem(cursor));
|
||||
|
@ -380,13 +388,13 @@ public class AwesomeBarTabs extends TabHost {
|
|||
cursor.close();
|
||||
|
||||
if (groups != null && childrenLists != null) {
|
||||
result = Pair.create((List) groups, (List) childrenLists);
|
||||
result = Pair.<GroupList,List<ChildrenList>>create(groups, childrenLists);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public Map<String,?> createHistoryItem(Cursor cursor) {
|
||||
public Map<String,Object> createHistoryItem(Cursor cursor) {
|
||||
Map<String,Object> historyItem = new HashMap<String,Object>();
|
||||
|
||||
String url = cursor.getString(cursor.getColumnIndexOrThrow(URLColumns.URL));
|
||||
|
@ -407,7 +415,7 @@ public class AwesomeBarTabs extends TabHost {
|
|||
return historyItem;
|
||||
}
|
||||
|
||||
public Map<String,?> createGroupItem(HistorySection section) {
|
||||
public Map<String,String> createGroupItem(HistorySection section) {
|
||||
Map<String,String> groupItem = new HashMap<String,String>();
|
||||
|
||||
groupItem.put(URLColumns.TITLE, getSectionName(section));
|
||||
|
@ -458,8 +466,7 @@ public class AwesomeBarTabs extends TabHost {
|
|||
return HistorySection.OLDER;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void onPostExecute(Pair<List,List> result) {
|
||||
protected void onPostExecute(Pair<GroupList,List<ChildrenList>> result) {
|
||||
// FIXME: display some sort of message when there's no history
|
||||
if (result == null)
|
||||
return;
|
||||
|
|
|
@ -304,7 +304,7 @@ public class CrashReporter extends Activity
|
|||
HashMap<String, String> responseMap = new HashMap<String, String>();
|
||||
readStringsFromReader(br, responseMap);
|
||||
|
||||
if (conn.getResponseCode() == conn.HTTP_OK) {
|
||||
if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) {
|
||||
File submittedDir = new File(SUBMITTED_DIR);
|
||||
submittedDir.mkdirs();
|
||||
minidumpFile.delete();
|
||||
|
|
|
@ -215,9 +215,9 @@ public class Favicons {
|
|||
|
||||
// Cancel any pending tasks
|
||||
Set<Long> taskIds = mLoadTasks.keySet();
|
||||
Iterator iter = taskIds.iterator();
|
||||
Iterator<Long> iter = taskIds.iterator();
|
||||
while (iter.hasNext()) {
|
||||
long taskId = (Long) iter.next();
|
||||
long taskId = iter.next();
|
||||
cancelFaviconLoad(taskId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -898,9 +898,9 @@ abstract public class GeckoApp
|
|||
if (mTabsChangedListeners == null)
|
||||
return;
|
||||
|
||||
Iterator items = mTabsChangedListeners.iterator();
|
||||
Iterator<OnTabsChangedListener> items = mTabsChangedListeners.iterator();
|
||||
while (items.hasNext()) {
|
||||
((OnTabsChangedListener) items.next()).onTabsChanged(tab);
|
||||
items.next().onTabsChanged(tab);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -307,9 +307,9 @@ public class GeckoAppShell
|
|||
if (files == null)
|
||||
return false;
|
||||
try {
|
||||
Iterator fileIterator = Arrays.asList(files).iterator();
|
||||
Iterator<File> fileIterator = Arrays.asList(files).iterator();
|
||||
while (fileIterator.hasNext()) {
|
||||
File file = (File)fileIterator.next();
|
||||
File file = fileIterator.next();
|
||||
File dest = new File(to, file.getName());
|
||||
if (file.isDirectory())
|
||||
retVal = moveDir(file, dest) ? retVal : false;
|
||||
|
@ -421,9 +421,9 @@ public class GeckoAppShell
|
|||
// remove any previously extracted libs
|
||||
File[] files = cacheFile.listFiles();
|
||||
if (files != null) {
|
||||
Iterator cacheFiles = Arrays.asList(files).iterator();
|
||||
Iterator<File> cacheFiles = Arrays.asList(files).iterator();
|
||||
while (cacheFiles.hasNext()) {
|
||||
File libFile = (File)cacheFiles.next();
|
||||
File libFile = cacheFiles.next();
|
||||
if (libFile.getName().endsWith(".so"))
|
||||
libFile.delete();
|
||||
}
|
||||
|
@ -1007,7 +1007,7 @@ public class GeckoAppShell
|
|||
String resource = imageUri.getSchemeSpecificPart();
|
||||
resource = resource.substring(resource.lastIndexOf('/') + 1);
|
||||
try {
|
||||
Class drawableClass = R.drawable.class;
|
||||
Class<R.drawable> drawableClass = R.drawable.class;
|
||||
Field f = drawableClass.getField(resource);
|
||||
icon = f.getInt(null);
|
||||
} catch (Exception e) {} // just means the resource doesn't exist
|
||||
|
@ -1715,9 +1715,9 @@ public class GeckoAppShell
|
|||
return "";
|
||||
|
||||
ArrayList<GeckoEventListener> listeners = mEventListeners.get(type);
|
||||
Iterator items = listeners.iterator();
|
||||
Iterator<GeckoEventListener> items = listeners.iterator();
|
||||
while (items.hasNext()) {
|
||||
((GeckoEventListener) items.next()).handleMessage(type, geckoObject);
|
||||
items.next().handleMessage(type, geckoObject);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -734,7 +734,7 @@ public class GeckoInputConnection
|
|||
InputMethodManager imm = (InputMethodManager)
|
||||
v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.toggleSoftInputFromWindow(v.getWindowToken(),
|
||||
imm.SHOW_FORCED, 0);
|
||||
InputMethodManager.SHOW_FORCED, 0);
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -195,11 +195,11 @@ public class LauncherShortcuts extends Activity {
|
|||
try {
|
||||
JSONObject webApps = (JSONObject) new JSONTokener(webappsJson).nextValue();
|
||||
|
||||
Iterator appKeys = webApps.keys();
|
||||
@SuppressWarnings("rawtypes") Iterator appKeys = webApps.keys();
|
||||
HashMap<String, String> map;
|
||||
|
||||
while (appKeys.hasNext()) {
|
||||
String appKey = appKeys.next().toString();
|
||||
String appKey = (String)appKeys.next();
|
||||
JSONObject app = webApps.getJSONObject(appKey);
|
||||
|
||||
map = new HashMap<String, String>();
|
||||
|
|
|
@ -306,9 +306,9 @@ public class ProfileMigrator {
|
|||
File cacheFile = GeckoAppShell.getCacheDir();
|
||||
File[] files = cacheFile.listFiles();
|
||||
if (files != null) {
|
||||
Iterator cacheFiles = Arrays.asList(files).iterator();
|
||||
Iterator<File> cacheFiles = Arrays.asList(files).iterator();
|
||||
while (cacheFiles.hasNext()) {
|
||||
File libFile = (File)cacheFiles.next();
|
||||
File libFile = cacheFiles.next();
|
||||
if (libFile.getName().endsWith(".so")) {
|
||||
libFile.delete();
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public class Restarter extends Activity {
|
|||
while (GeckoAppShell.checkForGeckoProcs() && --countdown > 0) {
|
||||
// Wait for the old process to die before we continue
|
||||
try {
|
||||
Thread.currentThread().sleep(100);
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException ie) {}
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ public class Restarter extends Activity {
|
|||
// wait for the kill to take effect
|
||||
while (GeckoAppShell.checkForGeckoProcs() && --countdown > 0) {
|
||||
try {
|
||||
Thread.currentThread().sleep(100);
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException ie) {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -203,13 +203,13 @@ public abstract class TileLayer extends Layer {
|
|||
|
||||
if (newlyCreated || dirtyRect.contains(bufferRect)) {
|
||||
if (mSize.equals(bufferSize)) {
|
||||
gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, glInfo.internalFormat, mSize.width, mSize.height,
|
||||
gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, glInfo.internalFormat, mSize.width, mSize.height,
|
||||
0, glInfo.format, glInfo.type, imageBuffer);
|
||||
return;
|
||||
} else {
|
||||
gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, glInfo.internalFormat, mSize.width, mSize.height,
|
||||
gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, glInfo.internalFormat, mSize.width, mSize.height,
|
||||
0, glInfo.format, glInfo.type, null);
|
||||
gl.glTexSubImage2D(gl.GL_TEXTURE_2D, 0, 0, 0, bufferSize.width, bufferSize.height,
|
||||
gl.glTexSubImage2D(GL10.GL_TEXTURE_2D, 0, 0, 0, bufferSize.width, bufferSize.height,
|
||||
glInfo.format, glInfo.type, imageBuffer);
|
||||
return;
|
||||
}
|
||||
|
@ -237,7 +237,7 @@ public abstract class TileLayer extends Layer {
|
|||
}
|
||||
|
||||
viewBuffer.position(position);
|
||||
gl.glTexSubImage2D(gl.GL_TEXTURE_2D, 0, 0, dirtyRect.top, bufferSize.width,
|
||||
gl.glTexSubImage2D(GL10.GL_TEXTURE_2D, 0, 0, dirtyRect.top, bufferSize.width,
|
||||
Math.min(bufferSize.height - dirtyRect.top, dirtyRect.height()),
|
||||
glInfo.format, glInfo.type, viewBuffer);
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ public class PanZoomController
|
|||
}
|
||||
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
switch (event.getAction() & event.ACTION_MASK) {
|
||||
switch (event.getAction() & MotionEvent.ACTION_MASK) {
|
||||
case MotionEvent.ACTION_DOWN: return onTouchStart(event);
|
||||
case MotionEvent.ACTION_MOVE: return onTouchMove(event);
|
||||
case MotionEvent.ACTION_UP: return onTouchEnd(event);
|
||||
|
@ -295,14 +295,14 @@ public class PanZoomController
|
|||
GeckoApp.mAppContext.hidePlugins(false /* don't hide layers */);
|
||||
// fall through
|
||||
case PANNING_HOLD_LOCKED:
|
||||
GeckoApp.mAppContext.mAutoCompletePopup.hide();
|
||||
GeckoApp.mAutoCompletePopup.hide();
|
||||
mState = PanZoomState.PANNING_LOCKED;
|
||||
// fall through
|
||||
case PANNING_LOCKED:
|
||||
track(event);
|
||||
return true;
|
||||
case PANNING_HOLD:
|
||||
GeckoApp.mAppContext.mAutoCompletePopup.hide();
|
||||
GeckoApp.mAutoCompletePopup.hide();
|
||||
mState = PanZoomState.PANNING;
|
||||
// fall through
|
||||
case PANNING:
|
||||
|
@ -749,7 +749,7 @@ public class PanZoomController
|
|||
mState = PanZoomState.PINCHING;
|
||||
mLastZoomFocus = new PointF(detector.getFocusX(), detector.getFocusY());
|
||||
GeckoApp.mAppContext.hidePlugins(false /* don't hide layers, only views */);
|
||||
GeckoApp.mAppContext.mAutoCompletePopup.hide();
|
||||
GeckoApp.mAutoCompletePopup.hide();
|
||||
cancelTouch();
|
||||
|
||||
return true;
|
||||
|
@ -852,7 +852,7 @@ public class PanZoomController
|
|||
|
||||
@Override
|
||||
public boolean onSingleTapConfirmed(MotionEvent motionEvent) {
|
||||
GeckoApp.mAppContext.mAutoCompletePopup.hide();
|
||||
GeckoApp.mAutoCompletePopup.hide();
|
||||
sendPointToGecko("Gesture:SingleTap", motionEvent);
|
||||
return true;
|
||||
}
|
||||
|
@ -869,7 +869,7 @@ public class PanZoomController
|
|||
}
|
||||
|
||||
private boolean animatedZoomTo(RectF zoomToRect) {
|
||||
GeckoApp.mAppContext.mAutoCompletePopup.hide();
|
||||
GeckoApp.mAutoCompletePopup.hide();
|
||||
|
||||
mState = PanZoomState.ANIMATED_ZOOM;
|
||||
final float startZoom = mController.getZoomFactor();
|
||||
|
|
|
@ -81,7 +81,7 @@ public class SimpleScaleGestureDetector {
|
|||
|
||||
/** Forward touch events to this function. */
|
||||
public void onTouchEvent(MotionEvent event) {
|
||||
switch (event.getAction() & event.ACTION_MASK) {
|
||||
switch (event.getAction() & MotionEvent.ACTION_MASK) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
case MotionEvent.ACTION_POINTER_DOWN:
|
||||
onTouchStart(event);
|
||||
|
|
Загрузка…
Ссылка в новой задаче