2007-06-01から1ヶ月間の記事一覧

顧客が本当に欲しかったもの

name.equals(ns.getSimpleName().equals(name))共変型引数を持つ boolean equalsCovariant(X other)とかあればいいのに… (X[X := |self|]) Class getClass() があるからできるんじゃないかと。

JSR202

Java Virtual Machine SpecificationにAnnotationとStackMapの項がいつまでたっても追加されないので調べる。http://jcp.org/aboutJava/communityprocess/pr/jsr202/§4.8.16 The RuntimeVisibleAnnotations attribute 辺りからAnnotation。

いれいじゃ

普段お目にかかることがないけど、下のs[1..3]のうち一つがコンパイルエラー。 どれでしょう? public static void main(String[] args) { String s1 = f(null); String s2 = f((List) null); String s3 = f((List) null); } public static <P, R> R f(List<P> s) { r</p></p,>…

ありそうでなさそうでありえない

public class Hoge { public int foo() { return 1; } public int foo(int a, int b) { return a + b; } }に対して、// generated. 以降を自動実装。 public class Hoge { public int foo() { return 1; } public int foo(int a, int b) { return a + b; } /…

5.6.1 Unary Numeric Promotion

char c = + 'a'; // OK char d = + ('a'); // OK char e = + c; // NGunary operationでoperandがliteralのときは特殊らしい。