Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*    */ package net.sf.cglib.core;
 /*    */ 
 /*    */ public class DefaultNamingPolicy
 /*    */   implements NamingPolicy
 /*    */ {
 /* 31 */   public static final DefaultNamingPolicy INSTANCE = new DefaultNamingPolicy();
 /*    */ 
 /*    */   public String getClassName(String prefixString sourceObject keyPredicate names)
 /*    */   {
/* 36 */     StringBuffer sb = new StringBuffer();
/* 37 */     sb.append(prefix != null ? prefix : prefix.startsWith("java") ? "$" + prefix : "net.sf.cglib.empty.Object");
/*    */ 
/* 45 */     sb.append("$$");
/* 46 */     sb.append(source.substring(source.lastIndexOf('.') + 1));
/* 47 */     sb.append("ByCGLIB$$");
/* 48 */     sb.append(Integer.toHexString(key.hashCode()));
/* 49 */     String base = sb.toString();
/* 50 */     String attempt = base;
/* 51 */     int index = 2;
/* 52 */     while (names.evaluate(attempt)) {
/* 53 */       attempt = base + "_" + index++;
/*    */     }
/*    */ 
/* 56 */     return attempt;
/*    */   }
/*    */ }
/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/thirdparty-all.jar
 * Qualified Name:     net.sf.cglib.core.DefaultNamingPolicy
 * JD-Core Version:    0.6.0
 */
New to GrepCode? Check out our FAQ X