@Test public void testCheckTableNameForbiddenChar7() { this.exception.expect(IllegalArgumentException.class); this.exception.expectMessage("Table name should not contain []*?:/\\: a name with \\"); this.util.checkTableName("a name with \\"); }
public void checkTableName(final CharSequence name) { if (name.charAt(0) == SINGLE_QUOTE) { throw new IllegalArgumentException( "Table name should not start with " + SINGLE_QUOTE + ": " + name); } for (int i = 0; i < name.length(); i++) { final char c = name.charAt(i); for (final char fc : FORBIDDEN_CHARS) { if (c == fc) { throw new IllegalArgumentException( "Table name should not contain " + new String(FORBIDDEN_CHARS) + ": " + name); } } } }
TableNameUtil { public void checkTableName(final CharSequence name) { if (name.charAt(0) == SINGLE_QUOTE) { throw new IllegalArgumentException( "Table name should not start with " + SINGLE_QUOTE + ": " + name); } for (int i = 0; i < name.length(); i++) { final char c = name.charAt(i); for (final char fc : FORBIDDEN_CHARS) { if (c == fc) { throw new IllegalArgumentException( "Table name should not contain " + new String(FORBIDDEN_CHARS) + ": " + name); } } } } }
TableNameUtil { public void checkTableName(final CharSequence name) { if (name.charAt(0) == SINGLE_QUOTE) { throw new IllegalArgumentException( "Table name should not start with " + SINGLE_QUOTE + ": " + name); } for (int i = 0; i < name.length(); i++) { final char c = name.charAt(i); for (final char fc : FORBIDDEN_CHARS) { if (c == fc) { throw new IllegalArgumentException( "Table name should not contain " + new String(FORBIDDEN_CHARS) + ": " + name); } } } }  }
TableNameUtil { public void checkTableName(final CharSequence name) { if (name.charAt(0) == SINGLE_QUOTE) { throw new IllegalArgumentException( "Table name should not start with " + SINGLE_QUOTE + ": " + name); } for (int i = 0; i < name.length(); i++) { final char c = name.charAt(i); for (final char fc : FORBIDDEN_CHARS) { if (c == fc) { throw new IllegalArgumentException( "Table name should not contain " + new String(FORBIDDEN_CHARS) + ": " + name); } } } }  void checkTableName(final CharSequence name); String escapeTableName(final CharSequence tableName); String unescapeFilename(final String filename); String unescapeQuotes(final String str); }
TableNameUtil { public void checkTableName(final CharSequence name) { if (name.charAt(0) == SINGLE_QUOTE) { throw new IllegalArgumentException( "Table name should not start with " + SINGLE_QUOTE + ": " + name); } for (int i = 0; i < name.length(); i++) { final char c = name.charAt(i); for (final char fc : FORBIDDEN_CHARS) { if (c == fc) { throw new IllegalArgumentException( "Table name should not contain " + new String(FORBIDDEN_CHARS) + ": " + name); } } } }  void checkTableName(final CharSequence name); String escapeTableName(final CharSequence tableName); String unescapeFilename(final String filename); String unescapeQuotes(final String str);  }