idx
int32 46
1.86M
| input
stringlengths 321
6.6k
| target
stringlengths 9
1.24k
|
|---|---|---|
1,644,620
|
private static String errorDetailMessage(Any detail) throws InvalidProtocolBufferException {<NEW_LINE>if (detail.is(RetryInfo.class)) {<NEW_LINE>return retryInfoMessage(detail<MASK><NEW_LINE>}<NEW_LINE>if (detail.is(DebugInfo.class)) {<NEW_LINE>return debugInfoMessage(detail.unpack(DebugInfo.class));<NEW_LINE>}<NEW_LINE>if (detail.is(QuotaFailure.class)) {<NEW_LINE>return quotaFailureMessage(detail.unpack(QuotaFailure.class));<NEW_LINE>}<NEW_LINE>if (detail.is(PreconditionFailure.class)) {<NEW_LINE>return preconditionFailureMessage(detail.unpack(PreconditionFailure.class));<NEW_LINE>}<NEW_LINE>if (detail.is(BadRequest.class)) {<NEW_LINE>return badRequestMessage(detail.unpack(BadRequest.class));<NEW_LINE>}<NEW_LINE>if (detail.is(RequestInfo.class)) {<NEW_LINE>return requestInfoMessage(detail.unpack(RequestInfo.class));<NEW_LINE>}<NEW_LINE>if (detail.is(ResourceInfo.class)) {<NEW_LINE>return resourceInfoMessage(detail.unpack(ResourceInfo.class));<NEW_LINE>}<NEW_LINE>if (detail.is(Help.class)) {<NEW_LINE>return helpMessage(detail.unpack(Help.class));<NEW_LINE>}<NEW_LINE>return "Unrecognized error detail: " + detail;<NEW_LINE>}
|
.unpack(RetryInfo.class));
|
1,690,236
|
private static void replaceGuardNode(LoopEx loop, GuardNode guard, ValueNode range, StructuredGraph graph, long scaleCon, ValueNode offset) {<NEW_LINE>final InductionVariable counter = loop.counted().getLimitCheckedIV();<NEW_LINE>ValueNode rangeLong = IntegerConvertNode.convert(range, StampFactory.forInteger(64), graph, NodeView.DEFAULT);<NEW_LINE>ValueNode extremumNode = counter.extremumNode(false, StampFactory.forInteger(64));<NEW_LINE>final GuardingNode overFlowGuard = loop.counted().createOverFlowGuard();<NEW_LINE>assert overFlowGuard != null || loop.counted().counterNeverOverflows();<NEW_LINE>if (overFlowGuard != null) {<NEW_LINE>extremumNode = graph.unique(new GuardedValueNode(extremumNode, overFlowGuard));<NEW_LINE>}<NEW_LINE>final ValueNode upperNode = MathUtil.add(graph, MathUtil.mul(graph, extremumNode, ConstantNode.forLong(scaleCon, graph)), IntegerConvertNode.convert(offset, StampFactory.forInteger(64), graph, NodeView.DEFAULT));<NEW_LINE>final LogicNode upperCond = IntegerBelowNode.create(upperNode, rangeLong, NodeView.DEFAULT);<NEW_LINE>final ValueNode initNode = IntegerConvertNode.convert(loop.counted().getBodyIVStart(), StampFactory.forInteger(64), graph, NodeView.DEFAULT);<NEW_LINE>final ValueNode lowerNode = MathUtil.add(graph, MathUtil.mul(graph, initNode, ConstantNode.forLong(scaleCon, graph)), IntegerConvertNode.convert(offset, StampFactory.forInteger(64), graph, NodeView.DEFAULT));<NEW_LINE>final LogicNode lowerCond = IntegerBelowNode.create(lowerNode, rangeLong, NodeView.DEFAULT);<NEW_LINE>final FrameState state = loop<MASK><NEW_LINE>final BytecodePosition pos = new BytecodePosition(null, state.getMethod(), state.bci);<NEW_LINE>SpeculationLog.SpeculationReason reason = LOOP_PREDICATION.createSpeculationReason(pos);<NEW_LINE>SpeculationLog.Speculation speculation = graph.getSpeculationLog().speculate(reason);<NEW_LINE>final AbstractBeginNode anchor = AbstractBeginNode.prevBegin(loop.entryPoint());<NEW_LINE>final GuardNode upperGuard = graph.addOrUniqueWithInputs(new GuardNode(upperCond, anchor, guard.getReason(), guard.getAction(), guard.isNegated(), speculation, null));<NEW_LINE>final GuardNode lowerGuard = graph.addOrUniqueWithInputs(new GuardNode(lowerCond, anchor, guard.getReason(), guard.getAction(), guard.isNegated(), speculation, null));<NEW_LINE>final GuardingNode combinedGuard = MultiGuardNode.combine(lowerGuard, upperGuard);<NEW_LINE>guard.replaceAtUsagesAndDelete(combinedGuard.asNode());<NEW_LINE>}
|
.loopBegin().stateAfter();
|
1,318,735
|
private void drawAABB(Fixture fixture, Transform transform) {<NEW_LINE>if (fixture.getType() == Type.Circle) {<NEW_LINE>CircleShape shape = (CircleShape) fixture.getShape();<NEW_LINE>float radius = shape.getRadius();<NEW_LINE>vertices[0].set(shape.getPosition());<NEW_LINE>transform.mul(vertices[0]);<NEW_LINE>lower.set(vertices[0].x - radius, vertices[0].y - radius);<NEW_LINE>upper.set(vertices[0].x + radius, vertices[0].y + radius);<NEW_LINE>// define vertices in ccw fashion...<NEW_LINE>vertices[0].set(lower.x, lower.y);<NEW_LINE>vertices[1].set(upper.x, lower.y);<NEW_LINE>vertices[2].set(upper.x, upper.y);<NEW_LINE>vertices[3].set(lower.x, upper.y);<NEW_LINE>drawSolidPolygon(vertices, 4, AABB_COLOR, true);<NEW_LINE>} else if (fixture.getType() == Type.Polygon) {<NEW_LINE>PolygonShape shape = (PolygonShape) fixture.getShape();<NEW_LINE>int vertexCount = shape.getVertexCount();<NEW_LINE>shape.getVertex(0, vertices[0]);<NEW_LINE>lower.set(transform.mul(vertices[0]));<NEW_LINE>upper.set(lower);<NEW_LINE>for (int i = 1; i < vertexCount; i++) {<NEW_LINE>shape.getVertex(i, vertices[i]);<NEW_LINE>transform.mul(vertices[i]);<NEW_LINE>lower.x = Math.min(lower.x<MASK><NEW_LINE>lower.y = Math.min(lower.y, vertices[i].y);<NEW_LINE>upper.x = Math.max(upper.x, vertices[i].x);<NEW_LINE>upper.y = Math.max(upper.y, vertices[i].y);<NEW_LINE>}<NEW_LINE>// define vertices in ccw fashion...<NEW_LINE>vertices[0].set(lower.x, lower.y);<NEW_LINE>vertices[1].set(upper.x, lower.y);<NEW_LINE>vertices[2].set(upper.x, upper.y);<NEW_LINE>vertices[3].set(lower.x, upper.y);<NEW_LINE>drawSolidPolygon(vertices, 4, AABB_COLOR, true);<NEW_LINE>}<NEW_LINE>}
|
, vertices[i].x);
|
95,641
|
// Convert arrays from [[[I form to int[][][] form.<NEW_LINE>public static String fixParamClassName(String param) {<NEW_LINE>if (param.charAt(0) == '[') {<NEW_LINE>// an array<NEW_LINE>int dimensions = param.lastIndexOf('[') + 1;<NEW_LINE>char code = param.charAt(dimensions);<NEW_LINE>String newparam = null;<NEW_LINE>switch(code) {<NEW_LINE>case 'B':<NEW_LINE>newparam = "byte";<NEW_LINE>break;<NEW_LINE>case 'C':<NEW_LINE>newparam = "char";<NEW_LINE>break;<NEW_LINE>case 'D':<NEW_LINE>newparam = "double";<NEW_LINE>break;<NEW_LINE>case 'F':<NEW_LINE>newparam = "float";<NEW_LINE>break;<NEW_LINE>case 'I':<NEW_LINE>newparam = "int";<NEW_LINE>break;<NEW_LINE>case 'J':<NEW_LINE>newparam = "long";<NEW_LINE>break;<NEW_LINE>case 'S':<NEW_LINE>newparam = "short";<NEW_LINE>break;<NEW_LINE>case 'Z':<NEW_LINE>newparam = "boolean";<NEW_LINE>break;<NEW_LINE>case 'L':<NEW_LINE>newparam = param.substring(dimensions + 1);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>newparam = null;<NEW_LINE>}<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>buf.append(newparam);<NEW_LINE>for (int j = 0; j < dimensions; j<MASK><NEW_LINE>newparam = buf.toString();<NEW_LINE>return newparam;<NEW_LINE>} else {<NEW_LINE>return param;<NEW_LINE>}<NEW_LINE>}
|
++) buf.append("[]");
|
1,814,029
|
private void handleFeatureParameters() {<NEW_LINE>Parameter[] parameters = whereBlock.getParent()<MASK><NEW_LINE>Map<Boolean, List<Parameter>> declaredParameters = Arrays.stream(parameters).collect(partitioningBy(parameter -> isDataProcessorVariable(parameter.getName())));<NEW_LINE>Map<String, Parameter> declaredDataVariableParameters = declaredParameters.get(TRUE).stream().collect(toMap(Parameter::getName, identity()));<NEW_LINE>List<Parameter> auxiliaryParameters = declaredParameters.get(FALSE);<NEW_LINE>List<Parameter> newParameters = new ArrayList<>(dataProcessorVars.size() + auxiliaryParameters.size());<NEW_LINE>// first all data variables in order of where block<NEW_LINE>for (VariableExpression dataProcessorVar : dataProcessorVars) {<NEW_LINE>String name = dataProcessorVar.getName();<NEW_LINE>Parameter declaredDataVariableParameter = declaredDataVariableParameters.get(name);<NEW_LINE>newParameters.add(declaredDataVariableParameter == null ? new Parameter(ClassHelper.OBJECT_TYPE, name) : declaredDataVariableParameter);<NEW_LINE>}<NEW_LINE>// then all auxiliary parameters in declaration order<NEW_LINE>newParameters.addAll(auxiliaryParameters);<NEW_LINE>whereBlock.getParent().getAst().setParameters(newParameters.toArray(Parameter.EMPTY_ARRAY));<NEW_LINE>}
|
.getAst().getParameters();
|
1,048,983
|
private LLVMValueRef emitCall(Invoke invoke, LoweredCallTargetNode callTarget, LLVMValueRef callee, long patchpointId, LLVMValueRef... args) {<NEW_LINE>boolean nativeABI = ((SubstrateCallingConventionType) callTarget.callType()).nativeABI();<NEW_LINE>if (!SubstrateBackend.hasJavaFrameAnchor(callTarget)) {<NEW_LINE>assert SubstrateBackend.getNewThreadStatus(callTarget) == VMThreads.StatusSupport.STATUS_ILLEGAL;<NEW_LINE>return emitCallInstruction(invoke, nativeABI, callee, patchpointId, args);<NEW_LINE>}<NEW_LINE>assert VMThreads.StatusSupport.isValidStatus(SubstrateBackend.getNewThreadStatus(callTarget));<NEW_LINE>LLVMValueRef anchor = llvmOperand(SubstrateBackend.getJavaFrameAnchor(callTarget));<NEW_LINE>anchor = builder.buildIntToPtr(anchor, builder.rawPointerType());<NEW_LINE>LLVMValueRef lastSPAddr = builder.buildGEP(anchor, builder.constantInt(runtimeConfiguration.getJavaFrameAnchorLastSPOffset()));<NEW_LINE>Register stackPointer = gen.getRegisterConfig().getFrameRegister();<NEW_LINE>builder.buildStore(builder.buildReadRegister(builder.register(stackPointer.name)), builder.buildBitcast(lastSPAddr, builder.pointerType(builder.wordType())));<NEW_LINE>if (SubstrateOptions.MultiThreaded.getValue()) {<NEW_LINE>LLVMValueRef threadLocalArea = gen.getSpecialRegisterValue(SpecialRegister.ThreadPointer);<NEW_LINE>LLVMValueRef statusIndex = builder.constantInt(runtimeConfiguration.getVMThreadStatusOffset());<NEW_LINE>LLVMValueRef statusAddress = builder.buildGEP(builder.buildIntToPtr(threadLocalArea, builder.rawPointerType()), statusIndex);<NEW_LINE>LLVMValueRef newThreadStatus = builder.constantInt(SubstrateBackend.getNewThreadStatus(callTarget));<NEW_LINE>builder.buildVolatileStore(newThreadStatus, builder.buildBitcast(statusAddress, builder.pointerType(builder.intType())), Integer.BYTES);<NEW_LINE>}<NEW_LINE>LLVMValueRef wrapper = gen.createJNIWrapper(callee, nativeABI, args.length, runtimeConfiguration.getJavaFrameAnchorLastIPOffset());<NEW_LINE>LLVMValueRef[] newArgs = new LLVMValueRef[args.length + 2];<NEW_LINE>if (!nativeABI) {<NEW_LINE>System.arraycopy(args, 0, newArgs, 0, SpecialRegister.count());<NEW_LINE>newArgs[SpecialRegister.count() + 0] = anchor;<NEW_LINE>newArgs[SpecialRegister.<MASK><NEW_LINE>System.arraycopy(args, SpecialRegister.count(), newArgs, 2 + SpecialRegister.count(), args.length - SpecialRegister.count());<NEW_LINE>} else {<NEW_LINE>newArgs[0] = anchor;<NEW_LINE>newArgs[1] = callee;<NEW_LINE>System.arraycopy(args, 0, newArgs, 2, args.length);<NEW_LINE>}<NEW_LINE>return emitCallInstruction(invoke, nativeABI, wrapper, patchpointId, newArgs);<NEW_LINE>}
|
count() + 1] = callee;
|
525,836
|
public boolean isMethodConstrained(Method method, BeanDescriptor beanDescriptor, ClassLoader moduleClassLoader, String moduleUri) {<NEW_LINE>setupGlobalValidationSettings(moduleClassLoader, moduleUri);<NEW_LINE>if (!isExecutableValidationEnabled) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<Method> overriddenAndImplementedMethods = InheritedMethodsHelper.getAllMethods(method.getDeclaringClass());<NEW_LINE>Optional<String> correspondingProperty = getterPropertySelectionStrategy.getProperty(new ConstrainableMethod(method));<NEW_LINE>// obtain @ValidateOnExecution from the top-most method in the hierarchy<NEW_LINE>Method methodForExecutableTypeRetrieval = replaceWithOverriddenOrInterfaceMethod(method, overriddenAndImplementedMethods);<NEW_LINE>EnumSet<ExecutableType> classLevelExecutableTypes = executableTypesDefinedOnType(methodForExecutableTypeRetrieval.getDeclaringClass());<NEW_LINE>EnumSet<ExecutableType> memberLevelExecutableType = executableTypesDefinedOnMethod(methodForExecutableTypeRetrieval, correspondingProperty.isPresent());<NEW_LINE>ExecutableType currentExecutableType = correspondingProperty.isPresent() <MASK><NEW_LINE>// validation is enabled per default, so explicit configuration can just veto whether<NEW_LINE>// validation occurs<NEW_LINE>if (veto(classLevelExecutableTypes, memberLevelExecutableType, currentExecutableType)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean needsValidation;<NEW_LINE>if (correspondingProperty.isPresent()) {<NEW_LINE>needsValidation = isGetterConstrained(beanDescriptor, method, correspondingProperty.get());<NEW_LINE>} else {<NEW_LINE>needsValidation = isNonGetterConstrained(beanDescriptor, method);<NEW_LINE>}<NEW_LINE>return needsValidation;<NEW_LINE>}
|
? ExecutableType.GETTER_METHODS : ExecutableType.NON_GETTER_METHODS;
|
1,246,265
|
/*<NEW_LINE>* Here is how the volume of the fillet is found. It assumes a circular concave<NEW_LINE>* fillet tangent to the fin and the body tube.<NEW_LINE>*<NEW_LINE>* 1. Form a triangle with vertices at the BT center, the tangent point between<NEW_LINE>* the fillet and the fin, and the center of the fillet radius.<NEW_LINE>* 2. The line between the center of the BT and the center of the fillet radius<NEW_LINE>* will pass through the tangent point between the fillet and the BT.<NEW_LINE>* 3. Find the area of the triangle, then subtract the portion of the BT and<NEW_LINE>* fillet that is in that triangle. (angle/2PI * pi*r^2= angle/2 * r^2)<NEW_LINE>* 4. Multiply the remaining area by the length.<NEW_LINE>* 5. Return twice that since there is a fillet on each side of the fin.<NEW_LINE>*/<NEW_LINE>protected Coordinate calculateFilletVolumeCentroid() {<NEW_LINE>if ((null == this.parent) || (!SymmetricComponent.class.isAssignableFrom(this.parent.getClass()))) {<NEW_LINE>return Coordinate.ZERO;<NEW_LINE>}<NEW_LINE>Coordinate[] mountPoints = this.getRootPoints();<NEW_LINE>// if( null == mountPoints ){<NEW_LINE>// return Coordinate.ZERO;<NEW_LINE>// }<NEW_LINE>final SymmetricComponent sym = (SymmetricComponent) this.parent;<NEW_LINE>final Coordinate finLead = getFinFront();<NEW_LINE>final double xFinEnd = finLead.x + getLength();<NEW_LINE>final Coordinate[] rootPoints = getMountPoints(finLead.x, xFinEnd, -finLead.x, -finLead.y);<NEW_LINE>if (0 == rootPoints.length) {<NEW_LINE>return Coordinate.ZERO;<NEW_LINE>}<NEW_LINE>Coordinate filletVolumeCentroid = Coordinate.ZERO;<NEW_LINE>Coordinate prev = mountPoints[0];<NEW_LINE>for (int index = 1; index < mountPoints.length; index++) {<NEW_LINE>final Coordinate cur = mountPoints[index];<NEW_LINE>// cross section at mid-segment<NEW_LINE>final double xAvg = (prev.x + cur.x) / 2;<NEW_LINE>final double bodyRadius = sym.getRadius(xAvg);<NEW_LINE>final Coordinate segmentCrossSection = calculateFilletCrossSection(this.filletRadius, bodyRadius).setX(xAvg);<NEW_LINE>// final double xCentroid = xAvg;<NEW_LINE>// final double yCentroid = segmentCrossSection.y; ///< heuristic, not exact<NEW_LINE>final double segmentLength = Point2D.Double.distance(prev.x, prev.y, cur.x, cur.y);<NEW_LINE>final double segmentVolume = segmentLength * segmentCrossSection.weight;<NEW_LINE>final Coordinate segmentCentroid = segmentCrossSection.setWeight(segmentVolume);<NEW_LINE>filletVolumeCentroid = filletVolumeCentroid.add(segmentCentroid);<NEW_LINE>prev = cur;<NEW_LINE>}<NEW_LINE>if (finCount == 1) {<NEW_LINE>Transformation rotation = <MASK><NEW_LINE>return rotation.transform(filletVolumeCentroid);<NEW_LINE>} else {<NEW_LINE>return filletVolumeCentroid.setY(0.);<NEW_LINE>}<NEW_LINE>}
|
Transformation.rotate_x(getAngleOffset());
|
186,738
|
public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {<NEW_LINE>try {<NEW_LINE>IDocument document = viewer.getDocument();<NEW_LINE>// Handle wrapping in quotes if necessary<NEW_LINE>char prevChar = _replacementOffset > 0 ? document.<MASK><NEW_LINE>char quote = '"';<NEW_LINE>switch(prevChar) {<NEW_LINE>case '\'':<NEW_LINE>quote = '\'';<NEW_LINE>break;<NEW_LINE>case '"':<NEW_LINE>// We're fine<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// Add wrapping quotes<NEW_LINE>// $NON-NLS-1$<NEW_LINE>_replacementString = "\"" + _replacementString;<NEW_LINE>_cursorPosition++;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// handle adding trailing space if necessary<NEW_LINE>int nextCharIndex = _replacementOffset + _replacementLength;<NEW_LINE>if (nextCharIndex >= document.getLength()) {<NEW_LINE>// Add a close quote when we're against the EOF<NEW_LINE>_replacementString += quote;<NEW_LINE>_cursorPosition++;<NEW_LINE>} else {<NEW_LINE>char nextChar = document.getChar(nextCharIndex);<NEW_LINE>switch(nextChar) {<NEW_LINE>case '\'':<NEW_LINE>case '"':<NEW_LINE>// no need to add quote<NEW_LINE>break;<NEW_LINE>case ' ':<NEW_LINE>case '\t':<NEW_LINE>case '>':<NEW_LINE>case '/':<NEW_LINE>// add close quote<NEW_LINE>_replacementString += quote;<NEW_LINE>_cursorPosition++;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// Add a close quote and then a space<NEW_LINE>// $NON-NLS-1$<NEW_LINE>_replacementString += quote + " ";<NEW_LINE>_cursorPosition += 2;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>super.apply(viewer, trigger, stateMask, offset);<NEW_LINE>}
|
getChar(_replacementOffset - 1) : ' ';
|
1,679,980
|
private static BwaMemAlignment readAlignment(final Input input) {<NEW_LINE>final int samFlag = input.readInt();<NEW_LINE>final int refId = input.readInt();<NEW_LINE>final <MASK><NEW_LINE>final int refEnd = input.readInt();<NEW_LINE>final int seqStart = input.readInt();<NEW_LINE>final int seqEnd = input.readInt();<NEW_LINE>final int mapQual = input.readInt();<NEW_LINE>final int nMismatches = input.readInt();<NEW_LINE>final int alignerScore = input.readInt();<NEW_LINE>final int suboptimalScore = input.readInt();<NEW_LINE>final String cigar = input.readString();<NEW_LINE>final String mdTag = input.readString();<NEW_LINE>final String xaTag = input.readString();<NEW_LINE>final int mateRefId = input.readInt();<NEW_LINE>final int mateRefStart = input.readInt();<NEW_LINE>final int templateLen = input.readInt();<NEW_LINE>return new BwaMemAlignment(samFlag, refId, refStart, refEnd, seqStart, seqEnd, mapQual, nMismatches, alignerScore, suboptimalScore, cigar, mdTag, xaTag, mateRefId, mateRefStart, templateLen);<NEW_LINE>}
|
int refStart = input.readInt();
|
405,154
|
public void collect(CrawlController controller, StatisticsTracker stats) {<NEW_LINE>// TODO: reconsider names of these methods, inline?<NEW_LINE>downloadedUriCount = controller.getFrontier().succeededFetchCount();<NEW_LINE>bytesProcessed = stats.crawledBytes.getTotalBytes();<NEW_LINE>timestamp = System.currentTimeMillis();<NEW_LINE>novelBytes = stats.<MASK><NEW_LINE>novelUriCount = stats.crawledBytes.get(CrawledBytesHistotable.NOVELCOUNT);<NEW_LINE>warcNovelBytes = stats.crawledBytes.get(CrawledBytesHistotable.WARC_NOVEL_CONTENT_BYTES);<NEW_LINE>warcNovelUriCount = stats.crawledBytes.get(CrawledBytesHistotable.WARC_NOVEL_URLS);<NEW_LINE>elapsedMilliseconds = stats.getCrawlElapsedTime();<NEW_LINE>discoveredUriCount = controller.getFrontier().discoveredUriCount();<NEW_LINE>finishedUriCount = controller.getFrontier().finishedUriCount();<NEW_LINE>queuedUriCount = controller.getFrontier().queuedUriCount();<NEW_LINE>futureUriCount = controller.getFrontier().futureUriCount();<NEW_LINE>downloadFailures = controller.getFrontier().failedFetchCount();<NEW_LINE>downloadDisregards = controller.getFrontier().disregardedUriCount();<NEW_LINE>busyThreads = controller.getActiveToeCount();<NEW_LINE>congestionRatio = controller.getFrontier().congestionRatio();<NEW_LINE>deepestUri = controller.getFrontier().deepestUri();<NEW_LINE>averageDepth = controller.getFrontier().averageDepth();<NEW_LINE>// overall rates<NEW_LINE>docsPerSecond = (double) downloadedUriCount / (stats.getCrawlElapsedTime() / 1000d);<NEW_LINE>totalKiBPerSec = (long) ((bytesProcessed / 1024d) / ((stats.getCrawlElapsedTime() + 1) / 1000d));<NEW_LINE>CrawlStatSnapshot lastSnapshot = stats.snapshots.peek();<NEW_LINE>if (lastSnapshot == null) {<NEW_LINE>// no previous snapshot; unable to calculate current rates<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// last sample period rates<NEW_LINE>long sampleTime = timestamp - lastSnapshot.timestamp;<NEW_LINE>currentDocsPerSecond = (double) (downloadedUriCount - lastSnapshot.downloadedUriCount) / (sampleTime / 1000d);<NEW_LINE>currentKiBPerSec = (long) (((bytesProcessed - lastSnapshot.bytesProcessed) / 1024) / (sampleTime / 1000d));<NEW_LINE>}
|
crawledBytes.get(CrawledBytesHistotable.NOVEL);
|
1,400,224
|
private void storeFeedDetails() {<NEW_LINE>// Store the facebook and twitter page name in the shared preference from the database<NEW_LINE>storePageName(ConstantStrings.SOCIAL_LINK_FACEBOOK, ConstantStrings.FACEBOOK_PAGE_NAME);<NEW_LINE>storePageName(ConstantStrings.SOCIAL_LINK_TWITTER, ConstantStrings.TWITTER_PAGE_NAME);<NEW_LINE>if (SharedPreferencesUtil.getString(ConstantStrings.FACEBOOK_PAGE_ID, null) == null && SharedPreferencesUtil.getString(ConstantStrings.FACEBOOK_PAGE_NAME, null) != null) {<NEW_LINE>disposable.add(FacebookApi.getFacebookGraphAPI().getPageId(SharedPreferencesUtil.getString(ConstantStrings.FACEBOOK_PAGE_NAME, null), getResources().getString(R.string.facebook_access_token)).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(facebookPageId -> {<NEW_LINE>String id = facebookPageId.getId();<NEW_LINE>SharedPreferencesUtil.<MASK><NEW_LINE>}, throwable -> Timber.d("Facebook page id download failed: " + throwable.toString())));<NEW_LINE>}<NEW_LINE>}
|
putString(ConstantStrings.FACEBOOK_PAGE_ID, id);
|
1,052,202
|
static Map<ChannelOption<?>, Object> applyDefaultChannelOptions(boolean enabled, TransportType transportType, Map<ChannelOption<?>, Object> channelOptions, long idleTimeoutMillis, long pingIntervalMillis) {<NEW_LINE>if (!enabled) {<NEW_LINE>return channelOptions;<NEW_LINE>}<NEW_LINE>final ImmutableMap.Builder<ChannelOption<?>, Object> newChannelOptionsBuilder = ImmutableMap.builder();<NEW_LINE>if (idleTimeoutMillis > 0) {<NEW_LINE>final int tcpUserTimeout = Ints.saturatedCast(idleTimeoutMillis + TCP_USER_TIMEOUT_BUFFER_MILLIS);<NEW_LINE>if (transportType == TransportType.EPOLL && canAddChannelOption(epollTcpUserTimeout, channelOptions)) {<NEW_LINE>putChannelOption(newChannelOptionsBuilder, epollTcpUserTimeout, tcpUserTimeout);<NEW_LINE>} else if (transportType == TransportType.IO_URING && canAddChannelOption(ioUringTcpUserTimeout, channelOptions)) {<NEW_LINE>putChannelOption(newChannelOptionsBuilder, ioUringTcpUserTimeout, tcpUserTimeout);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pingIntervalMillis > 0) {<NEW_LINE>final int intPingIntervalMillis = Ints.saturatedCast(pingIntervalMillis);<NEW_LINE>if (transportType == TransportType.EPOLL && canAddChannelOption(epollTcpKeepidle, channelOptions) && canAddChannelOption(epollTcpKeepintvl, channelOptions) && canAddChannelOption(ChannelOption.SO_KEEPALIVE, channelOptions)) {<NEW_LINE>putChannelOption(<MASK><NEW_LINE>putChannelOption(newChannelOptionsBuilder, epollTcpKeepidle, intPingIntervalMillis);<NEW_LINE>putChannelOption(newChannelOptionsBuilder, epollTcpKeepintvl, intPingIntervalMillis);<NEW_LINE>} else if (transportType == TransportType.IO_URING && canAddChannelOption(ioUringTcpKeepidle, channelOptions) && canAddChannelOption(ioUringTcpKeepintvl, channelOptions) && canAddChannelOption(ChannelOption.SO_KEEPALIVE, channelOptions)) {<NEW_LINE>putChannelOption(newChannelOptionsBuilder, ChannelOption.SO_KEEPALIVE, true);<NEW_LINE>putChannelOption(newChannelOptionsBuilder, ioUringTcpKeepidle, intPingIntervalMillis);<NEW_LINE>putChannelOption(newChannelOptionsBuilder, ioUringTcpKeepintvl, intPingIntervalMillis);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newChannelOptionsBuilder.putAll(channelOptions);<NEW_LINE>return newChannelOptionsBuilder.build();<NEW_LINE>}
|
newChannelOptionsBuilder, ChannelOption.SO_KEEPALIVE, true);
|
393,742
|
public boolean similar(Object other) {<NEW_LINE>if (!(other instanceof JSONArray)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (len != ((JSONArray) other).length()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < len; i += 1) {<NEW_LINE>Object valueThis = this.myArrayList.get(i);<NEW_LINE>Object valueOther = ((JSONArray) other).myArrayList.get(i);<NEW_LINE>if (valueThis == valueOther) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (valueThis == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (valueThis instanceof LinkedJSONObject) {<NEW_LINE>if (!((LinkedJSONObject) valueThis).similar(valueOther)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else if (valueThis instanceof JSONArray) {<NEW_LINE>if (!((JSONArray) valueThis).similar(valueOther)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else if (!valueThis.equals(valueOther)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
int len = this.length();
|
1,812,466
|
// Visible for testing<NEW_LINE>@Nullable<NEW_LINE>static LogExporter configureOtlpLogs(ConfigProperties config, MeterProvider meterProvider) {<NEW_LINE>String protocol = OtlpConfigUtil.getOtlpProtocol(DATA_TYPE_LOGS, config);<NEW_LINE>if (protocol.equals(PROTOCOL_HTTP_PROTOBUF)) {<NEW_LINE>try {<NEW_LINE>ClasspathUtil.checkClassExists("io.opentelemetry.exporter.otlp.http.logs.OtlpHttpLogExporter", "OTLP HTTP Log Exporter", "opentelemetry-exporter-otlp-http-logs");<NEW_LINE>} catch (ConfigurationException e) {<NEW_LINE>// Squash this for now until logs are stable<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>OtlpHttpLogExporterBuilder builder = OtlpHttpLogExporter.builder();<NEW_LINE>OtlpConfigUtil.configureOtlpExporterBuilder(DATA_TYPE_LOGS, config, builder::setEndpoint, builder::addHeader, builder::setCompression, builder::setTimeout, builder::setTrustedCertificates, builder::setClientTls, retryPolicy -> RetryUtil.setRetryPolicyOnDelegate(builder, retryPolicy));<NEW_LINE>builder.setMeterProvider(meterProvider);<NEW_LINE>return builder.build();<NEW_LINE>} else if (protocol.equals(PROTOCOL_GRPC)) {<NEW_LINE>try {<NEW_LINE>ClasspathUtil.checkClassExists("io.opentelemetry.exporter.otlp.logs.OtlpGrpcLogExporter", "OTLP gRPC Log Exporter", "opentelemetry-exporter-otlp-logs");<NEW_LINE>} catch (ConfigurationException e) {<NEW_LINE>// Squash this for now until logs are stable<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>OtlpGrpcLogExporterBuilder builder = OtlpGrpcLogExporter.builder();<NEW_LINE>OtlpConfigUtil.configureOtlpExporterBuilder(DATA_TYPE_LOGS, config, builder::setEndpoint, builder::addHeader, builder::setCompression, builder::setTimeout, builder::setTrustedCertificates, builder::setClientTls, retryPolicy -> RetryUtil.setRetryPolicyOnDelegate(builder, retryPolicy));<NEW_LINE>builder.setMeterProvider(meterProvider);<NEW_LINE>return builder.build();<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
|
throw new ConfigurationException("Unsupported OTLP logs protocol: " + protocol);
|
1,421,412
|
public List<RemoteResourceInfo> scan(RemoteResourceFilter filter) throws IOException {<NEW_LINE>List<RemoteResourceInfo> rri = new LinkedList<RemoteResourceInfo>();<NEW_LINE>// TODO: Remove GOTO!<NEW_LINE>loop: for (; ; ) {<NEW_LINE>final Response res = requester.request(newRequest(PacketType.READDIR)).retrieve(requester.getTimeoutMs(), TimeUnit.MILLISECONDS);<NEW_LINE>switch(res.getType()) {<NEW_LINE>case NAME:<NEW_LINE>final int count = res.readUInt32AsInt();<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>final String name = res.readString(requester.sub.getRemoteCharset());<NEW_LINE>// long name - IGNORED - shdve never been in the protocol<NEW_LINE>res.readString();<NEW_LINE>final FileAttributes attrs = res.readFileAttributes();<NEW_LINE>final PathComponents comps = requester.getPathHelper(<MASK><NEW_LINE>final RemoteResourceInfo inf = new RemoteResourceInfo(comps, attrs);<NEW_LINE>if (!(".".equals(name) || "..".equals(name)) && (filter == null || filter.accept(inf))) {<NEW_LINE>rri.add(inf);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case STATUS:<NEW_LINE>res.ensureStatusIs(StatusCode.EOF);<NEW_LINE>break loop;<NEW_LINE>default:<NEW_LINE>throw new SFTPException("Unexpected packet: " + res.getType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rri;<NEW_LINE>}
|
).getComponents(path, name);
|
417,247
|
public ScheduleActivityTaskFailedEventAttributes unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ScheduleActivityTaskFailedEventAttributes scheduleActivityTaskFailedEventAttributes = new ScheduleActivityTaskFailedEventAttributes();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("activityType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>scheduleActivityTaskFailedEventAttributes.setActivityType(ActivityTypeJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("activityId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>scheduleActivityTaskFailedEventAttributes.setActivityId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("cause", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>scheduleActivityTaskFailedEventAttributes.setCause(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("decisionTaskCompletedEventId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>scheduleActivityTaskFailedEventAttributes.setDecisionTaskCompletedEventId(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return scheduleActivityTaskFailedEventAttributes;<NEW_LINE>}
|
class).unmarshall(context));
|
588,124
|
public void validate(Insert insert) {<NEW_LINE>for (ValidationCapability c : getCapabilities()) {<NEW_LINE>validateFeature(c, Feature.insert);<NEW_LINE>validateOptionalFeature(c, insert.getItemsList(), Feature.insertValues);<NEW_LINE>validateOptionalFeature(c, insert.getModifierPriority(), Feature.insertModifierPriority);<NEW_LINE>validateFeature(c, insert.isModifierIgnore(), Feature.insertModifierIgnore);<NEW_LINE>validateOptionalFeature(c, insert.getSelect(), Feature.insertFromSelect);<NEW_LINE>validateFeature(c, insert.isUseSet(), Feature.insertUseSet);<NEW_LINE>validateFeature(c, insert.isUseDuplicate(), Feature.insertUseDuplicateKeyUpdate);<NEW_LINE>validateFeature(c, insert.isReturningAllColumns(), Feature.insertReturningAll);<NEW_LINE>validateOptionalFeature(c, insert.getReturningExpressionList(), Feature.insertReturningExpressionList);<NEW_LINE>}<NEW_LINE>validateOptionalFromItem(insert.getTable());<NEW_LINE>validateOptionalExpressions(insert.getColumns());<NEW_LINE>validateOptionalItemsList(insert.getItemsList());<NEW_LINE>if (insert.getSelect() != null) {<NEW_LINE>insert.getSelect().accept(getValidator(StatementValidator.class));<NEW_LINE>}<NEW_LINE>if (insert.isUseSet()) {<NEW_LINE>ExpressionValidator v = getValidator(ExpressionValidator.class);<NEW_LINE>// TODO is this useful?<NEW_LINE>// validateModelCondition (insert.getSetColumns().size() !=<NEW_LINE>// insert.getSetExpressionList().size(), "model-error");<NEW_LINE>insert.getSetColumns().forEach(c <MASK><NEW_LINE>insert.getSetExpressionList().forEach(c -> c.accept(v));<NEW_LINE>}<NEW_LINE>if (insert.isUseDuplicate()) {<NEW_LINE>ExpressionValidator v = getValidator(ExpressionValidator.class);<NEW_LINE>// TODO is this useful?<NEW_LINE>// validateModelCondition (insert.getDuplicateUpdateColumns().size() !=<NEW_LINE>// insert.getDuplicateUpdateExpressionList().size(), "model-error");<NEW_LINE>insert.getDuplicateUpdateColumns().forEach(c -> c.accept(v));<NEW_LINE>insert.getDuplicateUpdateExpressionList().forEach(c -> c.accept(v));<NEW_LINE>}<NEW_LINE>if (isNotEmpty(insert.getReturningExpressionList())) {<NEW_LINE>ExpressionValidator v = getValidator(ExpressionValidator.class);<NEW_LINE>insert.getReturningExpressionList().forEach(c -> c.getExpression().accept(v));<NEW_LINE>}<NEW_LINE>}
|
-> c.accept(v));
|
1,057,143
|
protected Suggest.Suggestion<? extends Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>> innerExecute(String name, final CompletionSuggestionContext suggestionContext, final IndexSearcher searcher, CharsRefBuilder spare) throws IOException {<NEW_LINE>if (suggestionContext.getFieldType() != null) {<NEW_LINE>final CompletionFieldMapper.CompletionFieldType fieldType = suggestionContext.getFieldType();<NEW_LINE>CompletionSuggestion completionSuggestion = emptySuggestion(name, suggestionContext, spare);<NEW_LINE>int shardSize = suggestionContext.getShardSize() != null ? suggestionContext.getShardSize() : suggestionContext.getSize();<NEW_LINE>TopSuggestGroupDocsCollector collector = new TopSuggestGroupDocsCollector(<MASK><NEW_LINE>suggest(searcher, suggestionContext.toQuery(), collector);<NEW_LINE>int numResult = 0;<NEW_LINE>for (TopSuggestDocs.SuggestScoreDoc suggestDoc : collector.get().scoreLookupDocs()) {<NEW_LINE>// collect contexts<NEW_LINE>Map<String, Set<String>> contexts = Collections.emptyMap();<NEW_LINE>if (fieldType.hasContextMappings()) {<NEW_LINE>List<CharSequence> rawContexts = collector.getContexts(suggestDoc.doc);<NEW_LINE>if (rawContexts.size() > 0) {<NEW_LINE>contexts = fieldType.getContextMappings().getNamedContexts(rawContexts);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (numResult++ < suggestionContext.getSize()) {<NEW_LINE>CompletionSuggestion.Entry.Option option = new CompletionSuggestion.Entry.Option(suggestDoc.doc, new Text(suggestDoc.key.toString()), suggestDoc.score, contexts);<NEW_LINE>completionSuggestion.getEntries().get(0).addOption(option);<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return completionSuggestion;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
|
shardSize, suggestionContext.isSkipDuplicates());
|
1,070,673
|
public static ListQuotaApplicationsResponse unmarshall(ListQuotaApplicationsResponse listQuotaApplicationsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listQuotaApplicationsResponse.setRequestId(_ctx.stringValue("ListQuotaApplicationsResponse.RequestId"));<NEW_LINE>listQuotaApplicationsResponse.setTotalCount(_ctx.integerValue("ListQuotaApplicationsResponse.TotalCount"));<NEW_LINE>listQuotaApplicationsResponse.setNextToken(_ctx.stringValue("ListQuotaApplicationsResponse.NextToken"));<NEW_LINE>listQuotaApplicationsResponse.setMaxResults(_ctx.integerValue("ListQuotaApplicationsResponse.MaxResults"));<NEW_LINE>List<QuotaApplicationsItem> quotaApplications = new ArrayList<QuotaApplicationsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListQuotaApplicationsResponse.QuotaApplications.Length"); i++) {<NEW_LINE>QuotaApplicationsItem quotaApplicationsItem = new QuotaApplicationsItem();<NEW_LINE>quotaApplicationsItem.setStatus(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].Status"));<NEW_LINE>quotaApplicationsItem.setApplyTime(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].ApplyTime"));<NEW_LINE>quotaApplicationsItem.setComment(_ctx.stringValue<MASK><NEW_LINE>quotaApplicationsItem.setQuotaDescription(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].QuotaDescription"));<NEW_LINE>quotaApplicationsItem.setProductCode(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].ProductCode"));<NEW_LINE>quotaApplicationsItem.setEffectiveTime(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].EffectiveTime"));<NEW_LINE>quotaApplicationsItem.setAuditReason(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].AuditReason"));<NEW_LINE>quotaApplicationsItem.setQuotaUnit(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].QuotaUnit"));<NEW_LINE>quotaApplicationsItem.setDimension(_ctx.mapValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].Dimension"));<NEW_LINE>quotaApplicationsItem.setApproveValue(_ctx.floatValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].ApproveValue"));<NEW_LINE>quotaApplicationsItem.setReason(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].Reason"));<NEW_LINE>quotaApplicationsItem.setQuotaActionCode(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].QuotaActionCode"));<NEW_LINE>quotaApplicationsItem.setQuotaName(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].QuotaName"));<NEW_LINE>quotaApplicationsItem.setQuotaArn(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].QuotaArn"));<NEW_LINE>quotaApplicationsItem.setNoticeType(_ctx.integerValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].NoticeType"));<NEW_LINE>quotaApplicationsItem.setApplicationId(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].ApplicationId"));<NEW_LINE>quotaApplicationsItem.setDesireValue(_ctx.floatValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].DesireValue"));<NEW_LINE>quotaApplicationsItem.setExpireTime(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].ExpireTime"));<NEW_LINE>Period period = new Period();<NEW_LINE>period.setPeriodValue(_ctx.longValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].Period.PeriodValue"));<NEW_LINE>period.setPeriodUnit(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].Period.PeriodUnit"));<NEW_LINE>quotaApplicationsItem.setPeriod(period);<NEW_LINE>quotaApplications.add(quotaApplicationsItem);<NEW_LINE>}<NEW_LINE>listQuotaApplicationsResponse.setQuotaApplications(quotaApplications);<NEW_LINE>return listQuotaApplicationsResponse;<NEW_LINE>}
|
("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].Comment"));
|
240,657
|
public boolean eIsSet(int featureID) {<NEW_LINE>switch(featureID) {<NEW_LINE>case IArchimatePackage.FOLDER__NAME:<NEW_LINE>return NAME_EDEFAULT == null ? name != null <MASK><NEW_LINE>case IArchimatePackage.FOLDER__ID:<NEW_LINE>return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);<NEW_LINE>case IArchimatePackage.FOLDER__FEATURES:<NEW_LINE>return features != null && !features.isEmpty();<NEW_LINE>case IArchimatePackage.FOLDER__FOLDERS:<NEW_LINE>return folders != null && !folders.isEmpty();<NEW_LINE>case IArchimatePackage.FOLDER__DOCUMENTATION:<NEW_LINE>return DOCUMENTATION_EDEFAULT == null ? documentation != null : !DOCUMENTATION_EDEFAULT.equals(documentation);<NEW_LINE>case IArchimatePackage.FOLDER__PROPERTIES:<NEW_LINE>return properties != null && !properties.isEmpty();<NEW_LINE>case IArchimatePackage.FOLDER__ELEMENTS:<NEW_LINE>return elements != null && !elements.isEmpty();<NEW_LINE>case IArchimatePackage.FOLDER__TYPE:<NEW_LINE>return type != TYPE_EDEFAULT;<NEW_LINE>}<NEW_LINE>return super.eIsSet(featureID);<NEW_LINE>}
|
: !NAME_EDEFAULT.equals(name);
|
163,552
|
public <R, V extends Validation<E, R>> V apply(Function5<T1, T2, T3, T4, T5, R> f) {<NEW_LINE>final Validation<E, Function1<T2, Function1<T3, Function1<T4, Function1<T5, R>>>>> apply1 = v1.apply(Validation.success(<MASK><NEW_LINE>final Validation<E, Function1<T3, Function1<T4, Function1<T5, R>>>> apply2 = v2.apply(apply1);<NEW_LINE>final Validation<E, Function1<T4, Function1<T5, R>>> apply3 = v3.apply(apply2);<NEW_LINE>final Validation<E, Function1<T5, R>> apply4 = v4.apply(apply3);<NEW_LINE>return v5.apply(apply4);<NEW_LINE>}
|
Functions.curry(f)));
|
1,075,717
|
final ListTypedLinkFacetNamesResult executeListTypedLinkFacetNames(ListTypedLinkFacetNamesRequest listTypedLinkFacetNamesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTypedLinkFacetNamesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTypedLinkFacetNamesRequest> request = null;<NEW_LINE>Response<ListTypedLinkFacetNamesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTypedLinkFacetNamesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTypedLinkFacetNamesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudDirectory");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTypedLinkFacetNames");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTypedLinkFacetNamesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTypedLinkFacetNamesResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
invoke(request, responseHandler, executionContext);
|
18,908
|
public void add(Node node) {<NEW_LINE>float x = node.x();<NEW_LINE>float y = node.y();<NEW_LINE>float radius = node.size();<NEW_LINE>// Get the rectangle occupied by the node<NEW_LINE>double nxmin = x - (radius * ratio + margin);<NEW_LINE>double nxmax = x + (radius * ratio + margin);<NEW_LINE>double nymin = y - (radius * ratio + margin);<NEW_LINE>double nymax = y + (radius * ratio + margin);<NEW_LINE>// Get the rectangle as boxes<NEW_LINE>int minXbox = (int) Math.floor((COLUMNS_ROWS - 1) * (nxmin - xmin) / (xmax - xmin));<NEW_LINE>int maxXbox = (int) Math.floor((COLUMNS_ROWS - 1) * (nxmax - xmin) / (xmax - xmin));<NEW_LINE>int minYbox = (int) Math.floor((COLUMNS_ROWS - 1) * (nymin - ymin) / (ymax - ymin));<NEW_LINE>int maxYbox = (int) Math.floor((COLUMNS_ROWS - 1) * (nymax - ymin) / (ymax - ymin));<NEW_LINE>for (int col = minXbox; col <= maxXbox; col++) {<NEW_LINE>for (int row = minYbox; row <= maxYbox; row++) {<NEW_LINE>try {<NEW_LINE>data.get(new Cell(row, <MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>// Exceptions.printStackTrace(e);<NEW_LINE>if (nxmin < xmin || nxmax > xmax) {<NEW_LINE>}<NEW_LINE>if (nymin < ymin || nymax > ymax) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
col)).add(node);
|
1,018,374
|
public void optimize(HDLCircuit circuit) {<NEW_LINE>ArrayList<HDLNode<MASK><NEW_LINE>ArrayList<HDLNode> nodesAvail = new ArrayList<>(nodes);<NEW_LINE>nodes.clear();<NEW_LINE>HashSet<HDLNet> nets = new HashSet<>();<NEW_LINE>for (HDLPort p : circuit.getInputs()) nets.add(p.getNet());<NEW_LINE>// all nodes without an input at top!<NEW_LINE>for (HDLNode n : nodesAvail) if (n.getInputs().isEmpty()) {<NEW_LINE>nodes.add(n);<NEW_LINE>for (HDLPort p : n.getOutputs()) if (p.getNet() != null)<NEW_LINE>nets.add(p.getNet());<NEW_LINE>}<NEW_LINE>nodesAvail.removeAll(nodes);<NEW_LINE>// then a layer sorting<NEW_LINE>while (!nodesAvail.isEmpty()) {<NEW_LINE>ArrayList<HDLNode> layer = new ArrayList<>();<NEW_LINE>for (HDLNode n : nodesAvail) {<NEW_LINE>if (n.traverseExpressions(new DependsOnlyOn(nets)).ok())<NEW_LINE>layer.add(n);<NEW_LINE>}<NEW_LINE>if (layer.isEmpty()) {<NEW_LINE>// circular dependency detected<NEW_LINE>for (HDLNode n : nodesAvail) if (n.traverseExpressions(new DependsAtLeastOnOneOf(nets)).ok())<NEW_LINE>layer.add(n);<NEW_LINE>}<NEW_LINE>if (layer.isEmpty())<NEW_LINE>break;<NEW_LINE>nodes.addAll(layer);<NEW_LINE>nodesAvail.removeAll(layer);<NEW_LINE>for (HDLNode n : layer) for (HDLPort p : n.getOutputs()) if (p.getNet() != null)<NEW_LINE>nets.add(p.getNet());<NEW_LINE>}<NEW_LINE>// if there are unsolvable circular dependencies, keep old order<NEW_LINE>if (!nodesAvail.isEmpty())<NEW_LINE>nodes.addAll(nodesAvail);<NEW_LINE>}
|
> nodes = circuit.getNodes();
|
1,039,975
|
private void trimStackTrace(Class<?> testClass, Throwable throwable) {<NEW_LINE>if (testClass != null) {<NEW_LINE>// first we cut all the platform stuff out of the stack trace<NEW_LINE>Throwable cause = throwable;<NEW_LINE>while (cause != null) {<NEW_LINE>StackTraceElement[] st = cause.getStackTrace();<NEW_LINE>for (int i = st.length - 1; i >= 0; --i) {<NEW_LINE>StackTraceElement elem = st[i];<NEW_LINE>if (elem.getClassName().equals(testClass.getName())) {<NEW_LINE>StackTraceElement[] newst = new StackTraceElement[i + 1];<NEW_LINE>System.arraycopy(st, 0, newst, 0, i + 1);<NEW_LINE>st = newst;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// now cut out all the restassured internals<NEW_LINE>// TODO: this should be pluggable<NEW_LINE>for (int i = st.length - 1; i >= 0; --i) {<NEW_LINE>StackTraceElement elem = st[i];<NEW_LINE>if (elem.getClassName().startsWith("io.restassured")) {<NEW_LINE>StackTraceElement[] newst = new StackTraceElement[st.length - i];<NEW_LINE>System.arraycopy(st, i, newst, <MASK><NEW_LINE>st = newst;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cause.setStackTrace(st);<NEW_LINE>cause = cause.getCause();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
0, st.length - i);
|
1,768,068
|
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {<NEW_LINE>Set<OCFile> checkedFiles = getCommonAdapter().getCheckedItems();<NEW_LINE>final int checkedCount = checkedFiles.size();<NEW_LINE>String title = getResources().getQuantityString(R.plurals.items_selected_count, checkedCount, checkedCount);<NEW_LINE>mode.setTitle(title);<NEW_LINE>FileMenuFilter mf = new FileMenuFilter(getCommonAdapter().getFilesCount(), checkedFiles, mContainerActivity, getActivity(), <MASK><NEW_LINE>mf.filter(menu, false);<NEW_LINE>// Determine if we need to finish the action mode because there are no items selected<NEW_LINE>if (checkedCount == 0 && !mIsActionModeNew) {<NEW_LINE>exitSelectionMode();<NEW_LINE>} else if (checkedCount == 1) {<NEW_LINE>// customize for locking if file is locked<NEW_LINE>new FileLockingMenuCustomization(requireContext()).customizeMenu(menu, checkedFiles.iterator().next());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
false, accountManager.getUser());
|
573,188
|
private void postCreateRecurringSnapshotForPolicy(long userId, long volumeId, long snapshotId, long policyId) {<NEW_LINE>// Use count query<NEW_LINE>SnapshotVO <MASK><NEW_LINE>Type type = spstVO.getRecurringType();<NEW_LINE>int maxSnaps = type.getMax();<NEW_LINE>List<SnapshotVO> snaps = listSnapsforVolumeTypeNotDestroyed(volumeId, type);<NEW_LINE>SnapshotPolicyVO policy = _snapshotPolicyDao.findById(policyId);<NEW_LINE>if (policy != null && policy.getMaxSnaps() < maxSnaps) {<NEW_LINE>maxSnaps = policy.getMaxSnaps();<NEW_LINE>}<NEW_LINE>while (snaps.size() > maxSnaps && snaps.size() > 1) {<NEW_LINE>SnapshotVO oldestSnapshot = snaps.get(0);<NEW_LINE>long oldSnapId = oldestSnapshot.getId();<NEW_LINE>if (policy != null) {<NEW_LINE>s_logger.debug("Max snaps: " + policy.getMaxSnaps() + " exceeded for snapshot policy with Id: " + policyId + ". Deleting oldest snapshot: " + oldSnapId);<NEW_LINE>}<NEW_LINE>if (deleteSnapshot(oldSnapId)) {<NEW_LINE>// log Snapshot delete event<NEW_LINE>ActionEventUtils.onCompletedActionEvent(User.UID_SYSTEM, oldestSnapshot.getAccountId(), EventVO.LEVEL_INFO, EventTypes.EVENT_SNAPSHOT_DELETE, "Successfully deleted oldest snapshot: " + oldSnapId, 0);<NEW_LINE>}<NEW_LINE>snaps.remove(oldestSnapshot);<NEW_LINE>}<NEW_LINE>}
|
spstVO = _snapshotDao.findById(snapshotId);
|
1,057,014
|
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create window MyWindowOne#keepall as (theString string, intv int)", path);<NEW_LINE>env.compileDeploy("insert into MyWindowOne select theString, intPrimitive as intv from SupportBean", path);<NEW_LINE>env.advanceTime(0);<NEW_LINE>String[] fields = new String[] { "theString", "c" };<NEW_LINE>env.compileDeploy("@name('s0') select irstream theString, count(*) as c from MyWindowOne group by theString output snapshot every 1 second", path).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean("A", 1));<NEW_LINE>env.sendEventBean(new SupportBean("A", 2));<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.advanceTime(1000);<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "A", 2L }, { "B", 1L } });<NEW_LINE>env.sendEventBean(new SupportBean("B", 5));<NEW_LINE>env.advanceTime(2000);<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "A", 2L }, { "B", 2L } });<NEW_LINE>env.advanceTime(3000);<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "A", 2L }, { "B", 2L } });<NEW_LINE>env.sendEventBean(new SupportBean("A", 5));<NEW_LINE>env.sendEventBean(new SupportBean("C", 1));<NEW_LINE>env.advanceTime(4000);<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "A", 3L }, { "B", 2L }, { "C", 1L } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
|
new SupportBean("B", 4));
|
694,243
|
public boolean deleteToolData(String userId, String toolName) {<NEW_LINE>if (tc.isEntryEnabled()) {<NEW_LINE>Tr.entry(tc, "deleteToolData", new Object[] { "userId=" + userId, "toolName=" + toolName });<NEW_LINE>}<NEW_LINE>String[] persistedNames = getPersistedNames(toolName, userId);<NEW_LINE>boolean deletedFromCollective = true;<NEW_LINE>boolean deletedFromFile = true;<NEW_LINE>synchronized (getSyncObject(persistedNames[1])) {<NEW_LINE>for (String persistedName : persistedNames) {<NEW_LINE>if (persistenceProviderCollective != null)<NEW_LINE>deletedFromCollective = deleteToolDataFromPersistence(persistenceProviderCollective, persistedName, userId, toolName) && deletedFromCollective;<NEW_LINE>if (persistenceProviderFile != null)<NEW_LINE>deletedFromFile = deleteToolDataFromPersistence(persistenceProviderFile, persistedName, userId, toolName) && deletedFromFile;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tc.isEntryEnabled()) {<NEW_LINE>Tr.exit(<MASK><NEW_LINE>}<NEW_LINE>return deletedFromCollective && deletedFromFile;<NEW_LINE>}
|
tc, "deleteToolData", deletedFromCollective && deletedFromFile);
|
732,431
|
public ProjectionAttributeStateSet appendProjectionAttributeState(ProjectionContext projCtx, ProjectionAttributeStateSet projOutputSet, CdmAttributeContext attrCtx) {<NEW_LINE>// Pass through all the input projection attribute states if there are any<NEW_LINE>for (ProjectionAttributeState currentPAS : projCtx.getCurrentAttributeStateSet().getStates()) {<NEW_LINE>projOutputSet.add(currentPAS);<NEW_LINE>}<NEW_LINE>// Create a new attribute context for the operation<NEW_LINE>AttributeContextParameters attrCtxOpAddTypeParam = new AttributeContextParameters();<NEW_LINE>attrCtxOpAddTypeParam.setUnder(attrCtx);<NEW_LINE>attrCtxOpAddTypeParam.setType(CdmAttributeContextType.OperationAddTypeAttribute);<NEW_LINE>attrCtxOpAddTypeParam.setName("operation/index" + this.getIndex() + "/operationAddTypeAttribute");<NEW_LINE>CdmAttributeContext attrCtxOpAddType = CdmAttributeContext.createChildUnder(projCtx.getProjectionDirective().getResOpt(), attrCtxOpAddTypeParam);<NEW_LINE>// Create a new attribute context for the Type attribute we will create<NEW_LINE>AttributeContextParameters attrCtxTypeAttrParam = new AttributeContextParameters();<NEW_LINE>attrCtxTypeAttrParam.setUnder(attrCtxOpAddType);<NEW_LINE>attrCtxTypeAttrParam.setType(CdmAttributeContextType.AddedAttributeSelectedType);<NEW_LINE>attrCtxTypeAttrParam.setName("_selectedEntityName");<NEW_LINE>CdmAttributeContext attrCtxTypeAttr = CdmAttributeContext.createChildUnder(projCtx.getProjectionDirective(<MASK><NEW_LINE>// Create the Type attribute with the specified "typeAttribute" (from the operation) as its target and apply the trait "is.linkedEntity.name" to it<NEW_LINE>List<String> addTrait = new ArrayList<String>(Arrays.asList("is.linkedEntity.name"));<NEW_LINE>ResolvedAttribute newResAttr = createNewResolvedAttribute(projCtx, attrCtxTypeAttr, this.typeAttribute, null, addTrait);<NEW_LINE>// Create a new projection attribute state for the new Type attribute and add it to the output set<NEW_LINE>// There is no previous state for the newly created Type attribute<NEW_LINE>ProjectionAttributeState newPAS = new ProjectionAttributeState(projOutputSet.getCtx());<NEW_LINE>newPAS.setCurrentResolvedAttribute(newResAttr);<NEW_LINE>projOutputSet.add(newPAS);<NEW_LINE>return projOutputSet;<NEW_LINE>}
|
).getResOpt(), attrCtxTypeAttrParam);
|
75,489
|
public static void openBundleWiringError(Throwable t) {<NEW_LINE>List<Status> childStatuses = new ArrayList<>(t.getStackTrace().length);<NEW_LINE>for (StackTraceElement stackTrace : t.getStackTrace()) {<NEW_LINE>Status status = new Status(IStatus.ERROR, BootDashActivator.PLUGIN_ID, stackTrace.toString());<NEW_LINE>childStatuses.add(status);<NEW_LINE>}<NEW_LINE>MultiStatus status = new MultiStatus(BootDashActivator.PLUGIN_ID, IStatus.ERROR, childStatuses.toArray(new Status[] {}), <MASK><NEW_LINE>Display display = Display.getCurrent();<NEW_LINE>if (display != null && !display.isDisposed()) {<NEW_LINE>ErrorDialog.openError(display.getActiveShell(), "Error Wiring Bundles", MESSAGE_WIRING_ERROR, status);<NEW_LINE>} else {<NEW_LINE>display = PlatformUI.getWorkbench().getDisplay();<NEW_LINE>if (display != null && !display.isDisposed()) {<NEW_LINE>display.asyncExec(() -> ErrorDialog.openError(Display.getCurrent().getActiveShell(), "Error Wiring Bundles", MESSAGE_WIRING_ERROR, status));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
t.toString(), t);
|
1,622,957
|
final DeleteHostedConfigurationVersionResult executeDeleteHostedConfigurationVersion(DeleteHostedConfigurationVersionRequest deleteHostedConfigurationVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteHostedConfigurationVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteHostedConfigurationVersionRequest> request = null;<NEW_LINE>Response<DeleteHostedConfigurationVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteHostedConfigurationVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteHostedConfigurationVersionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AppConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteHostedConfigurationVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteHostedConfigurationVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteHostedConfigurationVersionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
|
653,777
|
private void parseBody(JSONObject requestObject, Body msBody) {<NEW_LINE>if (requestObject.containsKey("body")) {<NEW_LINE>Object body = requestObject.get("body");<NEW_LINE>if (body instanceof JSONArray) {<NEW_LINE>JSONArray bodies = requestObject.getJSONArray("body");<NEW_LINE>if (bodies != null) {<NEW_LINE>StringBuilder bodyStr = new StringBuilder();<NEW_LINE>for (int i = 0; i < bodies.size(); i++) {<NEW_LINE>String tmp = bodies.getString(i);<NEW_LINE>bodyStr.append(tmp);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>msBody.setRaw(bodyStr.toString());<NEW_LINE>}<NEW_LINE>} else if (body instanceof JSONObject) {<NEW_LINE>JSONObject bodyObj = requestObject.getJSONObject("body");<NEW_LINE>if (bodyObj != null) {<NEW_LINE>ArrayList<KeyValue> kvs = new ArrayList<>();<NEW_LINE>bodyObj.keySet().forEach(key -> {<NEW_LINE>kvs.add(new KeyValue(key, bodyObj.getString(key)));<NEW_LINE>});<NEW_LINE>msBody.setKvs(kvs);<NEW_LINE>msBody.setType(Body.WWW_FROM);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
msBody.setType(Body.RAW);
|
1,469,739
|
protected AssemblyResolution solveTwoSided(RightShiftExpression exp, MaskedLong goal, Map<String, Long> vals, AssemblyResolvedPatterns cur, Set<SolverHint> hints, String description) throws NeedsBackfillException, SolverException {<NEW_LINE>// Do the similar thing as in {@link LeftShiftExpressionSolver}<NEW_LINE>// Do not guess the same parameter recursively<NEW_LINE>if (hints.contains(DefaultSolverHint.GUESSING_RIGHT_SHIFT_AMOUNT)) {<NEW_LINE>// NOTE: Nested right shifts ought to be written as a right shift by a sum<NEW_LINE>return super.solveTwoSided(exp, goal, vals, cur, hints, description);<NEW_LINE>}<NEW_LINE>int maxShift = Long.numberOfLeadingZeros(goal.val);<NEW_LINE>Set<SolverHint> hintsWithRShift = SolverHint.with(hints, DefaultSolverHint.GUESSING_RIGHT_SHIFT_AMOUNT);<NEW_LINE>for (int shift = 0; shift <= maxShift; shift++) {<NEW_LINE>try {<NEW_LINE>MaskedLong reqr = MaskedLong.fromLong(shift);<NEW_LINE>MaskedLong reql = computeLeft(reqr, goal);<NEW_LINE>AssemblyResolution lres = solver.solve(exp.getLeft(), reql, <MASK><NEW_LINE>if (lres.isError()) {<NEW_LINE>throw new SolverException("Solving left failed");<NEW_LINE>}<NEW_LINE>AssemblyResolution rres = solver.solve(exp.getRight(), reqr, vals, cur, hints, description);<NEW_LINE>if (rres.isError()) {<NEW_LINE>throw new SolverException("Solving right failed");<NEW_LINE>}<NEW_LINE>AssemblyResolvedPatterns lsol = (AssemblyResolvedPatterns) lres;<NEW_LINE>AssemblyResolvedPatterns rsol = (AssemblyResolvedPatterns) rres;<NEW_LINE>AssemblyResolvedPatterns sol = lsol.combine(rsol);<NEW_LINE>if (sol == null) {<NEW_LINE>throw new SolverException("Left and right solutions conflict for shift=" + shift);<NEW_LINE>}<NEW_LINE>return sol;<NEW_LINE>} catch (SolverException | UnsupportedOperationException e) {<NEW_LINE>Msg.trace(this, "Shift of " + shift + " resulted in " + e);<NEW_LINE>// try the next<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.solveTwoSided(exp, goal, vals, cur, hints, description);<NEW_LINE>}
|
vals, cur, hintsWithRShift, description);
|
104,833
|
final GetAccessKeyInfoResult executeGetAccessKeyInfo(GetAccessKeyInfoRequest getAccessKeyInfoRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getAccessKeyInfoRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetAccessKeyInfoRequest> request = null;<NEW_LINE>Response<GetAccessKeyInfoResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetAccessKeyInfoRequestMarshaller().marshall(super.beforeMarshalling(getAccessKeyInfoRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "STS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetAccessKeyInfo");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetAccessKeyInfoResult> responseHandler = new StaxResponseHandler<GetAccessKeyInfoResult>(new GetAccessKeyInfoResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
|
868,085
|
protected void paintContent(@NotNull final Graphics2D g2d, @NotNull final C c, @NotNull final D d, @NotNull final Rectangle bounds) {<NEW_LINE>final Stroke os = GraphicsUtils.setupStroke(g2d, stroke, stroke != null);<NEW_LINE>final Paint op = GraphicsUtils.setupPaint(g2d, color);<NEW_LINE><MASK><NEW_LINE>gp.moveTo(bounds.x + bounds.width * 0.1875, bounds.y + bounds.height * 0.375);<NEW_LINE>gp.lineTo(bounds.x + bounds.width * 0.4575, bounds.y + bounds.height * 0.6875);<NEW_LINE>gp.lineTo(bounds.x + bounds.width * 0.875, bounds.y + bounds.height * 0.125);<NEW_LINE>g2d.draw(gp);<NEW_LINE>GraphicsUtils.restorePaint(g2d, op);<NEW_LINE>GraphicsUtils.restoreStroke(g2d, os);<NEW_LINE>}
|
final GeneralPath gp = new GeneralPath();
|
1,354,048
|
public AmazonInfo deserialize(JsonParser jp, DeserializationContext context) throws IOException {<NEW_LINE>Map<String, String> metadata = EurekaJacksonCodec.METADATA_MAP_SUPPLIER.get();<NEW_LINE>DeserializerStringCache intern = DeserializerStringCache.from(context);<NEW_LINE>if (skipToMetadata(jp)) {<NEW_LINE>JsonToken jsonToken = jp.nextToken();<NEW_LINE>while ((jsonToken = jp.nextToken()) != JsonToken.END_OBJECT) {<NEW_LINE>String metadataKey = intern.apply(jp, CacheScope.GLOBAL_SCOPE);<NEW_LINE>jp.nextToken();<NEW_LINE>CacheScope scope = VALUE_INTERN_KEYS.get(metadataKey);<NEW_LINE>String metadataValue = (scope != null) ? intern.apply(jp, scope) : intern.apply(jp, CacheScope.APPLICATION_SCOPE);<NEW_LINE>metadata.put(metadataKey, metadataValue);<NEW_LINE>}<NEW_LINE>skipToEnd(jp);<NEW_LINE>}<NEW_LINE>if (jp.getCurrentToken() == JsonToken.END_OBJECT) {<NEW_LINE>jp.nextToken();<NEW_LINE>}<NEW_LINE>return new AmazonInfo(Name.<MASK><NEW_LINE>}
|
Amazon.name(), metadata);
|
856,912
|
public boolean onPreparePanel(int featureId, View view, Menu menu) {<NEW_LINE>if (BuildConfig.DEBUG)<NEW_LINE>Log.d(TAG, "[onPreparePanel] featureId: " + featureId + <MASK><NEW_LINE>if (featureId == Window.FEATURE_OPTIONS_PANEL) {<NEW_LINE>boolean result = onPrepareOptionsMenu(menu);<NEW_LINE>if (BuildConfig.DEBUG)<NEW_LINE>Log.d(TAG, "[onPreparePanel] activity prepare result: " + result);<NEW_LINE>boolean show = false;<NEW_LINE>if (mFragments.mAdded != null) {<NEW_LINE>for (int i = 0; i < mFragments.mAdded.size(); i++) {<NEW_LINE>Fragment f = mFragments.mAdded.get(i);<NEW_LINE>if (f != null && !f.mHidden && f.mHasMenu && f.mMenuVisible && f instanceof OnPrepareOptionsMenuListener) {<NEW_LINE>show = true;<NEW_LINE>((OnPrepareOptionsMenuListener) f).onPrepareOptionsMenu(menu);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (BuildConfig.DEBUG)<NEW_LINE>Log.d(TAG, "[onPreparePanel] fragments prepare result: " + show);<NEW_LINE>result |= show;<NEW_LINE>result &= menu.hasVisibleItems();<NEW_LINE>if (BuildConfig.DEBUG)<NEW_LINE>Log.d(TAG, "[onPreparePanel] returning " + result);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
|
", view: " + view + " menu: " + menu);
|
1,130,011
|
public void acceptType(char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, int modifiers, AccessRestriction accessRestriction) {<NEW_LINE>// does not check cancellation for every types to avoid performance loss<NEW_LINE>if ((this.foundTypesCount % CHECK_CANCEL_FREQUENCY) == 0)<NEW_LINE>checkCancel();<NEW_LINE>this.foundTypesCount++;<NEW_LINE>if (this.options.checkDeprecation && (modifiers & ClassFileConstants.AccDeprecated) != 0)<NEW_LINE>return;<NEW_LINE>if (this.assistNodeIsExtendedType && (modifiers & ClassFileConstants.AccFinal) != 0)<NEW_LINE>return;<NEW_LINE>if (this.options.checkVisibility) {<NEW_LINE>if ((modifiers & ClassFileConstants.AccPublic) == 0) {<NEW_LINE>if ((modifiers & ClassFileConstants.AccPrivate) != 0)<NEW_LINE>return;<NEW_LINE>if (this.moduleDeclaration == null) {<NEW_LINE>char[] currentPackage = CharOperation.concatWith(this.<MASK><NEW_LINE>if (!CharOperation.equals(packageName, currentPackage))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int accessibility = IAccessRule.K_ACCESSIBLE;<NEW_LINE>if (accessRestriction != null) {<NEW_LINE>switch(accessRestriction.getProblemId()) {<NEW_LINE>case IProblem.ForbiddenReference:<NEW_LINE>if (this.options.checkForbiddenReference) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>accessibility = IAccessRule.K_NON_ACCESSIBLE;<NEW_LINE>break;<NEW_LINE>case IProblem.DiscouragedReference:<NEW_LINE>if (this.options.checkDiscouragedReference) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>accessibility = IAccessRule.K_DISCOURAGED;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isForbidden(packageName, simpleTypeName, enclosingTypeNames)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (this.acceptedTypes == null) {<NEW_LINE>this.acceptedTypes = new ObjectVector();<NEW_LINE>}<NEW_LINE>this.acceptedTypes.add(new AcceptedType(packageName, simpleTypeName, enclosingTypeNames, modifiers, accessibility));<NEW_LINE>}
|
unitScope.fPackage.compoundName, '.');
|
457,759
|
/*<NEW_LINE>* passed JSON is a single connection from the response to sites/%d/publicize-connections<NEW_LINE>{"ID":12783250,<NEW_LINE>"site_ID":52451176,<NEW_LINE>"user_ID":5399133,<NEW_LINE>"keyring_connection_ID":12781808,<NEW_LINE>"keyring_connection_user_ID":5399133,<NEW_LINE>"shared":false,<NEW_LINE>"service":"twitter",<NEW_LINE>"label":"Twitter",<NEW_LINE>"issued":"2015-11-02 17:46:42",<NEW_LINE>"expires":"0000-00-00 00:00:00",<NEW_LINE>"external_ID":"4098796763",<NEW_LINE>"external_name":"AutomatticNickB",<NEW_LINE>"external_display":"@AutomatticNickB",<NEW_LINE>"external_profile_picture":"https://pbs.twimg.com/profile_images/661237406360727552/RycwaFzg.png",<NEW_LINE>"external_profile_URL":"http://twitter.com/AutomatticNickB",<NEW_LINE>"external_follower_count":null,<NEW_LINE>"status":"ok",<NEW_LINE>"refresh_URL":"https://public-api.wordpress.com/connect/?action=request&kr_nonce=<NEW_LINE>10c147b6fb&nonce=44fce811bb&refresh=1&for=connect&service=twitter&kr_blog_nonce=<NEW_LINE>e3686ea86a&magic=keyring&blog=52451176",<NEW_LINE>"meta":{<NEW_LINE>"links":{<NEW_LINE>"self":"https://public-api.wordpress.com/rest/v1.1/sites/52451176/publicize-connections/12783250",<NEW_LINE>"help":"https://public-api.wordpress.com/rest/v1.1/sites/52451176/publicize-connections/12783250/help",<NEW_LINE>"site":"https://public-api.wordpress.com/rest/v1.1/sites/52451176",<NEW_LINE>"service":"https://public-api.wordpress.com/rest/v1.1/meta/external-services/twitter",<NEW_LINE>"keyring-connection":"https://public-api.wordpress.com/rest/v1.1/me/keyring-connections/12781808"}<NEW_LINE>}}]}<NEW_LINE>*/<NEW_LINE>public static PublicizeConnection fromJson(JSONObject json) {<NEW_LINE>PublicizeConnection connection = new PublicizeConnection();<NEW_LINE>connection.connectionId = json.optInt("ID");<NEW_LINE>connection.siteId = json.optLong("site_ID");<NEW_LINE>connection.userId = json.optInt("user_ID");<NEW_LINE>connection.keyringConnectionId = json.optInt("keyring_connection_ID");<NEW_LINE>connection.keyringConnectionUserId = json.optInt("keyring_connection_user_ID");<NEW_LINE>connection.isShared = JSONUtils.getBool(json, "shared");<NEW_LINE>connection.mService = json.optString("service");<NEW_LINE>connection.<MASK><NEW_LINE>connection.mExternalId = json.optString("external_ID");<NEW_LINE>connection.mExternalName = json.optString("external_name");<NEW_LINE>connection.mExternalDisplayName = json.optString("external_display");<NEW_LINE>connection.mExternalProfilePictureUrl = json.optString("external_profile_picture");<NEW_LINE>connection.mStatus = json.optString("status");<NEW_LINE>connection.mRefreshUrl = json.optString("refresh_URL");<NEW_LINE>try {<NEW_LINE>JSONArray jsonSitesArray = json.getJSONArray("sites");<NEW_LINE>connection.mSites = getSitesArrayFromJson(jsonSitesArray);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>connection.mSites = new long[0];<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return connection;<NEW_LINE>}
|
mLabel = json.optString("label");
|
835,410
|
private boolean shouldRepartitionForIndexJoin(List<VariableReferenceExpression> joinColumns, PreferredProperties parentPreferredProperties, ActualProperties probeProperties) {<NEW_LINE>// See if distributed index joins are enabled<NEW_LINE>if (!distributedIndexJoins) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// No point in repartitioning if the plan is not distributed<NEW_LINE>if (probeProperties.isSingleNode()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Optional<PartitioningProperties> parentPartitioningPreferences = parentPreferredProperties.getGlobalProperties().flatMap(PreferredProperties.Global::getPartitioningProperties);<NEW_LINE>// Disable repartitioning if it would disrupt a parent's partitioning preference when streaming is enabled<NEW_LINE>boolean parentAlreadyPartitionedOnChild = parentPartitioningPreferences.map(partitioning -> probeProperties.isStreamPartitionedOn(partitioning.getPartitioningColumns(), <MASK><NEW_LINE>if (preferStreamingOperators && parentAlreadyPartitionedOnChild) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Otherwise, repartition if we need to align with the join columns<NEW_LINE>if (!probeProperties.isStreamPartitionedOn(joinColumns, false)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// If we are already partitioned on the join columns because the data has been forced effectively into one stream,<NEW_LINE>// then we should repartition if that would make a difference (from the single stream state).<NEW_LINE>return probeProperties.isEffectivelySingleStream() && probeProperties.isStreamRepartitionEffective(joinColumns);<NEW_LINE>}
|
false)).orElse(false);
|
604,836
|
public void evaluate(char[] codeSnippet, char[][] contextLocalVariableTypeNames, char[][] contextLocalVariableNames, int[] contextLocalVariableModifiers, char[] contextDeclaringTypeName, boolean contextIsStatic, boolean contextIsConstructorCall, INameEnvironment environment, Map<String, String> options, final IRequestor requestor, IProblemFactory problemFactory) throws InstallException {<NEW_LINE>// Initialialize context<NEW_LINE>this.localVariableTypeNames = contextLocalVariableTypeNames;<NEW_LINE>this.localVariableNames = contextLocalVariableNames;<NEW_LINE>this.localVariableModifiers = contextLocalVariableModifiers;<NEW_LINE>this.declaringTypeName = contextDeclaringTypeName;<NEW_LINE>this.isStatic = contextIsStatic;<NEW_LINE>this.isConstructorCall = contextIsConstructorCall;<NEW_LINE>deployCodeSnippetClassIfNeeded(requestor);<NEW_LINE>try {<NEW_LINE>// Install new variables if needed<NEW_LINE>class ForwardingRequestor implements IRequestor {<NEW_LINE><NEW_LINE>boolean hasErrors = false;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean acceptClassFiles(ClassFile[] classFiles, char[] codeSnippetClassName) {<NEW_LINE>return requestor.acceptClassFiles(classFiles, codeSnippetClassName);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void acceptProblem(CategorizedProblem problem, char[] fragmentSource, int fragmentKind) {<NEW_LINE>requestor.acceptProblem(problem, fragmentSource, fragmentKind);<NEW_LINE>if (problem.isError()) {<NEW_LINE>this.hasErrors = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ForwardingRequestor forwardingRequestor = new ForwardingRequestor();<NEW_LINE>if (this.varsChanged) {<NEW_LINE>evaluateVariables(environment, options, forwardingRequestor, problemFactory);<NEW_LINE>}<NEW_LINE>// Compile code snippet if there was no errors while evaluating the variables<NEW_LINE>if (!forwardingRequestor.hasErrors) {<NEW_LINE>Evaluator evaluator = new CodeSnippetEvaluator(codeSnippet, this, <MASK><NEW_LINE>ClassFile[] classes = evaluator.getClasses();<NEW_LINE>// Send code snippet on target<NEW_LINE>if (classes != null && classes.length > 0) {<NEW_LINE>char[] simpleClassName = evaluator.getClassName();<NEW_LINE>char[] pkgName = getPackageName();<NEW_LINE>char[] qualifiedClassName = pkgName.length == 0 ? simpleClassName : CharOperation.concat(pkgName, simpleClassName, '.');<NEW_LINE>CODE_SNIPPET_COUNTER++;<NEW_LINE>if (!requestor.acceptClassFiles(classes, qualifiedClassName))<NEW_LINE>throw new InstallException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>// Reinitialize context to default values<NEW_LINE>this.localVariableTypeNames = null;<NEW_LINE>this.localVariableNames = null;<NEW_LINE>this.localVariableModifiers = null;<NEW_LINE>this.declaringTypeName = null;<NEW_LINE>this.isStatic = true;<NEW_LINE>this.isConstructorCall = false;<NEW_LINE>}<NEW_LINE>}
|
environment, options, requestor, problemFactory);
|
624,323
|
public void removeWorkflow(String workflowId) {<NEW_LINE>long startTime = Instant.now().toEpochMilli();<NEW_LINE>String docType = StringUtils.isBlank(docTypeOverride) ? WORKFLOW_DOC_TYPE : docTypeOverride;<NEW_LINE>DeleteRequest request = new DeleteRequest(workflowIndexName, docType, workflowId);<NEW_LINE>try {<NEW_LINE>DeleteResponse response = elasticSearchClient.delete(request);<NEW_LINE>if (response.getResult() == DocWriteResponse.Result.NOT_FOUND) {<NEW_LINE>LOGGER.error("Index removal failed - document not found by id: {}", workflowId);<NEW_LINE>}<NEW_LINE>long endTime = Instant.now().toEpochMilli();<NEW_LINE>LOGGER.debug(<MASK><NEW_LINE>Monitors.recordESIndexTime("remove_workflow", WORKFLOW_DOC_TYPE, endTime - startTime);<NEW_LINE>Monitors.recordWorkerQueueSize("indexQueue", ((ThreadPoolExecutor) executorService).getQueue().size());<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error("Failed to remove workflow {} from index", workflowId, e);<NEW_LINE>Monitors.error(className, "remove");<NEW_LINE>}<NEW_LINE>}
|
"Time taken {} for removing workflow: {}", endTime - startTime, workflowId);
|
1,721,917
|
public byte[] encode(final int[] ld) {<NEW_LINE>final BitCoderContext ctx = ctxEndode;<NEW_LINE>ctx.reset();<NEW_LINE>int skippedTags = 0;<NEW_LINE>int nonNullTags = 0;<NEW_LINE>// (skip first bit ("reversedirection") )<NEW_LINE>// all others are generic<NEW_LINE>for (int inum = 1; inum < lookupValues.size(); inum++) {<NEW_LINE>// loop over lookup names<NEW_LINE>final int d = ld[inum];<NEW_LINE>if (d == 0) {<NEW_LINE>skippedTags++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ctx.encodeVarBits(skippedTags + 1);<NEW_LINE>nonNullTags++;<NEW_LINE>skippedTags = 0;<NEW_LINE>// 0 excluded already, 1 (=unknown) we rotate up to 8<NEW_LINE>// to have the good code space for the popular values<NEW_LINE>final int dd = d < 2 ? 7 : (d < 9 ? d - 2 : d - 1);<NEW_LINE>ctx.encodeVarBits(dd);<NEW_LINE>}<NEW_LINE>ctx.encodeVarBits(0);<NEW_LINE>if (nonNullTags == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>final byte[] ab = new byte[len];<NEW_LINE>System.arraycopy(abBuf, 0, ab, 0, len);<NEW_LINE>// crosscheck: decode and compare<NEW_LINE>final int[] ld2 = new int[lookupValues.size()];<NEW_LINE>decode(ld2, false, ab);<NEW_LINE>for (int inum = 1; inum < lookupValues.size(); inum++) {<NEW_LINE>// loop over lookup names (except reverse dir)<NEW_LINE>if (ld2[inum] != ld[inum]) {<NEW_LINE>throw new RuntimeException("assertion failed encoding inum=" + inum + " val=" + ld[inum] + " " + getKeyValueDescription(false, ab));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ab;<NEW_LINE>}
|
int len = ctx.closeAndGetEncodedLength();
|
1,039,450
|
public CommandResponse<String> handle(CommandRequest request) {<NEW_LINE>String data = request.getParam("data");<NEW_LINE>if (StringUtil.isBlank(data)) {<NEW_LINE>return CommandResponse.ofFailure(new IllegalArgumentException("Bad data"));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>data = URLDecoder.decode(data, "utf-8");<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>return CommandResponse.ofFailure(e, "decode rule data error");<NEW_LINE>}<NEW_LINE>RecordLog.info("[API Server] Receiving rule change (type:parameter flow rule): {}", data);<NEW_LINE>String result = SUCCESS_MSG;<NEW_LINE>List<ParamFlowRule> flowRules = JSONArray.parseArray(data, ParamFlowRule.class);<NEW_LINE>ParamFlowRuleManager.loadRules(flowRules);<NEW_LINE>if (!writeToDataSource(paramFlowWds, flowRules)) {<NEW_LINE>result = WRITE_DS_FAILURE_MSG;<NEW_LINE>}<NEW_LINE>return CommandResponse.ofSuccess(result);<NEW_LINE>}
|
RecordLog.info("Decode rule data error", e);
|
763,126
|
private void configureColumnMemory() {<NEW_LINE>this.symbolMapWriters.setPos(columnCount);<NEW_LINE>for (int i = 0; i < columnCount; i++) {<NEW_LINE>int type = metadata.getColumnType(i);<NEW_LINE>configureColumn(type, metadata.isColumnIndexed(i), i);<NEW_LINE>if (ColumnType.isSymbol(type)) {<NEW_LINE>final int symbolIndex = denseSymbolMapWriters.size();<NEW_LINE>long columnNameTxn = columnVersionWriter.getDefaultColumnNameTxn(i);<NEW_LINE>SymbolMapWriter symbolMapWriter = new SymbolMapWriter(configuration, path.trimTo(rootLen), metadata.getColumnName(i), columnNameTxn, txWriter.unsafeReadSymbolTransientCount<MASK><NEW_LINE>symbolMapWriters.extendAndSet(i, symbolMapWriter);<NEW_LINE>denseSymbolMapWriters.add(symbolMapWriter);<NEW_LINE>}<NEW_LINE>if (metadata.isColumnIndexed(i)) {<NEW_LINE>indexers.extendAndSet(i, new SymbolColumnIndexer());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int timestampIndex = metadata.getTimestampIndex();<NEW_LINE>if (timestampIndex != -1) {<NEW_LINE>o3TimestampMem = o3Columns.getQuick(getPrimaryColumnIndex(timestampIndex));<NEW_LINE>o3TimestampMemCpy = Vm.getCARWInstance(o3ColumnMemorySize, Integer.MAX_VALUE, MemoryTag.NATIVE_O3);<NEW_LINE>}<NEW_LINE>}
|
(symbolIndex), symbolIndex, txWriter);
|
1,326,354
|
public Prediction<Regressor> predict(Example<Regressor> example) {<NEW_LINE>//<NEW_LINE>// Ensures we handle collisions correctly<NEW_LINE>SparseVector vec = SparseVector.createSparseVector(example, featureIDMap, false);<NEW_LINE>if (vec.numActiveElements() == 0) {<NEW_LINE>throw new IllegalArgumentException("No features found in Example " + example.toString());<NEW_LINE>}<NEW_LINE>List<Prediction<Regressor>> predictionList = new ArrayList<>();<NEW_LINE>for (Map.Entry<String, Node<Regressor>> e : roots.entrySet()) {<NEW_LINE>Node<Regressor> oldNode = e.getValue();<NEW_LINE>Node<Regressor<MASK><NEW_LINE>while (curNode != null) {<NEW_LINE>oldNode = curNode;<NEW_LINE>curNode = oldNode.getNextNode(vec);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// oldNode must be a LeafNode.<NEW_LINE>predictionList.add(((LeafNode<Regressor>) oldNode).getPrediction(vec.numActiveElements(), example));<NEW_LINE>}<NEW_LINE>return combine(predictionList);<NEW_LINE>}
|
> curNode = e.getValue();
|
54,421
|
private void validateAnnotations(EndpointConfig epConfig, Errors.Collector collector) {<NEW_LINE>// list all annotations that are marked as Attribute and make sure some AbacValidator supports them<NEW_LINE>for (SecurityLevel securityLevel : epConfig.securityLevels()) {<NEW_LINE>int attributeAnnotations = 0;<NEW_LINE>int unsupported = 0;<NEW_LINE>List<String> <MASK><NEW_LINE>Map<Class<? extends Annotation>, List<Annotation>> allAnnotations = securityLevel.allAnnotations();<NEW_LINE>for (Class<? extends Annotation> type : allAnnotations.keySet()) {<NEW_LINE>AbacAnnotation abacAnnotation = type.getAnnotation(AbacAnnotation.class);<NEW_LINE>if (null != abacAnnotation || isSupportedAnnotation(type)) {<NEW_LINE>attributeAnnotations++;<NEW_LINE>if (!supportedAnnotations.contains(type)) {<NEW_LINE>unsupported++;<NEW_LINE>unsupportedClassNames.add(type.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// evaluate that we can continue<NEW_LINE>if (unsupported != 0) {<NEW_LINE>boolean fail = failOnUnvalidated;<NEW_LINE>if (unsupported == attributeAnnotations && failIfNoneValidated) {<NEW_LINE>fail = true;<NEW_LINE>}<NEW_LINE>if (fail) {<NEW_LINE>for (String unsupportedClassName : unsupportedClassNames) {<NEW_LINE>collector.fatal(this, unsupportedClassName + " attribute annotation is not supported.");<NEW_LINE>}<NEW_LINE>collector.fatal(this, "Supported annotations: " + supportedAnnotations);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
unsupportedClassNames = new LinkedList<>();
|
1,556,110
|
private SuperByteBuffer buildStructureBuffer(PonderWorld world, RenderType layer) {<NEW_LINE>BlockRenderDispatcher dispatcher = ModelUtil.VANILLA_RENDERER;<NEW_LINE>ThreadLocalObjects objects = THREAD_LOCAL_OBJECTS.get();<NEW_LINE>PoseStack poseStack = objects.poseStack;<NEW_LINE>Random random = objects.random;<NEW_LINE>ShadeSeparatingVertexConsumer shadeSeparatingWrapper = objects.shadeSeparatingWrapper;<NEW_LINE>ShadeSeparatedBufferBuilder builder = new ShadeSeparatedBufferBuilder(512);<NEW_LINE>BufferBuilder unshadedBuilder = objects.unshadedBuilder;<NEW_LINE>builder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);<NEW_LINE>unshadedBuilder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);<NEW_LINE>shadeSeparatingWrapper.prepare(builder, unshadedBuilder);<NEW_LINE>world.setMask(this.section);<NEW_LINE>ForgeHooksClient.setRenderType(layer);<NEW_LINE>ModelBlockRenderer.enableCaching();<NEW_LINE>section.forEach(pos -> {<NEW_LINE>BlockState state = world.getBlockState(pos);<NEW_LINE>FluidState fluidState = world.getFluidState(pos);<NEW_LINE>poseStack.pushPose();<NEW_LINE>poseStack.translate(pos.getX(), pos.getY(), pos.getZ());<NEW_LINE>if (state.getRenderShape() == RenderShape.MODEL && ItemBlockRenderTypes.canRenderInLayer(state, layer)) {<NEW_LINE>BlockEntity <MASK><NEW_LINE>dispatcher.renderBatched(state, pos, world, poseStack, shadeSeparatingWrapper, true, random, tileEntity != null ? tileEntity.getModelData() : EmptyModelData.INSTANCE);<NEW_LINE>}<NEW_LINE>if (!fluidState.isEmpty() && ItemBlockRenderTypes.canRenderInLayer(fluidState, layer))<NEW_LINE>dispatcher.renderLiquid(pos, world, builder, state, fluidState);<NEW_LINE>poseStack.popPose();<NEW_LINE>});<NEW_LINE>ModelBlockRenderer.clearCache();<NEW_LINE>ForgeHooksClient.setRenderType(null);<NEW_LINE>world.clearMask();<NEW_LINE>shadeSeparatingWrapper.clear();<NEW_LINE>unshadedBuilder.end();<NEW_LINE>builder.appendUnshadedVertices(unshadedBuilder);<NEW_LINE>builder.end();<NEW_LINE>return new SuperByteBuffer(builder);<NEW_LINE>}
|
tileEntity = world.getBlockEntity(pos);
|
610,634
|
protected void initLayout() {<NEW_LINE>ThemeConstants theme = App.getInstance().getThemeConstants();<NEW_LINE>VerticalLayout root = new VerticalLayout();<NEW_LINE>root.setWidthUndefined();<NEW_LINE>root.setSpacing(true);<NEW_LINE>root.setMargin(false);<NEW_LINE>setContent(root);<NEW_LINE>messages = AppBeans.get(Messages.class);<NEW_LINE>nameField = new TextField(messages.getMainMessage("PresentationsEditor.name"));<NEW_LINE>nameField.setWidth(theme.get("cuba.web.PresentationEditor.name.width"));<NEW_LINE>nameField.setValue(getPresentationCaption());<NEW_LINE>root.addComponent(nameField);<NEW_LINE>autoSaveField = new CheckBox();<NEW_LINE>autoSaveField.setCaption(messages.getMainMessage("PresentationsEditor.autoSave"));<NEW_LINE>autoSaveField.setValue(BooleanUtils.isTrue(presentation.getAutoSave()));<NEW_LINE>root.addComponent(autoSaveField);<NEW_LINE>defaultField = new CheckBox();<NEW_LINE>defaultField.setCaption(messages.getMainMessage("PresentationsEditor.default"));<NEW_LINE>defaultField.setValue(presentation.getId().equals<MASK><NEW_LINE>root.addComponent(defaultField);<NEW_LINE>if (allowGlobalPresentations) {<NEW_LINE>globalField = new CheckBox();<NEW_LINE>globalField.setCaption(messages.getMainMessage("PresentationsEditor.global"));<NEW_LINE>globalField.setValue(!isNew && presentation.getUser() == null);<NEW_LINE>root.addComponent(globalField);<NEW_LINE>}<NEW_LINE>HorizontalLayout buttons = new HorizontalLayout();<NEW_LINE>buttons.setMargin(false);<NEW_LINE>buttons.setSpacing(true);<NEW_LINE>buttons.setWidthUndefined();<NEW_LINE>root.addComponent(buttons);<NEW_LINE>root.setComponentAlignment(buttons, Alignment.MIDDLE_LEFT);<NEW_LINE>Button commitButton = new CubaButton(messages.getMainMessage("PresentationsEditor.save"));<NEW_LINE>commitButton.addClickListener(event -> {<NEW_LINE>if (validate()) {<NEW_LINE>commit();<NEW_LINE>forceClose();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>buttons.addComponent(commitButton);<NEW_LINE>Button closeButton = new CubaButton(messages.getMainMessage("PresentationsEditor.close"));<NEW_LINE>closeButton.addClickListener(event -> forceClose());<NEW_LINE>buttons.addComponent(closeButton);<NEW_LINE>nameField.focus();<NEW_LINE>}
|
(component.getDefaultPresentationId()));
|
909,030
|
public void marshall(CreateDatasetRequest createDatasetRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createDatasetRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createDatasetRequest.getDatasetName(), DATASETNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDatasetRequest.getActions(), ACTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createDatasetRequest.getContentDeliveryRules(), CONTENTDELIVERYRULES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDatasetRequest.getRetentionPeriod(), RETENTIONPERIOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDatasetRequest.getVersioningConfiguration(), VERSIONINGCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDatasetRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDatasetRequest.getLateDataRules(), LATEDATARULES_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
createDatasetRequest.getTriggers(), TRIGGERS_BINDING);
|
1,133,753
|
FormatterFunc createFormat() throws Exception {<NEW_LINE>ClassLoader classLoader = jarState.getClassLoader();<NEW_LINE>// instantiate the formatter and get its format method<NEW_LINE>Class<?> optionsClass = classLoader.loadClass(OPTIONS_CLASS);<NEW_LINE>Class<?> optionsBuilderClass = classLoader.loadClass(OPTIONS_BUILDER_CLASS);<NEW_LINE>Method optionsBuilderMethod = optionsClass.getMethod(OPTIONS_BUILDER_METHOD);<NEW_LINE>Object optionsBuilder = optionsBuilderMethod.invoke(null);<NEW_LINE>Class<?> optionsStyleClass = classLoader.loadClass(OPTIONS_Style);<NEW_LINE>Object styleConstant = Enum.valueOf((Class<Enum>) optionsStyleClass, style);<NEW_LINE>Method optionsBuilderStyleMethod = optionsBuilderClass.getMethod(OPTIONS_BUILDER_STYLE_METHOD, optionsStyleClass);<NEW_LINE>optionsBuilderStyleMethod.invoke(optionsBuilder, styleConstant);<NEW_LINE>Method optionsBuilderBuildMethod = optionsBuilderClass.getMethod(OPTIONS_BUILDER_BUILD_METHOD);<NEW_LINE>Object options = optionsBuilderBuildMethod.invoke(optionsBuilder);<NEW_LINE>Class<?> formatterClazz = classLoader.loadClass(FORMATTER_CLASS);<NEW_LINE>Object formatter = formatterClazz.getConstructor(optionsClass).newInstance(options);<NEW_LINE>Method formatterMethod = formatterClazz.getMethod(FORMATTER_METHOD, String.class);<NEW_LINE>Function<String, String> removeUnused = constructRemoveUnusedFunction(classLoader);<NEW_LINE>Class<?> importOrdererClass = classLoader.loadClass(IMPORT_ORDERER_CLASS);<NEW_LINE>Method importOrdererMethod = importOrdererClass.getMethod(IMPORT_ORDERER_METHOD, String.class);<NEW_LINE>BiFunction<String, Object, String> reflowLongStrings = this.reflowLongStrings ? constructReflowLongStringsFunction(classLoader, formatterClazz) : (s, f) -> s;<NEW_LINE>return JVM_SUPPORT.suggestLaterVersionOnError(version, (input -> {<NEW_LINE>String formatted = (String) formatterMethod.invoke(formatter, input);<NEW_LINE>String removedUnused = removeUnused.apply(formatted);<NEW_LINE>String sortedImports = (String) importOrdererMethod.invoke(null, removedUnused);<NEW_LINE>String reflowedLongStrings = <MASK><NEW_LINE>return fixWindowsBug(reflowedLongStrings, version);<NEW_LINE>}));<NEW_LINE>}
|
reflowLongStrings.apply(sortedImports, formatter);
|
539,110
|
public void writeWebConfigurationFile() {<NEW_LINE>List<String> <MASK><NEW_LINE>defaultWebConfContents.addAll(getWebConfigurationFileHeader());<NEW_LINE>defaultWebConfContents.addAll(Arrays.asList("", "# image feeds", "imagefeed.Web,Pictures=https://api.flickr.com/services/feeds/photos_public.gne?format=rss2", "imagefeed.Web,Pictures=https://api.flickr.com/services/feeds/photos_public.gne?id=39453068@N05&format=rss2", "imagefeed.Web,Pictures=https://api.flickr.com/services/feeds/photos_public.gne?id=14362684@N08&format=rss2", "", "# audio feeds", "audiofeed.Web,Podcasts=https://rss.art19.com/caliphate", "audiofeed.Web,Podcasts=https://www.nasa.gov/rss/dyn/Gravity-Assist.rss", "audiofeed.Web,Podcasts=https://rss.art19.com/wolverine-the-long-night", "", "# video feeds", "videofeed.Web,Vodcasts=https://feeds.feedburner.com/tedtalks_video", "videofeed.Web,Vodcasts=https://www.nasa.gov/rss/dyn/nasax_vodcast.rss", "videofeed.Web,YouTube Channels=https://www.youtube.com/feeds/videos.xml?channel_id=UC0PEAMcRK7Mnn2G1bCBXOWQ", "videofeed.Web,YouTube Channels=https://www.youtube.com/feeds/videos.xml?channel_id=UCccjdJEay2hpb5scz61zY6Q", "videofeed.Web,YouTube Channels=https://www.youtube.com/feeds/videos.xml?channel_id=UCqFzWxSCi39LnW1JKFR3efg", "videofeed.Web,YouTube Channels=https://www.youtube.com/feeds/videos.xml?channel_id=UCfAOh2t5DpxVrgS9NQKjC7A", "videofeed.Web,YouTube Channels=https://www.youtube.com/feeds/videos.xml?channel_id=UCzRBkt4a2hy6HObM3cl-x7g", "", "# audio streams", "audiostream.Web,Radio=RNZ,http://radionz-ice.streamguys.com/national.mp3,https://www.rnz.co.nz/assets/cms_uploads/000/000/159/RNZ_logo-Te-Reo-NEG-500.png", "", "# video streams", "# videostream.Web,TV=France 24,mms://stream1.france24.yacast.net/f24_liveen,http://www.france24.com/en/sites/france24.com.en/themes/france24/logo-fr.png", "# videostream.Web,TV=BFM TV (French TV),mms://vipmms9.yacast.net/bfm_bfmtv,http://upload.wikimedia.org/wikipedia/en/6/62/BFMTV.png", "# videostream.Web,Webcams=View of Shanghai Harbour,mmst://www.onedir.com/cam3,http://media-cdn.tripadvisor.com/media/photo-s/00/1d/4b/d8/pudong-from-the-bund.jpg"));<NEW_LINE>writeWebConfigurationFile(defaultWebConfContents);<NEW_LINE>}
|
defaultWebConfContents = new ArrayList<>();
|
1,224,999
|
public static final void create(final ITool tool) {<NEW_LINE>final CostModelCreator collector = new CostModelCreator(tool);<NEW_LINE>// TODO Start from the ModuleNode similar to how the Explorer works. It is<NEW_LINE>// unclear how to lookup the corresponding subtree in the global CM graph<NEW_LINE>// in getNextState and getInitStates of the model checker.<NEW_LINE>final Vect<Action> init = tool.getInitStateSpec();<NEW_LINE>for (int i = 0; i < init.size(); i++) {<NEW_LINE>final Action initAction = init.elementAt(i);<NEW_LINE>initAction.cm = collector.getCM(initAction, Relation.INIT);<NEW_LINE>}<NEW_LINE>final Map<SemanticNode, CostModel> cms = new HashMap<>();<NEW_LINE>for (Action nextAction : tool.getActions()) {<NEW_LINE>if (cms.containsKey(nextAction.pred)) {<NEW_LINE>nextAction.cm = cms.get(nextAction.pred);<NEW_LINE>} else {<NEW_LINE>nextAction.cm = collector.getCM(nextAction, Relation.NEXT);<NEW_LINE>cms.put(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Action invariant : tool.getInvariants()) {<NEW_LINE>invariant.cm = collector.getCM(invariant, Relation.PROP);<NEW_LINE>}<NEW_LINE>// action constraints<NEW_LINE>final ExprNode[] actionConstraints = tool.getActionConstraints();<NEW_LINE>for (ExprNode exprNode : actionConstraints) {<NEW_LINE>final OpDefNode odn = (OpDefNode) exprNode.getToolObject(tool.getId());<NEW_LINE>final Action act = new Action(exprNode, Context.Empty, odn);<NEW_LINE>act.cm = collector.getCM(act, Relation.CONSTRAINT);<NEW_LINE>exprNode.setToolObject(tool.getId(), act);<NEW_LINE>}<NEW_LINE>// state constraints<NEW_LINE>final ExprNode[] modelConstraints = tool.getModelConstraints();<NEW_LINE>for (ExprNode exprNode : modelConstraints) {<NEW_LINE>final OpDefNode odn = (OpDefNode) exprNode.getToolObject(tool.getId());<NEW_LINE>final Action act = new Action(exprNode, Context.Empty, odn);<NEW_LINE>act.cm = collector.getCM(act, Relation.CONSTRAINT);<NEW_LINE>exprNode.setToolObject(tool.getId(), act);<NEW_LINE>}<NEW_LINE>// https://github.com/tlaplus/tlaplus/issues/413#issuecomment-577304602<NEW_LINE>if (Boolean.getBoolean(CostModelCreator.class.getName() + ".implied")) {<NEW_LINE>for (Action impliedInits : tool.getImpliedInits()) {<NEW_LINE>impliedInits.cm = collector.getCM(impliedInits, Relation.PROP);<NEW_LINE>}<NEW_LINE>for (Action impliedActions : tool.getImpliedActions()) {<NEW_LINE>impliedActions.cm = collector.getCM(impliedActions, Relation.PROP);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
nextAction.pred, nextAction.cm);
|
285,594
|
private void buildRuleTable(FDE fde, long instructionPointer) throws IOException {<NEW_LINE>PrintStream out = System.err;<NEW_LINE>state = new RuleState();<NEW_LINE>state.registerRules = new HashMap<Integer, RegisterRule>();<NEW_LINE>{<NEW_LINE>// out.printf("CIE has initial instructions:\n");<NEW_LINE>//<NEW_LINE>// String s = "";<NEW_LINE>// for( byte b: fde.getCIE().getInitialInstructions() ) {<NEW_LINE>// s += String.format("0x%x ", b);<NEW_LINE>// }<NEW_LINE>// out.println(s);<NEW_LINE>// ByteBuffer initialInstructionStream = ByteBuffer.wrap(fde.getCIE().getInitialInstructions());<NEW_LINE>// initialInstructionStream.order(fde.getCIE().byteOrder);<NEW_LINE>InputStream i = new ByteArrayInputStream(fde.getCIE().getInitialInstructions());<NEW_LINE>ImageInputStream initialInstructionStream = new MemoryCacheImageInputStream(i);<NEW_LINE>initialInstructionStream.setByteOrder(fde.getCIE().byteOrder);<NEW_LINE>// System.err.println("Initial Instructions:");<NEW_LINE>while (initialInstructionStream.getStreamPosition() < fde.getCIE().getInitialInstructions().length) {<NEW_LINE>// currentAddress is 0 as initialInstructions are always applied.<NEW_LINE>processInstruction(/*out,*/<NEW_LINE>initialInstructionStream, fde.<MASK><NEW_LINE>// out.println();<NEW_LINE>}<NEW_LINE>state.cieRegisterRules = new HashMap<Integer, RegisterRule>();<NEW_LINE>// We can copy the rules as rules are immutable. (Don't need a deep copy.)<NEW_LINE>state.cieRegisterRules.putAll(state.registerRules);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// System.err.printf("FDE has instructions:\n");<NEW_LINE>//<NEW_LINE>// String s = "";<NEW_LINE>// for( byte b: fde.getCallFrameInstructions()) {<NEW_LINE>// s += String.format("0x%x ", b);<NEW_LINE>// }<NEW_LINE>// out.println(s);<NEW_LINE>InputStream i = new ByteArrayInputStream(fde.getCallFrameInstructions());<NEW_LINE>ImageInputStream instructionStream = new MemoryCacheImageInputStream(i);<NEW_LINE>instructionStream.setByteOrder(fde.getCIE().byteOrder);<NEW_LINE>Map<Integer, RegisterRule> fdeRules = new HashMap<Integer, RegisterRule>();<NEW_LINE>// fdeRules.putAll(ruleRows.get(ruleRows.size()-1));<NEW_LINE>long currentAddress = fde.getBaseAddress();<NEW_LINE>// out.printf("@0x%x -\t", currentAddress);<NEW_LINE>// System.err.println("FDE Instructions:");<NEW_LINE>while (instructionStream.getStreamPosition() < fde.getCallFrameInstructions().length && instructionPointer >= currentAddress) {<NEW_LINE>currentAddress = processInstruction(/*out,*/<NEW_LINE>instructionStream, fde.getCIE(), state, currentAddress);<NEW_LINE>// out.println();<NEW_LINE>// out.printf("@0x%x -\t", currentAddress);<NEW_LINE>}<NEW_LINE>// out.println();<NEW_LINE>}<NEW_LINE>}
|
getCIE(), state, 0);
|
382,028
|
private void printEpubCheckCompleted(Report report) {<NEW_LINE>if (report != null) {<NEW_LINE>StringBuilder messageCount = new StringBuilder();<NEW_LINE>int count;<NEW_LINE>String variant;<NEW_LINE>if (reportingLevel <= ReportingLevel.Fatal) {<NEW_LINE>messageCount.append(messages.get("messages") + ": ");<NEW_LINE>count = report.getFatalErrorCount();<NEW_LINE>variant = (count == 0) ? "zero" : (count == 1) ? "one" : "many";<NEW_LINE>messageCount.append(String.format(messages.get("counter_fatal_" + variant), count));<NEW_LINE>}<NEW_LINE>if (reportingLevel <= ReportingLevel.Error) {<NEW_LINE>count = report.getErrorCount();<NEW_LINE>variant = (count == 0) ? "zero" : (count == 1) ? "one" : "many";<NEW_LINE>messageCount.append(" / " + String.format(messages.get("counter_error_" + variant), count));<NEW_LINE>}<NEW_LINE>if (reportingLevel <= ReportingLevel.Warning) {<NEW_LINE>count = report.getWarningCount();<NEW_LINE>variant = (count == 0) ? "zero" : (count == 1) ? "one" : "many";<NEW_LINE>messageCount.append(" / " + String.format(messages.get("counter_warn_" + variant), count));<NEW_LINE>}<NEW_LINE>if (reportingLevel <= ReportingLevel.Info) {<NEW_LINE>count = report.getInfoCount();<NEW_LINE>variant = (count == 0) ? "zero" : (<MASK><NEW_LINE>messageCount.append(" / " + String.format(messages.get("counter_info_" + variant), count));<NEW_LINE>}<NEW_LINE>if (reportingLevel <= ReportingLevel.Usage) {<NEW_LINE>count = report.getUsageCount();<NEW_LINE>variant = (count == 0) ? "zero" : (count == 1) ? "one" : "many";<NEW_LINE>messageCount.append(" / " + String.format(messages.get("counter_usage_" + variant), count));<NEW_LINE>}<NEW_LINE>if (messageCount.length() > 0) {<NEW_LINE>messageCount.append("\n");<NEW_LINE>outWriter.println(messageCount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>outWriter.println(messages.get("epubcheck_completed"));<NEW_LINE>outWriter.setQuiet(false);<NEW_LINE>}
|
count == 1) ? "one" : "many";
|
1,626,034
|
protected void analyzeDependency(Dependency dependency, Engine engine) throws AnalysisException {<NEW_LINE>if (dependency.getDisplayFileName().equals(dependency.getFileName())) {<NEW_LINE>engine.removeDependency(dependency);<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>if (!packageLock.isFile() || packageLock.length() == 0 || !shouldProcess(packageLock)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final File packageJson = new File(packageLock.getParentFile(), "package.json");<NEW_LINE>final List<Advisory> advisories;<NEW_LINE>final MultiValuedMap<String, String> dependencyMap = new HashSetValuedHashMap<>();<NEW_LINE>advisories = analyzePackage(packageLock, packageJson, dependency, dependencyMap);<NEW_LINE>try {<NEW_LINE>processResults(advisories, engine, dependency, dependencyMap);<NEW_LINE>} catch (CpeValidationException ex) {<NEW_LINE>throw new UnexpectedAnalysisException(ex);<NEW_LINE>}<NEW_LINE>}
|
File packageLock = dependency.getActualFile();
|
1,256,591
|
private synchronized void handleRouteAssignmentOffline(Message message) {<NEW_LINE>if (controllerWorkerHelixHandler == null) {<NEW_LINE>LOGGER.warn("Controller route not online yet.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String[] clustersInfo = WorkerUtils.parseSrcDstCluster(message.getResourceName());<NEW_LINE>if (clustersInfo == null || clustersInfo.length != 3) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String srcCluster = clustersInfo[1];<NEW_LINE>String dstCluster = clustersInfo[2];<NEW_LINE><MASK><NEW_LINE>if (!validateRequest(srcCluster, dstCluster, routeId)) {<NEW_LINE>throw new IllegalArgumentException(String.format("Invalid handleRouteAssignmentOffline request, srcCluster: %s, dstCluster: %s, routeId: %s", srcCluster, dstCluster, routeId));<NEW_LINE>}<NEW_LINE>LOGGER.info("Handling resource offline {}", message.getResourceName());<NEW_LINE>if (controllerWorkerHelixHandler != null) {<NEW_LINE>controllerWorkerHelixHandler.shutdown();<NEW_LINE>controllerWorkerHelixHandler = null;<NEW_LINE>}<NEW_LINE>currentDstCluster = null;<NEW_LINE>currentSrcCluster = null;<NEW_LINE>currentRouteId = null;<NEW_LINE>LOGGER.info("Handling resource offline {} finished", message.getResourceName());<NEW_LINE>}
|
String routeId = message.getPartitionName();
|
1,154,348
|
final DescribeIpGroupsResult executeDescribeIpGroups(DescribeIpGroupsRequest describeIpGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeIpGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeIpGroupsRequest> request = null;<NEW_LINE>Response<DescribeIpGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeIpGroupsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeIpGroupsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WorkSpaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeIpGroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeIpGroupsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeIpGroupsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
|
397,994
|
private JSpinner initGapHeightSpinner() {<NEW_LINE>SpinnerNumberModel gapHeightModel = new SpinnerNumberModel(DEFAULT_GAP_HEIGHT, 0, 100, 1);<NEW_LINE>JSpinner spinner = new JSpinner(gapHeightModel);<NEW_LINE>spinner.setEditor(new JSpinner.NumberEditor(spinner));<NEW_LINE>// NOI18N<NEW_LINE>spinner.setToolTipText(NbBundle.getMessage<MASK><NEW_LINE>Dimension labelPrefSize = new JLabel("999").getPreferredSize();<NEW_LINE>Dimension spinnerMinSize = spinner.getMinimumSize();<NEW_LINE>spinner.setMaximumSize(new Dimension(labelPrefSize.width + spinnerMinSize.width, Short.MAX_VALUE));<NEW_LINE>spinner.addChangeListener(new ChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stateChanged(ChangeEvent e) {<NEW_LINE>JSpinner spinner = (JSpinner) e.getSource();<NEW_LINE>int gapHeight = (Integer) spinner.getValue();<NEW_LINE>FormLoaderSettings.getInstance().setGapHeight(gapHeight);<NEW_LINE>glassPane.updateLayout();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return spinner;<NEW_LINE>}
|
(GridDesigner.class, "GridDesigner.gapRowSpinner"));
|
1,850,699
|
private static ExecutableDdlJob generateRandomDag(int expectNodeCount, int maxOutEdgeCount, int edgeRate, boolean mockSubJob) {<NEW_LINE>int nodeCount = expectNodeCount * 2 / 3 + random.nextInt(expectNodeCount * 4 / 3) + 1;<NEW_LINE>ExecutableDdlJob executableDdlJob = new ExecutableDdlJob();<NEW_LINE>List<Integer> oldNode = new ArrayList<>(nodeCount);<NEW_LINE>List<DdlTask> foobar = new ArrayList<>(nodeCount);<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("digraph {\n");<NEW_LINE>for (int i = 0; i < nodeCount; i++) {<NEW_LINE>sb.append(String.format(" %d;\n", i));<NEW_LINE>oldNode.add(i);<NEW_LINE>DdlTask task;<NEW_LINE>if (!mockSubJob) {<NEW_LINE>task = new MockDdlTask(String.valueOf(i), 1000L);<NEW_LINE>} else {<NEW_LINE>task = new SubJobTask(String.valueOf(i), <MASK><NEW_LINE>}<NEW_LINE>task.setTaskId(ID_GENERATOR.nextId());<NEW_LINE>foobar.add(task);<NEW_LINE>executableDdlJob.addTask(task);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < nodeCount; i++) {<NEW_LINE>int from = oldNode.get(i);<NEW_LINE>for (int j = 0; j < maxOutEdgeCount; j++) {<NEW_LINE>if (random.nextInt(100) >= edgeRate) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int to = from + random.nextInt(nodeCount - from);<NEW_LINE>if (from == to) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>sb.append(String.format(" %d -> %d;\n", from, to));<NEW_LINE>executableDdlJob.addTaskRelationship(foobar.get(from), foobar.get(to));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append("}\n");<NEW_LINE>return executableDdlJob;<NEW_LINE>}
|
FailPointKey.FP_INJECT_SUBJOB, FailPointKey.FP_INJECT_SUBJOB);
|
599,543
|
private String generateContentWorldsCreatorCode() {<NEW_LINE>if (this.contentWorlds.size() == 1) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>StringBuilder source = new StringBuilder();<NEW_LINE>LinkedHashSet<PluginScript> pluginScriptsRequired = this.getPluginScriptsRequiredInAllContentWorlds();<NEW_LINE>for (PluginScript script : pluginScriptsRequired) {<NEW_LINE>source.<MASK><NEW_LINE>}<NEW_LINE>List<String> contentWorldsNames = new ArrayList<>();<NEW_LINE>for (ContentWorld contentWorld : this.contentWorlds) {<NEW_LINE>if (contentWorld.equals(ContentWorld.PAGE)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>contentWorldsNames.add("'" + escapeContentWorldName(contentWorld.getName()) + "'");<NEW_LINE>}<NEW_LINE>return CONTENT_WORLDS_GENERATOR_JS_SOURCE.replace(PluginScriptsUtil.VAR_CONTENT_WORLD_NAME_ARRAY, TextUtils.join(", ", contentWorldsNames)).replace(PluginScriptsUtil.VAR_JSON_SOURCE_ENCODED, escapeCode(source.toString()));<NEW_LINE>}
|
append(script.getSource());
|
1,735,177
|
public int codePointAt(int index) {<NEW_LINE>int currentLength = lengthInternal();<NEW_LINE>if (index >= 0 && index < currentLength) {<NEW_LINE>// Check if the StringBuilder is compressed<NEW_LINE>if (String.COMPACT_STRINGS && count >= 0) {<NEW_LINE>return helpers.byteToCharUnsigned(helpers<MASK><NEW_LINE>} else {<NEW_LINE>int high = value[index];<NEW_LINE>if ((index + 1) < currentLength && high >= Character.MIN_HIGH_SURROGATE && high <= Character.MAX_HIGH_SURROGATE) {<NEW_LINE>int low = value[index + 1];<NEW_LINE>if (low >= Character.MIN_LOW_SURROGATE && low <= Character.MAX_LOW_SURROGATE) {<NEW_LINE>return 0x10000 + ((high - Character.MIN_HIGH_SURROGATE) << 10) + (low - Character.MIN_LOW_SURROGATE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return high;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new StringIndexOutOfBoundsException(index);<NEW_LINE>}<NEW_LINE>}
|
.getByteFromArrayByIndex(value, index));
|
1,093,079
|
public static ListIpv4GatewaysResponse unmarshall(ListIpv4GatewaysResponse listIpv4GatewaysResponse, UnmarshallerContext _ctx) {<NEW_LINE>listIpv4GatewaysResponse.setRequestId<MASK><NEW_LINE>listIpv4GatewaysResponse.setNextToken(_ctx.stringValue("ListIpv4GatewaysResponse.NextToken"));<NEW_LINE>listIpv4GatewaysResponse.setTotalCount(_ctx.stringValue("ListIpv4GatewaysResponse.TotalCount"));<NEW_LINE>List<Ipv4GatewayModelsItem> ipv4GatewayModels = new ArrayList<Ipv4GatewayModelsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListIpv4GatewaysResponse.Ipv4GatewayModels.Length"); i++) {<NEW_LINE>Ipv4GatewayModelsItem ipv4GatewayModelsItem = new Ipv4GatewayModelsItem();<NEW_LINE>ipv4GatewayModelsItem.setVpcId(_ctx.stringValue("ListIpv4GatewaysResponse.Ipv4GatewayModels[" + i + "].VpcId"));<NEW_LINE>ipv4GatewayModelsItem.setStatus(_ctx.stringValue("ListIpv4GatewaysResponse.Ipv4GatewayModels[" + i + "].Status"));<NEW_LINE>ipv4GatewayModelsItem.setIpv4GatewayId(_ctx.stringValue("ListIpv4GatewaysResponse.Ipv4GatewayModels[" + i + "].Ipv4GatewayId"));<NEW_LINE>ipv4GatewayModelsItem.setIpv4GatewayDescription(_ctx.stringValue("ListIpv4GatewaysResponse.Ipv4GatewayModels[" + i + "].Ipv4GatewayDescription"));<NEW_LINE>ipv4GatewayModelsItem.setEnabled(_ctx.booleanValue("ListIpv4GatewaysResponse.Ipv4GatewayModels[" + i + "].Enabled"));<NEW_LINE>ipv4GatewayModelsItem.setGmtCreate(_ctx.stringValue("ListIpv4GatewaysResponse.Ipv4GatewayModels[" + i + "].GmtCreate"));<NEW_LINE>ipv4GatewayModelsItem.setIpv4GatewayRouteTableId(_ctx.stringValue("ListIpv4GatewaysResponse.Ipv4GatewayModels[" + i + "].Ipv4GatewayRouteTableId"));<NEW_LINE>ipv4GatewayModelsItem.setIpv4GatewayName(_ctx.stringValue("ListIpv4GatewaysResponse.Ipv4GatewayModels[" + i + "].Ipv4GatewayName"));<NEW_LINE>ipv4GatewayModels.add(ipv4GatewayModelsItem);<NEW_LINE>}<NEW_LINE>listIpv4GatewaysResponse.setIpv4GatewayModels(ipv4GatewayModels);<NEW_LINE>return listIpv4GatewaysResponse;<NEW_LINE>}
|
(_ctx.stringValue("ListIpv4GatewaysResponse.RequestId"));
|
1,763,715
|
private static void activate(String agentArgs, Instrumentation inst, int activateCode) {<NEW_LINE>URL classUrl = getSelfClassUrl();<NEW_LINE>File jar = getArchiveFile(classUrl);<NEW_LINE>String fullJFluidPath = jar.getParent();<NEW_LINE>if ((agentArgs == null) || (agentArgs.length() == 0)) {<NEW_LINE>// no options, just load the native library. This is used for remote-pack calibration<NEW_LINE>ProfilerServer.loadNativeLibrary(fullJFluidPath, false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int timeOut = 0;<NEW_LINE>int commaPos = agentArgs.indexOf(',');<NEW_LINE>if (commaPos != -1) {<NEW_LINE>// optional timeout is specified<NEW_LINE>String timeOutStr = agentArgs.substring(commaPos + 1, agentArgs.length());<NEW_LINE>try {<NEW_LINE>timeOut = Integer.parseInt(timeOutStr);<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>// NOI18N<NEW_LINE>System.<MASK><NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>agentArgs = agentArgs.substring(0, commaPos);<NEW_LINE>}<NEW_LINE>String portStr = agentArgs;<NEW_LINE>int portNo = 0;<NEW_LINE>try {<NEW_LINE>portNo = Integer.parseInt(portStr);<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>// NOI18N<NEW_LINE>System.err.println("*** Profiler Engine: invalid port number specified to premain(): " + portStr);<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>ProfilerServer.loadNativeLibrary(fullJFluidPath, false);<NEW_LINE>ProfilerServer.activate(fullJFluidPath, portNo, activateCode, timeOut);<NEW_LINE>}
|
err.println("*** Profiler Engine: invalid timeout number specified to premain(): " + timeOutStr);
|
147,918
|
public static KFFeature readObject(JsonReader reader) throws IOException {<NEW_LINE>reader.beginObject();<NEW_LINE>KFFeature.Builder builder = new KFFeature.Builder();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>switch(name) {<NEW_LINE>case KFFeature.NAME_JSON_FIELD:<NEW_LINE>builder.name = reader.nextString();<NEW_LINE>break;<NEW_LINE>case KFFeature.FILL_COLOR_JSON_FIELD:<NEW_LINE>builder.fillColor = Color.parseColor(reader.nextString());<NEW_LINE>break;<NEW_LINE>case KFFeature.STROKE_COLOR_JSON_FIELD:<NEW_LINE>builder.strokeColor = Color.parseColor(reader.nextString());<NEW_LINE>break;<NEW_LINE>case KFFeature.STROKE_WIDTH_JSON_FIELD:<NEW_LINE>builder.strokeWidth = (float) reader.nextDouble();<NEW_LINE>break;<NEW_LINE>case KFFeature.FROM_FRAME_JSON_FIELD:<NEW_LINE>builder.fromFrame = (float) reader.nextDouble();<NEW_LINE>break;<NEW_LINE>case KFFeature.TO_FRAME_JSON_FIELD:<NEW_LINE>builder.toFrame = (float) reader.nextDouble();<NEW_LINE>break;<NEW_LINE>case KFFeature.KEY_FRAMES_JSON_FIELD:<NEW_LINE>builder.keyFrames = KFFeatureFrameDeserializer.LIST_DESERIALIZER.readList(reader);<NEW_LINE>break;<NEW_LINE>case KFFeature.TIMING_CURVES_JSON_FIELD:<NEW_LINE>builder.<MASK><NEW_LINE>break;<NEW_LINE>case KFFeature.ANIMATION_GROUP_JSON_FIELD:<NEW_LINE>builder.animationGroup = reader.nextInt();<NEW_LINE>break;<NEW_LINE>case KFFeature.FEATURE_ANIMATIONS_JSON_FIELD:<NEW_LINE>builder.featureAnimations = KFAnimationDeserializer.LIST_DESERIALIZER.readList(reader);<NEW_LINE>break;<NEW_LINE>case KFFeature.EFFECT_JSON_FIELD:<NEW_LINE>builder.effect = KFFeatureEffectDeserializer.readObject(reader);<NEW_LINE>break;<NEW_LINE>case KFFeature.STROKE_LINE_CAP_JSON_FIELD:<NEW_LINE>builder.strokeLineCap = Paint.Cap.valueOf(reader.nextString().toUpperCase(Locale.US));<NEW_LINE>break;<NEW_LINE>case KFFeature.BACKED_IMAGE_NAME_JSON_FIELD:<NEW_LINE>builder.backedImageName = reader.nextString();<NEW_LINE>break;<NEW_LINE>case KFFeature.FEATURE_MASK_JSON_FIELD:<NEW_LINE>builder.featureMask = KFFeatureDeserializer.readObject(reader);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return builder.build();<NEW_LINE>}
|
timingCurves = CommonDeserializerHelper.read3DFloatArray(reader);
|
1,423,636
|
public byte[] serialize() {<NEW_LINE>int length = 2 + this.chassisId.getLength() + 2 + this.portId.getLength() + 2 + this.ttl.getLength() + 2;<NEW_LINE>for (LLDPTLV tlv : this.optionalTLVList) {<NEW_LINE>if (tlv != null)<NEW_LINE>length += 2 + tlv.getLength();<NEW_LINE>}<NEW_LINE>byte[] data = new byte[length];<NEW_LINE>ByteBuffer <MASK><NEW_LINE>bb.put(this.chassisId.serialize());<NEW_LINE>bb.put(this.portId.serialize());<NEW_LINE>bb.put(this.ttl.serialize());<NEW_LINE>for (LLDPTLV tlv : this.optionalTLVList) {<NEW_LINE>if (tlv != null)<NEW_LINE>bb.put(tlv.serialize());<NEW_LINE>}<NEW_LINE>// End of LLDPDU<NEW_LINE>bb.putShort((short) 0);<NEW_LINE>if (this.parent != null && this.parent instanceof Ethernet)<NEW_LINE>((Ethernet) this.parent).setEtherType(ethType);<NEW_LINE>return data;<NEW_LINE>}
|
bb = ByteBuffer.wrap(data);
|
1,808,264
|
public PortablePipelineResult run(Pipeline pipeline, JobInfo jobInfo) throws Exception {<NEW_LINE>PortablePipelineOptions pipelineOptions = PipelineOptionsTranslation.fromProto(jobInfo.pipelineOptions()).as(PortablePipelineOptions.class);<NEW_LINE>final String jobName = jobInfo.jobName();<NEW_LINE>File outputFile = new File(checkArgumentNotNull(pipelineOptions.getOutputExecutablePath()));<NEW_LINE>LOG.info("Creating jar {} for job {}", <MASK><NEW_LINE>outputStream = new JarOutputStream(new FileOutputStream(outputFile), createManifest(mainClass, jobName));<NEW_LINE>outputChannel = Channels.newChannel(outputStream);<NEW_LINE>PortablePipelineJarUtils.writeDefaultJobName(outputStream, jobName);<NEW_LINE>copyResourcesFromJar(new JarFile(mainClass.getProtectionDomain().getCodeSource().getLocation().getPath()));<NEW_LINE>writeAsJson(PipelineOptionsTranslation.toProto(pipelineOptions), PortablePipelineJarUtils.getPipelineOptionsUri(jobName));<NEW_LINE>Pipeline pipelineWithClasspathArtifacts = writeArtifacts(pipeline, jobName);<NEW_LINE>writeAsJson(pipelineWithClasspathArtifacts, PortablePipelineJarUtils.getPipelineUri(jobName));<NEW_LINE>// Closing the channel also closes the underlying stream.<NEW_LINE>outputChannel.close();<NEW_LINE>LOG.info("Jar {} created successfully.", outputFile.getAbsolutePath());<NEW_LINE>return new JarCreatorPipelineResult();<NEW_LINE>}
|
outputFile.getAbsolutePath(), jobName);
|
576,015
|
public static void intersection(IntIterableRangeSet setr, IntIterableRangeSet set1, int from, int to) {<NEW_LINE>setr.clear();<NEW_LINE>int <MASK><NEW_LINE>int s2 = from <= to ? 1 : 0;<NEW_LINE>if (s1 > 0 && s2 > 0) {<NEW_LINE>setr.grow(set1.SIZE);<NEW_LINE>int i = 0, j = 0;<NEW_LINE>int lbi, ubi, lbj, ubj, lb, ub;<NEW_LINE>lbi = set1.ELEMENTS[0];<NEW_LINE>ubi = set1.ELEMENTS[1];<NEW_LINE>lbj = from;<NEW_LINE>ubj = to;<NEW_LINE>while (i < s1 && j < s2) {<NEW_LINE>if ((lbi <= lbj && lbj <= ubi) || (lbj <= lbi && lbi <= ubj)) {<NEW_LINE>lb = Math.max(lbi, lbj);<NEW_LINE>ub = Math.min(ubi, ubj);<NEW_LINE>setr.pushRange(lb, ub);<NEW_LINE>}<NEW_LINE>if (ubi <= ubj && ++i < s1) {<NEW_LINE>lbi = set1.ELEMENTS[i << 1];<NEW_LINE>ubi = set1.ELEMENTS[(i << 1) + 1];<NEW_LINE>} else if (ubj <= ubi) {<NEW_LINE>j++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
s1 = set1.SIZE >> 1;
|
1,172,913
|
private void renderIcon(MatrixStack matrixStack, ItemStack stack, int x, int y, boolean large) {<NEW_LINE>MatrixStack modelViewStack = RenderSystem.getModelViewStack();<NEW_LINE>modelViewStack.push();<NEW_LINE>Window parent = getParent();<NEW_LINE>modelViewStack.translate(parent.getX(), parent.getY() + 13 + parent.getScrollOffset(), 0);<NEW_LINE>modelViewStack.translate(x, y, 0);<NEW_LINE>float scale = large ? 1.5F : 0.75F;<NEW_LINE>modelViewStack.<MASK><NEW_LINE>DiffuseLighting.enableGuiDepthLighting();<NEW_LINE>ItemStack grass = new ItemStack(Blocks.GRASS_BLOCK);<NEW_LINE>ItemStack renderStack = !stack.isEmpty() ? stack : grass;<NEW_LINE>WurstClient.MC.getItemRenderer().renderInGuiWithOverrides(renderStack, 0, 0);<NEW_LINE>DiffuseLighting.disableGuiDepthLighting();<NEW_LINE>modelViewStack.pop();<NEW_LINE>RenderSystem.applyModelViewMatrix();<NEW_LINE>if (stack.isEmpty())<NEW_LINE>renderQuestionMark(matrixStack, x, y, large);<NEW_LINE>}
|
scale(scale, scale, scale);
|
1,766,997
|
final CreateNFSFileShareResult executeCreateNFSFileShare(CreateNFSFileShareRequest createNFSFileShareRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createNFSFileShareRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateNFSFileShareRequest> request = null;<NEW_LINE>Response<CreateNFSFileShareResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateNFSFileShareRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Storage Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateNFSFileShare");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateNFSFileShareResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateNFSFileShareResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
(super.beforeMarshalling(createNFSFileShareRequest));
|
1,457,481
|
void sel(Actor actor, World world, LocalSession session, int index) {<NEW_LINE>LocalConfiguration config = we.getConfiguration();<NEW_LINE>if (index < 1) {<NEW_LINE>actor.printError(TranslatableComponent.of("worldedit.snapshot.index-above-0"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>List<Snapshot> snapshots = config.snapshotRepo.getSnapshots(true, world.getName());<NEW_LINE>if (snapshots.size() < index) {<NEW_LINE>actor.printError(TranslatableComponent.of("worldedit.snapshot.index-oob", TextComponent.of(snapshots.size())));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Snapshot snapshot = <MASK><NEW_LINE>if (snapshot == null) {<NEW_LINE>actor.printError(TranslatableComponent.of("worldedit.restore.not-available"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>session.setSnapshot(snapshot);<NEW_LINE>actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use", TextComponent.of(snapshot.getName())));<NEW_LINE>} catch (MissingWorldException e) {<NEW_LINE>actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world"));<NEW_LINE>}<NEW_LINE>}
|
snapshots.get(index - 1);
|
144,753
|
public List<AnalyticJob> fetchAnalyticJobs() throws IOException, AuthenticationException {<NEW_LINE>List<AnalyticJob> appList = new ArrayList<AnalyticJob>();<NEW_LINE>// There is a lag of job data from AM/NM to JobHistoryServer HDFS, we shouldn't use the current time, since there<NEW_LINE>// might be new jobs arriving after we fetch jobs. We provide one minute delay to address this lag.<NEW_LINE>_currentTime = System.currentTimeMillis() - FETCH_DELAY;<NEW_LINE>updateAuthToken();<NEW_LINE>logger.info("Fetching recent finished application runs between last time: " + (_lastTime + 1) + ", and current time: " + _currentTime);<NEW_LINE>// Fetch all succeeded apps<NEW_LINE>URL succeededAppsURL = new URL(new URL("http://" + _resourceManagerAddress), String.format("/ws/v1/cluster/apps?finalStatus=SUCCEEDED&finishedTimeBegin=%s&finishedTimeEnd=%s", String.valueOf(_lastTime + 1), String.valueOf(_currentTime)));<NEW_LINE>logger.info("The succeeded apps URL is " + succeededAppsURL);<NEW_LINE>List<AnalyticJob> succeededApps = readApps(succeededAppsURL);<NEW_LINE>appList.addAll(succeededApps);<NEW_LINE>// Fetch all failed apps<NEW_LINE>// state: Application Master State<NEW_LINE>// finalStatus: Status of the Application as reported by the Application Master<NEW_LINE>URL failedAppsURL = new URL(new URL("http://" + _resourceManagerAddress), String.format("/ws/v1/cluster/apps?finalStatus=FAILED&state=FINISHED&finishedTimeBegin=%s&finishedTimeEnd=%s", String.valueOf(_lastTime + 1), <MASK><NEW_LINE>List<AnalyticJob> failedApps = readApps(failedAppsURL);<NEW_LINE>logger.info("The failed apps URL is " + failedAppsURL);<NEW_LINE>appList.addAll(failedApps);<NEW_LINE>// Append promises from the retry queue at the end of the list<NEW_LINE>while (!_firstRetryQueue.isEmpty()) {<NEW_LINE>appList.add(_firstRetryQueue.poll());<NEW_LINE>}<NEW_LINE>// Fetch jobs from second retry queue which are ready for second retry and<NEW_LINE>// add to app list.<NEW_LINE>fetchJobsFromSecondRetryQueue(appList);<NEW_LINE>_lastTime = _currentTime;<NEW_LINE>return appList;<NEW_LINE>}
|
String.valueOf(_currentTime)));
|
401,288
|
public void testCaptureDebuggerThreadsPlugin() throws Throwable {<NEW_LINE>mb.createTestModel();<NEW_LINE>TestTargetProcess process = mb.testModel.addProcess(1234);<NEW_LINE>TraceRecorder recorder = modelService.recordTarget(process, new TestDebuggerTargetTraceMapper(process), ActionSource.AUTOMATIC);<NEW_LINE>Trace trace = recorder.getTrace();<NEW_LINE>TestTargetThread mainThread = process.addThread(1);<NEW_LINE>waitForValue(() -> recorder.getTraceThread(mainThread));<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>TestTargetThread serverThread = process.addThread(2);<NEW_LINE>waitForValue(() <MASK><NEW_LINE>recorder.forceSnapshot();<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>TestTargetThread handler1Thread = process.addThread(3);<NEW_LINE>waitForValue(() -> recorder.getTraceThread(handler1Thread));<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>TestTargetThread handler2Thread = process.addThread(4);<NEW_LINE>waitForValue(() -> recorder.getTraceThread(handler2Thread));<NEW_LINE>AbstractGhidraHeadedDebuggerGUITest.waitForDomainObject(trace);<NEW_LINE>try (UndoableTransaction tid = UndoableTransaction.start(trace, "Comments", true)) {<NEW_LINE>recorder.getTraceThread(mainThread).setComment("GUI main loop");<NEW_LINE>recorder.getTraceThread(serverThread).setComment("Server");<NEW_LINE>recorder.getTraceThread(handler1Thread).setComment("Handler 1");<NEW_LINE>recorder.getTraceThread(handler2Thread).setComment("Handler 2");<NEW_LINE>}<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>process.removeThreads(handler1Thread);<NEW_LINE>waitFor(() -> nullOrDead(recorder.getTraceThread(handler1Thread)));<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>process.removeThreads(handler2Thread);<NEW_LINE>waitFor(() -> nullOrDead(recorder.getTraceThread(handler2Thread)));<NEW_LINE>long lastSnap = recorder.forceSnapshot().getKey();<NEW_LINE>traceManager.openTrace(trace);<NEW_LINE>traceManager.activateThread(recorder.getTraceThread(serverThread));<NEW_LINE>traceManager.activateSnap(lastSnap);<NEW_LINE>TestTargetProcess dummy1 = mb.testModel.addProcess(4321);<NEW_LINE>TestTargetProcess dummy2 = mb.testModel.addProcess(5432);<NEW_LINE>TraceRecorder recDummy1 = modelService.recordTarget(dummy1, new TestDebuggerTargetTraceMapper(dummy1), ActionSource.AUTOMATIC);<NEW_LINE>TraceRecorder recDummy2 = modelService.recordTarget(dummy2, new TestDebuggerTargetTraceMapper(dummy2), ActionSource.AUTOMATIC);<NEW_LINE>traceManager.setAutoCloseOnTerminate(false);<NEW_LINE>traceManager.openTrace(recDummy1.getTrace());<NEW_LINE>traceManager.openTrace(recDummy2.getTrace());<NEW_LINE>recDummy1.stopRecording();<NEW_LINE>captureIsolatedProvider(DebuggerThreadsProvider.class, 900, 300);<NEW_LINE>}
|
-> recorder.getTraceThread(serverThread));
|
589,279
|
public void bind(@NonNull ItemViewHolder holder, int position) {<NEW_LINE>super.bind(holder, position);<NEW_LINE>if (mGetTitleSupplier != null) {<NEW_LINE>mTitle = mGetTitleSupplier.get();<NEW_LINE>}<NEW_LINE>final TextView titleTv = holder.findViewById(R.id.commonItemTitleTv);<NEW_LINE>final TextView contentTv = holder.<MASK><NEW_LINE>titleTv.setText(mTitle);<NEW_LINE>contentTv.setText(mContent);<NEW_LINE>if (isViewType(R.layout.common_item_title_content)) {<NEW_LINE>if (mIsTitleCenter) {<NEW_LINE>holder.itemView.setBackgroundColor(Color.TRANSPARENT);<NEW_LINE>titleTv.setGravity(Gravity.CENTER_HORIZONTAL);<NEW_LINE>titleTv.getPaint().setFakeBoldText(true);<NEW_LINE>} else {<NEW_LINE>titleTv.setGravity(Gravity.START);<NEW_LINE>titleTv.getPaint().setFakeBoldText(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
findViewById(R.id.commonItemContentTv);
|
1,570,102
|
private void updateProgressNotification() {<NEW_LINE>Collection<MegaTransfer> transfers = mapProgressFileTransfers.values();<NEW_LINE>UploadProgress up = getInProgressNotification(transfers);<NEW_LINE>long total = up.total;<NEW_LINE>long inProgress = up.inProgress;<NEW_LINE>int progressPercent = 0;<NEW_LINE>long inProgressTemp;<NEW_LINE>if (total > 0) {<NEW_LINE>inProgressTemp = inProgress * 100;<NEW_LINE>progressPercent = (int) (inProgressTemp / total);<NEW_LINE>showRating(total, megaApi.getCurrentUploadSpeed());<NEW_LINE>}<NEW_LINE>String message = getMessageForProgressNotification(inProgress);<NEW_LINE>logDebug(<MASK><NEW_LINE>String actionString = isOverquota == NOT_OVERQUOTA_STATE ? getString(R.string.download_touch_to_show) : getString(R.string.general_show_info);<NEW_LINE>String info = getProgressSize(UploadService.this, inProgress, total);<NEW_LINE>notifyProgressNotification(progressPercent, message, info, actionString);<NEW_LINE>}
|
"updateProgressNotification" + progressPercent + " " + message);
|
704,379
|
public void flatMap(BaseRow input, Collector<BaseRow> out) throws Exception {<NEW_LINE>GenericRow genericRow = (GenericRow) input;<NEW_LINE>Map<String, Object> inputParams = Maps.newHashMap();<NEW_LINE>for (Integer conValIndex : sideInfo.getEqualValIndex()) {<NEW_LINE>Object equalObj = genericRow.getField(conValIndex);<NEW_LINE>if (equalObj == null) {<NEW_LINE>if (sideInfo.getJoinType() == JoinType.LEFT) {<NEW_LINE>BaseRow data = fillData(input, null);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String columnName = sideInfo.getEqualFieldList().get(conValIndex);<NEW_LINE>inputParams.put(columnName, equalObj.toString());<NEW_LINE>}<NEW_LINE>String key = redisSideReqRow.buildCacheKey(inputParams);<NEW_LINE>Map<String, String> cacheMap = cacheRef.get().get(key);<NEW_LINE>if (cacheMap == null) {<NEW_LINE>if (sideInfo.getJoinType() == JoinType.LEFT) {<NEW_LINE>BaseRow data = fillData(input, null);<NEW_LINE>RowDataComplete.collectBaseRow(out, data);<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BaseRow newRow = fillData(input, cacheMap);<NEW_LINE>RowDataComplete.collectBaseRow(out, newRow);<NEW_LINE>}
|
RowDataComplete.collectBaseRow(out, data);
|
556,340
|
public CreateDatastoreResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateDatastoreResult createDatastoreResult = new CreateDatastoreResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return createDatastoreResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("datastoreName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createDatastoreResult.setDatastoreName(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("datastoreArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createDatastoreResult.setDatastoreArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("retentionPeriod", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createDatastoreResult.setRetentionPeriod(RetentionPeriodJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createDatastoreResult;<NEW_LINE>}
|
class).unmarshall(context));
|
99,648
|
public List<List<Writable>> next(int num) {<NEW_LINE>List<File> files = new ArrayList<>(num);<NEW_LINE>List<List<ImageObject>> objects = new ArrayList<>(num);<NEW_LINE>for (int i = 0; i < num && hasNext(); i++) {<NEW_LINE>File f = iter.next();<NEW_LINE>this.currentFile = f;<NEW_LINE>if (!f.isDirectory()) {<NEW_LINE>files.add(f);<NEW_LINE>objects.add(labelProvider.getImageObjectsForPath(f.getPath()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int nClasses = labels.size();<NEW_LINE>INDArray outImg = Nd4j.create(files.size(<MASK><NEW_LINE>INDArray outLabel = Nd4j.create(files.size(), 4 + nClasses, gridH, gridW);<NEW_LINE>int exampleNum = 0;<NEW_LINE>for (int i = 0; i < files.size(); i++) {<NEW_LINE>File imageFile = files.get(i);<NEW_LINE>this.currentFile = imageFile;<NEW_LINE>try {<NEW_LINE>this.invokeListeners(imageFile);<NEW_LINE>Image image = this.imageLoader.asImageMatrix(imageFile);<NEW_LINE>this.currentImage = image;<NEW_LINE>Nd4j.getAffinityManager().ensureLocation(image.getImage(), AffinityManager.Location.DEVICE);<NEW_LINE>outImg.put(new INDArrayIndex[] { point(exampleNum), all(), all(), all() }, image.getImage());<NEW_LINE>List<ImageObject> objectsThisImg = objects.get(exampleNum);<NEW_LINE>label(image, objectsThisImg, outLabel, exampleNum);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>exampleNum++;<NEW_LINE>}<NEW_LINE>if (!nchw) {<NEW_LINE>// NCHW to NHWC<NEW_LINE>outImg = outImg.permute(0, 2, 3, 1);<NEW_LINE>outLabel = outLabel.permute(0, 2, 3, 1);<NEW_LINE>}<NEW_LINE>return new NDArrayRecordBatch(Arrays.asList(outImg, outLabel));<NEW_LINE>}
|
), channels, height, width);
|
633,243
|
private static void initializeReachability(final NodeData node) {<NEW_LINE>List<SpecializationData> specializations = node.getSpecializations();<NEW_LINE>for (int i = specializations.size() - 1; i >= 0; i--) {<NEW_LINE>SpecializationData current = specializations.get(i);<NEW_LINE>List<SpecializationData> shadowedBy = null;<NEW_LINE>for (int j = i - 1; j >= 0; j--) {<NEW_LINE>SpecializationData prev = specializations.get(j);<NEW_LINE>if (!current.isReachableAfter(prev)) {<NEW_LINE>if (shadowedBy == null) {<NEW_LINE>shadowedBy = new ArrayList<>();<NEW_LINE>}<NEW_LINE>shadowedBy.add(prev);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (shadowedBy != null) {<NEW_LINE>StringBuilder name = new StringBuilder();<NEW_LINE>String sep = "";<NEW_LINE>for (SpecializationData shadowSpecialization : shadowedBy) {<NEW_LINE>name.append(sep);<NEW_LINE>name.<MASK><NEW_LINE>sep = ", ";<NEW_LINE>}<NEW_LINE>current.addError("%s is not reachable. It is shadowed by %s.", current.isFallback() ? "Generic" : "Specialization", name);<NEW_LINE>}<NEW_LINE>current.setReachable(shadowedBy == null);<NEW_LINE>}<NEW_LINE>}
|
append(shadowSpecialization.createReferenceName());
|
1,590,787
|
public List<SuppressionRule> parseSuppressionRules(InputStream inputStream, SuppressionRuleFilter filter) throws SuppressionParseException, SAXException {<NEW_LINE>try (InputStream schemaStream13 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_3);<NEW_LINE>InputStream schemaStream12 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_2);<NEW_LINE>InputStream schemaStream11 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_1);<NEW_LINE>InputStream schemaStream10 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_0)) {<NEW_LINE>final BOMInputStream bomStream = new BOMInputStream(inputStream);<NEW_LINE>final ByteOrderMark bom = bomStream.getBOM();<NEW_LINE>final String defaultEncoding = StandardCharsets.UTF_8.name();<NEW_LINE>final String charsetName = bom == null ? defaultEncoding : bom.getCharsetName();<NEW_LINE>final SuppressionHandler handler = new SuppressionHandler(filter);<NEW_LINE>final SAXParser saxParser = XmlUtils.buildSecureSaxParser(schemaStream13, schemaStream12, schemaStream11, schemaStream10);<NEW_LINE>final <MASK><NEW_LINE>xmlReader.setErrorHandler(new SuppressionErrorHandler());<NEW_LINE>xmlReader.setContentHandler(handler);<NEW_LINE>xmlReader.setEntityResolver(new ClassloaderResolver());<NEW_LINE>try (Reader reader = new InputStreamReader(bomStream, charsetName)) {<NEW_LINE>final InputSource in = new InputSource(reader);<NEW_LINE>xmlReader.parse(in);<NEW_LINE>return handler.getSuppressionRules();<NEW_LINE>}<NEW_LINE>} catch (ParserConfigurationException | FileNotFoundException ex) {<NEW_LINE>LOGGER.debug("", ex);<NEW_LINE>throw new SuppressionParseException(ex);<NEW_LINE>} catch (SAXException ex) {<NEW_LINE>if (ex.getMessage().contains("Cannot find the declaration of element 'suppressions'.")) {<NEW_LINE>throw ex;<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("", ex);<NEW_LINE>throw new SuppressionParseException(ex);<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.debug("", ex);<NEW_LINE>throw new SuppressionParseException(ex);<NEW_LINE>}<NEW_LINE>}
|
XMLReader xmlReader = saxParser.getXMLReader();
|
1,589,148
|
private void writeCacheHeaders(HttpServerRequest request, FileProps props) {<NEW_LINE>MultiMap headers = request<MASK><NEW_LINE>if (cache.enabled()) {<NEW_LINE>// We use cache-control and last-modified<NEW_LINE>// We *do not use* etags and expires (since they do the same thing - redundant)<NEW_LINE>Utils.addToMapIfAbsent(headers, HttpHeaders.CACHE_CONTROL, "public, immutable, max-age=" + maxAgeSeconds);<NEW_LINE>Utils.addToMapIfAbsent(headers, HttpHeaders.LAST_MODIFIED, Utils.formatRFC1123DateTime(props.lastModifiedTime()));<NEW_LINE>// We send the vary header (for intermediate caches)<NEW_LINE>// (assumes that most will turn on compression when using static handler)<NEW_LINE>if (sendVaryHeader && request.headers().contains(HttpHeaders.ACCEPT_ENCODING)) {<NEW_LINE>Utils.addToMapIfAbsent(headers, HttpHeaders.VARY, "accept-encoding");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// date header is mandatory<NEW_LINE>headers.set("date", Utils.formatRFC1123DateTime(System.currentTimeMillis()));<NEW_LINE>}
|
.response().headers();
|
327,867
|
public void onClick(View v) {<NEW_LINE>logDebug("onClick");<NEW_LINE>((MegaApplication) ((Activity) context).getApplication()).sendSignalPresenceActivity();<NEW_LINE>ViewHolderBrowser holder = (ViewHolderBrowser) v.getTag();<NEW_LINE>int currentPosition = holder.getAdapterPosition();<NEW_LINE>logDebug("Current position: " + currentPosition);<NEW_LINE>if (currentPosition < 0) {<NEW_LINE>logWarning("Current position error - not valid value");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final MegaChatMessage m = (MegaChatMessage) getItem(currentPosition);<NEW_LINE>if (m == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch(v.getId()) {<NEW_LINE>case R.id.file_list_three_dots_layout:<NEW_LINE>case R.id.file_grid_three_dots:<NEW_LINE>{<NEW_LINE>threeDotsClicked(currentPosition, m);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case R.id.file_grid_three_dots_for_file:<NEW_LINE>{<NEW_LINE>threeDotsClicked(currentPosition, m);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case R.id.file_list_item_layout:<NEW_LINE>case R.id.file_grid_item_layout:<NEW_LINE>{<NEW_LINE>int[] screenPosition = new int[2];<NEW_LINE>ImageView imageView;<NEW_LINE>if (adapterType == NodeAttachmentHistoryAdapter.ITEM_VIEW_TYPE_LIST) {<NEW_LINE>imageView = (ImageView) v.findViewById(R.id.file_list_thumbnail);<NEW_LINE>} else {<NEW_LINE>imageView = (ImageView) v.findViewById(R.id.file_grid_thumbnail);<NEW_LINE>}<NEW_LINE>imageView.getLocationOnScreen(screenPosition);<NEW_LINE>int[] dimens = new int[4];<NEW_LINE>dimens[0] = screenPosition[0];<NEW_LINE>dimens<MASK><NEW_LINE>dimens[2] = imageView.getWidth();<NEW_LINE>dimens[3] = imageView.getHeight();<NEW_LINE>((NodeAttachmentHistoryActivity) context).itemClick(currentPosition);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
[1] = screenPosition[1];
|
1,773,054
|
public static ListDigitalTemplatesResponse unmarshall(ListDigitalTemplatesResponse listDigitalTemplatesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDigitalTemplatesResponse.setRequestId(_ctx.stringValue("ListDigitalTemplatesResponse.RequestId"));<NEW_LINE>listDigitalTemplatesResponse.setErrorCode(_ctx.stringValue("ListDigitalTemplatesResponse.ErrorCode"));<NEW_LINE>listDigitalTemplatesResponse.setErrorDesc(_ctx.stringValue("ListDigitalTemplatesResponse.ErrorDesc"));<NEW_LINE>listDigitalTemplatesResponse.setSuccess(_ctx.booleanValue("ListDigitalTemplatesResponse.Success"));<NEW_LINE>listDigitalTemplatesResponse.setTraceId(_ctx.stringValue("ListDigitalTemplatesResponse.TraceId"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotalNum(_ctx.longValue("ListDigitalTemplatesResponse.Data.TotalNum"));<NEW_LINE>data.setPageSize(_ctx.longValue("ListDigitalTemplatesResponse.Data.PageSize"));<NEW_LINE>data.setPageNum(_ctx.longValue("ListDigitalTemplatesResponse.Data.PageNum"));<NEW_LINE>List<ContentItem> content = new ArrayList<ContentItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDigitalTemplatesResponse.Data.Content.Length"); i++) {<NEW_LINE>ContentItem contentItem = new ContentItem();<NEW_LINE>contentItem.setId(_ctx.stringValue("ListDigitalTemplatesResponse.Data.Content[" + i + "].Id"));<NEW_LINE>contentItem.setTemplateName(_ctx.stringValue("ListDigitalTemplatesResponse.Data.Content[" + i + "].TemplateName"));<NEW_LINE>contentItem.setTemplateTheme(_ctx.stringValue("ListDigitalTemplatesResponse.Data.Content[" + i + "].TemplateTheme"));<NEW_LINE>contentItem.setSmsTemplateCode(_ctx.stringValue("ListDigitalTemplatesResponse.Data.Content[" + i + "].SmsTemplateCode"));<NEW_LINE>contentItem.setTemplateStatus(_ctx.longValue("ListDigitalTemplatesResponse.Data.Content[" + i + "].TemplateStatus"));<NEW_LINE>contentItem.setPlatformName(_ctx.stringValue("ListDigitalTemplatesResponse.Data.Content[" + i + "].PlatformName"));<NEW_LINE>contentItem.setPlatformId(_ctx.stringValue("ListDigitalTemplatesResponse.Data.Content[" + i + "].PlatformId"));<NEW_LINE>contentItem.setReason(_ctx.stringValue("ListDigitalTemplatesResponse.Data.Content[" + i + "].Reason"));<NEW_LINE>contentItem.setSign(_ctx.stringValue("ListDigitalTemplatesResponse.Data.Content[" + i + "].Sign"));<NEW_LINE>contentItem.setSupportProvider(_ctx.stringValue<MASK><NEW_LINE>content.add(contentItem);<NEW_LINE>}<NEW_LINE>data.setContent(content);<NEW_LINE>listDigitalTemplatesResponse.setData(data);<NEW_LINE>return listDigitalTemplatesResponse;<NEW_LINE>}
|
("ListDigitalTemplatesResponse.Data.Content[" + i + "].SupportProvider"));
|
775,123
|
// Close and remove the JMSContext instances<NEW_LINE>@PreDestroy<NEW_LINE>public synchronized void cleanup() {<NEW_LINE>ServiceLocator serviceLocator = <MASK><NEW_LINE>InvocationManager invMgr = serviceLocator.getService(InvocationManager.class);<NEW_LINE>ComponentInvocation currentInv = invMgr.getCurrentInvocation();<NEW_LINE>for (Entry<String, JMSContextEntry> entry : contexts.entrySet()) {<NEW_LINE>JMSContextEntry contextEntry = entry.getValue();<NEW_LINE>String ipId = contextEntry.getInjectionPointId();<NEW_LINE>JMSContext context = contextEntry.getCtx();<NEW_LINE>if (context != null) {<NEW_LINE>ComponentInvocation inv = contextEntry.getComponentInvocation();<NEW_LINE>if (inv != null && currentInv != inv)<NEW_LINE>invMgr.preInvoke(inv);<NEW_LINE>try {<NEW_LINE>context.close();<NEW_LINE>if (logger.isLoggable(Level.FINE)) {<NEW_LINE>logger.log(Level.FINE, localStrings.getLocalString("JMSContext.impl.close", "Closed JMSContext instance associated with id {0}: {1}.", ipId, context.toString()));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.log(Level.SEVERE, localStrings.getLocalString("JMSContext.impl.close.failure", "Failed to close JMSContext instance associated with id {0}: {1}.", ipId, context.toString()), e);<NEW_LINE>} finally {<NEW_LINE>if (inv != null && currentInv != inv)<NEW_LINE>invMgr.postInvoke(inv);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>contexts.clear();<NEW_LINE>}
|
Globals.get(ServiceLocator.class);
|
1,764,881
|
final protected void updateLinkedAttribute(final AttributeState state, long timestamp) {<NEW_LINE>Attribute<?> attribute = linkedAttributes.get(state.getRef());<NEW_LINE>if (attribute == null) {<NEW_LINE>LOG.severe("Update linked attribute called for un-linked attribute: " + state);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Pair<Boolean, Object> ignoreAndConverted = ProtocolUtil.doInboundValueProcessing(state.getRef().getId(), attribute, agent.getAgentLink(attribute), state.getValue().orElse(null));<NEW_LINE>if (ignoreAndConverted.key) {<NEW_LINE>LOG.fine("Value conversion returned ignore so attribute will not be updated: " + state.getRef());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AttributeEvent attributeEvent = new AttributeEvent(new AttributeState(state.getRef(), ignoreAndConverted.value), timestamp);<NEW_LINE><MASK><NEW_LINE>producerTemplate.sendBodyAndHeader(SENSOR_QUEUE, attributeEvent, Protocol.SENSOR_QUEUE_SOURCE_PROTOCOL, getProtocolName());<NEW_LINE>}
|
LOG.finer("Sending linked attribute update on sensor queue: " + attributeEvent);
|
742,039
|
public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException {<NEW_LINE>try {<NEW_LINE>rsetImpl.updateBinaryStream(columnIndex, x);<NEW_LINE>} catch (SQLException sqlX) {<NEW_LINE>FFDCFilter.processException(sqlX, getClass().getName() + ".updateBinaryStream", "3157", this);<NEW_LINE>throw WSJdbcUtil.mapException(this, sqlX);<NEW_LINE>} catch (NullPointerException nullX) {<NEW_LINE>// No FFDC code needed; we might be closed.<NEW_LINE>throw runtimeXIfNotClosed(nullX);<NEW_LINE>} catch (AbstractMethodError methError) {<NEW_LINE>// No FFDC code needed; wrong JDBC level.<NEW_LINE>throw AdapterUtil.notSupportedX("ResultSet.updateBinaryStream", methError);<NEW_LINE>} catch (RuntimeException runX) {<NEW_LINE>FFDCFilter.processException(runX, getClass().getName() + ".updateBinaryStream", "3579", this);<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(this, tc, "updateBinaryStream", runX);<NEW_LINE>throw runX;<NEW_LINE>} catch (Error err) {<NEW_LINE>FFDCFilter.processException(err, getClass().getName() + ".updateBinaryStream", "3586", this);<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(<MASK><NEW_LINE>throw err;<NEW_LINE>}<NEW_LINE>}
|
this, tc, "updateBinaryStream", err);
|
432,018
|
public static void parseField(FieldMapper.Builder builder, String name, Map<String, Object> fieldNode, Mapper.TypeParser.ParserContext parserContext) {<NEW_LINE>for (Iterator<Map.Entry<String, Object>> iterator = fieldNode.entrySet().iterator(); iterator.hasNext(); ) {<NEW_LINE>Map.Entry<String, Object> entry = iterator.next();<NEW_LINE>final String propName = entry.getKey();<NEW_LINE>final <MASK><NEW_LINE>if (false == propName.equals("null_value") && propNode == null) {<NEW_LINE>throw new MapperParsingException("[" + propName + "] must not have a [null] value");<NEW_LINE>}<NEW_LINE>if (propName.equals("store")) {<NEW_LINE>builder.store(nodeBooleanValue(propNode, name + ".store"));<NEW_LINE>iterator.remove();<NEW_LINE>} else if (propName.equals("index")) {<NEW_LINE>builder.index(nodeBooleanValue(propNode, name + ".index"));<NEW_LINE>iterator.remove();<NEW_LINE>} else if (propName.equals(DOC_VALUES)) {<NEW_LINE>builder.docValues(nodeBooleanValue(propNode, name + '.' + DOC_VALUES));<NEW_LINE>iterator.remove();<NEW_LINE>} else if (propName.equals("index_options")) {<NEW_LINE>builder.indexOptions(nodeIndexOptionValue(propNode));<NEW_LINE>iterator.remove();<NEW_LINE>} else if (propName.equals("copy_to")) {<NEW_LINE>parseCopyFields(propNode, builder);<NEW_LINE>iterator.remove();<NEW_LINE>} else if (propName.equals("position")) {<NEW_LINE>builder.position(nodeIntegerValue(propNode));<NEW_LINE>iterator.remove();<NEW_LINE>} else if (propName.equals("default_expr")) {<NEW_LINE>builder.defaultExpression(nodeStringValue(propNode, null));<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
Object propNode = entry.getValue();
|
125,678
|
public static QueryReservedInstanceSharedInfosResponse unmarshall(QueryReservedInstanceSharedInfosResponse queryReservedInstanceSharedInfosResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryReservedInstanceSharedInfosResponse.setRequestId(_ctx.stringValue("QueryReservedInstanceSharedInfosResponse.RequestId"));<NEW_LINE>queryReservedInstanceSharedInfosResponse.setCode(_ctx.stringValue("QueryReservedInstanceSharedInfosResponse.Code"));<NEW_LINE>queryReservedInstanceSharedInfosResponse.setSuccess(_ctx.booleanValue("QueryReservedInstanceSharedInfosResponse.Success"));<NEW_LINE>queryReservedInstanceSharedInfosResponse.setCount(_ctx.integerValue("QueryReservedInstanceSharedInfosResponse.Count"));<NEW_LINE>queryReservedInstanceSharedInfosResponse.setPageSize(_ctx.integerValue("QueryReservedInstanceSharedInfosResponse.PageSize"));<NEW_LINE>queryReservedInstanceSharedInfosResponse.setCurrentPage(_ctx.integerValue("QueryReservedInstanceSharedInfosResponse.CurrentPage"));<NEW_LINE>queryReservedInstanceSharedInfosResponse.setTotalCount(_ctx.integerValue("QueryReservedInstanceSharedInfosResponse.TotalCount"));<NEW_LINE>queryReservedInstanceSharedInfosResponse.setMessage(_ctx.stringValue("QueryReservedInstanceSharedInfosResponse.Message"));<NEW_LINE>queryReservedInstanceSharedInfosResponse.setRegion(_ctx.stringValue("QueryReservedInstanceSharedInfosResponse.Region"));<NEW_LINE>List<EcsRiShareInfo> data = new ArrayList<EcsRiShareInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryReservedInstanceSharedInfosResponse.Data.Length"); i++) {<NEW_LINE>EcsRiShareInfo ecsRiShareInfo = new EcsRiShareInfo();<NEW_LINE>ecsRiShareInfo.setMainAccountPk(_ctx.longValue("QueryReservedInstanceSharedInfosResponse.Data[" + i + "].MainAccountPk"));<NEW_LINE>ecsRiShareInfo.setSubAccountPk(_ctx.longValue<MASK><NEW_LINE>ecsRiShareInfo.setRelationType(_ctx.stringValue("QueryReservedInstanceSharedInfosResponse.Data[" + i + "].RelationType"));<NEW_LINE>ecsRiShareInfo.setRiInstanceId(_ctx.stringValue("QueryReservedInstanceSharedInfosResponse.Data[" + i + "].RiInstanceId"));<NEW_LINE>ecsRiShareInfo.setEffectTime(_ctx.longValue("QueryReservedInstanceSharedInfosResponse.Data[" + i + "].EffectTime"));<NEW_LINE>ecsRiShareInfo.setRegion(_ctx.stringValue("QueryReservedInstanceSharedInfosResponse.Data[" + i + "].Region"));<NEW_LINE>data.add(ecsRiShareInfo);<NEW_LINE>}<NEW_LINE>queryReservedInstanceSharedInfosResponse.setData(data);<NEW_LINE>return queryReservedInstanceSharedInfosResponse;<NEW_LINE>}
|
("QueryReservedInstanceSharedInfosResponse.Data[" + i + "].SubAccountPk"));
|
928,646
|
public Query rewrite(IndexReader reader) throws IOException {<NEW_LINE>Query rewritten = super.rewrite(reader);<NEW_LINE>if (rewritten != this) {<NEW_LINE>return rewritten;<NEW_LINE>}<NEW_LINE>if (reader instanceof DirectoryReader) {<NEW_LINE><MASK><NEW_LINE>indexSearcher.setQueryCache(null);<NEW_LINE>indexSearcher.setSimilarity(similarity);<NEW_LINE>IndexOrdinalsFieldData indexParentChildFieldData = fieldDataJoin.loadGlobal((DirectoryReader) reader);<NEW_LINE>OrdinalMap ordinalMap = indexParentChildFieldData.getOrdinalMap();<NEW_LINE>return JoinUtil.createJoinQuery(joinField, innerQuery, toQuery, indexSearcher, scoreMode, ordinalMap, minChildren, maxChildren);<NEW_LINE>} else {<NEW_LINE>if (reader.leaves().isEmpty() && reader.numDocs() == 0) {<NEW_LINE>// asserting reader passes down a MultiReader during rewrite which makes this<NEW_LINE>// blow up since for this query to work we have to have a DirectoryReader otherwise<NEW_LINE>// we can't load global ordinals - for this to work we simply check if the reader has no leaves<NEW_LINE>// and rewrite to match nothing<NEW_LINE>return new MatchNoDocsQuery();<NEW_LINE>}<NEW_LINE>throw new IllegalStateException("can't load global ordinals for reader of type: " + reader.getClass() + " must be a DirectoryReader");<NEW_LINE>}<NEW_LINE>}
|
IndexSearcher indexSearcher = new IndexSearcher(reader);
|
1,412,949
|
private void drawLine(MatrixStack matrixStack, ArrayList<Vec3d> path, Vec3d camPos) {<NEW_LINE>Matrix4f matrix = matrixStack.peek().getPositionMatrix();<NEW_LINE>BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();<NEW_LINE>RenderSystem.setShader(GameRenderer::getPositionShader);<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION);<NEW_LINE>float[<MASK><NEW_LINE>RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.75F);<NEW_LINE>for (Vec3d point : path) bufferBuilder.vertex(matrix, (float) (point.x - camPos.x), (float) (point.y - camPos.y), (float) (point.z - camPos.z)).next();<NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>}
|
] colorF = color.getColorF();
|
443,274
|
public static boolean isJoinKeyHaveSameType(Join join) {<NEW_LINE>JoinInfo joinInfo = join.analyzeCondition();<NEW_LINE>RelDataType keyDataType = CalciteUtils.getJoinKeyDataType(join.getCluster().getTypeFactory(), join, joinInfo.leftKeys, joinInfo.rightKeys);<NEW_LINE>List<RelDataTypeField> keyDataFieldList = keyDataType.getFieldList();<NEW_LINE>RelNode left = join.getLeft();<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < keyDataFieldList.size(); i++) {<NEW_LINE>RelDataType t1 = keyDataFieldList.get(i).getType();<NEW_LINE>RelDataTypeField t2Field = left.getRowType().getFieldList().get(joinInfo.leftKeys.get(i));<NEW_LINE>RelDataType t2 = t2Field.getType();<NEW_LINE>// only compare sql type name<NEW_LINE>if (!t1.getSqlTypeName().equals(t2.getSqlTypeName())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < keyDataFieldList.size(); i++) {<NEW_LINE>RelDataType t1 = keyDataFieldList.get(i).getType();<NEW_LINE>RelDataTypeField t2Field = right.getRowType().getFieldList().get(joinInfo.rightKeys.get(i));<NEW_LINE>RelDataType t2 = t2Field.getType();<NEW_LINE>// only compare sql type name<NEW_LINE>if (!t1.getSqlTypeName().equals(t2.getSqlTypeName())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
RelNode right = join.getRight();
|
142,919
|
final DeleteIndexFieldResult executeDeleteIndexField(DeleteIndexFieldRequest deleteIndexFieldRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteIndexFieldRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteIndexFieldRequest> request = null;<NEW_LINE>Response<DeleteIndexFieldResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteIndexFieldRequestMarshaller().marshall(super.beforeMarshalling(deleteIndexFieldRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudSearch");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteIndexFieldResult> responseHandler = new StaxResponseHandler<DeleteIndexFieldResult>(new DeleteIndexFieldResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteIndexField");
|
1,362,076
|
public void run() {<NEW_LINE>try {<NEW_LINE>boolean findMatchedIndex = checkMatchIndex();<NEW_LINE>if (abort) {<NEW_LINE>peer.resetInconsistentHeartbeatNum();<NEW_LINE>raftMember.getLastCatchUpResponseTime().remove(node);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean catchUpSucceeded;<NEW_LINE>if (!findMatchedIndex) {<NEW_LINE>logger.info("{}: performing a snapshot catch-up to {}", raftMember.getName(), node);<NEW_LINE>doSnapshot();<NEW_LINE>// snapshot may overlap with logs<NEW_LINE>removeSnapshotLogs();<NEW_LINE>SnapshotCatchUpTask task = new SnapshotCatchUpTask(logs, snapshot, node, raftId, raftMember);<NEW_LINE>catchUpSucceeded = task.call();<NEW_LINE>} else {<NEW_LINE>logger.info("{}: performing a log catch-up to {}", raftMember.getName(), node);<NEW_LINE>LogCatchUpTask task = new LogCatchUpTask(logs, node, raftId, raftMember);<NEW_LINE>catchUpSucceeded = task.call();<NEW_LINE>}<NEW_LINE>if (catchUpSucceeded) {<NEW_LINE>// the catch up may be triggered by an old heartbeat, and the node may have already<NEW_LINE>// caught up, so logs can be empty<NEW_LINE>if (!logs.isEmpty() || snapshot != null) {<NEW_LINE>long lastIndex = !logs.isEmpty() ? logs.get(logs.size() - 1).getCurrLogIndex() : snapshot.getLastLogIndex();<NEW_LINE>peer.setMatchIndex(lastIndex);<NEW_LINE>}<NEW_LINE>if (logger.isInfoEnabled()) {<NEW_LINE>logger.info("{}: Catch up {} finished, update it's matchIndex to {}", raftMember.getName(), node, peer.getMatchIndex());<NEW_LINE>}<NEW_LINE>peer.resetInconsistentHeartbeatNum();<NEW_LINE>}<NEW_LINE>} catch (LeaderUnknownException e) {<NEW_LINE>logger.warn("Catch up {} failed because leadership is lost", node);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.<MASK><NEW_LINE>}<NEW_LINE>// the next catch up is enabled<NEW_LINE>raftMember.getLastCatchUpResponseTime().remove(node);<NEW_LINE>}
|
error("Catch up {} errored", node, e);
|
1,272,923
|
private void writeOptimizedForEachLoop(CompileStack compileStack, OperandStack operandStack, MethodVisitor mv, ForStatement loop, Expression collectionExpression, ClassNode collectionType, Parameter loopVariable) {<NEW_LINE>BytecodeVariable variable = compileStack.defineVariable(loopVariable, false);<NEW_LINE>Label continueLabel = compileStack.getContinueLabel();<NEW_LINE>Label breakLabel = compileStack.getBreakLabel();<NEW_LINE>AsmClassGenerator acg = controller.getAcg();<NEW_LINE>// load array on stack<NEW_LINE>collectionExpression.visit(acg);<NEW_LINE>mv.visitInsn(DUP);<NEW_LINE>int array = compileStack.defineTemporaryVariable("$arr", collectionType, true);<NEW_LINE>mv.visitJumpInsn(IFNULL, breakLabel);<NEW_LINE>// $len = array.length<NEW_LINE>mv.visitVarInsn(ALOAD, array);<NEW_LINE>mv.visitInsn(ARRAYLENGTH);<NEW_LINE>operandStack.push(ClassHelper.int_TYPE);<NEW_LINE>int arrayLen = compileStack.defineTemporaryVariable(<MASK><NEW_LINE>// $idx = 0<NEW_LINE>mv.visitInsn(ICONST_0);<NEW_LINE>operandStack.push(ClassHelper.int_TYPE);<NEW_LINE>int loopIdx = compileStack.defineTemporaryVariable("$idx", ClassHelper.int_TYPE, true);<NEW_LINE>mv.visitLabel(continueLabel);<NEW_LINE>// $idx<$len?<NEW_LINE>mv.visitVarInsn(ILOAD, loopIdx);<NEW_LINE>mv.visitVarInsn(ILOAD, arrayLen);<NEW_LINE>mv.visitJumpInsn(IF_ICMPGE, breakLabel);<NEW_LINE>// get array element<NEW_LINE>loadFromArray(mv, variable, array, loopIdx);<NEW_LINE>// $idx++<NEW_LINE>mv.visitIincInsn(loopIdx, 1);<NEW_LINE>// loop body<NEW_LINE>loop.getLoopBlock().visit(acg);<NEW_LINE>mv.visitJumpInsn(GOTO, continueLabel);<NEW_LINE>mv.visitLabel(breakLabel);<NEW_LINE>compileStack.removeVar(loopIdx);<NEW_LINE>compileStack.removeVar(arrayLen);<NEW_LINE>compileStack.removeVar(array);<NEW_LINE>}
|
"$len", ClassHelper.int_TYPE, true);
|
740,587
|
public WebResponse createClientEntry(String url, String method, String action, List<endpointSettings> parms, List<endpointSettings> headers, List<validationData> expectations, InputStream source, String contentType) throws Exception {<NEW_LINE>WebResponse response = null;<NEW_LINE>String thisMethod = "createClientEntry";<NEW_LINE>msgUtils.printMethodName(thisMethod);<NEW_LINE>msgUtils.printOAuthOidcExpectations(expectations, new String[] { action }, null);<NEW_LINE>WebConversation wc = new WebConversation();<NEW_LINE>MessageBodyWebRequest request = null;<NEW_LINE>if (method.equals(Constants.POSTMETHOD)) {<NEW_LINE>request = new PostMethodWebRequest(url, source, contentType);<NEW_LINE>} else {<NEW_LINE>if (method.equals(Constants.PUTMETHOD)) {<NEW_LINE>request = new PutMethodWebRequest(url, source, contentType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Log.info(thisClass, thisMethod, "Endpoint URL: " + url);<NEW_LINE>if (parms != null) {<NEW_LINE>for (endpointSettings parm : parms) {<NEW_LINE>Log.info(thisClass, thisMethod, "Setting request parameter: key: " + parm.<MASK><NEW_LINE>request.setParameter(parm.key, parm.value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Log.info(thisClass, thisMethod, "No parameters to set");<NEW_LINE>}<NEW_LINE>if (headers != null) {<NEW_LINE>for (endpointSettings header : headers) {<NEW_LINE>Log.info(thisClass, thisMethod, "Setting header field: key: " + header.key + " value: " + header.value);<NEW_LINE>request.setHeaderField(header.key, header.value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Log.info(thisClass, thisMethod, "No header fields to add");<NEW_LINE>}<NEW_LINE>response = wc.getResponse(request);<NEW_LINE>msgUtils.printResponseParts(response, thisMethod, "Invoke with Parms and Headers: ");<NEW_LINE>} catch (HttpException e) {<NEW_LINE>System.err.println("Exception: " + e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Exception: " + e);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
|
key + " value: " + parm.value);
|
739,601
|
private IExtractor<ResourceIndexedSearchParamString> createStringExtractor(IBaseResource theResource) {<NEW_LINE>return (params, searchParam, value, path, theWantLocalReferences) -> {<NEW_LINE>String resourceType = toRootTypeName(theResource);<NEW_LINE>if (value instanceof IPrimitiveType) {<NEW_LINE>IPrimitiveType<?> nextValue = (IPrimitiveType<?>) value;<NEW_LINE>String valueAsString = nextValue.getValueAsString();<NEW_LINE>createStringIndexIfNotBlank(resourceType, params, searchParam, valueAsString);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String nextType = toRootTypeName(value);<NEW_LINE>switch(nextType) {<NEW_LINE>case "HumanName":<NEW_LINE>addString_HumanName(resourceType, params, searchParam, value);<NEW_LINE>break;<NEW_LINE>case "Address":<NEW_LINE>addString_Address(resourceType, params, searchParam, value);<NEW_LINE>break;<NEW_LINE>case "ContactPoint":<NEW_LINE>addString_ContactPoint(resourceType, params, searchParam, value);<NEW_LINE>break;<NEW_LINE>case "Quantity":<NEW_LINE>addString_Quantity(resourceType, params, searchParam, value);<NEW_LINE>break;<NEW_LINE>case "Range":<NEW_LINE>addString_Range(resourceType, params, searchParam, value);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
|
addUnexpectedDatatypeWarning(params, searchParam, value);
|
1,134,214
|
private void enableTracing(TracingConfig config) throws IOException {<NEW_LINE>final TracingConfig.Lightstep lightstep = config.getLightstep();<NEW_LINE>if (!lightstep.getCollectorHost().isBlank()) {<NEW_LINE>final Options.OptionsBuilder optionsBuilder = new Options.OptionsBuilder().withAccessToken(lightstep.getAccessToken()).withMaxReportingIntervalMillis(lightstep.getReportingIntervalMs()).withMaxBufferedSpans(lightstep.getMaxBufferedSpans()).withCollectorProtocol("http").withResetClient(lightstep.getResetClient()).withComponentName(lightstep.getComponentName()).withCollectorHost(lightstep.getCollectorHost()).<MASK><NEW_LINE>final Options options;<NEW_LINE>try {<NEW_LINE>options = optionsBuilder.build();<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new IllegalArgumentException("Malformed configuration for LightStep.", e);<NEW_LINE>}<NEW_LINE>log.info("Creating LightStep tracing exporter");<NEW_LINE>LightStepExporterHandler handler = new LightStepExporterHandler(new JRETracer(options));<NEW_LINE>log.info("Registering LightStep exporter as the SquashingTraceExporter delegate");<NEW_LINE>SquashingTraceExporter.createAndRegister(handler, config.getSquash().getThreshold(), config.getSquash().getWhitelist());<NEW_LINE>log.info("Setting global trace probability to {}", config.getProbability());<NEW_LINE>TraceConfig traceConfig = Tracing.getTraceConfig();<NEW_LINE>traceConfig.updateActiveTraceParams(traceConfig.getActiveTraceParams().toBuilder().setSampler(Samplers.probabilitySampler(config.getProbability())).build());<NEW_LINE>}<NEW_LINE>if (config.getZpagesPort() > 0) {<NEW_LINE>log.info("Starting zpage handlers on port {}", config.getZpagesPort());<NEW_LINE>// Start a web server for tracing data<NEW_LINE>ZPageHandlers.startHttpServerAndRegisterAll(config.getZpagesPort());<NEW_LINE>}<NEW_LINE>}
|
withCollectorPort(lightstep.getCollectorPort());
|
1,463,240
|
protected DBGeometry makeGeometryFromWKT(DBCSession session, String pgString) throws DBCException {<NEW_LINE>if (CommonUtils.isEmpty(pgString)) {<NEW_LINE>return new DBGeometry();<NEW_LINE>}<NEW_LINE>final String geometry;<NEW_LINE>final int srid;<NEW_LINE>if (pgString.startsWith("SRID=") && pgString.indexOf(';') > 5) {<NEW_LINE>final int index = pgString.indexOf(';');<NEW_LINE>geometry = <MASK><NEW_LINE>srid = CommonUtils.toInt(pgString.substring(5, index));<NEW_LINE>} else {<NEW_LINE>geometry = pgString;<NEW_LINE>srid = 0;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final Geometry result = new WKTReader().read(geometry);<NEW_LINE>result.setSRID(srid);<NEW_LINE>return new DBGeometry(result);<NEW_LINE>} catch (Throwable ignored) {<NEW_LINE>// May happen when geometry value was stored inside composite<NEW_LINE>return makeGeometryFromWKB(geometry);<NEW_LINE>}<NEW_LINE>}
|
pgString.substring(index + 1);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.