-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* (docs): update docs references from `master` to `main` * (docs): switch build status badge to buildkite * Update selector to accept only the major version * Update Changelog * update linting * Added severity check (#214) * added severity check * fixed linting * fixed linting v2 * added changelog entry * Reverting changes * update notify override with null check * Update changelog * Update Bugsnag.java call notify override method on null severity * add aopproxyutils dependancy and add handling in scheduledTaskConfig class (#218) * add aopproxyutils dependancy and add handling in scheduledTaskConfig class * fixed comment typo * fixed import of aoputils * added proxy testing * fixed linting * Updated tests * updated tests * update changelog * moving createProxy method to util class * update variable name * reverting * Update Serializer object to be an interface (#219) * Adding non serializable metadata handling * removed an unused import * update feature * update changelog * Add serializeObject public method * Fixed linting * fixed tests * Implemented Serializer interface * update scenarios * update changelog * Changes based on feedback * update tests * updates based on reviews * Update bugsnag/src/main/java/com/bugsnag/Configuration.java Co-authored-by: Tom Longridge <[email protected]> * update config --------- Co-authored-by: Tom Longridge <[email protected]> * v3.7.2 --------- Co-authored-by: Yousif Ahmed <[email protected]> Co-authored-by: Yousif <[email protected]> Co-authored-by: Tom Longridge <[email protected]>
- Loading branch information
1 parent
8cc7444
commit 8663402
Showing
17 changed files
with
177 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
bugsnag/src/main/java/com/bugsnag/serialization/DefaultSerializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.bugsnag.serialization; | ||
|
||
import com.fasterxml.jackson.annotation.JsonAutoDetect; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
|
||
public class DefaultSerializer implements Serializer { | ||
private ObjectMapper mapper = new ObjectMapper(); | ||
|
||
/** | ||
* Constructor. | ||
*/ | ||
// Use deprecated method to ensure we don't break with older versions of jackson | ||
@SuppressWarnings("deprecation") | ||
public DefaultSerializer() { | ||
mapper | ||
.setSerializationInclusion(JsonInclude.Include.NON_EMPTY) | ||
.setVisibilityChecker( | ||
mapper.getVisibilityChecker().with(JsonAutoDetect.Visibility.NONE)); | ||
} | ||
|
||
@Override | ||
public void writeToStream(OutputStream stream, Object object) throws SerializationException { | ||
try { | ||
mapper.writeValue(stream, object); | ||
} catch (IOException ex) { | ||
throw new SerializationException("Exception during serialization", ex); | ||
} | ||
} | ||
} |
34 changes: 6 additions & 28 deletions
34
bugsnag/src/main/java/com/bugsnag/serialization/Serializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,17 @@ | ||
package com.bugsnag.serialization; | ||
|
||
import com.fasterxml.jackson.annotation.JsonAutoDetect; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
|
||
public class Serializer { | ||
private ObjectMapper mapper = new ObjectMapper(); | ||
|
||
/** | ||
* Constructor. | ||
*/ | ||
// Use deprecated method to ensure we don't break with older versions of jackson | ||
@SuppressWarnings("deprecation") | ||
public Serializer() { | ||
mapper | ||
.setSerializationInclusion(JsonInclude.Include.NON_EMPTY) | ||
.setVisibilityChecker( | ||
mapper.getVisibilityChecker().with(JsonAutoDetect.Visibility.NONE)); | ||
} | ||
|
||
/** | ||
* The Serializer is called to generate the JSON for an object to be added as metadata to a Bugsnag event. | ||
*/ | ||
public interface Serializer { | ||
/** | ||
* Write the object to the stream. | ||
* Write the specified object to the provided stream to be used on metadata for a Bugsnag event. | ||
* | ||
* @param stream the stream to write the object to. | ||
* @param object the object to write to the stream. | ||
* @throws SerializationException the object could not be serialized. | ||
*/ | ||
public void writeToStream(OutputStream stream, Object object) throws SerializationException { | ||
try { | ||
mapper.writeValue(stream, object); | ||
} catch (IOException ex) { | ||
throw new SerializationException("Exception during serialization", ex); | ||
} | ||
} | ||
void writeToStream(OutputStream stream, Object object) throws SerializationException; | ||
} |
Oops, something went wrong.