Wrap the last location step in an Identifier.

@param selector
@param start
@param bumpLocationStep
@throws InvalidXPathSyntaxException
343685
private void wrapLastLocationStep(String selector,
                                    int start,
                                    boolean bumpLocationStep)
    throws InvalidXPathSyntaxException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.entry(cclass,
               "wrapLastLocationStep",
               "selector: " + selector + ", start: " + start + 
               ", bumpLocationStep: " + new Boolean(bumpLocationStep));
    
    int stepEnd = selector.length();
    String step =  selector.substring(start,stepEnd);
    String full =  selector.substring(0,stepEnd);
    // Add an IdentifierImpl for the location step to the array list
    selOperands.add(createIdentifierForSubExpression(step, full, bumpLocationStep, true));
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.exit(this,cclass, "wrapLastLocationStep");    
  }
1007888
@Override
    public void setRedirectLocation(String location, String renderUrlParamName) {
        this.location = location;
        this.renderUrlParamName = renderUrlParamName;
    }
279025
private static PortablePosition navigateToPathTokenWithAnyQuantifierInPortableArray(
            PortableNavigatorContext ctx, PortablePathCursor path, NavigationFrame frame) throws IOException {
        // if no frame, we're pursuing the cell[0] case and populating the frames for cell[1 to length-1]
        if (frame == null) {
            // first we check if array null or empty
            int len = getArrayLengthOfTheField(ctx);
            PortablePosition result = doValidateArrayLengthForAnyQuantifier(len, path.isLastToken());
            if (result != null) {
                return result;
            }

            // then we populate frames for cell[1 to length-1]
            ctx.populateAnyNavigationFrames(path.index(), len);

            // pursue navigation to index 0, return result if last token
            int cellIndex = 0;
            result = doNavigateToPortableArrayCell(ctx, path, cellIndex);
            if (result != null) {
                return result;
            }
        } else {
            // pursue navigation to index given by the frame, return result if last token
            // no validation since it index in-bound has been validated while the navigation frames have been populated
            PortablePosition result = doNavigateToPortableArrayCell(ctx, path, frame.arrayIndex);
            if (result != null) {
                return result;
            }
        }
        return null;
    }
1336767
private void takeNextStep(int lastStep, int nextStep)
    {
        if (!pathStoppedRequested)
        {
            removeObjectId(path.getX(lastStep), path.getY(lastStep));
            assignObjectId(path.getX(nextStep), path.getY(nextStep));
        }
    }
651597
public void step(Context ctxt, ILexLocation location)
	{
		if (Settings.dialect == Dialect.VDM_RT)
		{
			if (!virtual)
			{
				duration(getObject().getCPU().getDuration(Properties.rt_cycle_default), ctxt, location);
			}
		} else
		{
			SystemClock.advance(Properties.rt_duration_default);
		}

		// Note that we don't reschedule if we are in an outer cycles/duration

		if (++steps >= timeslice && !inOuterTimeStep)
		{
			reschedule(ctxt, location);
			steps = 0;
		}
	}
121046
@Override
    public void startElement( String uri, String localName, String qName, Attributes attributes )
        throws SAXException
    {
        flushCharacters();
        IndentCheckSaxHandler.ElementEntry currentEntry = new ElementEntry( qName, lastIndent );
        if ( !stack.isEmpty() )
        {
            IndentCheckSaxHandler.ElementEntry parentEntry = stack.peek();
            /*
             * note that we use parentEntry.expectedIndent rather than parentEntry.foundIndent this is to make the
             * messages more useful
             */
            int indentDiff = currentEntry.foundIndent.size - parentEntry.expectedIndent.size;
            int expectedIndent = parentEntry.expectedIndent.size + indentSize;
            if ( indentDiff == 0 && currentEntry.foundIndent.lineNumber == parentEntry.foundIndent.lineNumber )
            {
                /*
                 * Zero foundIndent acceptable only if current is on the same line as parent This is OK, therefore do
                 * nothing
                 */
            }
            else if ( indentDiff != indentSize )
            {
                /* generally unexpected foundIndent */
                int opValue = expectedIndent - currentEntry.foundIndent.size;
                String op = opValue > 0 ? "Insert" : "Delete";
                String message = op + " " + Math.abs( opValue ) + " spaces. Expected " + expectedIndent + " found "
                    + currentEntry.foundIndent.size + " spaces before start element <" + currentEntry.elementName + ">";

                XmlFormatViolation violation =
                    new XmlFormatViolation( file, locator.getLineNumber(), locator.getColumnNumber(), message );
                violationHandler.handle( violation );

                /* reset the expected indent in the entry we'll push */
                currentEntry =
                    new ElementEntry( qName, lastIndent, new Indent( lastIndent.lineNumber, expectedIndent ) );
            }
        }
        stack.push( currentEntry );
    }
