[Jiemamy-notify:2247] commit [3294] warning解消。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 4月 15日 (水) 22:50:39 JST


Revision: 3294
          http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=3294
Author:   daisuke_m
Date:     2009-04-15 22:50:39 +0900 (Wed, 15 Apr 2009)

Log Message:
-----------
warning解消。
thanks しげるんば

Modified Paths:
--------------
    artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/internal/enhance/FactoryExtension.java
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/enhance/ViewFactoryExtensionEnhancer.java
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/enhance/ViewFactoryExtensionEnhancer2.java


-------------- next part --------------
Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/internal/enhance/FactoryExtension.java
===================================================================
--- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/internal/enhance/FactoryExtension.java	2009-04-15 10:11:53 UTC (rev 3293)
+++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/internal/enhance/FactoryExtension.java	2009-04-15 13:50:39 UTC (rev 3294)
@@ -103,7 +103,7 @@
 	 * @throws IllegalArgumentException 引数に{@code null}を与えた場合
 	 */
 	@SuppressWarnings("unchecked")
-	public T newAdapter(Class<T> clazz) {
+	public T newAdapter(Class<? extends T> clazz) {
 		Validate.notNull(clazz);
 		T adapter;
 		if (clazz == Disablable.class) {
@@ -131,7 +131,7 @@
 	 * @throws IllegalArgumentException 引数に{@code null}を与えた場合
 	 */
 	@SuppressWarnings("unchecked")
-	public T newBuilder(Class<T> clazz, JiemamyFactory factory) {
+	public T newBuilder(Class<? extends T> clazz, JiemamyFactory factory) {
 		Validate.notNull(clazz);
 		Validate.notNull(factory);
 		T builder = null;
@@ -151,7 +151,7 @@
 	 * @return 生成されたインスタンス
 	 * @throws IllegalArgumentException 引数に{@code null}を与えた場合
 	 */
-	public T newInstance(Class<T> clazz, Jiemamy jiemamy) {
+	public T newInstance(Class<? extends T> clazz, Jiemamy jiemamy) {
 		Validate.notNull(clazz);
 		Validate.notNull(jiemamy);
 		return newInstance(clazz, jiemamy, UUID.randomUUID());
@@ -170,7 +170,7 @@
 	 * @return 生成されたインスタンス
 	 * @throws IllegalArgumentException 引数に{@code null}を与えた場合
 	 */
-	public T newInstance(Class<T> clazz, Jiemamy jiemamy, UUID id) {
+	public T newInstance(Class<? extends T> clazz, Jiemamy jiemamy, UUID id) {
 		Validate.notNull(clazz);
 		Validate.notNull(jiemamy);
 		Validate.notNull(id);

Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/enhance/ViewFactoryExtensionEnhancer.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/enhance/ViewFactoryExtensionEnhancer.java	2009-04-15 10:11:53 UTC (rev 3293)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/enhance/ViewFactoryExtensionEnhancer.java	2009-04-15 13:50:39 UTC (rev 3294)
@@ -65,7 +65,7 @@
 	public static class ViewExtention<T> extends FactoryExtension<T> {
 		
 		@Override
-		public T newInstance(Class<T> clazz, Jiemamy jiemamy, UUID id) {
+		public T newInstance(Class<? extends T> clazz, Jiemamy jiemamy, UUID id) {
 			T product = super.newInstance(clazz, jiemamy, id);
 			if (RootModel.class.isAssignableFrom(clazz)) {
 				DiagramPresentationsImpl diagramPresentations = new DiagramPresentationsImpl((RootModel) product);

Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/enhance/ViewFactoryExtensionEnhancer2.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/enhance/ViewFactoryExtensionEnhancer2.java	2009-04-15 10:11:53 UTC (rev 3293)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/enhance/ViewFactoryExtensionEnhancer2.java	2009-04-15 13:50:39 UTC (rev 3294)
@@ -31,6 +31,7 @@
 import org.jiemamy.internal.model.node.StickyModelImpl;
 import org.jiemamy.model.ConnectionProfile;
 import org.jiemamy.model.DiagramPresentationModel;
+import org.jiemamy.model.JiemamyElement;
 import org.jiemamy.model.NodeProfile;
 import org.jiemamy.model.RootModel;
 import org.jiemamy.model.attribute.constraint.ForeignKey;
@@ -49,13 +50,14 @@
  */
 public class ViewFactoryExtensionEnhancer2 implements InvocationHandler {
 	
-	private static final FactoryExtension VE = new ViewFactoryExtensionEnhancer.ViewExtention();
+	private static final FactoryExtension<JiemamyElement> VE =
+			new ViewFactoryExtensionEnhancer.ViewExtention<JiemamyElement>();
 	
 
-	@SuppressWarnings("unchecked")
 	public Object handle(Invocation invocation) throws Throwable {
 		// FactoryExtension#newInstance() -> ViewFactoryExtensionEnhancer#newInstance();
-		Class<?> clazz = (Class<?>) invocation.getArguments()[0];
+		Class<? extends JiemamyElement> clazz =
+				((Class<?>) invocation.getArguments()[0]).asSubclass(JiemamyElement.class);
 		Jiemamy jiemamy = (Jiemamy) invocation.getArguments()[1];
 		UUID id = (UUID) invocation.getArguments()[2];
 		Object enhancedResult = VE.newInstance(clazz, jiemamy, id);
@@ -75,7 +77,7 @@
 	public static class ViewExtention<T> extends FactoryExtension<T> {
 		
 		@Override
-		public T newInstance(Class<T> clazz, Jiemamy jiemamy, UUID id) {
+		public T newInstance(Class<? extends T> clazz, Jiemamy jiemamy, UUID id) {
 			T product = super.newInstance(clazz, jiemamy, id);
 			if (RootModel.class.isAssignableFrom(clazz)) {
 				DiagramPresentationsImpl diagramPresentations = new DiagramPresentationsImpl((RootModel) product);



Jiemamy-notify メーリングリストの案内
Back to archive index