提交 0ea30d28 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 6f67c668
......@@ -106,12 +106,12 @@ public class H2Dictionary extends DBDictionary {
buf.append(", ").append(pkStr);
}
Unique[] unqs = table.getUniques();
String unqStr;
for (int i = 0; i < unqs.length; i++) {
unqStr = getUniqueConstraintSQL(unqs[i]);
if (unqStr != null)
buf.append(", ").append(unqStr);
Unique[] uniques = table.getUniques();
String uniqueStr;
for (int i = 0; i < uniques.length; i++) {
uniqueStr = getUniqueConstraintSQL(uniques[i]);
if (uniqueStr != null)
buf.append(", ").append(uniqueStr);
}
buf.append(")");
......@@ -154,12 +154,12 @@ public class H2Dictionary extends DBDictionary {
return cols;
}
public void setDouble(PreparedStatement stmnt, int idx, double val, Column col) throws SQLException {
super.setDouble(stmnt, idx, val, col);
public void setDouble(PreparedStatement stat, int idx, double val, Column col) throws SQLException {
super.setDouble(stat, idx, val, col);
}
public void setBigDecimal(PreparedStatement stmnt, int idx, BigDecimal val, Column col) throws SQLException {
super.setBigDecimal(stmnt, idx, val, col);
public void setBigDecimal(PreparedStatement stat, int idx, BigDecimal val, Column col) throws SQLException {
super.setBigDecimal(stat, idx, val, col);
}
protected void appendSelectRange(SQLBuffer buf, long start, long end) {
......
......@@ -68,8 +68,8 @@ public class CodeSwitch {
System.out.println("labels in the source code are shown.");
System.out.println("-r+ recurse subdirectories (default)");
System.out.println("-r- do not recurse subdirectories");
System.out.println("Use +MODE to switch on the things labeld MODE");
System.out.println("Use -MODE to switch off the things labeld MODE");
System.out.println("Use +MODE to switch on code labeled MODE");
System.out.println("Use -MODE to switch off code labeled MODE");
System.out
.println("Path: Any number of path or files may be specified.");
System.out
......@@ -164,7 +164,7 @@ public class CodeSwitch {
private boolean processFile(String name) {
File f = new File(name);
boolean switchoff = false;
boolean off = false;
boolean working = false;
int state = 0;
try {
......@@ -233,11 +233,11 @@ public class CodeSwitch {
}
if (switchedOn) {
working = true;
switchoff = false;
off = false;
} else if (switchedOff) {
working = true;
insertLine(++i, "/*" + endOfLine);
switchoff = true;
off = true;
}
if (switches.indexOf(s) == -1) {
switches.add(s);
......@@ -249,12 +249,12 @@ public class CodeSwitch {
}
state = 2;
if (working) {
if (switchoff) {
if (off) {
insertLine(++i, "*/" + endOfLine);
switchoff = false;
off = false;
} else {
insertLine(++i, "/*" + endOfLine);
switchoff = true;
off = true;
}
}
} else if (lineTrim.startsWith("//#endif")) {
......@@ -263,7 +263,7 @@ public class CodeSwitch {
return false;
}
state = 0;
if (working && switchoff) {
if (working && off) {
insertLine(i++, "*/" + endOfLine);
}
working = false;
......@@ -275,18 +275,18 @@ public class CodeSwitch {
return false;
}
if (changed) {
File fnew = new File(name + ".new");
FileWriter write = new FileWriter(fnew);
File fileNew = new File(name + ".new");
FileWriter write = new FileWriter(fileNew);
for (int i = 0; i < lines.size(); i++) {
write.write(getLine(i));
}
write.close();
File fbak = new File(name + ".bak");
fbak.delete();
f.renameTo(fbak);
File fcopy = new File(name);
fnew.renameTo(fcopy);
fbak.delete();
File fileBack = new File(name + ".bak");
fileBack.delete();
f.renameTo(fileBack);
File fileCopy = new File(name);
fileNew.renameTo(fileCopy);
fileBack.delete();
System.out.println(name);
}
return true;
......
......@@ -12,13 +12,15 @@ import java.io.OutputStreamWriter;
import java.io.RandomAccessFile;
import org.h2.server.web.PageParser;
import org.h2.tools.indexer.HtmlConverter;
import org.h2.util.IOUtils;
import org.h2.util.StringUtils;
public class PropertiesToUTF8 {
public static void main(String[] args) throws Exception {
File[] list = new File("bin/org/h2/web/res").listFiles();
for(int i=0; i<list.length; i++) {
File[] list = new File("bin/org/h2/server/web/res").listFiles();
for(int i=0; list != null && i<list.length; i++) {
File f = list[i];
if(!f.getName().endsWith(".properties")) {
continue;
......@@ -29,13 +31,14 @@ public class PropertiesToUTF8 {
in.close();
String name = f.getName();
if(name.startsWith("utf8")) {
s = PageParser.escapeHtml(s, false);
s = HtmlConverter.convertStringToHtml(s);
RandomAccessFile out = new RandomAccessFile(name.substring(4), "rw");
out.write(s.getBytes());
out.close();
} else {
new CheckTextFiles().checkOrFixFile(f, false, false);
s = unescapeHtml(s);
s = HtmlConverter.convertHtmlToString(s);
// s = unescapeHtml(s);
s = StringUtils.javaDecode(s);
FileOutputStream out = new FileOutputStream("utf8" + f.getName());
OutputStreamWriter w = new OutputStreamWriter(out, "UTF-8");
......
......@@ -71,13 +71,13 @@ public class GenerateDoc {
}
void process(String fileName) throws Exception {
FileOutputStream fout = new FileOutputStream(outDir + "/"+fileName+".html");
FileInputStream fin = new FileInputStream(inDir + "/"+fileName+".jsp");
byte[] bytes = IOUtils.readBytesAndClose(fin, 0);
FileOutputStream out = new FileOutputStream(outDir + "/"+fileName+".html");
FileInputStream in = new FileInputStream(inDir + "/"+fileName+".jsp");
byte[] bytes = IOUtils.readBytesAndClose(in, 0);
String page = new String(bytes);
page = PageParser.parse(null, page, session);
fout.write(page.getBytes());
fout.close();
out.write(page.getBytes());
out.close();
}
void map(String key, String sql) throws Exception {
......
......@@ -163,7 +163,7 @@ public class LinkChecker {
} else if(type.equals("name")) {
targets.put(path + "#" + ref, "name");
} else {
error(fileName, "unsupported <a xxx: " + html.substring(idx, idx + 100));
error(fileName, "unsupported <a ?: " + html.substring(idx, idx + 100));
}
}
}
......
......@@ -5,6 +5,7 @@ import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.io.StringWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
......@@ -18,6 +19,7 @@ public class SpellChecker {
private HashSet used = new HashSet();
private HashMap unknown = new HashMap();
private boolean debug;
private boolean printDictionary;
private boolean addToDictionary;
private static final String[] SUFFIX = new String[]{"java", "sql", "cpp", "txt", "html", "xml", "jsp", "css", "bat", "nsi", "csv", "xml", "js", "def", "dev", "h", "Driver", "properties", "win", "task", "php", "" };
private static final String[] IGNORE = new String[]{"gif", "png", "odg", "ico", "sxd", "zip", "bz2", "rc", "layout", "res", "dll", "jar"};
......@@ -30,22 +32,37 @@ public class SpellChecker {
private void run(String dictionary, String dir) throws IOException {
process(new File(dir + "/" + dictionary));
process(new File(dir));
System.out.println("used words");
for(Iterator it = used.iterator(); it.hasNext();) {
String s = (String) it.next();
System.out.print(s + " ");
}
System.out.println();
System.out.println("ALL UNKNOWN ----------------------------");
for(Iterator it = unknown.keySet().iterator(); it.hasNext();) {
String s = (String) it.next();
int count = ((Integer) unknown.get(s)).intValue();
if(count > 5) {
System.out.print(s + " ");
if(printDictionary) {
System.out.println("USED WORDS");
String[] list = new String[used.size()];
used.toArray(list);
Arrays.sort(list);
StringBuffer buff = new StringBuffer();
for(int i=0; i<list.length; i++) {
String s = list[i];
if(buff.length() > 0) {
if(buff.length() + s.length() > 80) {
System.out.println(buff.toString());
buff.setLength(0);
} else {
buff.append(' ');
}
}
buff.append(s);
}
System.out.println(buff.toString());
}
System.out.println();
if(unknown.size() > 0) {
System.out.println();
System.out.println("UNKNOWN WORDS");
for(Iterator it = unknown.keySet().iterator(); it.hasNext();) {
String s = (String) it.next();
int count = ((Integer) unknown.get(s)).intValue();
if(count > 5) {
System.out.print(s + " ");
}
}
System.out.println();
throw new IOException("spell check failed");
}
}
......@@ -57,9 +74,9 @@ public class SpellChecker {
}
int removeThisLater;
if(name.indexOf("\\test\\") >= 0) {
return;
}
// if(name.indexOf("\\test\\") >= 0) {
// return;
// }
if(file.isDirectory()) {
File[] list = file.listFiles();
......@@ -115,7 +132,7 @@ public class SpellChecker {
}
private void scan(String fileName, String text) {
HashSet notfound = new HashSet();
HashSet notFound = new HashSet();
StringTokenizer tokenizer = new StringTokenizer(text, "\r\n \t+\"*%&/()='[]{},.-;:_<>\\!?$@#|~^`");
while(tokenizer.hasMoreTokens()) {
String token = tokenizer.nextToken();
......@@ -126,17 +143,17 @@ public class SpellChecker {
if(!addToDictionary && debug) {
System.out.print(token + " ");
}
scanCombinedToken(notfound, token);
scanCombinedToken(notFound, token);
if(!addToDictionary && debug) {
System.out.println();
}
}
if(notfound.isEmpty()) {
if(notFound.isEmpty()) {
return;
}
if(notfound.size() > 0) {
if(notFound.size() > 0) {
System.out.println("file: " + fileName);
for(Iterator it = notfound.iterator(); it.hasNext();) {
for(Iterator it = notFound.iterator(); it.hasNext();) {
String s = (String) it.next();
System.out.print(s + " ");
}
......@@ -144,24 +161,24 @@ public class SpellChecker {
}
}
private void scanCombinedToken(HashSet notfound, String token) {
private void scanCombinedToken(HashSet notFound, String token) {
for(int i=1; i<token.length(); i++) {
char cleft = token.charAt(i-1);
char cright = token.charAt(i);
if(Character.isLowerCase(cleft) && Character.isUpperCase(cright)) {
scanToken(notfound, token.substring(0, i));
char charLeft = token.charAt(i-1);
char charRight = token.charAt(i);
if(Character.isLowerCase(charLeft) && Character.isUpperCase(charRight)) {
scanToken(notFound, token.substring(0, i));
token = token.substring(i);
i = 1;
} else if(Character.isUpperCase(cleft) && Character.isLowerCase(cright)) {
scanToken(notfound, token.substring(0, i - 1));
} else if(Character.isUpperCase(charLeft) && Character.isLowerCase(charRight)) {
scanToken(notFound, token.substring(0, i - 1));
token = token.substring(i - 1);
i = 1;
}
}
scanToken(notfound, token);
scanToken(notFound, token);
}
private void scanToken(HashSet notfound, String token) {
private void scanToken(HashSet notFound, String token) {
if(token.length() < 3) {
return;
}
......@@ -188,7 +205,7 @@ public class SpellChecker {
dictionary.add(token);
} else {
if(!dictionary.contains(token)) {
notfound.add(token);
notFound.add(token);
increment(unknown, token);
} else {
used.add(token);
......
......@@ -89,7 +89,7 @@ public class XMLChecker {
private static void checkXML(String xml, boolean html) throws Exception {
String lastElement = null;
String[] noclose = new String[]{
String[] noClose = new String[]{
"li", "link", "meta", "br", "img", "input", "hr", "frame"
};
XMLParser parser = new XMLParser(xml);
......@@ -110,8 +110,8 @@ public class XMLChecker {
if(html && name.equals("table") && lastElement.trim().length() > 0) {
throw new Exception("Test before table: " + lastElement);
}
for(int i=0; html && i<noclose.length; i++) {
if(name.equals(noclose[i])) {
for(int i=0; html && i<noClose.length; i++) {
if(name.equals(noClose[i])) {
name = null;
break;
}
......@@ -121,8 +121,8 @@ public class XMLChecker {
}
} else if(event == XMLParser.END_ELEMENT) {
String name = parser.getName();
for(int i=0; html && i<noclose.length; i++) {
if(name.equals(noclose[i])) {
for(int i=0; html && i<noClose.length; i++) {
if(name.equals(noClose[i])) {
throw new Exception("Unnecessary closing element " + name + " at " + parser.getRemaining());
}
}
......
aacute about above abs absolute abstract accept accepts access accessed accessing
accessor according acirc acme acos across action active activity actual acute
adapter adapting add added addiction adding addition additional additionally addr
address adds admin advanced advised aelig aes affect affected after afterwards
again against age agg aggregate aggregated aggregates agrave agreed ahead alan
alefsym alexander algo algorithm alias aliases aliasing align aligned all
allclasses allocate allocated allocation allow allowed allows almost alone along
alpha already also alt alter alternatively always ambiguous amp analysis analyze
analyzer and andy ang anon anonymous another ansi ant antivir any anything anyway
apache api apos app appears append applicable application applications applied
apply appropriate approx approximate arbitrary are arg args argument arguments
argv aring arising around arr array arraycopy arrays artifact asc ascending ascii
asin aspx assert assign assignable assigned assignment asterisk asymp atan atilde
atomic attack attacker attacks attempted attr attrib attribute attributes auml
author authorization auto autocommit autoincrement automatic automatically
available avg avoid avoiding avoids back backed backing backs backslash backspace
backup backwards bad bak balance base based basic basis bat batch bcc bdata bdquo
because become been before begin beginning behavior behaviour belongs below
benchmark best beta better between beyond big bigger biggest bigint biginteger
bin binary bind bit bitand bitor bits bitxor blob blobs block blockquote blocks
blocksize blowfish bnf body bookkeeping bool boolean bootstrap border boston both
bound bounds bout brackets branch break breaks broken browser brute brvbar bsd
btree btrees bucket buckets buf buff buffer buffered buffering bug bugdatabase
bugs build building built bull business busy but button bye byte bytea bytes
cache cached cal calculate calculated calendar call callable callback called
caller calling calls can cancel cancelled cancels cannot canonical cap capacity
cardinality carriage cascade case cases casesensitive casewhen cast cat catalog
catalogs catch caucho cause caused causes ccedil cdata cdd cddl cdup cedil ceil
ceiling cellpadding cellspacing cent cert certain certificate certs cfg chain
chained chance change changed changes char character characters chars charset
cheating check checked checker checking checklist checkpoint checks checksum chi
child children chinese cipher class classes classpath clause clazz clean cleaned
cleaner clear clears clicked client clients clientside clob clone close closed
closely closer closes closing clubs cluster clustered clustering coalesce code
codes codeswitch coding col coll collation collations collator collect collected
collection collections collector cols colspan column columnlist columns com
combinatorics combine combined combo combobox comma command commands comment
comments commit commits committed common commons comp compact comparator compare
comparing comparison comparisons compatibility compatible compile compiled
compiling complete complex compliance compliant component compress compressed
compression compressor compsci compute computed computer concat concatenate
concatenated concept concur concurrency concurrent cond condition conditions conf
config configure conflict cong conn connect connected connecting connection
connections cons consequential consistency consistent console const constant
constants constraint constraints constructor constructs contain container
containing contains content contents context continue continued contract
contributors control conversion convert converted converter converting converts
copy copying copyright core correct correctly correctness correlated correlation
corresponding corrupt corrupted cos cost cot could count country counts coverage
covered cpp crarr create created creates creating creation crlf cross css csv
csvread csvwrite ctrl ctx cube cup curdate curren currency current currently
currval cursor cursors curtime curtimestamp cvs cwd cyclic daemon daffodil dagger
damage damages darr dash data database databaseaccess databases datalink datapage
datastore datatype datatypes date dateadd datediff datetime day dayname
dayofmonth dayofweek dayofyear dba dbo ddl debug dec decimal decision declaration
declare declared decode decoder decoding decompress decompresser decompressing
decrement decrypt decryption deep def default deferrability deferrable deferred
define defined definitely definition definitions deflate deflater deg degrees
deinterleave delay delayed dele delegate delete deleted deleter deletes deleting
delimiter delta demand denied dependencies dependent depends deprecated derby
derived desc descending describing description deserialization deserialize dest
destdir destroy destroyed detailed details detect detected detection detects
determ deterministic deutsch dev developer development diagram dialect diams
dictionary did didn diff difference differences different digit digits dim
dimension dimensional dimensions dip dips dir direct direction directly
directories directory dirs dirty disable disabled disables disclaimed disclaimer
disconnect disconnected disconnecting disk display displayed dist distinct
distributed distributing distribution div divide dividend divider division
divisor dll dml dname doc doclet docs docsrc doctype document documentation
documented documents does doesn dollar domain domains don done dos dot dots
double doubt down downloads driver drivers drop dropped drops dtd dual dummy dump
dumps duplicate during dynamic each eacute eagrave early easily easy ecirc edit
editing edu eee eeee effect effects egrave either eldest element elements elig
else elsewhere embedded emergency empty emsp enable enabled enables enc enclose
enclosed encode encoded encoder encoding encrypt encrypted encryption end endif
endorse ends engine english enhancement enough ensp ensure entity entries entry
enumeration environment eof eol epsilon equal equality equals equiv era err error
errors esc escape escaped escapes espa essentials estimated eta eth euml euro
evaluatable evaluated even event events every everybody everything everywhere
exact exactly example except exception exceptions excluding exclusive exclusively
exe exec execute executed executes executing execution exemplary exist existence
existing exists exit exp expand expands expected explain explorer exported expr
express expression expressions exps extend extended extends extensions external
externally extra extract extracted extracter extracting facility fact factor
factory fail failed fails failure fake fall false faq fashioned fast faster fatal
feature features feed ferguson fetch few fid field fields fifo file filedata
filename files filesystem fill filler fillers filter filters fin final
finalization finalize finally find finds fine finish finished fire firebird
firebirdsql firefox first fitness fix fixed fkcolumn fktable flag flags flat
float floor flush flushed flushing fly folder followed following foo footer for
forall force foreign forever forget form format formatdatetime formats forms
forward found foundation four frac fractional frame fran frasl free fresh
freshmeat from front ftl ftp ftpguide full fulltext fully func function
functionality functions further future gamma gap garbage gcj gcjhack general
generate generated generates generating generation generator generic genetic
genkey get getpart gets getter getting gif given glassfish global gmt gnu good
goods google googlecode got governing gpl grabbing grammar grant grantable
granted grantedrole grantee granteetype grantor grants granularity greater greedy
gregorian group grouped groups guest guid guide guides gzip hack half hand handle
handler handling happen happens hard hardware harr has hash hashcode hashed
hashing hashmap hashtable have having hazorea head header heading hearts height
hellip hello help helper here hex hextoraw hey hibernate hidden high higher
highest hint historical history hit hits hmmss hms hoc hold holdability holes
home hook hope hopefully horizontal host hostname hour hover how however href
hsql hsqldb htm html http https huge human hyc hyt iacute ibiblio ibm icirc ico
icon identical identified identifier identifiers identifying identity ids idx
iexcl iface ifdef ifexists ifnull ignore ignorecase ignored ignorelist igrave
illegal image img immediately immutable impl implement implementation implemented
implements implicit implied import imported improve inc incidental include
included includes including incompatibility inconsistent increment incrementing
indent indentation indented indents independent independently index indexed
indexer indexers indexes indexid indexing indicate indirect inet inf infin
infinite infinity inflate inflater info information infringement init initial
initialize initialized initializes initializing inmemory inner inplace input ins
insensitive insert inserted inserting insertion inserts inside installation
installer instance instanceof instantiate instead instr instruction int integer
integrity intended interactive interesting interface interfaces interleave
interleaving intermediate intern internal internally interpreted interrupted
interruption intersect interval into inval invalid invalidate inversed invocation
invoke iota iquest isin iso isolation issue item items iterate iteration
iterations iterator its itself iuml january jar java javadoc javascript javax
jdbc jdbcx jdk jefferson jks join joins jpox jsessionid jsp just kappa keep keeps
kept kernel key keyalg keypass keys keystore keystores keytool keyword keywords
kill killed kind know known knows koders label labeled labels lambda lang
language languages laquo large larger largest larr last lastmodified late later
latest law layout lcase lceil ldquo leach leading leaf least left legal lehmann
len length lenient less letter level lfloor liability liable lib license licensed
licenses lifetime like limit limitations limited limits line linear linefeed
lines lineup link linked links list listed listen listener listeners listing lite
literal literals little live load loader lob lobs local locale locales localhost
localized locate location locators lock locked locking locks log logged logger
logging logic login logout logs logsize long longblob longtext longvarbinary
longvarchar look lookup loop loopback loops loose loss losslessly lost lot low
lowast lower lowercase loz lpt lrm lru lsaquo lsquo ltrim lucene lzf mac macr
made magic magyar main major make making malformed management manager
manipulation manipulations manually many map mapped mapping maps marc margin mark
marked marker mask masks master match matches materials math matter maurice maven
max maximum maxlen maxrows may maybe mdash mdd mdtm mean means meanwhile
mediumblob mediumint mediumtext mem memory menu merchantability merge merging
message messages met meta metadata method methods micro microsoft middle middot
might millis millisecond mime min mine mini minimum minor minus minute minutes
mirrors mismatch miss missing mix mixed mkd mkdirs mmm mmmm mod mode model modes
modification modified modifier modifiers modify module modulus month monthname
more morton most move moved moves much mueller mul multi multiple multiply
multithreaded must mutable myself mysql mystery nabla name named names namespace
naming nano nanos nanoseconds native natural nbsp nchar nclob ndash necessarily
necessary need needed needs negate negative negligence neighbor nested net
networked networks never new newline newsletter next nextval nlst nnnnnnnnn
nobody nodata node noframe non none noop nopasswords normal normalize normally
nosettings not nota notation notch nothing notice notified notify notin now
nowait nsi nsis nsub ntext ntilde null nullable nullif nulls num number numbers
numeric numsum nvarchar nvl oacute obj object objects obtain occur occurred
occurrence occurs ocirc octal octet octype odbc odd odg off office offset ograve
oid old oline omega omicron once onclick one online only onmouseout onmouseover
open opened opening openjpa operand operands operating operation operations
operator operators oplus optimal optimistic optimizable optimization
optimizations optimize optimized optimizer option optional options oracle order
ordered ordf ordinal ordm oren org orig original orphan oslash other others
otherwise otilde otimes ouml our out outer output outs outside over overflow
overflows overhead override overview overwrite own owner owners oymaurice package
packaging padded page pages para paragraph param parameter parameters params
paren parent parentheses parentid parse parsedatetime parser parses parsing part
partial partially particular parts pass passed passes passive password passwords
pasv path paths pattern pdf people per percent performance permil permission
permissions permitted permutation permutations perp persistent phantom phase phi
php pieces pinned piv pivot pkcolumn pkcs pktable place plan planned plans
platform please pluggable plus plusmn png point pointer pointers points poll pool
poolable pooled pooling pop populated port portions pos position positioned
positive possibility possible post postgre postgres postgresql potentially pound
pow power pre prec precision preferred prefix prep prepare prepared preparing
prepended preserve previous primary prime primitive print println prints prior
priority private privilege privileges probably problem problems procedure
procedures process processed processing procurement prod produces product
products profits programme programs progress prohibited project promote prop
properties property proposed protected protocol provide provided provider
provides provisions pseudo psi pub public published purpose push put pwd
qualified qualifier quantified quantifieds quarter queries query queryframework
queue quick quicker quickstart quiet quit quot quote quoted quotes quoting race
radians radic radix rand random rang range ranges raquo rarr raw rawtohex rceil
rcon rdbms rdquo read readable reader reading readonly reads real really reason
reasons rebuild rebuilt rec recalculate receive received recently recipient
reclaimed recompile reconnect record records recover recovering recovery recurse
recursion recursive redirect redistribute redistribution redistributions redo
reduce ref refactor refactoring reference referenceable referenced references
referencing referential reflect refresh reg region register registered regression
regular rehash rein reindex rejected rel related relations relationship relative
release releases relies remainder remaining remark remarks remember remembered
remote remove removed removes removing rename renamed renaming repeat repeatable
repl replace replaced replacement replied reply repo reported represents
reproduce request requested requests required requirement requires res reserve
reserved reset resets resin resolution resolved resolver resource resources rest
restart restoring restrict restricted restriction result resulting results ret
retain retr retrieve return returned returns reuse rev reverse reversed revision
revoke rfc rfloor rho right rightmost rights rlm rmd rnd rnfr rnto role roles
roll rollback rolled rolls root roots rot round rounding roundmagic rounds row
rowcount rowid rownum rows rowsize rsa rsaquo rsquo rtrim rule rules run rundll
runnable running runs runscript runtime rws safari safe said salt salz same samp
sample save savepoint savepoints saves says sbquo scalar scale scan scanned
scanners scanning scans schem schema schemas schemata schmorp school scm scope
scott script scroll scrollable sdot search searchable searched searcher searches
searching second secondary seconds sect section secure security see seed seek
seems select selectable selected selection selectivity selects self selfhtml send
sending sense sensitive sentence sep separate separated separator separators seq
sequence sequences serial serializable serialization serialize serialized server
serverlist servers service services servlet session sessions set sets setters
setting settings sha shall shallow share shared shift short should show shown
shrink shuffle shut shutdown shutting shy side sides sig sigma sigmaf sign
signature signed signs signum silently silly sim simple simplify simulated sin
since single singleton site situations sixty size sizes skip skipped sleep slock
slow slower small smalldatetime smaller smallint snoozesoft socket sockets
software solution solve some somebody somehow something sometime sometimes sort
sortable sorted sorting soundex source space spaces spades span spec special
specific specification specified specifies specify specs speed spell spi split
sql sqlexpress sqlite sqlnulls sqlserver sqlstate sqlxml sqrt src ssl stack stage
standalone standard stanford start started starter starting starts startup
starves stat state statement statements states static status stay stddev stddevp
step still stmt stop stops stor storage storages store stored storepass stores
str strange strategy stream strength strict strictfp string stringdecode
stringencode strings stringtoutf stru struct structures students style stylesheet
sub subdirectories sube subject submit subqueries subquery subset substitute
substr substring subtract subtree succeed successful successfully such suffix
suggest suggested suite suites sum summary sun sup supe super superseded
supertable supplied support supported supports sure svn swap swapped switch
switched switches sxd sync synchronization synchronized synonym syntax sys
sysdate sysdba syst system systems systime systimestamp szlig tab table tables
tabs tag tags tail takes tan tape tapes target targets task tasks tau tcp
technology temp template templated temple temporarily temporary term terminated
terms tertiary test testing tests text than that the them then theoretically
theory there therefore these theta thetasym they thin thing thinsp this thomas
thorn those thread threaded threads three throttle through throw throwable thrown
throws ticker tid time timeout times timestamp timestampdiff timestamps timezone
timezones timing tiny tinyblob tinyint tinytext tired title tmendrscan tmfail
tmjoin tmnoflags tmonephase tmresume tmstartrscan tmsuccess tmsuspend today todo
together token tokenize tokenized tokenizer tokens tom too tool tools top topic
toplink tort total trace traces trade trailing trans transaction transactional
transactions transfer transform transient transitional translatable translate
translated translates translation translations tray tread tree trick tried tries
trigger triggered triggers trim true truncate truncated truncates trunk try
trying tucker tune tutorial twice two txt type types uacute uarr ucase ucirc udts
ugrave uid uml unaligned uncaught unclosed uncommitted uncompressed under
understand understands understood undo undocumented undone unencrypted unescape
unexpected unicode unindexed union unique uniques universal unix unknown unless
unlink unlinked unlock unmaintained unmodified unnamed unnecessarily unnecessary
unquoted unrecoverable unrelated unscaled unset unsigned unsorted unsupported
until untranslated unusable unused unwrap unwritten updatable update updated
updates updating upgrade upload upper uppercase upsih upsilon uri url urls usa
usage use used useful user username users uses using usually utc utf util
utilization utils uuid uuml val valid validate validation validity value values
var varbinary varchar variable variables variance variant various varp vector
vendor versa version versions very vice view views violated violation virtual
viruses visible visitor vldb void volatile vpn wait waiting wants warning
warnings warranties warranty was watchdog way weak web week weierp weight weights
weird well what when where whether which while whirlpool white whitespace whole
why width wikipedia wildcard will win windows wish with within without wlam
wondering word wordid words work workaround worked working works world worst
would wrap wrapper writable write writer writes writing written wrong www xads
xaer xares xid xlock xml xmlattr xmlcdata xmlcomment xmlnode xmlstartdoc xmltext
xor xtea xtime xyz yacute year yen yes yet yield yielding ymd you your yuml yyyy
zero zeta zip zone zwj zwnj
unit abc samples compacting email phone jones john bob abcde
matrix probable cartesian samples polar newsfeed
rss disallow pending download stable scripts longer contained modules machine proposal exits bugfixes jun depending persisted thu roadmap channel production quality
undefined unsafe sam overwritten reside samples abnormal termination
amount samples invoice bench
phone cnt terminal orders think response uniform warehouses neworder price delivered quantity stock districts city warehouse customers delivery district discount keying street orderid customer supply lim payment lastname amount credit loading tax ytd carrier
eing bench cally bar ese uniform lastname anti ation pri ought city able pres
phone bench cnt terminal orders threshold midpoint namecnt uniform warehouses price tpc quantity city districts stock warehouse customers district delivery discount street customer supply lim payment amt lastname amount deck credit ytd tax carrier
bench hallo welt sequential
accounts bid tpca bbalance account branches htime tbalance teller tellers tpc aid able abcdefghijklmnopqrstuvwxyz abalance
trial depth cpu xrunhprof maciej wegorkiewicz destroyer killer testtab student
ruebezahl wide crash hallo welt expect synth shortest halt news oranges apples
possible time modulus processed results foundation truncated suites overflows approximate location body continue zone trunk overwritten escaped first times detected modify recovering superior abstract result setters said module ways never those accounts places input unmodified core sect emergency character function implicit lenient grouped age interleave implied runs effect suggested mac corrupt selects comparator subtree checkpoint client sales third raw closely delegate country sets optimal users weak codes web tutorial okay super option price interrupted applications three logging channel disconnect save naming connection rights bin fields space encrypted cafe warranty any cent aligned
byte transform bigger done cot mix decision contain backups best copying readable illegal actual release news insecure inc allow invoice bound revision frame quarter year advanced locks systems future root networks begin register pointers scanned useful hot era calculate ins rounds warehouses string balance appear line preserve seed modes please the search includes restricted hint unless occurs consistent you servers exactly encoded reclaimed regular closed arrays outer listening overview arch goods gap immutable net vice amp row developer understand grammar degrees poll myself renaming today removing connected place mode disable assignable closes shown here named english divide
......@@ -30,14 +302,14 @@ compliant timezone rollback unscaled analyzer optimize localized deflater hibern
datediff datatype xmltext stddev bitxor currval openjpa rownum hsqldb dayname upsert xmlattr thomas params postgre analyze xmlcdata decrypt nullable mueller tinyint ifexists systime curdate radians ifnull substr apache subquery bitand datalink concat unicode sysdate grantee toplink smallint nextval casewhen xmlnode varchar hextoraw testall rawtohex struct toolbar lucene locale postgres catalog tostring soundex nullif readonly roadmap welt mod desc acos lcase steve init atan jones url ref clob col param java args throwable dir expr util http btree multi sql info pos obj stat int utils todo config prep temp lob savepoint rec jdbc html app org println cols conn synth min com timestamp len idx admin
abc metadata sqrt nosettings servlet bigint seq righthand gmail nopasswords hallo anne postgresql val ignorecase buf autocommit arg jpox mysql joe str
abc metadata sqrt nosettings servlet bigint seq righthand gmail nopasswords hallo anne postgresql val ignorecase buf arg jpox mysql joe str
qty foo meier impl parsedatetime caucho stringencode eid pre instr ucase dateadd scott sha johann roundmagic sabine www varbinary lang javax petra aes fulltext asin yyyy xml nodata fktable curtime doc
formatdatetime cos longvarchar samp simon uuid lehmann kindergarden const rand octet gmt avg rdbms xyz exp rtrim ltrim rekord stringtoutf monthname
rss xmlstartdoc asc runscript marc odbc usa txt xmlcomment eins def johnson blockquote ddl color addr zip karin api susan mem cal https jon classpath xtea pfister unionall dec svn jackson
gcj grantor glassfish hoi gnu tpca google bak numsum btrees maven clancy poleposition yen keyalg unescape implies tpc rhino
gcj grantor glassfish hoi gnu tpca google bak numsum btrees maven clancy poleposition yen keyalg unescape implies tpc rhino structures
sigma env iterate millis algo uml
mediumint combo george
......@@ -63,8 +335,25 @@ onclick alt onmouseout udts onmouseover eee decrement mine nano occurred subquer
casesensitive gpl ibiblio codeswitch sep stddevp varp asterisk sqlnulls compsci wlam strictfp nvl determ deinterleave
iface hyc aspx alan koders lpt uid bytea longtext oid smalldatetime longblob nvarchar inf jun thu
drda dbname mydb xdb syscs ruebezahl spell php doclet further hyt
pkcs genkey jks storepass dname keystore keystores keypass bugdatabase
pkcs genkey jks storepass dname keystore keystores keypass bugdatabase notation
oacute aacute egrave ntilde uuml eagrave eacute ouml ecirc ccedil icirc iacute uacute
deferrability grantedrole granteetype pkcolumn fkcolumn temporarily cellpadding rnd
sqlexpress doctype colspan
ntilde mdash ensp radic szlig phi chi sube micro weierp loz bdquo zeta aelig rfloor notin empty le upsilon frac lang prop rho times rsquo uml nsub ni oslash crarr cup eth rang isin cong permil zwnj sdot iquest gamma diams sect acute macr ucirc amp ndash ge atilde forall oplus lowast image supe sim exist real sup dagger rceil nbsp emsp upsih pound lt ang quot ugrave beta int ordf otilde lsaquo yacute euml frac harr divide spades lfloor iuml ordm icirc para acirc curren reg rarr bull oacute zwj prime and cap uuml sbquo part agrave lsquo copy sigmaf laquo igrave iexcl euro thetasym ldquo thorn or clubs ccedil auml rsaquo uacute pi larr alpha aring yen mu equiv prod not ograve alefsym tau hearts yuml psi trade piv hellip iota thinsp lceil egrave cent ne xi lrm sub asymp cedil brvbar theta perp deg ecirc raquo sup omega frasl oline nu kappa omicron minus darr otimes aacute sum shy frac gt ocirc sup plusmn eacute delta eta nabla sup rlm middot ouml sigma epsilon rdquo lambda uarr iacute infin there
schmorp alexander tort maurice oren oymaurice hazorea incompatibility timestampdiff
wordid indexid ignorelist ftl minutes partially causes supertable quantifieds across selectable
deserialize referenceable tmjoin tmresume tmsuccess tmsuspend tmstartrscan xaer nota tmnoflags
synchronization xares inval tmonephase tmendrscan deserialization apos
queryframework operators cdd databaseaccess behaviour cddl parentheses extracter
autocommit magyar recalculate indentation octype
upd testid dbid adam pipe pid xdo xsm xbl xby xts ffeecc xbo xcl xti xbi xda bohlen rawbyte
gast abcdef injection rmi ldap rmiregistry bracket careful peek prev ucs bucher herkules ghi orld
rwd lck brack feb bel abcd xfc substituted substitution intra neg supplier gross datum prd pack lead rate accountid
createtable unordered abcdefghijklmnop ffffff aeiou bdfghklmnpqrst wizbangblog
### evaluatable evaluable
### evaluatable > evaluable
......@@ -8,6 +8,7 @@ import java.util.HashMap;
public class HtmlConverter {
private static HashMap charMap = new HashMap();
private static HashMap codeMap = new HashMap();
private static final String[] CHARS = {
"quot:34", "amp:38", "lt:60", "gt:62", "nbsp:160", "iexcl:161", "cent:162",
......@@ -58,11 +59,43 @@ public class HtmlConverter {
int idx = token.indexOf(':');
String key = token.substring(0, idx);
int ch = Integer.parseInt(token.substring(idx+1));
charMap.put(key, new Character((char)ch));
Character character = new Character((char)ch);
charMap.put(key, character);
codeMap.put(character, key);
}
}
public static String convertHtml(String html) {
public static String convertStringToHtml(String s) {
if(s == null) {
return null;
}
if(s.length() == 0) {
return s;
}
StringBuffer buff = new StringBuffer();
for(int i=0; i<s.length(); i++) {
char ch = s.charAt(i);
Character c = new Character(ch);
String token = (String) codeMap.get(c);
if(token == null) {
if(ch < 128) {
buff.append(ch);
} else {
buff.append('&');
buff.append('#');
buff.append((int)ch);
buff.append(';');
}
} else {
buff.append('&');
buff.append(token);
buff.append(';');
}
}
return buff.toString();
}
public static String convertHtmlToString(String html) {
if(html == null) {
return null;
}
......@@ -110,6 +143,5 @@ public class HtmlConverter {
}
return buff.toString();
}
}
......@@ -31,7 +31,7 @@ public class Indexer {
boolean title;
boolean heading;
private static final int MIN_WORDSIZE = 3;
private static final int MIN_WORD_SIZE = 3;
private static final int MAX_RELATIONS = 20;
public static void main(String[] args) throws Exception {
......@@ -222,7 +222,7 @@ public class Indexer {
// buff.append(weight.value);
}
}
// TODO optimization: could support "a name=" and go to _first_ occurance, or scan page and mark
// TODO optimization: could support "a name=" and go to _first_ occurrence, or scan page and mark
output.println("ref['"+convertUTF(first)+"']='"+buff.toString()+"';");
output.println("// totalRelations: "+totalRelations);
}
......@@ -290,7 +290,7 @@ public class Indexer {
}
void process(String text) {
text = HtmlConverter.convertHtml(text);
text = HtmlConverter.convertHtmlToString(text);
if(title) {
if(page.title == null) {
page.title = text;
......@@ -312,7 +312,7 @@ public class Indexer {
false);
while (t.hasMoreTokens()) {
String token = t.nextToken();
if(token.length()<MIN_WORDSIZE) {
if(token.length()<MIN_WORD_SIZE) {
continue;
}
if(Character.isDigit(token.charAt(0))) {
......
......@@ -47,7 +47,7 @@ class H2Adapter extends DatabaseAdapter
private String schemaName;
/**
* Constructs a H2 adapter based on the given JDBCmetadata.
* Constructs a H2 adapter based on the given JDBC metadata.
* @param dictionary The Dictionary to use
* @param metadata the database metadata.
*/
......@@ -75,7 +75,7 @@ class H2Adapter extends DatabaseAdapter
}
/**
* Accessor for the vendor ID for this adapter.
* Getter for the vendor ID for this adapter.
* @return The vendor ID
*/
public String getVendorID()
......@@ -85,7 +85,7 @@ class H2Adapter extends DatabaseAdapter
/**
* Accessor for a Connection to the datastore.
* @param ds The data source. Possible to have more than one datasource for failover
* @param ds The data source. Possible to have more than one data source for fail over
* @param userName The username for the datastore
* @param password The password for the datastore
* @param isolationLevel The level of transaction isolation
......@@ -149,7 +149,7 @@ class H2Adapter extends DatabaseAdapter
/**
* Method to return the SQL to append to the SELECT clause of a SELECT statement to handle
* restriction of ranges using the LIMUT keyword.
* restriction of ranges using the LIMIT keyword.
* @param offset The offset to return from
* @param count The number of items to return
* @return The SQL to append to allow for ranges using LIMIT.
......@@ -244,8 +244,8 @@ class H2Adapter extends DatabaseAdapter
}
/**
* Whether we support autoincrementing fields.
* @return whether we support autoincrementing fields.
* Whether we support auto incrementing fields.
* @return whether we support auto incrementing fields.
**/
public boolean supportsAutoIncrementFields()
{
......@@ -264,7 +264,7 @@ class H2Adapter extends DatabaseAdapter
}
/**
* Accessor for the auto-increment keyword for generating DDLs (CREATE TABLEs...).
* Accessor for the auto-increment keyword for generating DDLs (CREATE TABLE...).
* @return The keyword for a column using auto-increment
**/
public String getAutoIncrementKeyword()
......@@ -273,7 +273,7 @@ class H2Adapter extends DatabaseAdapter
}
/**
* Method to retutn the INSERT statement to use when inserting into a table that has no
* Method to return the INSERT statement to use when inserting into a table that has no
* columns specified. This is the case when we have a single column in the table and that column
* is autoincrement/identity (and so is assigned automatically in the datastore).
* @param table The table
......@@ -298,7 +298,7 @@ class H2Adapter extends DatabaseAdapter
* Whether this datastore supports the use of CHECK after the column
* definitions in CREATE TABLE statements (DDL).
* e.g.
* CREATE TABLE XXX
* CREATE TABLE XYZ
* (
* COL_A int,
* COL_B char(1),
......
......@@ -28,8 +28,8 @@ public class H2Dialect extends Dialect {
try {
Class constants = ReflectHelper.classForName( "org.h2.engine.Constants" );
Integer build = (Integer)constants.getDeclaredField("BUILD_ID" ).get(null);
int buildid = build.intValue();
if(buildid < 32) {
int buildId = build.intValue();
if(buildId < 32) {
querySequenceString = "select name from information_schema.sequences";
}
} catch(Throwable e) {
......@@ -141,7 +141,7 @@ public class H2Dialect extends Dialect {
// registerFunction("minute", new StandardSQLFunction("minute", Hibernate.INTEGER));
// registerFunction("month", new StandardSQLFunction("month", Hibernate.INTEGER));
registerFunction("monthname", new StandardSQLFunction("monthname", Hibernate.STRING));
registerFunction("quater", new StandardSQLFunction("quater", Hibernate.INTEGER));
registerFunction("quarter", new StandardSQLFunction("quarter", Hibernate.INTEGER));
// registerFunction("second", new StandardSQLFunction("second", Hibernate.INTEGER));
registerFunction("week", new StandardSQLFunction("week", Hibernate.INTEGER));
// registerFunction("year", new StandardSQLFunction("year", Hibernate.INTEGER));
......@@ -246,15 +246,15 @@ public class H2Dialect extends Dialect {
/**
* Extract the name of the violated constraint from the given SQLException.
*
* @param sqle The exception that was the result of the constraint violation.
* @param e The exception that was the result of the constraint violation.
* @return The extracted constraint name.
*/
public String extractConstraintName(SQLException sqle) {
public String extractConstraintName(SQLException e) {
String constraintName = null;
// 23000: Check constraint violation: {0}
// 23001: Unique index or primary key violation: {0}
if(sqle.getSQLState().startsWith("23")) {
String message = sqle.getMessage();
if(e.getSQLState().startsWith("23")) {
String message = e.getMessage();
int idx = message.indexOf("violation: ");
if(idx > 0) {
constraintName = message.substring(idx + "violation: ".length());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论