129974
private static PortablePosition navigateToPathTokenWithAnyQuantifierInPrimitiveArray(
            PortableNavigatorContext ctx, PortablePathCursor path, NavigationFrame frame) throws IOException {
        // if no frame, we're pursuing the cell[0] case and populating the frames for cell[1 to length-1]
        if (frame == null) {
            if (path.isLastToken()) {
                // first we check if array null or empty
                int len = getArrayLengthOfTheField(ctx);
                PortablePosition result = doValidateArrayLengthForAnyQuantifier(len, path.isLastToken());
                if (result != null) {
                    return result;
                }

                // then we populate frames for cell[1 to length-1]
                ctx.populateAnyNavigationFrames(path.index(), len);

                // finally, we return the cell's position for reading -> cell[0]
                return createPositionForReadAccess(ctx, path, 0);
            }
            // primitive array cell has to be a last token, there's no furhter navigation from there.
            throw createWrongUseOfAnyOperationException(ctx, path.path());
        } else {
            if (path.isLastToken()) {
                return createPositionForReadAccess(ctx, path, frame.arrayIndex);
            }
            throw createWrongUseOfAnyOperationException(ctx, path.path());
        }
    }
685370
public void startPath(Point point) {
		if (point.isEmpty())
			throw new IllegalArgumentException();// throw new
													// IllegalArgumentException();

		mergeVertexDescription(point.getDescription());
		_initPathStartPoint();
		point.copyTo(m_moveToPoint);

		// TODO check MultiPathImpl.cpp comment
		// "//the description will be merged later"
		// assignVertexDescription(m_moveToPoint.getDescription());
		m_bPathStarted = true;
	}
207249
function (stepsLocator, status) {
            var self = this,
                stepsCollection = document.querySelectorAll(stepsLocator),
                i,
                scenarioArrowCollection = document.querySelectorAll('.scenario-arrow');
            for (i = 0; i < stepsCollection.length; i++) {
                if (stepsCollection[i].style.display === 'none') {
                    this.addArrowUp(scenarioArrowCollection);
                    stepsCollection[i].style.display = 'block';
                } else {
                    this.addArrowDown(scenarioArrowCollection);
                    stepsCollection[i].style.display = 'none';
                }
            }
            self.hideFeatureContainer(status);
        }
1043758
function touchstart(e) {
    var i = -1,
        n = e.touches.length,
        t = Date.now();

    // doubletap detection
    if ((n == 1) && (t - last < 300)) {
      var z = map.zoom();
      map.zoomBy(1 - z + Math.floor(z), map.mouse(e.touches[0]));
      e.preventDefault();
    }
    last = t;

    // store original zoom & touch locations
    zoom = map.zoom();
    angle = map.angle();
    while (++i < n) {
      t = e.touches[i];
      locations[t.identifier] = map.pointLocation(map.mouse(t));
    }
  }
