Skip to content

Commit c7362a0

Browse files
committed
Fix #52 (manual merge of fix; test can't go in 2.x as it needs Java 8)
1 parent 70e072e commit c7362a0

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
language: java
22

33
jdk:
4-
- openjdk7
54
- openjdk8
5+
- openjdk11
66

77
# whitelist
88
branches:
99
only:
1010
- master
11-
- 2.9
11+
- 2.10
1212
env:
1313
global:
1414
- secure: "QNxd7SfYx4lv/q3fJyON9Paefzh1yVMXSR5t+T8QDmASn0A0+KgiMIjBFSF7XZVnlj4fCRR3WxZVL1C2QlS1fis9hMppCVs5E3D6uCEy+9HV8AChPWO/iVciWzfyK6lNC/mq5BbduNmGrif39DWcaZnOiGqz+bC1QPfBSDl3kcjoRdWCKfPVLmsLm27zYIJ+bsk+1hzCKkhnwhYNKkUuO+Qee/2eZAfsxdVNXryaMA03c6kgRa87ZPYegwGm77y7CA6DFxiKDGXkRDkZVSbe/6k1mf44tgrDfhuN+meR+UHnGMvd3UXMh5W2d3fQhRttV4cQ/lD82RbDBJ9p2d14DPDil3xfyP1JBcP2DJ0FkXIMem8xD5/vWh3jb/K7Ot7F8xefkdASK/IOcXnvHlvFb26gZZgYgCHiwF7eqpKxDxoExFFY1Hil62ElNLZYXoxE32xmcxuWcFlrX1Mrm7ueOhAPL9btR0dQhYiCNLXxpriTtNbZX91UfOP+2Xaxepz73yEAuk3xuFhcZcBRC88UE9Y3BNa3zz7CLr9aL5YN/NE62tDpuAtTRB//uG5vWWcp0UP2AjF7Jvflno0wbV114BTbs01FfFOZ4pxXBixdiyfmhz0fGYiEP6tCX8RzFURd76Me7egGj9v7Ei8u4nuKgGr7HC36sB0K2H4W3Ql8gmg="

mrbean/src/main/java/com/fasterxml/jackson/module/mrbean/BeanBuilder.java

+7-9
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ public BeanBuilder implement(boolean failOnUnrecognized)
6868
// First: find all supertypes:
6969
implTypes.add(_type);
7070
BeanUtil.findSuperTypes(_type, Object.class, implTypes);
71-
final boolean hasConcrete = !_type.isInterface();
72-
71+
7372
for (JavaType impl : implTypes) {
7473
TypeResolutionContext ctxt = buildTypeContext(impl);
7574

@@ -107,7 +106,7 @@ public BeanBuilder implement(boolean failOnUnrecognized)
107106
continue;
108107
}
109108
// [module-mrbean#11]: try to support overloaded methods
110-
if (hasConcrete && hasConcreteOverride(m, _type)) {
109+
if (hasConcreteOverride(m, _type)) {
111110
continue;
112111
}
113112
if (failOnUnrecognized) {
@@ -117,14 +116,13 @@ public BeanBuilder implement(boolean failOnUnrecognized)
117116
_unsupportedMethods.put(methodName, m);
118117
}
119118
}
120-
121119
return this;
122120
}
123121

124122
/**
125123
* Method that generates byte code for class that implements abstract
126124
* types requested so far.
127-
*
125+
*
128126
* @param className Fully-qualified name of the class to generate
129127
* @return Byte code Class instance built by this builder
130128
*/
@@ -176,7 +174,7 @@ public byte[] build(String className)
176174
/**
177175
* Helper method used to detect if an abstract method found in a base class
178176
* may actually be implemented in a (more) concrete sub-class.
179-
*
177+
*
180178
* @since 2.4
181179
*/
182180
protected boolean hasConcreteOverride(Method m0, JavaType implementedType)
@@ -196,7 +194,7 @@ protected boolean hasConcreteOverride(Method m0, JavaType implementedType)
196194
}
197195
return false;
198196
}
199-
197+
200198
protected String getPropertyName(String methodName)
201199
{
202200
int prefixLen = methodName.startsWith("is") ? 2 : 3;
@@ -220,7 +218,7 @@ protected void addGetter(TypeResolutionContext ctxt, Method m)
220218
POJOProperty prop = findProperty(ctxt, getPropertyName(m.getName()));
221219
// only set if not yet set; we start with super class:
222220
if (prop.getGetter() == null) {
223-
prop.setGetter(m);
221+
prop.setGetter(m);
224222
}
225223
}
226224

@@ -241,7 +239,7 @@ protected POJOProperty findProperty(TypeResolutionContext ctxt, String propName)
241239
}
242240
return prop;
243241
}
244-
242+
245243
protected final static boolean returnsBoolean(Method m)
246244
{
247245
Class<?> rt = m.getReturnType();

release-notes/VERSION-2.x

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Modules:
1212

1313
2.10.0 (not yet released)
1414

15-
#79: Add simple module-info for JDK9+, using Moditect
15+
#52: (mrbean) Interfaces may have non-abstract methods (since java8)
16+
#79: (all) Add simple module-info for JDK9+, using Moditect
1617
- Update `asm` version 5.2 -> 7.0 for JDK 11 support
1718
- Remove SPI metadata for OSGi module as there is no 0-arg constructor, does
1819
not work

0 commit comments

Comments
 (0)