org.openide.nodes.FilterNode.hashCodeLogging()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(69)

本文整理了Java中org.openide.nodes.FilterNode.hashCodeLogging()方法的一些代码示例,展示了FilterNode.hashCodeLogging()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FilterNode.hashCodeLogging()方法的具体详情如下:
包路径:org.openide.nodes.FilterNode
类名称:FilterNode
方法名:hashCodeLogging

FilterNode.hashCodeLogging介绍

[英]Method for tracing the issue 46993. Counts the depth of execution and if larger than 1000 throws debugging exception.
[中]跟踪问题的方法46993。计算执行深度,如果大于1000,则引发调试异常。

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-nodes

/** Hash by original nodes.
* Note that for subclasses of <code>FilterNode</code>, or filter nodes with non-default children,
* the hash reverts to the identity hash code.
* @return the delegated hash code
*/
@Override
public int hashCode() {
  try {
    assert hashCodeLogging(true) : ""; // NOI18N
    int result = isDefault() ? original.hashCode() : System.identityHashCode(this);
    assert hashCodeLogging(false) : ""; // NOI18N
    return result;
  } catch (StackError err) {
    err.add(this);
    throw err;
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Hash by original nodes.
* Note that for subclasses of <code>FilterNode</code>, or filter nodes with non-default children,
* the hash reverts to the identity hash code.
* @return the delegated hash code
*/
public int hashCode () {
  try {
    assert hashCodeLogging (true) : ""; // NOI18N
    // [pnejedly] identityHashCode used as workaround of JDK bug
    // see issue #46993
    int result = isDefault () ? original.hashCode () : System.identityHashCode(this);
    assert hashCodeLogging (false) : ""; // NOI18N
    return result;
  } catch (StackError err) {
    err.add (this);
    throw err;
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Hash by original nodes.
* Note that for subclasses of <code>FilterNode</code>, or filter nodes with non-default children,
* the hash reverts to the identity hash code.
* @return the delegated hash code
*/
public int hashCode () {
  try {
    assert hashCodeLogging (true) : ""; // NOI18N
    // [pnejedly] identityHashCode used as workaround of JDK bug
    // see issue #46993
    int result = isDefault () ? original.hashCode () : System.identityHashCode(this);
    assert hashCodeLogging (false) : ""; // NOI18N
    return result;
  } catch (StackError err) {
    err.add (this);
    throw err;
  }
}

相关文章

微信公众号

最新文章

更多