[jboss-dev-forums] [Design of POJO Server] - Re: Various performance issues in core projects

alesj do-not-reply at jboss.com
Sun May 10 06:06:54 EDT 2009


"alesj" wrote : 
  | 3) ObjectName quote
  | 
  | I see a different code in CDC:
  | 
  |   |          name = name.replace("\"", """);
  |   |          String temp = "jboss.deployment:id=\"" + name + "\",type=Component";
  |   | 
  | where I don't see a " in your code.
  | 
Ah, the forum "eats" the ". :-)

But the ObjectName::quote doesn't handle this as we would like:
(probably a readable web text)

  |     public static String quote(String s)
  | 	    throws NullPointerException {
  | 	final StringBuffer buf = new StringBuffer("\"");
  | 	final int len = s.length();
  | 	for (int i = 0; i < len; i++) {
  | 	    char c = s.charAt(i);
  | 	    switch (c) {
  | 	    case '\n':
  | 		c = 'n';
  | 		// fall in...
  | 	    case '\\':
  | 	    case '\"':
  | 	    case '*':
  | 	    case '?':
  | 		buf.append('\\');
  | 		break;
  | 	    }
  | 	    buf.append(c);
  | 	}
  | 	buf.append('"');
  | 	return buf.toString();
  |     }
  | 


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229884#4229884

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4229884



More information about the jboss-dev-forums mailing list