[YMIR-136] Collectionのインジェクション時にHotdeployが正しく行われない。 Created: 2007-10-11  Updated: 2007-10-12  Resolved: 2007-10-11

Status: Closed
Project: Ymir
Component/s: ymir-core
Affects Version/s: 0.9.1
Fix Version/s: 0.9.2

Type: Bug Priority: Major
Reporter: Yumeto Yamagishi Assignee: skirnir
Resolution: Fixed Votes: 0
Labels: None


 Description   

Hotdeployが有効な状態で、Collectionのインスタンスを@Inアノテーションを付加してPageにインジェクションすると、その要素を取得しようとしたときにClassCastExceptionが発生する。

原因:
org.seasar.ymir.ScopeAttribute#injectTo(Object component) 内で、Hotdeployを適用する条件を以下のように実装しているため。(ラップしている一番外側のタイプしか見ていないため。)

if (value != null
&& YmirContext.isUnderDevelopment()
&& !writeMethod_.getParameterTypes()[0]
.isAssignableFrom(value.getClass()))

{ // 開発時はHotdeployのせいで見かけ上型が合わないことがありうる。 // そのため開発時で見かけ上型が合わない場合はオブジェクトを再構築する。 value = hotdeployManager_.fit(value); }

 Comments   
Comment by skirnir [ 2007-10-12 ]

正しく動作することが確認されたのでcloseします。

Comment by skirnir [ 2007-10-11 ]

対処しました。具体的には、isAssignableFromの処理を止めました。

Generated at Wed Apr 09 01:49:26 JST 2025 using Jira 10.5.0#10050000-sha1:9d9d098bb7b67e8dba8da380ba9c3900d82ac3cf.