/** provoke hits */ public void testDateFormats() { // test 1 DateFormat tFrm1 = frmStatic; // should fire if (tFrm1.equals(frmStatic)) // hide from unused variable detector; // should fire System.out.println("Frm1 equals frmStatic"); // test 2 DateFormat tFrm2 = getFrm(); if (System.currentTimeMillis() < 1L) return; // some other code in between if (tFrm2.equals(frmStatic)) return; // should fire // test 3 DateFormat tCal3 = frmInstance; tCal3.setLenient(true); // should not fire // test 4 DateFormat tCal4 = frmStatic2; // should fire int tInt = 1; // some other code in between boolean tBoolean = false; // some other code in between Object tObj = new Object(); // some other code in between if (tObj.hashCode() > 0) return; // some other code in between tCal4.setLenient(true); // should fire tCal4 = new SimpleDateFormat(); tCal4.setLenient(true); // should not fire }
/** * Compares the specified object with this simple date format and indicates * if they are equal. In order to be equal, {@code object} must be an * instance of {@code SimpleDateFormat} and have the same {@code DateFormat} * properties, pattern, {@code DateFormatSymbols} and creation year. * * @param object * the object to compare with this object. * @return {@code true} if the specified object is equal to this simple date * format; {@code false} otherwise. * @see #hashCode */ @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof SimpleDateFormat)) { return false; } SimpleDateFormat simple = (SimpleDateFormat) object; return super.equals(object) && pattern.equals(simple.pattern) && formatData.equals(simple.formatData); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; Builder builder = (Builder) o; return excludeFieldsWithoutExposeAnnotation == builder.excludeFieldsWithoutExposeAnnotation && disableHtmlEscaping == builder.disableHtmlEscaping && dateFormat.get().equals(builder.dateFormat.get()) && (fieldNamingStrategy != null ? fieldNamingStrategy.equals(builder.fieldNamingStrategy) : builder.fieldNamingStrategy == null) && (version != null ? version.equals(builder.version) : builder.version == null) && (serializationExclusionStrategies != null ? serializationExclusionStrategies.equals(builder.serializationExclusionStrategies) : builder.serializationExclusionStrategies == null) && (deserializationExclusionStrategies != null ? deserializationExclusionStrategies.equals(builder.deserializationExclusionStrategies) : builder.deserializationExclusionStrategies == null); }
/** * Overrides equals. * @stable ICU 2.0 */ public boolean equals(Object obj) { try { return dateFormat.equals(((DateFormat)obj).dateFormat); } catch (Exception e) { return false; } }
/** * Overrides equals. * @stable ICU 2.0 */ public boolean equals(Object obj) { try { return dateFormat.equals(((DateFormat)obj).dateFormat); } catch (Exception e) { return false; } }
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } final CalendarDateFormat that = (CalendarDateFormat) o; return lenient == that.lenient && pattern.equals(that.pattern) && timeZone.equals(that.timeZone); }
/** * Tests this formatter for equality with an arbitrary object. * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof QuarterDateFormat)) { return false; } QuarterDateFormat that = (QuarterDateFormat) obj; if (!Arrays.equals(this.quarters, that.quarters)) { return false; } if (this.quarterFirst != that.quarterFirst) { return false; } return super.equals(obj); }
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } final CalendarDateFormat that = (CalendarDateFormat) o; return lenient == that.lenient && pattern.equals(that.pattern) && timeZone.equals(that.timeZone); }
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } final CalendarDateFormat that = (CalendarDateFormat) o; return lenient == that.lenient && pattern.equals(that.pattern) && timeZone.equals(that.timeZone); }
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } final CalendarDateFormat that = (CalendarDateFormat) o; return lenient == that.lenient && pattern.equals(that.pattern) && timeZone.equals(that.timeZone); }
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } final CalendarDateFormat that = (CalendarDateFormat) o; if (lenient != that.lenient) { return false; } if (!pattern.equals(that.pattern)) { return false; } if (!timeZone.equals(that.timeZone)) { return false; } return true; }
/** * Compares the given object with this <code>SimpleDateFormat</code> for * equality. * * @return true if the given object is equal to this * <code>SimpleDateFormat</code> */ public boolean equals(Object obj) { if (!super.equals(obj)) return false; // super does class check SimpleDateFormat that = (SimpleDateFormat) obj; return (pattern.equals(that.pattern) && formatData.equals(that.formatData)); }
/** * Compares the given object with this <code>SimpleDateFormat</code> for * equality. * * @return true if the given object is equal to this * <code>SimpleDateFormat</code> */ public boolean equals(Object obj) { if (!super.equals(obj)) return false; // super does class check SimpleDateFormat that = (SimpleDateFormat) obj; return (pattern.equals(that.pattern) && formatData.equals(that.formatData)); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; Builder builder = (Builder) o; return excludeFieldsWithoutExposeAnnotation == builder.excludeFieldsWithoutExposeAnnotation && disableHtmlEscaping == builder.disableHtmlEscaping && dateFormat.get().equals(builder.dateFormat.get()) && (fieldNamingStrategy != null ? fieldNamingStrategy.equals(builder.fieldNamingStrategy) : builder.fieldNamingStrategy == null) && (version != null ? version.equals(builder.version) : builder.version == null) && (serializationExclusionStrategies != null ? serializationExclusionStrategies.equals(builder.serializationExclusionStrategies) : builder.serializationExclusionStrategies == null) && (deserializationExclusionStrategies != null ? deserializationExclusionStrategies.equals(builder.deserializationExclusionStrategies) : builder.deserializationExclusionStrategies == null); }
/** * Compares the specified object with this simple date format and indicates * if they are equal. In order to be equal, {@code object} must be an * instance of {@code SimpleDateFormat} and have the same {@code DateFormat} * properties, pattern, {@code DateFormatSymbols} and creation year. * * @param object * the object to compare with this object. * @return {@code true} if the specified object is equal to this simple date * format; {@code false} otherwise. * @see #hashCode */ @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof SimpleDateFormat)) { return false; } SimpleDateFormat simple = (SimpleDateFormat) object; return super.equals(object) && pattern.equals(simple.pattern) && formatData.equals(simple.formatData); }
/** * Compares the specified object with this simple date format and indicates * if they are equal. In order to be equal, {@code object} must be an * instance of {@code SimpleDateFormat} and have the same {@code DateFormat} * properties, pattern, {@code DateFormatSymbols} and creation year. * * @param object * the object to compare with this object. * @return {@code true} if the specified object is equal to this simple date * format; {@code false} otherwise. * @see #hashCode */ @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof SimpleDateFormat)) { return false; } SimpleDateFormat simple = (SimpleDateFormat) object; return super.equals(object) && pattern.equals(simple.pattern) && formatData.equals(simple.formatData); }
/** * Compares the specified object with this simple date format and indicates * if they are equal. In order to be equal, {@code object} must be an * instance of {@code SimpleDateFormat} and have the same {@code DateFormat} * properties, pattern, {@code DateFormatSymbols} and creation year. * * @param object * the object to compare with this object. * @return {@code true} if the specified object is equal to this simple date * format; {@code false} otherwise. * @see #hashCode */ @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof SimpleDateFormat)) { return false; } SimpleDateFormat simple = (SimpleDateFormat) object; return super.equals(object) && pattern.equals(simple.pattern) && formatData.equals(simple.formatData); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; Row other = (Row) obj; if (columnMap == null) { if (other.columnMap != null) return false; } else if (!columnMap.equals(other.columnMap)) return false; if (dateFormat == null) { if (other.dateFormat != null) return false; } else if (!dateFormat.equals(other.dateFormat)) return false; return true; }
public boolean equals(Object obj) { Capturer.capture(Instrumenter.CAPTURE_ID_JAVA_TEXT_DATEFORMAT, this, "equals", "(Ljava/lang/Object;)Z", new Object[] {obj}); boolean ret = super.equals(obj); Capturer.enable(Instrumenter.CAPTURE_ID_JAVA_TEXT_DATEFORMAT, this, ret); return ret; }
public static String getDateWidget(String fieldId, String name) { String calType = "2"; // default to US DateWidgetFormat format = new DateWidgetFormat(); if (format.getLocaleDateFormat().equals(DateWidgetFormat.DD_MM_YYYY())) { calType = "1"; // European type } String javascript = "javascript:var cal"+fieldId+" = new calendar"+calType+ "(document.getElementById('"+name+"'));cal"+fieldId+".year_scroll = true;cal"+fieldId+ ".time_comp = false;cal"+fieldId+".popup('','/jsf-resource/inputDate/')"; return javascript; }