Skip to content

Commit aec76ea

Browse files
author
Tobias Warneke
committed
corrected lookahead problem of PR #1225
1 parent d70e151 commit aec76ea

File tree

5 files changed

+672
-670
lines changed

5 files changed

+672
-670
lines changed
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
/*
2-
* #%L
3-
* JSQLParser library
4-
* %%
5-
* Copyright (C) 2004 - 2020 JSQLParser
6-
* %%
7-
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
8-
* #L%
9-
*/
10-
package net.sf.jsqlparser.util.deparser;
11-
12-
import net.sf.jsqlparser.statement.create.sequence.CreateSequence;
13-
14-
/**
15-
* A class to de-parse (that is, transform from JSqlParser hierarchy into a string) a
16-
* {@link net.sf.jsqlparser.statement.create.sequence.CreateSequence}
17-
*/
18-
public class CreateSequenceDeParser extends AbstractDeParser<CreateSequence>{
19-
20-
/**
21-
* @param buffer the buffer that will be filled with the CreatSequence
22-
*/
23-
public CreateSequenceDeParser(StringBuilder buffer) {
24-
super(buffer);
25-
}
26-
27-
@Override
28-
public void deParse(CreateSequence statement) {
29-
buffer.append("CREATE SEQUENCE ");
30-
buffer.append(statement.getSequence());
31-
}
32-
}
1+
/*
2+
* #%L
3+
* JSQLParser library
4+
* %%
5+
* Copyright (C) 2004 - 2020 JSQLParser
6+
* %%
7+
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
8+
* #L%
9+
*/
10+
package net.sf.jsqlparser.util.deparser;
11+
12+
import net.sf.jsqlparser.statement.create.sequence.CreateSequence;
13+
14+
/**
15+
* A class to de-parse (that is, transform from JSqlParser hierarchy into a string) a
16+
* {@link net.sf.jsqlparser.statement.create.sequence.CreateSequence}
17+
*/
18+
public class CreateSequenceDeParser extends AbstractDeParser<CreateSequence>{
19+
20+
/**
21+
* @param buffer the buffer that will be filled with the CreatSequence
22+
*/
23+
public CreateSequenceDeParser(StringBuilder buffer) {
24+
super(buffer);
25+
}
26+
27+
@Override
28+
public void deParse(CreateSequence statement) {
29+
buffer.append("CREATE SEQUENCE ");
30+
buffer.append(statement.getSequence());
31+
}
32+
}
Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
/*-
2-
* #%L
3-
* JSQLParser library
4-
* %%
5-
* Copyright (C) 2004 - 2020 JSQLParser
6-
* %%
7-
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
8-
* #L%
9-
*/
1+
/*-
2+
* #%L
3+
* JSQLParser library
4+
* %%
5+
* Copyright (C) 2004 - 2020 JSQLParser
6+
* %%
7+
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
8+
* #L%
9+
*/
1010
package net.sf.jsqlparser.util.validation;
1111

12-
import java.util.Collection;
13-
import java.util.HashSet;
14-
import java.util.Set;
12+
import java.util.Collection;
13+
import java.util.HashSet;
14+
import java.util.Set;
1515
import net.sf.jsqlparser.statement.Statement;
1616

17-
public class ValidationError {
17+
public class ValidationError {
1818

19-
private final String statements;
19+
private final String statements;
2020
private Statement parsedStatement;
2121

2222
private Set<ValidationException> errors = new HashSet<>();
23-
private ValidationCapability capability;
24-
23+
private ValidationCapability capability;
24+
2525
public ValidationError(String statements) {
2626
this.statements = statements;
2727
}
@@ -35,58 +35,58 @@ public ValidationError addErrors(Collection<ValidationException> errors) {
3535
this.errors.addAll(errors);
3636
return this;
3737
}
38-
39-
/**
40-
* @return the set of {@link ValidationException}'s (no duplicates)
38+
39+
/**
40+
* @return the set of {@link ValidationException}'s (no duplicates)
4141
*/
4242
public Set<ValidationException> getErrors() {
4343
return errors;
4444
}
45-
46-
/**
47-
* @return the {@link ValidationCapability} which produced this error
45+
46+
/**
47+
* @return the {@link ValidationCapability} which produced this error
4848
*/
4949
public ValidationCapability getCapability() {
5050
return capability;
51-
}
52-
53-
/**
54-
* @return the parsed {@link Statement}, if parsing was possible
55-
*/
56-
public Statement getParsedStatement() {
57-
return parsedStatement;
58-
}
59-
60-
/**
61-
* @return the statements (may be more than one) given for validation
62-
*/
63-
public String getStatements() {
64-
return statements;
65-
}
66-
67-
public void setCapability(ValidationCapability databaseType) {
51+
}
52+
53+
/**
54+
* @return the parsed {@link Statement}, if parsing was possible
55+
*/
56+
public Statement getParsedStatement() {
57+
return parsedStatement;
58+
}
59+
60+
/**
61+
* @return the statements (may be more than one) given for validation
62+
*/
63+
public String getStatements() {
64+
return statements;
65+
}
66+
67+
public void setCapability(ValidationCapability databaseType) {
6868
this.capability = databaseType;
69-
}
70-
71-
public void setParsedStatement(Statement parsedStatement) {
72-
this.parsedStatement = parsedStatement;
69+
}
70+
71+
public void setParsedStatement(Statement parsedStatement) {
72+
this.parsedStatement = parsedStatement;
7373
}
7474

7575
public ValidationError withCapability(ValidationCapability databaseType) {
7676
setCapability(databaseType);
7777
return this;
78-
}
79-
80-
public ValidationError withParsedStatement(Statement parsedStatement) {
81-
setParsedStatement(parsedStatement);
82-
return this;
8378
}
8479

85-
@Override
86-
public String toString() {
87-
return "ValidationError [\nstatement=" + statements + "\ncapability="
88-
+ (capability != null ? capability.getName() : "<null>") + "\nerrors=" + errors + "\n]";
89-
}
90-
80+
public ValidationError withParsedStatement(Statement parsedStatement) {
81+
setParsedStatement(parsedStatement);
82+
return this;
83+
}
84+
85+
@Override
86+
public String toString() {
87+
return "ValidationError [\nstatement=" + statements + "\ncapability="
88+
+ (capability != null ? capability.getName() : "<null>") + "\nerrors=" + errors + "\n]";
89+
}
90+
9191

9292
}

0 commit comments

Comments
 (0)