Project

Profile

Help

Revision 48713e66

Added by Michael Kay about 13 years ago

Fix bug 2315436 - NPE in SingletonAtomizer.java when container not set as a result of variable inlining

View differences:

latest9.1/bj/net/sf/saxon/expr/PromotionOffer.java
231 231
                if (child instanceof VariableReference &&
232 232
                    ((VariableReference)child).getBinding() == bindingList[0]) {
233 233
                    try {
234
                        return containingExpression.copy();
234
                        Expression copy = containingExpression.copy();
235
                        ExpressionTool.copyLocationInfo(child, copy);
236
                        return copy;
235 237
                    } catch (UnsupportedOperationException err) {
236 238
                        // If we can't make a copy, return the original. This is safer than it seems,
237 239
                        // because on the paths where this happens, we are merely moving the expression from
latest9.1/bj/net/sf/saxon/expr/SingletonAtomizer.java
1 1
package net.sf.saxon.expr;
2 2
import net.sf.saxon.Configuration;
3
import net.sf.saxon.instruct.Executable;
4 3
import net.sf.saxon.om.Item;
5 4
import net.sf.saxon.om.NodeInfo;
6 5
import net.sf.saxon.om.SequenceIterator;
......
173 172

  
174 173
	public ItemType getItemType(TypeHierarchy th) {
175 174
        boolean isSchemaAware = true;
176
        Executable exec = getExecutable();
177
        if (exec != null && !exec.getConfiguration().isSchemaAware(Configuration.XML_SCHEMA)) {
175
        //Executable exec = getExecutable();
176
        if (!th.getConfiguration().isSchemaAware(Configuration.XML_SCHEMA)) {
178 177
            isSchemaAware = false;
179 178
        }
180 179
        ItemType in = operand.getItemType(th);

Also available in: Unified diff