Skip to content

Commit 231e9bd

Browse files
committed
more internal changes and refactorings
Signed-off-by: Ceki Gulcu <[email protected]>
1 parent 8f3a304 commit 231e9bd

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

logback-core/src/main/java/ch/qos/logback/core/model/ModelConstants.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ public class ModelConstants {
2424
public static final String INVALID_ATTRIBUTES = "In <property> element, either the \"file\" attribute alone, or "
2525
+ "the \"resource\" element alone, or both the \"name\" and \"value\" attributes must be set.";
2626

27-
}
27+
public static final String PARENT_PROPPERTY_KEY = "parent";
28+
}

logback-core/src/main/java/ch/qos/logback/core/model/processor/ImplicitModelHandler.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import ch.qos.logback.core.model.ComponentModel;
2424
import ch.qos.logback.core.model.ImplicitModel;
2525
import ch.qos.logback.core.model.Model;
26+
import ch.qos.logback.core.model.ModelConstants;
2627
import ch.qos.logback.core.spi.ContextAware;
2728
import ch.qos.logback.core.spi.LifeCycle;
2829
import ch.qos.logback.core.util.AggregationType;
@@ -33,8 +34,7 @@ public class ImplicitModelHandler extends ModelHandlerBase {
3334

3435
private final BeanDescriptionCache beanDescriptionCache;
3536
private ImplicitModelData implicitModelData;
36-
37-
static final String PARENT_PROPPERTY_KEY = "parent";
37+
3838
static public final String IGNORING_UNKNOWN_PROP = "Ignoring unknown property";
3939

4040
boolean inError = false;
@@ -196,8 +196,8 @@ private void postHandleComplex(ModelInterpretationContext mic, Model model,
196196
nestedBean.setContext(context);
197197

198198
// have the nested element point to its parent if possible
199-
if (nestedBean.computeAggregationType(PARENT_PROPPERTY_KEY) == AggregationType.AS_COMPLEX_PROPERTY) {
200-
nestedBean.setComplexProperty(PARENT_PROPPERTY_KEY, imdComplex.parentBean.getObj());
199+
if (nestedBean.computeAggregationType(ModelConstants.PARENT_PROPPERTY_KEY) == AggregationType.AS_COMPLEX_PROPERTY) {
200+
nestedBean.setComplexProperty(ModelConstants.PARENT_PROPPERTY_KEY, imdComplex.parentBean.getObj());
201201
}
202202

203203
// start the nested complex property if it implements LifeCycle and is not

0 commit comments

Comments
 (0)