Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mihai.herda
keyjoana
Commits
f07f951a
Commit
f07f951a
authored
Nov 25, 2019
by
Joachim Müssig
Browse files
use ClassLoader to get JAVALANG.txt resource instead of FileInputStream
parent
55e3f655
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/joanakey/javaforkeycreator/javatokeypipeline/CopyKeYCompatibleListener.java
View file @
f07f951a
...
...
@@ -49,7 +49,11 @@ public class CopyKeYCompatibleListener extends Java8BaseListener implements Java
Set
<
StaticCGJavaMethod
>
neededMethods
;
public
CopyKeYCompatibleListener
(
String
mainPackageName
)
throws
FileNotFoundException
,
IOException
{
InputStream
is
=
new
FileInputStream
(
ViolationsWrapper
.
KeY_COMPATIBLE_JAVA_FEATURES
);
// InputStream is = new FileInputStream(ViolationsWrapper.KeY_COMPATIBLE_JAVA_FEATURES);
InputStream
is
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
ViolationsWrapper
.
KeY_COMPATIBLE_JAVA_FEATURES
);
if
(
is
==
null
)
{
System
.
out
.
println
(
"could not read JAVALANG.txt"
);
}
BufferedReader
buf
=
new
BufferedReader
(
new
InputStreamReader
(
is
));
String
line
=
buf
.
readLine
();
this
.
mainPackageName
=
mainPackageName
;
...
...
src/joanakey/violations/ViolationsWrapper.java
View file @
f07f951a
...
...
@@ -63,7 +63,7 @@ public class ViolationsWrapper {
static
final
String
SOURCE
=
"src"
;
static
final
String
SINK
=
"sink"
;
public
static
final
String
KeY_COMPATIBLE_JAVA_FEATURES
=
"otherdata/JAVALANG.txt"
;
public
static
final
String
KeY_COMPATIBLE_JAVA_FEATURES
=
"resources/JAVALANG.txt"
;
//
"otherdata/JAVALANG.txt";
private
Collection
<?
extends
IViolation
<
SecurityNode
>>
uncheckedViolations
;
private
SDG
sdg
;
...
...
@@ -91,7 +91,12 @@ public class ViolationsWrapper {
this
.
callGraph
=
callGraph
;
this
.
ana
=
ana
;
InputStream
is
=
new
FileInputStream
(
KeY_COMPATIBLE_JAVA_FEATURES
);
// InputStream is = new FileInputStream(KeY_COMPATIBLE_JAVA_FEATURES);
InputStream
is
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
"resources/JAVALANG.txt"
);
if
(
is
==
null
)
{
System
.
out
.
println
(
"could not read JAVALANG.txt"
);
}
BufferedReader
buf
=
new
BufferedReader
(
new
InputStreamReader
(
is
));
String
line
=
buf
.
readLine
();
while
(
line
!=
null
)
{
...
...
otherdata
/JAVALANG.txt
→
src/resources
/JAVALANG.txt
View file @
f07f951a
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment