Formatting

This commit is contained in:
Roman Inflianskas 2016-06-06 10:57:46 +03:00
parent a9b7e4138f
commit 9f92c83940
3 changed files with 19 additions and 20 deletions

View file

@ -182,7 +182,7 @@ public class BinaryMapAddressReaderAdapter {
}
}
codedIS.popLimit(oldLimit);
if(resultMatcher != null && resultMatcher.isCancelled()){
if (resultMatcher != null && resultMatcher.isCancelled()) {
codedIS.skipRawBytes(codedIS.getBytesUntilLimit());
}
break;
@ -233,7 +233,7 @@ public class BinaryMapAddressReaderAdapter {
int y = 0;
City c = null;
LinkedList<String> additionalTags = null;
while(true){
while (true) {
int t = codedIS.readTag();
int tag = WireFormat.getTagFieldNumber(t);
switch (tag) {
@ -263,7 +263,7 @@ public class BinaryMapAddressReaderAdapter {
case OsmandOdb.CityIndex.ATTRIBUTETAGIDS_FIELD_NUMBER :
int tgid = codedIS.readUInt32();
if(additionalTags == null) {
additionalTags = new LinkedList<String>();
additionalTags = new LinkedList<>();
}
if(additionalTagsTable != null && tgid < additionalTagsTable.size()) {
additionalTags.add(additionalTagsTable.get(tgid));
@ -577,15 +577,15 @@ public class BinaryMapAddressReaderAdapter {
do {
int st = codedIS.readTag();
stag = WireFormat.getTagFieldNumber(st);
if(stag == AddressNameIndexData.ATOM_FIELD_NUMBER) {
if (stag == AddressNameIndexData.ATOM_FIELD_NUMBER) {
int slen = codedIS.readRawVarint32();
int soldLim = codedIS.pushLimit(slen);
readAddressNameData(req, refs, fp);
codedIS.popLimit(soldLim);
} else if(stag != 0){
} else if (stag != 0){
skipUnknownField(st);
}
} while(stag != 0);
} while (stag != 0);
codedIS.popLimit(oldLim);
if (req.isCancelled()) {
@ -659,8 +659,8 @@ public class BinaryMapAddressReaderAdapter {
private void readAddressNameData(SearchRequest<MapObject> req, TIntArrayList[] refs, int fp) throws IOException {
TIntArrayList toAdd = null;
while(true){
if(req.isCancelled()){
while (true) {
if (req.isCancelled()){
return;
}
int t = codedIS.readTag();
@ -675,12 +675,12 @@ public class BinaryMapAddressReaderAdapter {
codedIS.readString();
break;
case AddressNameIndexDataAtom.SHIFTTOCITYINDEX_FIELD_NUMBER :
if(toAdd != null) {
if (toAdd != null) {
toAdd.add(fp - codedIS.readInt32());
}
break;
case AddressNameIndexDataAtom.SHIFTTOINDEX_FIELD_NUMBER :
if(toAdd != null) {
if (toAdd != null) {
toAdd.add(fp - codedIS.readInt32());
}
break;

View file

@ -176,7 +176,7 @@ public abstract class SearchByNameAbstractActivity<T> extends OsmandListActivity
});
selectAddress = getIntent() != null && getIntent().hasExtra(SELECT_ADDRESS);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
if(initializeTask != null){
if (initializeTask != null){
initializeTask.execute();
}
}
@ -286,8 +286,8 @@ public abstract class SearchByNameAbstractActivity<T> extends OsmandListActivity
protected void addObjectToInitialList(T initial){
initialListToFilter.add(initial);
if(!namesFilter.active){
if(filterObject(initial, currentFilter)) {
if (!namesFilter.active) {
if (filterObject(initial, currentFilter)) {
Message msg = uiHandler.obtainMessage(MESSAGE_ADD_ENTITY, initial);
msg.sendToTarget();
}
@ -335,7 +335,6 @@ public abstract class SearchByNameAbstractActivity<T> extends OsmandListActivity
return matches;
}
@Override
protected void onResume() {
super.onResume();
@ -394,7 +393,7 @@ public abstract class SearchByNameAbstractActivity<T> extends OsmandListActivity
@Override
public void handleMessage(Message msg) {
String currentFilter = SearchByNameAbstractActivity.this.currentFilter;
if (msg.what == MESSAGE_CLEAR_LIST){
if (msg.what == MESSAGE_CLEAR_LIST) {
minimalIndex = Integer.MAX_VALUE;
minimalText = null;
getListAdapter().clear();
@ -457,7 +456,7 @@ public abstract class SearchByNameAbstractActivity<T> extends OsmandListActivity
protected FilterResults performFiltering(CharSequence constraint) {
isCancelled = false;
String query = constraint.toString();
if(query.equals(newFilter)){
if (query.equals(newFilter)) {
active = true;
startTime = System.currentTimeMillis();
uiHandler.sendEmptyMessage(MESSAGE_CLEAR_LIST);
@ -466,7 +465,7 @@ public abstract class SearchByNameAbstractActivity<T> extends OsmandListActivity
filterLoop(query, list);
active = false;
}
if(!isCancelled){
if (!isCancelled) {
return new FilterResults();
}

View file

@ -127,9 +127,9 @@ public class SearchStreetByNameActivity extends SearchByNameAbstractActivity<Str
protected void filterLoop(String query, Collection<Street> list) {
if(searchWithCity == -1){
filter(query, list);
} else if(searchWithCity == 0){
} else if (searchWithCity == 0) {
for (Street obj : list) {
if(namesFilter.isCancelled){
if (namesFilter.isCancelled) {
break;
}
if(filterObject(obj, query)){
@ -143,7 +143,7 @@ public class SearchStreetByNameActivity extends SearchByNameAbstractActivity<Str
@Override
public boolean publish(MapObject object) {
if (object instanceof Street) {
if(city == null ||
if (city == null ||
MapUtils.getDistance(city.getLocation(), object.getLocation()) < 100*1000) {
Message msg = uiHandler.obtainMessage(MESSAGE_ADD_ENTITY, object);
msg.sendToTarget();