Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
Just-CJ committed Dec 26, 2024
1 parent 9785dc8 commit d9745e6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ public class SingleClassLoaderSofaSerializerFactory extends SerializerFactory {
/**
* logger for this class
*/
private static final Logger LOGGER = LoggerFactory
.getLogger(SingleClassLoaderSofaSerializerFactory.class);

private Map<ClassLoader, Map<String, Object>> _typeNotFoundMap = new ConcurrentHashMap<ClassLoader, Map<String, Object>>(
8);
private static final Object NOT_FOUND = new Object();
private boolean dynamicLoadEnable = Boolean.parseBoolean(System.getProperty(
DYNAMIC_LOAD_ENABLE_KEY,
Boolean.FALSE.toString()));
private static final Logger LOGGER = LoggerFactory
.getLogger(SingleClassLoaderSofaSerializerFactory.class);

private Map<ClassLoader, Map<String, Object>> _typeNotFoundMap = new ConcurrentHashMap<ClassLoader, Map<String, Object>>(
8);
private static final Object NOT_FOUND = new Object();
private boolean dynamicLoadEnable = Boolean.parseBoolean(System.getProperty(
DYNAMIC_LOAD_ENABLE_KEY,
Boolean.FALSE.toString()));

@Override
protected Serializer getDefaultSerializer(Class cl) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public void testDynamicLoadDisabled() throws Exception {
SingleClassLoaderSofaSerializerFactory factory = new SingleClassLoaderSofaSerializerFactory();
Field field = SingleClassLoaderSofaSerializerFactory.class.getDeclaredField("_typeNotFoundMap");
field.setAccessible(true);
Map<ClassLoader, Map<String, Object>> _typeNotFoundMap = (Map<ClassLoader, Map<String, Object>>) field.get(factory);
Map<ClassLoader, Map<String, Object>> _typeNotFoundMap = (Map<ClassLoader, Map<String, Object>>) field
.get(factory);
Assert.assertEquals(0, _typeNotFoundMap.size());
Deserializer deserializer = factory.getDeserializer("mock.xxx.MockObject");
Assert.assertNull(deserializer);
Expand All @@ -86,13 +87,13 @@ public void testDynamicLoadEnabled() throws Exception {
SingleClassLoaderSofaSerializerFactory factory = new SingleClassLoaderSofaSerializerFactory();
Field field = SingleClassLoaderSofaSerializerFactory.class.getDeclaredField("_typeNotFoundMap");
field.setAccessible(true);
Map<ClassLoader, Map<String, Object>> _typeNotFoundMap = (Map<ClassLoader, Map<String, Object>>) field.get(factory);
Map<ClassLoader, Map<String, Object>> _typeNotFoundMap = (Map<ClassLoader, Map<String, Object>>) field
.get(factory);
Assert.assertEquals(0, _typeNotFoundMap.size());
Deserializer deserializer = factory.getDeserializer("mock.xxx.MockObject");
Assert.assertNull(deserializer);
Assert.assertEquals(0, _typeNotFoundMap.size());
}
finally {
} finally {
System.clearProperty(SerializerFactory.DYNAMIC_LOAD_ENABLE_KEY);
}
}
Expand Down

0 comments on commit d9745e6

Please sign in to comment.