Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*    */ package org.jboss.aop.util;
 /*    */ 
 /*    */ import java.lang.reflect.Constructor;
 /*    */ import java.util.Comparator;
 /*    */ 
 /*    */ public class ConstructorComparator
 /*    */   implements Comparator
 /*    */ {
 /* 38 */   public static final Comparator INSTANCE = new ConstructorComparator();
/*    */ 
/*    */   private int compare(Constructor m1Constructor m2) {
/*    */     try {
/* 42 */       Class[] args1 = m1.getParameterTypes();
/* 43 */       Class[] args2 = m2.getParameterTypes();
/* 44 */       if (args1.length < args2.length) return -1;
/* 45 */       if (args1.length > args2.length) return 1;
/* 46 */       for (int i = 0; i < args1.length; i++) {
/* 47 */         int result = args1[i].getName().compareTo(args2[i].getName());
/*    */ 
/* 49 */         if (result != 0) return result; 
/*    */       }
/*    */     }
/*    */     catch (Exception e)
/*    */     {
/* 53 */       throw new RuntimeException(e);
/*    */     }
/*    */ 
/* 56 */     throw new Error();
/*    */   }
/*    */ 
/*    */   public int compare(Object o1Object o2) {
/* 60 */     return compare((Constructor)o1, (Constructor)o2);
/*    */   }
/*    */ }
/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/jboss-embedded-all.jar
 * Qualified Name:     org.jboss.aop.util.ConstructorComparator
 * JD-Core Version:    0.6.0
 */
New to GrepCode? Check out our FAQ X