< prev index next >

src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Property.java

Print this page

        

*** 560,571 **** return null; } @Override public int hashCode() { ! final Class<?> type = getLocalType(); ! return Objects.hashCode(this.key) ^ flags ^ getSlot() ^ (type == null ? 0 : type.hashCode()); } @Override public boolean equals(final Object other) { if (this == other) { --- 560,571 ---- return null; } @Override public int hashCode() { ! final Class<?> t = getLocalType(); ! return Objects.hashCode(this.key) ^ flags ^ getSlot() ^ (t == null ? 0 : t.hashCode()); } @Override public boolean equals(final Object other) { if (this == other) {
*** 586,596 **** return getFlags() == otherProperty.getFlags() && getSlot() == otherProperty.getSlot() && getKey().equals(otherProperty.getKey()); } ! private static final String type(final Class<?> type) { if (type == null) { return "undef"; } else if (type == int.class) { return "i"; } else if (type == long.class) { --- 586,596 ---- return getFlags() == otherProperty.getFlags() && getSlot() == otherProperty.getSlot() && getKey().equals(otherProperty.getKey()); } ! private static String type(final Class<?> type) { if (type == null) { return "undef"; } else if (type == int.class) { return "i"; } else if (type == long.class) {
*** 606,617 **** * Short toString version * @return short toString */ public final String toStringShort() { final StringBuilder sb = new StringBuilder(); ! final Class<?> type = getLocalType(); ! sb.append(getKey()).append(" (").append(type(type)).append(')'); return sb.toString(); } private static String indent(final String str, final int indent) { final StringBuilder sb = new StringBuilder(); --- 606,617 ---- * Short toString version * @return short toString */ public final String toStringShort() { final StringBuilder sb = new StringBuilder(); ! final Class<?> t = getLocalType(); ! sb.append(getKey()).append(" (").append(type(t)).append(')'); return sb.toString(); } private static String indent(final String str, final int indent) { final StringBuilder sb = new StringBuilder();
*** 623,643 **** } @Override public String toString() { final StringBuilder sb = new StringBuilder(); ! final Class<?> type = getLocalType(); sb.append(indent(getKey(), 20)). append(" id="). append(Debug.id(this)). append(" (0x"). append(indent(Integer.toHexString(flags), 4)). append(") "). append(getClass().getSimpleName()). append(" {"). ! append(indent(type(type), 5)). append('}'); if (slot != -1) { sb.append(" ["). append("slot="). --- 623,643 ---- } @Override public String toString() { final StringBuilder sb = new StringBuilder(); ! final Class<?> t = getLocalType(); sb.append(indent(getKey(), 20)). append(" id="). append(Debug.id(this)). append(" (0x"). append(indent(Integer.toHexString(flags), 4)). append(") "). append(getClass().getSimpleName()). append(" {"). ! append(indent(type(t), 5)). append('}'); if (slot != -1) { sb.append(" ["). append("slot=").
< prev index next >