解释java.lang.NoSuchMethodError消息

编程入门 行业动态 更新时间:2024-10-09 10:20:28
本文介绍了解释java.lang.NoSuchMethodError消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我收到以下运行时错误消息(以及堆栈跟踪的第一行,指向第94行)。我试图弄清楚为什么它说不存在这样的方法。

I get the following runtime error message (along with the first line of the stack trace, which points to line 94). I'm trying to figure out why it says no such method exists.

java.lang.NoSuchMethodError: com.sun.tools.doclets.formats.html.SubWriterHolderWriter.printDocLinkForMenu( ILcom/sun/javadoc/ClassDoc;Lcom/sun/javadoc/MemberDoc; Ljava/lang/String;Z)Ljava/lang/String; at com.sun.tools.doclets.formats.html.AbstractExecutableMemberWriter.writeSummaryLink( AbstractExecutableMemberWriter.java:94)

writeSummaryLink第94行如下所示。

Line 94 of writeSummaryLink is shown below.

问题 什么ILcom或Z是什么意思? 为什么括号中有四种类型(ILcom / sun / javadoc / ClassDoc; Lcom / sun / javadoc / MemberDoc; Ljava / lang / String; Z)和括号后面的一个 Ljava / lang / String;当方法printDocLinkForMenu显然有五个参数时?

QUESTIONS What does "ILcom" or "Z" mean? Why there are four types in parentheses (ILcom/sun/javadoc/ClassDoc;Lcom/sun/javadoc/MemberDoc;Ljava/lang/String;Z) and one after the parentheses Ljava/lang/String; when the method printDocLinkForMenu clearly has five parameters?

代码详细信息 writeSummaryLink方法是:

CODE DETAIL The writeSummaryLink method is:

protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) { ExecutableMemberDoc emd = (ExecutableMemberDoc)member; String name = emd.name(); writer.strong(); writer.printDocLinkForMenu(context, cd, (MemberDoc) emd, name, false); // 94 writer.strongEnd(); writer.displayLength = name.length(); writeParameters(emd, false); }

以下是94行方法:

public void printDocLinkForMenu(int context, ClassDoc classDoc, MemberDoc doc, String label, boolean strong) { String docLink = getDocLink(context, classDoc, doc, label, strong); print(deleteParameterAnchors(docLink)); }

推荐答案

来自第4.3.2节 :

Character Type Interpretation ------------------------------------------ B byte signed byte C char Unicode character D double double-precision floating-point value F float single-precision floating-point value I int integer J long long integer L<classname>; reference an instance of class S short signed short Z boolean true or false [ reference one array dimension

来自第4.3节。 3,方法描述符:

方法描述符表示方法采用的参数及其返回的值:

A method descriptor represents the parameters that the method takes and the value that it returns:

MethodDescriptor: ( ParameterDescriptor* ) ReturnDescriptor

因此,

(ILcom / sun / javadoc / ClassDoc; Lcom / sun / javadoc / MemberDoc; Ljava / lang / String; Z) Ljava / lang / String;

转换为:

int , ClassDoc 的方法, MemberDoc , String 和 boolean 作为参数,以及返回字符串。请注意,只有参考参数用分号分隔,因为分号是其字符表示的一部分。

A method with int, ClassDoc, MemberDoc, String and boolean as parameters, and which returns a String. Note that only reference parameters are separated with a semicolon, since the semicolon is part of their character representation.

所以,总结一下:

为什么括号中有四种类型(ILcom / sun / javadoc / ClassDoc; Lcom / sun / javadoc / MemberDoc; Ljava / lang / String; Z)和一个括号后面的Ljava / lang / String;当方法printDocLinkForMenu显然有五个参数?

Why there are four types in parentheses (ILcom/sun/javadoc/ClassDoc;Lcom/sun/javadoc/MemberDoc;Ljava/lang/String;Z) and one after the parentheses Ljava/lang/String; when the method printDocLinkForMenu clearly has five parameters?

有五个参数(int,ClassDoc,MemberDoc,String,boolean)和一个返回type(String)。

There are five parameters (int, ClassDoc, MemberDoc, String, boolean) and one return type (String).

更多推荐

解释java.lang.NoSuchMethodError消息

本文发布于:2023-11-25 11:40:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629600.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:消息   java   lang   NoSuchMethodError

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!