1 /* |
1 /* |
2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
645 |
645 |
646 /* Do unicode to ansi C identifier conversion. |
646 /* Do unicode to ansi C identifier conversion. |
647 %%% This may not be right, but should be called more often. */ |
647 %%% This may not be right, but should be called more often. */ |
648 protected final String nameToIdentifier(String name) { |
648 protected final String nameToIdentifier(String name) { |
649 int len = name.length(); |
649 int len = name.length(); |
650 StringBuffer buf = new StringBuffer(len); |
650 StringBuilder buf = new StringBuilder(len); |
651 for (int i = 0; i < len; i++) { |
651 for (int i = 0; i < len; i++) { |
652 char c = name.charAt(i); |
652 char c = name.charAt(i); |
653 if (isASCIILetterOrDigit(c)) |
653 if (isASCIILetterOrDigit(c)) |
654 buf.append(c); |
654 buf.append(c); |
655 else if (c == '/') |
655 else if (c == '/') |