Skip to content

Commit

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

main_check:
do {
if (_cfgIllegalClassNames.contains(full)) {
break;
Expand All @@ -84,8 +85,8 @@ public void validateSubType(DeserializationContext ctxt, JavaType type) throws J
// 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
Original file line number Diff line number Diff line change
@@ -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.*;

Expand Down Expand Up @@ -67,6 +70,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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.springframework.jacksontest;

public class AbstractApplicationContext {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.springframework.jacksontest;

public class AbstractPointcutAdvisor {

}
Original file line number Diff line number Diff line change
@@ -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!");
}
}
Original file line number Diff line number Diff line change
@@ -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 459107d

Please sign in to comment.