List of usage examples for java.util ConcurrentModificationException printStackTrace
public void printStackTrace()
From source file:org.iota.wallet.ui.adapter.TangleExplorerTransactionsCardAdapter.java
public void filter(final List<Transaction> coolTransactions, String searchText) { final String sText = searchText.toLowerCase(); final List<Transaction> filteredCoolTransactionList = new ArrayList<>(); new Thread(() -> { try {/*from w w w . j a va2 s . com*/ for (Transaction coolTransaction : coolTransactions) { List<String> list = new ArrayList<>(); list.add(coolTransaction.getAddress().toLowerCase()); list.add(coolTransaction.getBundle().toLowerCase()); list.add(coolTransaction.getHash().toLowerCase()); list.add(String.valueOf(coolTransaction.getValue()).toLowerCase()); list.add(coolTransaction.getTag().toLowerCase()); for (String str : list) { if (str.trim().contains(sText)) { filteredCoolTransactionList.add(coolTransaction); break; } } } ((Activity) context).runOnUiThread(() -> setAdapterList(filteredCoolTransactionList)); } catch (ConcurrentModificationException e) { e.printStackTrace(); } }).start(); }
From source file:com.google.cloud.solutions.griddler.android.ui.game.BoardView.java
/** * Notifies the game manager that a letter has been selected if the coordinates are in fact where * a letter exists/* w ww . j a v a 2 s.co m*/ */ @Override public void onTouchMove(int x, int y) { try { for (LetterView letterView : letterViews) { if (letterView != null) { if (isViewContains(letterView, x, y)) { gameManager.onLetterSelected(letterView.getLetterLocation()); } } } } catch (ConcurrentModificationException e) { Log.e(LOG_TAG, "onTouchMove", e); e.printStackTrace(); } }
From source file:com.google.cloud.solutions.griddler.android.ui.game.BoardView.java
/** * Resets the letters//from w w w .java 2 s .co m */ @Override public void onQuestionAnswered() { try { for (LetterView letterView : letterViews) { if (letterView != null) { letterView.reset(); } } } catch (ConcurrentModificationException e) { Log.e(LOG_TAG, "onQuestionAnswered", e); e.printStackTrace(); } updateLetterUI(); }
From source file:com.google.cloud.solutions.griddler.android.ui.game.BoardView.java
/** * Resets the letters/*from ww w .j ava 2 s. c o m*/ */ @Override public void onQuestionSkipped() { try { for (LetterView letterView : letterViews) { if (letterView != null) { letterView.reset(); } } } catch (ConcurrentModificationException e) { Log.e(LOG_TAG, "onQuestionSkipped", e); e.printStackTrace(); } updateLetterUI(); }
From source file:com.moziy.hollerback.bitmap.ImageCache.java
/** * @param options//from w w w .j a va2 s .co m * - BitmapFactory.Options with out* options populated * @return Bitmap that case be used for inBitmap */ protected Bitmap getBitmapFromReusableSet(BitmapFactory.Options options) { Bitmap bitmap = null; try { if (mReusableBitmaps != null && !mReusableBitmaps.isEmpty()) { final Iterator<SoftReference<Bitmap>> iterator = mReusableBitmaps.iterator(); Bitmap item; while (iterator.hasNext()) { item = iterator.next().get(); if (null != item && item.isMutable()) { // Check to see it the item can be used for inBitmap if (canUseForInBitmap(item, options)) { bitmap = item; // Remove from reusable set so it can't be used // again iterator.remove(); break; } } else { // Remove from the set if the reference has been // cleared. iterator.remove(); } } } } catch (ConcurrentModificationException e) { e.printStackTrace(); } return bitmap; }
From source file:org.energy_home.jemma.ah.internal.zigbee.InstallationStatus.java
private void unregisterAllDevices() { Set keys = ieee2sr.keySet();/*from ww w . ja v a2 s . c o m*/ for (Iterator iterator = keys.iterator(); iterator.hasNext();) { try { String nodePid = (String) iterator.next(); Vector deviceRegs = (Vector) this.ieee2sr.get(nodePid); if (deviceRegs != null) { this.ieee2devices.remove(nodePid); for (Iterator iterator2 = deviceRegs.iterator(); iterator2.hasNext();) { ServiceRegistration deviceReg = (ServiceRegistration) iterator2.next(); deviceReg.unregister(); } } } catch (ConcurrentModificationException e) { e.printStackTrace(); return; } } ieee2sr.clear(); }