Skip to content

Commit 4384f78

Browse files
committed
Play stubs improvements, cleanup and return values
1 parent 8e83de1 commit 4384f78

25 files changed

+444
-2879
lines changed

java/ql/test/stubs/playframework-2.6.x/play/Application.java

Lines changed: 16 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -7,82 +7,25 @@
77
import java.io.InputStream;
88
import java.net.URL;
99

10-
//import play.inject.Injector; -> Scala stuff
11-
//import play.libs.Scala;
12-
13-
/**
14-
* A Play application.
15-
*
16-
* Application creation is handled by the framework engine.
17-
*/
1810
public interface Application {
1911

20-
/**
21-
* Get the underlying Scala application.
22-
*
23-
* @
24-
*/
25-
//play.api.Application getWrappedApplication();
26-
27-
/**
28-
* Get the application configuration.
29-
*
30-
* @
31-
*/
32-
//Configuration configuration();
33-
34-
/**
35-
* Get the injector for this application.
36-
*
37-
* @
38-
*/
39-
//Injector injector();
40-
41-
/**
42-
* Get the application path.
43-
*
44-
* @
45-
*/
46-
default File path() {
47-
}
48-
49-
/**
50-
* Get the application classloader.
51-
*
52-
* @
53-
*/
54-
default ClassLoader classloader() {
55-
56-
}
57-
58-
/**
59-
* Get a file relative to the application root path.
60-
*
61-
* @param relativePath relative path of the file to fetch
62-
* @
63-
*/
64-
default File getFile(String relativePath) {
65-
66-
}
67-
68-
/**
69-
* Get a resource from the classpath.
70-
*
71-
* @param relativePath relative path of the resource to fetch
72-
* @
73-
*/
74-
default URL resource(String relativePath) {
12+
default File path() {
13+
return null;
14+
}
7515

76-
}
16+
default ClassLoader classloader() {
17+
return null;
18+
}
7719

78-
/**
79-
* Get a resource stream from the classpath.
80-
*
81-
* @param relativePath relative path of the resource to fetch
82-
* @
83-
*/
84-
default InputStream resourceAsStream(String relativePath) {
20+
default File getFile(String relativePath) {
21+
return null;
22+
}
8523

86-
}
24+
default URL resource(String relativePath) {
25+
return null;
26+
}
8727

88-
}
28+
default InputStream resourceAsStream(String relativePath) {
29+
return null;
30+
}
31+
}
Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
package play;
22

3-
/**
4-
* High-level API to access Play global features.
5-
*
6-
* @deprecated Please use dependency injection. Deprecated since 2.5.0.
7-
*/
83
@Deprecated
94
public class Play {
105

11-
/**
12-
* @deprecated inject the {@link play.Application} instead. Deprecated since 2.5.0.
13-
* @return Deprecated
14-
*/
156
@Deprecated
167
public static Application application() {
8+
return null;
179
}
18-
19-
//private static play.api.Application privateCurrent() { }
20-
}
10+
}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
package play.api.mvc;
22

3-
/** Scala dummy */
4-
public class Request<RequestBody> {
5-
6-
}
3+
public class Request<RequestBody> {}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
package play.api.mvc;
22

3-
/** Scala dummy */
4-
public class RequestHeader {
5-
6-
}
3+
public class RequestHeader {}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
package play.api.mvc;
22

3-
/** XML utilities. */
4-
public class StatusHeader {
5-
6-
}
3+
public class StatusHeader {}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
package play.core.j;
22

3-
/** XML utilities. */
4-
public class JavaContextComponents {
5-
6-
}
3+
public class JavaContextComponents {}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
package play.core.j;
22

3-
/** Scala dummy */
4-
public class RequestImpl {
5-
6-
}
3+
public class RequestImpl {}

java/ql/test/stubs/playframework-2.6.x/play/filters/csrf/AddCSRFToken.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import java.lang.annotation.RetentionPolicy;
66
import java.lang.annotation.Target;
77

8-
/** This action adds a CSRF token to the request and response if not already there. */
98
@Retention(RetentionPolicy.RUNTIME)
109
@Target({ElementType.METHOD, ElementType.TYPE})
11-
public @interface AddCSRFToken {}
10+
public @interface AddCSRFToken {}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
package play.http;
22

3-
/** XML utilities. */
4-
public abstract class HttpEntity {
5-
6-
}
3+
public abstract class HttpEntity {}

java/ql/test/stubs/playframework-2.6.x/play/i18n/Lang.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,5 @@
55
package play.i18n;
66

77
import java.util.*;
8-
import java.util.stream.Stream;
98

10-
//import play.Application;
11-
//import play.libs.*;
12-
//import scala.collection.immutable.Seq;
13-
14-
import static java.util.stream.Collectors.toList;
15-
16-
/** A Lang supported by the application. */
17-
public class Lang /* extends play.api.i18n.Lang */ {
18-
}
9+
public class Lang /* extends play.api.i18n.Lang */ {}

0 commit comments

Comments
 (0)