Download
Magazine
Develop
Account
Download
Magazine
Develop
Login
Forgot Account/Password
Create Account
Language
Help
Language
Help
×
Login
Login Name
Password
×
Forgot Account/Password
Category:
Software
People
PersonalForge
Magazine
Wiki
Search
OSDN
>
Find Software
>
System
>
Emulators
>
iModoki
>
Ticket List/Search
>
Ticket #531
iModoki
Description
Project Summary
Developer Dashboard
Web Page
Developers
Image Gallery
List of RSS Feeds
Activity
Statistics
History
Downloads
List of Releases
Stats
Source Code
Code Repository list
CVS
View Repository
Ticket
Ticket List
Milestone List
Type List
Component List
List of frequently used tickets/RSS
Submit New Ticket
Documents
Communication
Forums
List of Forums
オープンディスカッション (9)
開発フォーラム (1)
Mailing Lists
list of ML
News
Ticket #531
Ticket List
Submit New Ticket
RSS
インターフェースによる暗黙の abstract
Open Date:
2002-08-31 13:07
Last Update:
2002-08-31 13:07
monitor
ON
OFF
Reporter:
ymakise
Owner:
(None)
Type:
Bugs
Status:
Open
Component:
(None)
MileStone:
(None)
Priority:
3
Severity:
5 - Medium
Resolution:
None
File:
None
Details
Reply
public interface Interface {
public String hello();
}
public abstract class Super implements Interface {
public void sayHello() {
String msg = hello();
System.out.println(msg);
}
}
public class Test extends Super {
public String hello() {
return "hello, world";
}
public static void main(String[] args) {
new Test().sayHello();
}
}
というようなアプリケーションがあったとして、
ふつうに処理すると、Interface#hello() は参照されていな
いからという理由で削られてしまうが、
そうすると Super#sayHello() から呼ばれている hello()
(バイトコード上では invokevirtual test1/Super/hello()
になっている)は解決できなくなり、Super.class は不正な
クラスファイルになってしまう。
対処のし方は、Interface が結果の jar に含まれるものか、
そうでないものかによって変わってくる(はず)。
Ticket History (0/0 Histories)
Attachment File List (
0
)
Attachment File List
No attachments
Edit
Add Comment
You are not logged in.
I you are not logged in, your comment will be treated as an anonymous post. »
Login
Add Comment
Preview
Submit
public String hello();
}
public abstract class Super implements Interface {
public void sayHello() {
String msg = hello();
System.out.println(msg);
}
}
public class Test extends Super {
public String hello() {
return "hello, world";
}
public static void main(String[] args) {
new Test().sayHello();
}
}
というようなアプリケーションがあったとして、
ふつうに処理すると、Interface#hello() は参照されていな
いからという理由で削られてしまうが、
そうすると Super#sayHello() から呼ばれている hello()
(バイトコード上では invokevirtual test1/Super/hello()
になっている)は解決できなくなり、Super.class は不正な
クラスファイルになってしまう。
対処のし方は、Interface が結果の jar に含まれるものか、
そうでないものかによって変わってくる(はず)。