720716
private void parseRelativePathExpr() throws TTXPathException {

        parseStepExpr();

        while (mToken.getType() == TokenType.SLASH || mToken.getType() == TokenType.DESC_STEP) {

            if (is(TokenType.DESC_STEP, true)) {
                final AbsAxis mAxis = new DescendantAxis(getTransaction(), true);

                mPipeBuilder.addStep(mAxis);
            } else {
                // in this case the slash is just a separator
                consume(TokenType.SLASH, true);
            }
            parseStepExpr();
        }

    }
127820
private void locateNode(final String address, final Iterator<String> nodes, final Handler<AsyncResult<String>> doneHandler) {
    if (nodes.hasNext()) {
      final String node = nodes.next();
      vertx.eventBus().sendWithTimeout(node, new JsonObject().putString("action", "ping"), 1000, new Handler<AsyncResult<Message<JsonObject>>>() {
        @Override
        public void handle(AsyncResult<Message<JsonObject>> result) {
          if (result.failed() || result.result().body().getString("status", "ok").equals("error")) {
            removeNode(address, node);
            locateNode(address, nodes, doneHandler);
          } else {
            new DefaultFutureResult<String>(node).setHandler(doneHandler);
          }
        }
      });
    } else {
      new DefaultFutureResult<String>(new IllegalStateException("No local nodes found")).setHandler(doneHandler);
    }
  }
1026700
public void init (Pathable pable, long tickStamp)
    {
        _pable = pable;
        _pableRep = new DelegatingPathable(_pable) {
            @Override
            public void pathCompleted (long timeStamp) {
                long initStamp;
                // if we just finished a timed path, we can figure out how long ago it really
                // finished and init the next path at that time in the past.
                if (_curPath instanceof TimedPath) {
                    initStamp = _lastInit + ((TimedPath) _curPath)._duration;
                } else {
                    // we don't know
                    initStamp = timeStamp;
                }
                initNextPath(initStamp, timeStamp);
            }
        };
        initNextPath(tickStamp, tickStamp);
    }
