Skip to content

Commit 33526f6

Browse files
committed
Make path creation subclasses private.
1 parent b705f7f commit 33526f6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

java/ql/src/semmle/code/java/security/PathCreation.qll

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ abstract class PathCreation extends Expr {
1515
}
1616

1717
/** Models the `java.nio.file.Paths.get` method. */
18-
class PathsGet extends PathCreation, MethodAccess {
18+
private class PathsGet extends PathCreation, MethodAccess {
1919
PathsGet() {
2020
exists(Method m | m = this.getMethod() |
2121
m.getDeclaringType() instanceof TypePaths and
@@ -27,7 +27,7 @@ class PathsGet extends PathCreation, MethodAccess {
2727
}
2828

2929
/** Models the `java.nio.file.FileSystem.getPath` method. */
30-
class FileSystemGetPath extends PathCreation, MethodAccess {
30+
private class FileSystemGetPath extends PathCreation, MethodAccess {
3131
FileSystemGetPath() {
3232
exists(Method m | m = this.getMethod() |
3333
m.getDeclaringType() instanceof TypeFileSystem and
@@ -39,7 +39,7 @@ class FileSystemGetPath extends PathCreation, MethodAccess {
3939
}
4040

4141
/** Models the `new java.io.File(...)` constructor. */
42-
class FileCreation extends PathCreation, ClassInstanceExpr {
42+
private class FileCreation extends PathCreation, ClassInstanceExpr {
4343
FileCreation() { this.getConstructedType() instanceof TypeFile }
4444

4545
override Expr getAnInput() {
@@ -50,7 +50,7 @@ class FileCreation extends PathCreation, ClassInstanceExpr {
5050
}
5151

5252
/** Models the `java.nio.file.Path.resolveSibling` method. */
53-
class PathResolveSiblingCreation extends PathCreation, MethodAccess {
53+
private class PathResolveSiblingCreation extends PathCreation, MethodAccess {
5454
PathResolveSiblingCreation() {
5555
exists(Method m | m = this.getMethod() |
5656
m.getDeclaringType() instanceof TypePath and
@@ -66,7 +66,7 @@ class PathResolveSiblingCreation extends PathCreation, MethodAccess {
6666
}
6767

6868
/** Models the `java.nio.file.Path.resolve` method. */
69-
class PathResolveCreation extends PathCreation, MethodAccess {
69+
private class PathResolveCreation extends PathCreation, MethodAccess {
7070
PathResolveCreation() {
7171
exists(Method m | m = this.getMethod() |
7272
m.getDeclaringType() instanceof TypePath and
@@ -82,7 +82,7 @@ class PathResolveCreation extends PathCreation, MethodAccess {
8282
}
8383

8484
/** Models the `java.nio.file.Path.of` method. */
85-
class PathOfCreation extends PathCreation, MethodAccess {
85+
private class PathOfCreation extends PathCreation, MethodAccess {
8686
PathOfCreation() {
8787
exists(Method m | m = this.getMethod() |
8888
m.getDeclaringType() instanceof TypePath and
@@ -94,7 +94,7 @@ class PathOfCreation extends PathCreation, MethodAccess {
9494
}
9595

9696
/** Models the `new java.io.FileWriter(...)` constructor. */
97-
class FileWriterCreation extends PathCreation, ClassInstanceExpr {
97+
private class FileWriterCreation extends PathCreation, ClassInstanceExpr {
9898
FileWriterCreation() { this.getConstructedType().hasQualifiedName("java.io", "FileWriter") }
9999

100100
override Expr getAnInput() {
@@ -105,7 +105,7 @@ class FileWriterCreation extends PathCreation, ClassInstanceExpr {
105105
}
106106

107107
/** Models the `new java.io.FileReader(...)` constructor. */
108-
class FileReaderCreation extends PathCreation, ClassInstanceExpr {
108+
private class FileReaderCreation extends PathCreation, ClassInstanceExpr {
109109
FileReaderCreation() { this.getConstructedType().hasQualifiedName("java.io", "FileReader") }
110110

111111
override Expr getAnInput() {
@@ -116,7 +116,7 @@ class FileReaderCreation extends PathCreation, ClassInstanceExpr {
116116
}
117117

118118
/** Models the `new java.io.FileInputStream(...)` constructor. */
119-
class FileInputStreamCreation extends PathCreation, ClassInstanceExpr {
119+
private class FileInputStreamCreation extends PathCreation, ClassInstanceExpr {
120120
FileInputStreamCreation() {
121121
this.getConstructedType().hasQualifiedName("java.io", "FileInputStream")
122122
}
@@ -129,7 +129,7 @@ class FileInputStreamCreation extends PathCreation, ClassInstanceExpr {
129129
}
130130

131131
/** Models the `new java.io.FileOutputStream(...)` constructor. */
132-
class FileOutputStreamCreation extends PathCreation, ClassInstanceExpr {
132+
private class FileOutputStreamCreation extends PathCreation, ClassInstanceExpr {
133133
FileOutputStreamCreation() {
134134
this.getConstructedType().hasQualifiedName("java.io", "FileOutputStream")
135135
}

0 commit comments

Comments
 (0)