Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
isochrone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institut für Informatik
dbis
dbis-isochrone
isochrone
Commits
85c8d983
Commit
85c8d983
authored
10 years ago
by
Nikolaus Krismer
Browse files
Options
Downloads
Patches
Plain Diff
fixed NPE
parent
738842c0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/it/unibz/inf/isochrone/config/ConfigDataset.java
+4
-5
4 additions, 5 deletions
...ain/java/it/unibz/inf/isochrone/config/ConfigDataset.java
with
4 additions
and
5 deletions
src/main/java/it/unibz/inf/isochrone/config/ConfigDataset.java
+
4
−
5
View file @
85c8d983
...
...
@@ -372,13 +372,13 @@ public class ConfigDataset {
URL
r
=
null
;
InputStream
r2
=
null
;
Collection
<
String
>
resources
=
null
;
final
Collection
<
String
>
resources
=
new
ArrayList
<>();
try
{
// find resources on disk and add to available ones
r
=
cLoader
.
getResource
(
"/"
);
if
(
r
!=
null
)
{
final
Collection
<
File
>
files
=
FileUtils
.
listFiles
(
new
File
(
r
.
getFile
()),
new
String
[]
{
DS_CONFIG_EXTENSION
},
true
);
resources
=
new
ArrayList
<>(
files
.
size
());
for
(
File
file
:
files
)
{
final
String
filename
=
file
.
getName
();
if
(
dsConfigPattern
.
matcher
(
filename
).
matches
())
{
...
...
@@ -388,7 +388,7 @@ public class ConfigDataset {
}
// find resources on classpath (in jar files...) and add to available ones
r2
=
cLoader
.
getResourceAsStream
(
"
/
"
);
r2
=
cLoader
.
getResourceAsStream
(
""
);
if
(
r2
!=
null
)
{
final
Collection
<
String
>
files
=
IOUtils
.
readLines
(
r2
,
Charsets
.
UTF_8
);
for
(
String
filename
:
files
)
{
...
...
@@ -406,7 +406,6 @@ public class ConfigDataset {
resources
.
addAll
(
files
);
}
}
catch
(
IOException
e
)
{
resources
=
null
;
LOGGER
.
warn
(
"Datasets could not be read. There might be no configured datasets available!"
);
}
finally
{
if
(
r2
!=
null
)
{
...
...
@@ -418,7 +417,7 @@ public class ConfigDataset {
}
}
if
(
resources
==
null
||
resources
.
size
()
<=
0
)
{
if
(
resources
.
size
()
<=
0
)
{
LOGGER
.
debug
(
" - no datasets available"
);
return
Collections
.
emptyList
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment