Skip to content

Commit 5d56eb6

Browse files
committed
Add stubs
1 parent 4b491dc commit 5d56eb6

10 files changed

Lines changed: 422 additions & 15 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
3+
* agreements. See the NOTICE file distributed with this work for additional information regarding
4+
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
5+
* "License"); you may not use this file except in compliance with the License. You may obtain a
6+
* copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software distributed under the License
11+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
* or implied. See the License for the specific language governing permissions and limitations under
13+
* the License.
14+
*/
15+
package groovy.lang;
16+
17+
public class GroovyRuntimeException extends RuntimeException {
18+
public GroovyRuntimeException() {}
19+
20+
public GroovyRuntimeException(String message) {}
21+
22+
public GroovyRuntimeException(String message, Throwable cause) {}
23+
24+
public GroovyRuntimeException(Throwable t) {}
25+
26+
public String getMessage() {
27+
return null;
28+
}
29+
30+
public String getMessageWithoutLocationText() {
31+
return null;
32+
}
33+
34+
}

java/ql/test/stubs/groovy-all-3.0.7/groovy/lang/GroovyShell.java

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
/*
2-
* Licensed to the Apache Software Foundation (ASF) under one
3-
* or more contributor license agreements. See the NOTICE file
4-
* distributed with this work for additional information
5-
* regarding copyright ownership. The ASF licenses this file
6-
* to you under the Apache License, Version 2.0 (the
7-
* "License"); you may not use this file except in compliance
8-
* with the License. You may obtain a copy of the License at
2+
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
3+
* agreements. See the NOTICE file distributed with this work for additional information regarding
4+
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
5+
* "License"); you may not use this file except in compliance with the License. You may obtain a
6+
* copy of the License at
97
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://www.apache.org/licenses/LICENSE-2.0
119
*
12-
* Unless required by applicable law or agreed to in writing,
13-
* software distributed under the License is distributed on an
14-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
* KIND, either express or implied. See the License for the
16-
* specific language governing permissions and limitations
17-
* under the License.
10+
* Unless required by applicable law or agreed to in writing, software distributed under the License
11+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
* or implied. See the License for the specific language governing permissions and limitations under
13+
* the License.
1814
*/
1915
package groovy.lang;
2016

17+
import java.io.Reader;
18+
import java.net.URI;
2119
import java.util.*;
2220

2321
public class GroovyShell {
@@ -28,6 +26,14 @@ public Object evaluate(GroovyCodeSource codeSource) {
2826
return null;
2927
}
3028

29+
public Object evaluate(Reader in) {
30+
return null;
31+
}
32+
33+
public Object evaluate(Reader in, String fileName) {
34+
return null;
35+
}
36+
3137
public Object evaluate(String scriptText) {
3238
return null;
3339
}
@@ -48,19 +54,48 @@ public Object run(String scriptText, String fileName, String[] args) {
4854
return null;
4955
}
5056

51-
public Object run(GroovyCodeSource source, List<String> args) {
57+
58+
public Object run(Reader in, String fileName, List<String> list) {
59+
return null;
60+
}
61+
62+
public Object run(Reader in, String fileName, String[] args) {
63+
return null;
64+
}
65+
66+
public Object run(GroovyCodeSource source, List<String> list) {
5267
return null;
5368
}
5469

5570
public Object run(GroovyCodeSource source, String[] args) {
5671
return null;
5772
}
5873

74+
public Object run​(URI source, List<String> list) {
75+
return null;
76+
}
77+
78+
public Object run​(URI source, String[] args) {
79+
return null;
80+
}
81+
82+
public Script parse(Reader in) {
83+
return null;
84+
}
85+
86+
public Script parse(Reader reader, String fileName) {
87+
return null;
88+
}
89+
5990
public Script parse(String scriptText) {
6091
return null;
6192
}
6293

6394
public Script parse(final String scriptText, final String fileName) {
6495
return null;
6596
}
97+
98+
public Script parse(URI uri) {
99+
return null;
100+
}
66101
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
3+
* agreements. See the NOTICE file distributed with this work for additional information regarding
4+
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
5+
* "License"); you may not use this file except in compliance with the License. You may obtain a
6+
* copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software distributed under the License
11+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
* or implied. See the License for the specific language governing permissions and limitations under
13+
* the License.
14+
*/
15+
package org.codehaus.groovy.control;
16+
17+
import groovy.lang.GroovyRuntimeException;
18+
19+
public class CompilationFailedException extends GroovyRuntimeException {
20+
21+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
3+
* agreements. See the NOTICE file distributed with this work for additional information regarding
4+
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
5+
* "License"); you may not use this file except in compliance with the License. You may obtain a
6+
* copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software distributed under the License
11+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
* or implied. See the License for the specific language governing permissions and limitations under
13+
* the License.
14+
*/
15+
package org.codehaus.groovy.control;
16+
17+
import groovy.lang.GroovyClassLoader;
18+
import java.io.File;
19+
import java.io.InputStream;
20+
import java.net.URL;
21+
import java.util.Iterator;
22+
import java.util.Set;
23+
24+
public class CompilationUnit {
25+
public CompilationUnit() {}
26+
27+
public CompilationUnit(final GroovyClassLoader loader) {}
28+
29+
public Set<javax.tools.JavaFileObject> getJavaCompilationUnitSet() {
30+
return null;
31+
}
32+
33+
public void addJavaCompilationUnits(
34+
final Set<javax.tools.JavaFileObject> javaCompilationUnitSet) {}
35+
36+
public GroovyClassLoader getTransformLoader() {
37+
return null;
38+
}
39+
40+
public void addSources(final String[] paths) {}
41+
42+
public void addSources(final File[] files) {}
43+
44+
public SourceUnit addSource(final File file) {
45+
return null;
46+
}
47+
48+
public SourceUnit addSource(final URL url) {
49+
return null;
50+
}
51+
52+
public SourceUnit addSource(final String name, final InputStream stream) {
53+
return null;
54+
}
55+
56+
public SourceUnit addSource(final String name, final String scriptText) {
57+
return null;
58+
}
59+
60+
public SourceUnit addSource(final SourceUnit source) {
61+
return null;
62+
}
63+
64+
public Iterator<SourceUnit> iterator() {
65+
return null;
66+
}
67+
68+
public void compile() throws CompilationFailedException {}
69+
70+
public void compile(int throughPhase) throws CompilationFailedException {}
71+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
3+
* agreements. See the NOTICE file distributed with this work for additional information regarding
4+
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
5+
* "License"); you may not use this file except in compliance with the License. You may obtain a
6+
* copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software distributed under the License
11+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
* or implied. See the License for the specific language governing permissions and limitations under
13+
* the License.
14+
*/
15+
package org.codehaus.groovy.control;
16+
17+
public class CompilerConfiguration {
18+
19+
public CompilerConfiguration() {}
20+
21+
public CompilerConfiguration(final CompilerConfiguration configuration) {}
22+
23+
public static boolean isPostJDK5(final String bytecodeVersion) {
24+
return false;
25+
}
26+
27+
public static boolean isPostJDK7(final String bytecodeVersion) {
28+
return false;
29+
}
30+
31+
public static boolean isPostJDK8(final String bytecodeVersion) {
32+
return false;
33+
}
34+
35+
public static boolean isPostJDK9(final String bytecodeVersion) {
36+
return false;
37+
}
38+
39+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
3+
* agreements. See the NOTICE file distributed with this work for additional information regarding
4+
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
5+
* "License"); you may not use this file except in compliance with the License. You may obtain a
6+
* copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software distributed under the License
11+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
* or implied. See the License for the specific language governing permissions and limitations under
13+
* the License.
14+
*/
15+
package org.codehaus.groovy.control;
16+
17+
import java.io.Serializable;
18+
19+
public class ErrorCollector implements Serializable {
20+
public ErrorCollector(final CompilerConfiguration configuration) {}
21+
22+
public void addCollectorContents(final ErrorCollector that) {}
23+
24+
public void addException(final Exception exception, final SourceUnit source)
25+
throws CompilationFailedException {}
26+
27+
public CompilerConfiguration getConfiguration() {
28+
return null;
29+
}
30+
31+
public int getErrorCount() {
32+
return 0;
33+
}
34+
35+
public boolean hasErrors() {
36+
return false;
37+
}
38+
39+
public int getWarningCount() {
40+
return 0;
41+
}
42+
43+
public boolean hasWarnings() {
44+
return false;
45+
}
46+
47+
public Exception getException(final int index) {
48+
return null;
49+
}
50+
51+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
3+
* agreements. See the NOTICE file distributed with this work for additional information regarding
4+
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
5+
* "License"); you may not use this file except in compliance with the License. You may obtain a
6+
* copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software distributed under the License
11+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
* or implied. See the License for the specific language governing permissions and limitations under
13+
* the License.
14+
*/
15+
package org.codehaus.groovy.control;
16+
17+
import groovy.lang.GroovyClassLoader;
18+
import org.codehaus.groovy.control.io.ReaderSource;
19+
import java.io.File;
20+
import java.net.URL;
21+
22+
public class SourceUnit {
23+
public SourceUnit(String name, ReaderSource source, CompilerConfiguration flags,
24+
GroovyClassLoader loader, ErrorCollector er) {}
25+
26+
public SourceUnit(File source, CompilerConfiguration configuration, GroovyClassLoader loader,
27+
ErrorCollector er) {}
28+
29+
public SourceUnit(URL source, CompilerConfiguration configuration, GroovyClassLoader loader,
30+
ErrorCollector er) {}
31+
32+
public SourceUnit(String name, String source, CompilerConfiguration configuration,
33+
GroovyClassLoader loader, ErrorCollector er) {}
34+
35+
public String getName() {
36+
return null;
37+
}
38+
39+
public boolean failedWithUnexpectedEOF() {
40+
return false;
41+
}
42+
43+
public static SourceUnit create(String name, String source) {
44+
return null;
45+
}
46+
47+
public static SourceUnit create(String name, String source, int tolerance) {
48+
return null;
49+
}
50+
51+
public void parse() throws CompilationFailedException {}
52+
53+
public void convert() throws CompilationFailedException {}
54+
55+
public void addException(Exception e) throws CompilationFailedException {}
56+
57+
public ReaderSource getSource() {
58+
return null;
59+
}
60+
61+
public void setSource(ReaderSource source) {}
62+
63+
}

0 commit comments

Comments
 (0)