src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XsiNilLoader.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 60,70 ****
if (b != null && b) {
onNil(state);
boolean hasOtherAttributes = (ea.atts.getLength() - 1) > 0;
// see issues 6759703 and 565 - need to preserve attributes even if the element is nil; only when the type is stored in JAXBElement
! if (!(hasOtherAttributes && (state.prev.target instanceof JAXBElement))) {
return Discarder.INSTANCE;
}
}
}
return defaultLoader;
--- 60,70 ----
if (b != null && b) {
onNil(state);
boolean hasOtherAttributes = (ea.atts.getLength() - 1) > 0;
// see issues 6759703 and 565 - need to preserve attributes even if the element is nil; only when the type is stored in JAXBElement
! if (!(hasOtherAttributes && (state.getPrev().getTarget() instanceof JAXBElement))) {
return Discarder.INSTANCE;
}
}
}
return defaultLoader;
*** 94,105 ****
}
@Override
protected void onNil(UnmarshallingContext.State state) throws SAXException {
try {
! acc.set(state.prev.target,null);
! state.prev.nil = true;
} catch (AccessorException e) {
handleGenericException(e,true);
}
}
--- 94,105 ----
}
@Override
protected void onNil(UnmarshallingContext.State state) throws SAXException {
try {
! acc.set(state.getPrev().getTarget(),null);
! state.getPrev().setNil(true);
} catch (AccessorException e) {
handleGenericException(e,true);
}
}
*** 111,119 ****
}
@Override
protected void onNil(UnmarshallingContext.State state) {
// let the receiver add this to the lister
! state.target = null;
}
}
}
--- 111,119 ----
}
@Override
protected void onNil(UnmarshallingContext.State state) {
// let the receiver add this to the lister
! state.setTarget(null);
}
}
}