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
11c31eb0
Commit
11c31eb0
authored
Jan 15, 2026
by
Luna Riegel
Browse files
Refactor: Cleanup Code
parent
9e555084
Changes
4
Show whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/database/EmbeddedDatabaseConfiguration.java
View file @
11c31eb0
...
@@ -25,7 +25,6 @@ public record EmbeddedDatabaseConfiguration(String databaseName, String database
...
@@ -25,7 +25,6 @@ public record EmbeddedDatabaseConfiguration(String databaseName, String database
private
static
final
String
JDBC_DRIVER_PREFIX
=
"jdbc:h2:"
;
private
static
final
String
JDBC_DRIVER_PREFIX
=
"jdbc:h2:"
;
private
static
final
String
AUTO_SERVER_PARAMETER
=
"AUTO_SERVER=TRUE"
;
private
static
final
String
AUTO_SERVER_PARAMETER
=
"AUTO_SERVER=TRUE"
;
private
static
final
String
KEEP_ALIVE_PARAMETER
=
"DB_CLOSE_DELAY=-1"
;
private
static
final
String
KEEP_ALIVE_PARAMETER
=
"DB_CLOSE_DELAY=-1"
;
private
static
final
String
FILE_PREFIX
=
"file://"
;
/**
/**
* Instantiates the default configuration for the embedded database.
* Instantiates the default configuration for the embedded database.
*/
*/
...
...
CityDoctorParent/CityDoctorModel/src/test/java/de/hft/stuttgart/citydoctor2/database/EmbeddedDataBaseHandlerTest.java
View file @
11c31eb0
...
@@ -23,15 +23,13 @@ import java.util.List;
...
@@ -23,15 +23,13 @@ import java.util.List;
import
static
de
.
hft
.
stuttgart
.
citydoctor2
.
database
.
SerializationTest
.
assertCityObjectEquality
;
import
static
de
.
hft
.
stuttgart
.
citydoctor2
.
database
.
SerializationTest
.
assertCityObjectEquality
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertFalse
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertNull
;
import
static
org
.
junit
.
Assert
.
assertNull
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
static
org
.
junit
.
Assert
.
fail
;
public
class
EmbeddedDataBaseHandlerTest
{
public
class
EmbeddedDataBaseHandlerTest
{
private
EmbeddedDatabaseHandler
handler
=
new
EmbeddedDatabaseHandler
(
new
EmbeddedDatabaseConfiguration
());
private
final
EmbeddedDatabaseHandler
handler
=
new
EmbeddedDatabaseHandler
(
new
EmbeddedDatabaseConfiguration
());
@Test
@Test
public
void
testTempFileConfiguration
(){
public
void
testTempFileConfiguration
(){
...
...
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/check/Checker.java
View file @
11c31eb0
...
@@ -150,8 +150,8 @@ public class Checker {
...
@@ -150,8 +150,8 @@ public class Checker {
return
;
return
;
}
}
File
xmlFile
=
new
File
(
xmlOutput
);
File
xmlFile
=
new
File
(
xmlOutput
);
if
(
xmlFile
.
getParentFile
()
!=
null
)
{
if
(
xmlFile
.
getParentFile
()
!=
null
&&
xmlFile
.
getParentFile
().
mkdirs
()
)
{
xmlFile
.
getParentFile
().
mkdirs
(
);
logger
.
trace
(
"Xml dir created"
);
}
}
Reporter
reporter
=
new
XmlValidationReporter
();
Reporter
reporter
=
new
XmlValidationReporter
();
try
(
BufferedOutputStream
bos
=
new
BufferedOutputStream
(
new
FileOutputStream
(
xmlFile
.
getAbsolutePath
())))
{
try
(
BufferedOutputStream
bos
=
new
BufferedOutputStream
(
new
FileOutputStream
(
xmlFile
.
getAbsolutePath
())))
{
...
@@ -166,9 +166,10 @@ public class Checker {
...
@@ -166,9 +166,10 @@ public class Checker {
return
;
return
;
}
}
File
pdfFile
=
new
File
(
pdfOutput
);
File
pdfFile
=
new
File
(
pdfOutput
);
if
(
pdfFile
.
getParentFile
()
!=
null
)
{
if
(
pdfFile
.
getParentFile
()
!=
null
&&
pdfFile
.
getParentFile
().
mkdirs
())
{
pdfFile
.
getParentFile
().
mkdirs
(
);
logger
.
trace
(
"Pdf dir created"
);
}
}
Reporter
reporter
=
new
PdfReporter
();
Reporter
reporter
=
new
PdfReporter
();
try
(
BufferedOutputStream
bos
=
new
BufferedOutputStream
(
new
FileOutputStream
(
pdfFile
.
getAbsolutePath
())))
{
try
(
BufferedOutputStream
bos
=
new
BufferedOutputStream
(
new
FileOutputStream
(
pdfFile
.
getAbsolutePath
())))
{
reporter
.
writeReport
(
checkConfig
,
bos
,
model
,
config
);
reporter
.
writeReport
(
checkConfig
,
bos
,
model
,
config
);
...
@@ -243,7 +244,6 @@ public class Checker {
...
@@ -243,7 +244,6 @@ public class Checker {
private
void
handleSchematronResults
(
SvrlContentHandler
handler
)
{
private
void
handleSchematronResults
(
SvrlContentHandler
handler
)
{
CityObjectCache
cache
=
model
.
getCache
();
CityObjectCache
cache
=
model
.
getCache
();
handleSchematronErrorsGlobal
(
handler
.
getGeneralErrors
());
handleSchematronErrorsGlobal
(
handler
.
getGeneralErrors
());
Map
<
String
,
CityObject
>
featureMap
=
new
HashMap
<>();
boolean
onlySchematron
=
execLayers
.
isEmpty
();
boolean
onlySchematron
=
execLayers
.
isEmpty
();
if
(
onlySchematron
)
{
if
(
onlySchematron
)
{
CheckableUtilsVisitor
visitor
=
new
CheckableUtilsVisitor
()
{
CheckableUtilsVisitor
visitor
=
new
CheckableUtilsVisitor
()
{
...
@@ -252,12 +252,7 @@ public class Checker {
...
@@ -252,12 +252,7 @@ public class Checker {
checkable
.
setValidated
(
true
);
checkable
.
setValidated
(
true
);
}
}
};
};
model
.
createFeatureStream
().
forEach
(
f
->
{
model
.
createFeatureStream
().
forEach
(
co
->
co
.
accept
(
visitor
));
featureMap
.
put
(
f
.
getGmlId
().
getGmlString
(),
f
);
f
.
accept
(
visitor
);
});
}
else
{
model
.
createFeatureStream
().
forEach
(
f
->
featureMap
.
put
(
f
.
getGmlId
().
getGmlString
(),
f
));
}
}
handler
.
getFeatureErrors
().
forEach
((
k
,
v
)
->
{
handler
.
getFeatureErrors
().
forEach
((
k
,
v
)
->
{
String
trimmedId
=
k
.
trim
();
String
trimmedId
=
k
.
trim
();
...
...
CityDoctorParent/Extensions/CityDoctorHealer/src/main/java/de/hft/stuttgart/citydoctor2/healer/Healer.java
View file @
11c31eb0
...
@@ -296,9 +296,7 @@ public class Healer {
...
@@ -296,9 +296,7 @@ public class Healer {
*
*
* @param aco the feature to write
* @param aco the feature to write
* @return the byte array containing the feature
* @return the byte array containing the feature
* @throws ADEException
* @throws CityGMLWriteException if writing of the CityGML file fails
* @throws CityGMLBuilderException
* @throws CityGMLWriteException
*/
*/
private
byte
[]
writeCityGml
(
AbstractCityObject
aco
)
throws
CityGMLWriteException
{
private
byte
[]
writeCityGml
(
AbstractCityObject
aco
)
throws
CityGMLWriteException
{
CityModel
model
=
new
CityModel
();
CityModel
model
=
new
CityModel
();
...
...
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