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
8bb293f5
Commit
8bb293f5
authored
Aug 12, 2024
by
Riegel
Browse files
Changed error messaging to use logger. Ref
#69
parent
81964b6c
Changes
1
Show whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/utils/Copy.java
View file @
8bb293f5
...
@@ -18,6 +18,10 @@
...
@@ -18,6 +18,10 @@
*/
*/
package
de.hft.stuttgart.citydoctor2.utils
;
package
de.hft.stuttgart.citydoctor2.utils
;
import
org.apache.logging.log4j.Level
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -26,6 +30,8 @@ import java.io.ObjectOutputStream;
...
@@ -26,6 +30,8 @@ import java.io.ObjectOutputStream;
public
class
Copy
{
public
class
Copy
{
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
Copy
.
class
);
private
Copy
()
{
private
Copy
()
{
}
}
...
@@ -41,16 +47,11 @@ public class Copy {
...
@@ -41,16 +47,11 @@ public class Copy {
ByteArrayInputStream
in
=
new
ByteArrayInputStream
(
byteArray
);
ByteArrayInputStream
in
=
new
ByteArrayInputStream
(
byteArray
);
ObjectInputStream
ois
=
new
ObjectInputStream
(
in
);
ObjectInputStream
ois
=
new
ObjectInputStream
(
in
);
return
(
T
)
ois
.
readObject
();
return
(
T
)
ois
.
readObject
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
|
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
logger
.
log
(
Level
.
ERROR
,
e
.
getMessage
(),
e
);
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
}
}
throw
new
IllegalStateException
();
throw
new
IllegalStateException
();
// CopyHandler handler = new CopyHandler();
// return handler.copy(original);
}
}
}
}
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