Skip to content

Commit

Permalink
Merge branch '2.8' into 2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Dec 19, 2017
2 parents 9787983 + 459107d commit 4f16f67
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 2 deletions.
Expand Up @@ -73,6 +73,7 @@ public void validateSubType(DeserializationContext ctxt, JavaType type,
final Class<?> raw = type.getRawClass();
String full = raw.getName();

main_check:
do {
if (_cfgIllegalClassNames.contains(full)) {
break;
Expand All @@ -86,8 +87,8 @@ public void validateSubType(DeserializationContext ctxt, JavaType type,
// looking for "AbstractBeanFactoryPointcutAdvisor" but no point to allow any is there?
if ("AbstractPointcutAdvisor".equals(name)
// ditto for "FileSystemXmlApplicationContext": block all ApplicationContexts
|| "AbstractApplicationContext.equals".equals(name)) {
break;
|| "AbstractApplicationContext".equals(name)) {
break main_check;
}
}
}
Expand Down
@@ -1,5 +1,8 @@
package com.fasterxml.jackson.databind.interop;

import org.springframework.jacksontest.BogusApplicationContext;
import org.springframework.jacksontest.BogusPointcutAdvisor;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.exc.InvalidDefinitionException;
Expand Down Expand Up @@ -68,6 +71,10 @@ public void testJDKTypes1855() throws Exception
{
// apparently included by JDK?
_testIllegalType("com.sun.org.apache.bcel.internal.util.ClassLoader");

// also: we can try some form of testing, even if bit contrived...
_testIllegalType(BogusPointcutAdvisor.class);
_testIllegalType(BogusApplicationContext.class);
}

// 17-Aug-2017, tatu: Ideally would test handling of 3rd party types, too,
Expand Down
@@ -0,0 +1,5 @@
package org.springframework.jacksontest;

public class AbstractApplicationContext {

}
@@ -0,0 +1,5 @@
package org.springframework.jacksontest;

public class AbstractPointcutAdvisor {

}
@@ -0,0 +1,9 @@
package org.springframework.jacksontest;

//Made-up test class that should trigger checks for [databind#1855]
public class BogusApplicationContext extends AbstractApplicationContext {
public BogusApplicationContext(String s) {
super();
throw new Error("Wrong!");
}
}
@@ -0,0 +1,9 @@
package org.springframework.jacksontest;

// Made-up test class that should trigger checks for [databind#1855]
public class BogusPointcutAdvisor extends AbstractPointcutAdvisor {
public BogusPointcutAdvisor(String s) {
super();
throw new Error("Wrong!");
}
}

0 comments on commit 4f16f67

Please sign in to comment.