タグ

javaとByteCodeに関するoinumeのブックマーク (6)

  • JBE - Java Bytecode Editor

    JBE is a bytecode editor suitable for viewing and modifying java class files. It is built on top of the open-source jclasslib bytecode viewer by ej-technologies. For verification and exporting the class files, JBE uses the the Bytecode Engineering Library by Apache's Jakarta project. JBE requires Java 1.5 to run. It uses the standard mnemonics for JVM opcodes as instruction names. Jumps are absolu

    JBE - Java Bytecode Editor
  • Javaバイトコードの読み方 - プログラマーの脳みそ

    Javaのデバッグをしていて、ステップ実行中にステップインを繰り返したらソースコードのないところに行き当たったことがあるだろう。あるいはEclipseでF3キーでクラスやメソッド・フィールドの宣言元を辿っていってソースコードのないところに行き当たったことがあるだろう。 Eclipseの場合、"Class File Editor"というものが開く。そこにはJavaのバイトコードのニーモニックがズラズラと並んでいて、「これは読めないや、ワケが分からない」と投げ出してしまったりしていないだろうか。 怖がることはない。ちょっとコツを掴めばすぐに読めるようになる。 Class File Editorの開き方 自前のJavaクラスの場合、ビルドして出来上がったclassファイルを開く必要がある。"Package Explorer"だとclassファイルは隠されていて見えないのでWindow -> Sh

    Javaバイトコードの読み方 - プログラマーの脳みそ
  • cglibを使って動的コード生成 - KuniWiki

    ページの趣旨 † jparsecみてたら、動的ソースコード生成のライブラリであるcglibを使っており 興味が湧いたのでまとめてみる ついでに、サンプルのコードの説明がなかったので、自分で説明を試みてみる。 SpringやらHibernateなんかに内部的に使われているライブラリーらしい。 ↑ インタフェース定義するだけでPOJO的なインスタンスを生成するサンプル † net.sf.cglib.core.KeyFactory?のすごいのは、なんといっても、インタフェースのnewInstanceメソッドを定義するだけで、これまでのPOJOのgetterやらsetterやらの記述を省略できるのがすごいです。 http://cglib.sourceforge.net/xref/samples/KeySample.html package samples; import net.sf.cglib

  • BTrace — Project Kenai

    BTrace is a safe, dynamic tracing tool for the Java platform. BTrace can be used to dynamically trace a running Java program (similar to DTrace for OpenSolaris applications and OS). BTrace dynamically instruments the classes of the target application to inject tracing code ("bytecode tracing"). Tracing code is expressed in Java programming language. There is also integration with DTrace for the Op

  • Dynamic Java Bytecode Manipulation Framework Comparison

    Analysis of bytecode libraries As I can tell from the answers you got here and ones in the questions that you have looked at, these answers do not formally address the question in the explicit manner you have stated. You asked for a comparison, meanwhile these answers have vaguely stated what one might want based on what your target is (e.g. Do you need to know bytecode? [y/n]), or are too narrow.

    Dynamic Java Bytecode Manipulation Framework Comparison
  • BytemanによるJava黒魔術 - nekop's blog

    クリスマスも近いですね。さて、クリスマスといえばどういうわけか黒魔術への需要が一気に高まる時期のようですので、Java Advent Calendar -ja 2010の12月20日はJavaの黒魔術をお送りします。昨日はid:celitanでした。 今日紹介する黒魔術はバイトコードインジェクションツールであるBytemanです。 この前ですね、お仕事で「HTTPレスポンスのヘッダが勝手に想定外のものに書き換わる」という不思議現象の相談を受けたんですね。Servletの中ではsetHeader("Foo", "bar")ってしてるのに、実際のレスポンスは"Foo: hoge"とか返ってる。アプリのJavaソース調べてもそんなことしてなさそうだし、Tomcatのソース見てもsetHeader()呼び出しでは何のログも出さないっぽいのでログを有効にしても原因がわからなさそう。なんだこれはとか思

    BytemanによるJava黒魔術 - nekop's blog
  • 1