895061
private static PortablePosition navigateToPathTokenWithoutQuantifier(
            PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {
        if (path.isLastToken()) {
            // if it's a token that's on the last position we calculate its direct access position and return it for
            // reading in the value reader.
            return createPositionForReadAccess(ctx, path);
        } else {
            // if it's not a token that's on the last position in the path we advance the position to the next token
            // we also adjust the context, since advancing means that we are in the context of other
            // (and possibly different) portable type.
            if (!navigateContextToNextPortableTokenFromPortableField(ctx)) {
                // we return null if we didn't manage to advance from the current token to the next one.
                // For example: it may happen if the current token points to a null object.
                return nilNotLeafPosition();
            }
        }
        return null;
    }
455328
public Result<List<StraightPathItem>> findStraightPath(float[] startPos, float[] endPos, List<Long> path,
            int maxStraightPath, int options) {

        List<StraightPathItem> straightPath = new ArrayList<>();
        if (Objects.isNull(startPos) || !vIsFinite(startPos) || Objects.isNull(endPos) || !vIsFinite(endPos)
                || Objects.isNull(path) || path.isEmpty() || path.get(0) == 0 || maxStraightPath <= 0) {
            return Result.invalidParam();
        }
        // TODO: Should this be callers responsibility?
        Result<float[]> closestStartPosRes = closestPointOnPolyBoundary(path.get(0), startPos);
        if (closestStartPosRes.failed()) {
            return Result.invalidParam("Cannot find start position");
        }
        float[] closestStartPos = closestStartPosRes.result;
        Result<float[]> closestEndPosRes = closestPointOnPolyBoundary(path.get(path.size() - 1), endPos);
        if (closestEndPosRes.failed()) {
            return Result.invalidParam("Cannot find end position");
        }
        float[] closestEndPos = closestEndPosRes.result;
        // Add start point.
        Status stat = appendVertex(closestStartPos, DT_STRAIGHTPATH_START, path.get(0), straightPath, maxStraightPath);
        if (!stat.isInProgress()) {
            return Result.success(straightPath);
        }

        if (path.size() > 1) {
            float[] portalApex = vCopy(closestStartPos);
            float[] portalLeft = vCopy(portalApex);
            float[] portalRight = vCopy(portalApex);
            int apexIndex = 0;
            int leftIndex = 0;
            int rightIndex = 0;

            int leftPolyType = 0;
            int rightPolyType = 0;

            long leftPolyRef = path.get(0);
            long rightPolyRef = path.get(0);

            for (int i = 0; i < path.size(); ++i) {
                float[] left;
                float[] right;
                int toType;

                if (i + 1 < path.size()) {
                    // Next portal.
                    Result<PortalResult> portalPoints = getPortalPoints(path.get(i), path.get(i + 1));
                    left = portalPoints.result.left;
                    right = portalPoints.result.right;
                    toType = portalPoints.result.toType;
                    if (portalPoints.failed()) {
                        closestEndPosRes = closestPointOnPolyBoundary(path.get(i), endPos);
                        if (closestEndPosRes.failed()) {
                            return Result.invalidParam();
                        }
                        closestEndPos = closestEndPosRes.result;
                        // Append portals along the current straight path segment.
                        if ((options & (DT_STRAIGHTPATH_AREA_CROSSINGS | DT_STRAIGHTPATH_ALL_CROSSINGS)) != 0) {
                            // Ignore status return value as we're just about to return anyway.
                            appendPortals(apexIndex, i, closestEndPos, path, straightPath, maxStraightPath, options);
                        }
                        // Ignore status return value as we're just about to return anyway.
                        appendVertex(closestEndPos, 0, path.get(i), straightPath, maxStraightPath);
                        return Result.success(straightPath);
                    }

                    // If starting really close the portal, advance.
                    if (i == 0) {
                        Tupple2<Float, Float> dt = distancePtSegSqr2D(portalApex, left, right);
                        if (dt.first < sqr(0.001f)) {
                            continue;
                        }
                    }
                } else {
                    // End of the path.
                    left = vCopy(closestEndPos);
                    right = vCopy(closestEndPos);
                    toType = Poly.DT_POLYTYPE_GROUND;
                }

                // Right vertex.
                if (triArea2D(portalApex, portalRight, right) <= 0.0f) {
                    if (vEqual(portalApex, portalRight) || triArea2D(portalApex, portalLeft, right) > 0.0f) {
                        portalRight = vCopy(right);
                        rightPolyRef = (i + 1 < path.size()) ? path.get(i + 1) : 0;
                        rightPolyType = toType;
                        rightIndex = i;
                    } else {
                        // Append portals along the current straight path segment.
                        if ((options & (DT_STRAIGHTPATH_AREA_CROSSINGS | DT_STRAIGHTPATH_ALL_CROSSINGS)) != 0) {
                            stat = appendPortals(apexIndex, leftIndex, portalLeft, path, straightPath, maxStraightPath,
                                    options);
                            if (!stat.isInProgress()) {
                                return Result.success(straightPath);
                            }
                        }

                        portalApex = vCopy(portalLeft);
                        apexIndex = leftIndex;

                        int flags = 0;
                        if (leftPolyRef == 0) {
                            flags = DT_STRAIGHTPATH_END;
                        } else if (leftPolyType == Poly.DT_POLYTYPE_OFFMESH_CONNECTION) {
                            flags = DT_STRAIGHTPATH_OFFMESH_CONNECTION;
                        }
                        long ref = leftPolyRef;

                        // Append or update vertex
                        stat = appendVertex(portalApex, flags, ref, straightPath, maxStraightPath);
                        if (!stat.isInProgress()) {
                            return Result.success(straightPath);
                        }

                        portalLeft = vCopy(portalApex);
                        portalRight = vCopy(portalApex);
                        leftIndex = apexIndex;
                        rightIndex = apexIndex;

                        // Restart
                        i = apexIndex;

                        continue;
                    }
                }

                // Left vertex.
                if (triArea2D(portalApex, portalLeft, left) >= 0.0f) {
                    if (vEqual(portalApex, portalLeft) || triArea2D(portalApex, portalRight, left) < 0.0f) {
                        portalLeft = vCopy(left);
                        leftPolyRef = (i + 1 < path.size()) ? path.get(i + 1) : 0;
                        leftPolyType = toType;
                        leftIndex = i;
                    } else {
                        // Append portals along the current straight path segment.
                        if ((options & (DT_STRAIGHTPATH_AREA_CROSSINGS | DT_STRAIGHTPATH_ALL_CROSSINGS)) != 0) {
                            stat = appendPortals(apexIndex, rightIndex, portalRight, path, straightPath,
                                    maxStraightPath, options);
                            if (!stat.isInProgress()) {
                                return Result.success(straightPath);
                            }
                        }

                        portalApex = vCopy(portalRight);
                        apexIndex = rightIndex;

                        int flags = 0;
                        if (rightPolyRef == 0) {
                            flags = DT_STRAIGHTPATH_END;
                        } else if (rightPolyType == Poly.DT_POLYTYPE_OFFMESH_CONNECTION) {
                            flags = DT_STRAIGHTPATH_OFFMESH_CONNECTION;
                        }
                        long ref = rightPolyRef;

                        // Append or update vertex
                        stat = appendVertex(portalApex, flags, ref, straightPath, maxStraightPath);
                        if (!stat.isInProgress()) {
                            return Result.success(straightPath);
                        }

                        portalLeft = vCopy(portalApex);
                        portalRight = vCopy(portalApex);
                        leftIndex = apexIndex;
                        rightIndex = apexIndex;

                        // Restart
                        i = apexIndex;

                        continue;
                    }
                }
            }

            // Append portals along the current straight path segment.
            if ((options & (DT_STRAIGHTPATH_AREA_CROSSINGS | DT_STRAIGHTPATH_ALL_CROSSINGS)) != 0) {
                stat = appendPortals(apexIndex, path.size() - 1, closestEndPos, path, straightPath, maxStraightPath,
                        options);
                if (!stat.isInProgress()) {
                    return Result.success(straightPath);
                }
            }
        }

        // Ignore status return value as we're just about to return anyway.
        appendVertex(closestEndPos, DT_STRAIGHTPATH_END, 0, straightPath, maxStraightPath);
        return Result.success(straightPath);
    }
568744
public static <T> T step(final ThrowableContextRunnable<T, StepContext> runnable) {
        final String uuid = UUID.randomUUID().toString();
        getLifecycle().startStep(uuid, new StepResult().setName("step"));

        try {
            final T result = runnable.run(new DefaultStepContext(uuid));
            getLifecycle().updateStep(uuid, step -> step.setStatus(Status.PASSED));
            return result;
        } catch (Throwable throwable) {
            getLifecycle().updateStep(s -> s
                    .setStatus(getStatus(throwable).orElse(Status.BROKEN))
                    .setStatusDetails(getStatusDetails(throwable).orElse(null)));
            ExceptionUtils.sneakyThrow(throwable);
            return null;
        } finally {
            getLifecycle().stopStep(uuid);
        }
    }
135402
protected void eleminateSharedPartialPaths(ElemTemplateElement psuedoVarRecipient, Vector paths)
  {
  	MultistepExprHolder list = createMultistepExprList(paths);
  	if(null != list)
  	{
  		if(DIAGNOSE_MULTISTEPLIST)
        	list.diagnose();
        	
        boolean isGlobal = (paths == m_absPaths);
        	
        // Iterate over the list, starting with the most number of paths, 
        // trying to find the longest matches first.
        int longestStepsCount = list.m_stepCount;
    	for (int i = longestStepsCount-1; i >= 1; i--)
    	{
    		MultistepExprHolder next = list;
        	while(null != next)
        	{
        		if(next.m_stepCount < i)
        			break;
				list = matchAndEliminatePartialPaths(next, list, isGlobal, i, psuedoVarRecipient);
				next = next.m_next;
        	}
    	}
  	}
  }