List of usage examples for org.apache.http.util LangUtils equals
public static boolean equals(Object[] objArr, Object[] objArr2)
From source file:org.nuclos.client.common.NuclosCollectableStateComboBox.java
private StateSearchConditionVO getStateSearchCondition(ComparisonOperator compop, String sComparand) { if (sComparand.matches("[0-9*%]+")) { return new StateSearchConditionVO(getStatusNumeral(), null, sComparand); } else {//from www . ja va2 s . c o m for (int i = 0; i < getJComboBox().getModel().getSize(); i++) { try { CollectableValueField cvif = (CollectableValueField) getJComboBox().getModel() .getSelectedItem(); if (getJComboBox().getModel().getElementAt(i) != null && cvif != null && LangUtils.equals(sComparand, cvif.getValue())) { // Es wurde ein Eintrag aus der Liste gew\u00e4hlt if (compop.equals(ComparisonOperator.EQUAL) || compop.equals(ComparisonOperator.NOT_EQUAL) || compop.equals(ComparisonOperator.LIKE) || compop.equals(ComparisonOperator.NOT_LIKE)) { // Suche \u00fcber Name final String sStatusName = sComparand.substring(sComparand.indexOf(" ") + 1); return new StateSearchConditionVO(getStatus(), null, sStatusName); } else { // Suche \u00fcber Numeral final String sStatusNumeral = sComparand.substring(0, sComparand.indexOf(" ")); return new StateSearchConditionVO(getStatusNumeral(), null, sStatusNumeral); } } } catch (ClassCastException cce) { //first NULL Entry is by Default a ValueIdField... ignore } } return new StateSearchConditionVO(getStatus(), null, sComparand); } }
From source file:org.apache.http.impl.conn.BasicHttpClientConnectionManager.java
synchronized HttpClientConnection getConnection(final HttpRoute route, final Object state) { Asserts.check(!this.shutdown, "Connection manager has been shut down"); if (this.log.isDebugEnabled()) { this.log.debug("Get connection for route " + route); }/* w w w. j a v a2s . c om*/ Asserts.check(!this.leased, "Connection is still allocated"); if (!LangUtils.equals(this.route, route) || !LangUtils.equals(this.state, state)) { closeConnection(); } this.route = route; this.state = state; checkExpiry(); if (this.conn == null) { this.conn = this.connFactory.create(route, this.connConfig); } this.leased = true; return this.conn; }
From source file:org.apache.http.impl.conn.tsccm.RouteSpecificPool.java
/** * Obtains a free entry from this pool, if one is available. * * @return an available pool entry, or <code>null</code> if there is none *//* w ww .j a va 2 s . c o m*/ public BasicPoolEntry allocEntry(final Object state) { if (!freeEntries.isEmpty()) { final ListIterator<BasicPoolEntry> it = freeEntries.listIterator(freeEntries.size()); while (it.hasPrevious()) { final BasicPoolEntry entry = it.previous(); if (entry.getState() == null || LangUtils.equals(state, entry.getState())) { it.remove(); return entry; } } } if (getCapacity() == 0 && !freeEntries.isEmpty()) { final BasicPoolEntry entry = freeEntries.remove(); entry.shutdownEntry(); final OperatedClientConnection conn = entry.getConnection(); try { conn.close(); } catch (final IOException ex) { log.debug("I/O error closing connection", ex); } return entry; } return null; }