Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
3cd96976
Commit
3cd96976
authored
Jan 19, 2026
by
Luna Riegel
Browse files
Fix: Add null-handling for poolSize property
parent
1b3eb97f
Changes
1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/database/DatabaseSettings.java
View file @
3cd96976
...
...
@@ -51,20 +51,20 @@ public final class DatabaseSettings {
boolean
attemptFallback
=
attemptFallbackString
==
null
||
Boolean
.
parseBoolean
(
attemptFallbackString
);
boolean
debugMode
=
Boolean
.
parseBoolean
(
debugModeString
);
boolean
tempMode
=
Boolean
.
parseBoolean
(
tempModeString
);
int
poolSize
;
try
{
poolSize
=
Integer
.
parseInt
(
poolSizeString
);
if
(
poolSize
<
1
)
{
//TODO: Localize String
logger
.
warn
(
"poolSize property cannot be less than 1, using default value"
);
poolSize
=
defaultConfig
.
connectionPoolSize
();
}
}
catch
(
NumberFormatException
e
)
{
//TODO: Localize String
logger
.
warn
(
"poolSize property must be an integer, using default value"
);
poolSize
=
defaultConfig
.
connectionPoolSize
();
int
poolSize
=
defaultConfig
.
connectionPoolSize
();
if
(
poolSizeString
!=
null
&&
!
poolSizeString
.
isBlank
()){
try
{
int
size
=
Integer
.
parseInt
(
poolSizeString
);
if
(
size
<
1
)
{
logger
.
warn
(
Localization
.
getText
(
"DatabaseSettings.poolSizeLessThanOne"
));
}
else
poolSize
=
size
;
}
catch
(
NumberFormatException
e
)
{
logger
.
warn
(
Localization
.
getText
(
"DatabaseSettings.poolSizeNaN"
));
}
}
if
(
name
==
null
||
name
.
isBlank
()){
name
=
defaultConfig
.
databaseName
();
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment