idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,336,587 | protected void handleTokenRequestResponse(String t) {<NEW_LINE>token = t.substring(t.indexOf("=") + 1, t.indexOf("&"));<NEW_LINE>int off = t.indexOf("expires=");<NEW_LINE>int start = 8;<NEW_LINE>if (off == -1) {<NEW_LINE>off = t.indexOf("expires_in=");<NEW_LINE>start = 11;<NEW_LINE>}<NEW_LINE>if (off > -1) {<NEW_LINE>int end = t.indexOf('&', off);<NEW_LINE>if (end < 0 || end < off) {<NEW_LINE>end = t.length();<NEW_LINE>}<NEW_LINE>expires = t.substring(off + start, end);<NEW_LINE>}<NEW_LINE>off = t.indexOf("refresh_token=");<NEW_LINE>refreshToken = null;<NEW_LINE>start = "refresh_token=".length();<NEW_LINE>if (off > -1) {<NEW_LINE>int end = <MASK><NEW_LINE>if (end < 0 || end < off) {<NEW_LINE>end = t.length();<NEW_LINE>}<NEW_LINE>refreshToken = t.substring(off + start, end);<NEW_LINE>}<NEW_LINE>} | t.indexOf('&', off); |
1,400,092 | public CompareSameNameAnswerElement answer(NetworkSnapshot snapshot) {<NEW_LINE>_assumeAllUnique = _batfish.debugFlagEnabled(DEBUG_FLAG_ASSUME_ALL_UNIQUE);<NEW_LINE>_configurations = _batfish.loadConfigurations(snapshot);<NEW_LINE>_csnQuestion = (CompareSameNameQuestion) _question;<NEW_LINE>_nodes = _csnQuestion.getNodeRegex().getMatchingNodes(_batfish, snapshot);<NEW_LINE>_answerElement = new CompareSameNameAnswerElement(null, _nodes);<NEW_LINE>add(AsPathAccessList.class, Configuration::getAsPathAccessLists);<NEW_LINE>add(AuthenticationKeyChain.class, Configuration::getAuthenticationKeyChains);<NEW_LINE>add(CommunitySetMatchExpr.class, Configuration::getCommunitySetMatchExprs);<NEW_LINE>add(IkePhase1Key.class, Configuration::getIkePhase1Keys);<NEW_LINE>add(IkePhase1Policy.class, Configuration::getIkePhase1Policies);<NEW_LINE>add(IkePhase1Proposal.class, Configuration::getIkePhase1Proposals);<NEW_LINE>add(Interface.class, Configuration::getAllInterfaces);<NEW_LINE>add(Ip6AccessList.class, Configuration::getIp6AccessLists);<NEW_LINE>add(IpAccessList.class, Configuration::getIpAccessLists);<NEW_LINE>add(<MASK><NEW_LINE>add(IpsecPhase2Proposal.class, Configuration::getIpsecPhase2Proposals);<NEW_LINE>add(IpsecPeerConfig.class, Configuration::getIpsecPeerConfigs);<NEW_LINE>add(Route6FilterList.class, Configuration::getRoute6FilterLists);<NEW_LINE>add(RouteFilterList.class, Configuration::getRouteFilterLists, RouteFilterList::definitionJson);<NEW_LINE>add(RoutingPolicy.class, Configuration::getRoutingPolicies, CompareSameNameAnswerer::stripTracingHints);<NEW_LINE>add(Vrf.class, Configuration::getVrfs);<NEW_LINE>add(Zone.class, Configuration::getZones);<NEW_LINE>return _answerElement;<NEW_LINE>} | IpsecPhase2Policy.class, Configuration::getIpsecPhase2Policies); |
1,021,417 | public static void main(String[] args) {<NEW_LINE>Map<String, List<LightSource>> lightSourcesMap = new HashMap<String, List<LightSource>>();<NEW_LINE>List<LightSource> lightSourceList = new ArrayList<LightSource>();<NEW_LINE>lightSourceList.add(createD20LightSource("Candle - 5", 5, 360));<NEW_LINE>lightSourceList.add(createD20LightSource<MASK><NEW_LINE>lightSourceList.add(createD20LightSource("Torch - 20", 20, 360));<NEW_LINE>lightSourceList.add(createD20LightSource("Everburning - 20", 20, 360));<NEW_LINE>lightSourceList.add(createD20LightSource("Lantern, Hooded - 30", 30, 360));<NEW_LINE>lightSourceList.add(createD20LightSource("Sunrod - 30", 30, 360));<NEW_LINE>lightSourcesMap.put("D20", lightSourceList);<NEW_LINE>lightSourceList = new ArrayList<LightSource>();<NEW_LINE>lightSourceList.add(createLightSource("5", 5, 360));<NEW_LINE>lightSourceList.add(createLightSource("15", 15, 360));<NEW_LINE>lightSourceList.add(createLightSource("20", 20, 360));<NEW_LINE>lightSourceList.add(createLightSource("30", 30, 360));<NEW_LINE>lightSourceList.add(createLightSource("40", 40, 360));<NEW_LINE>lightSourceList.add(createLightSource("60", 60, 360));<NEW_LINE>lightSourcesMap.put("Generic", lightSourceList);<NEW_LINE>XStream xstream = FileUtil.getConfiguredXStream();<NEW_LINE>System.out.println(xstream.toXML(lightSourcesMap));<NEW_LINE>} | ("Lamp - 15", 15, 360)); |
1,484,829 | public void createBindings() {<NEW_LINE>DoubleConverter doubleConverter = new DoubleConverter("%f");<NEW_LINE>DoubleConverter degreeConverter = new DoubleConverter(Configuration.<MASK><NEW_LINE>IntegerConverter integerConverter = new IntegerConverter();<NEW_LINE>LengthConverter lengthConverter = new LengthConverter();<NEW_LINE>addWrappedBinding(machine, "simulationMode", simulationMode, "selectedItem");<NEW_LINE>addWrappedBinding(machine, "simulatedNonSquarenessFactor", simulatedNonSquarenessFactor, "text", doubleConverter);<NEW_LINE>addWrappedBinding(machine, "simulatedRunout", simulatedRunout, "text", lengthConverter);<NEW_LINE>addWrappedBinding(machine, "simulatedRunoutPhase", simulatedRunoutPhase, "text", degreeConverter);<NEW_LINE>addWrappedBinding(machine, "pickAndPlaceChecking", pickAndPlaceChecking, "selected");<NEW_LINE>addWrappedBinding(machine, "simulatedVibrationAmplitude", simulatedVibrationAmplitude, "text", doubleConverter);<NEW_LINE>addWrappedBinding(machine, "simulatedVibrationDuration", simulatedVibrationDuration, "text", doubleConverter);<NEW_LINE>addWrappedBinding(machine, "simulatedCameraNoise", simulatedCameraNoise, "text", integerConverter);<NEW_LINE>addWrappedBinding(machine, "simulatedCameraLag", simulatedCameraLag, "text", doubleConverter);<NEW_LINE>MutableLocationProxy homingError = new MutableLocationProxy();<NEW_LINE>bind(UpdateStrategy.READ_WRITE, machine, "homingError", homingError, "location");<NEW_LINE>addWrappedBinding(homingError, "lengthX", homingErrorX, "text", lengthConverter);<NEW_LINE>addWrappedBinding(homingError, "lengthY", homingErrorY, "text", lengthConverter);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(homingErrorX);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(homingErrorY);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(homingErrorX);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(homingErrorY);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(machineTableZ);<NEW_LINE>} | get().getLengthDisplayFormat()); |
1,503,820 | final GetServiceSettingsResult executeGetServiceSettings(GetServiceSettingsRequest getServiceSettingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getServiceSettingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetServiceSettingsRequest> request = null;<NEW_LINE>Response<GetServiceSettingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetServiceSettingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getServiceSettingsRequest));<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, "License Manager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetServiceSettings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetServiceSettingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetServiceSettingsResultJsonUnmarshaller());<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); |
323,896 | public OCompositeKey deserializeFromByteBufferObject(ByteBuffer buffer, OWALChanges walChanges, int offset) {<NEW_LINE>final OCompositeKey compositeKey = new OCompositeKey();<NEW_LINE>offset += OIntegerSerializer.INT_SIZE;<NEW_LINE>final int keysSize = walChanges.getIntValue(buffer, offset);<NEW_LINE>offset += OIntegerSerializer.INT_SIZE;<NEW_LINE>final OBinarySerializerFactory factory = OBinarySerializerFactory.getInstance();<NEW_LINE>for (int i = 0; i < keysSize; i++) {<NEW_LINE>final byte serializerId = walChanges.getByteValue(buffer, offset);<NEW_LINE>offset += OBinarySerializerFactory.TYPE_IDENTIFIER_SIZE;<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>OBinarySerializer<Object> binarySerializer = (OBinarySerializer<Object>) factory.getObjectSerializer(serializerId);<NEW_LINE>final Object key = binarySerializer.<MASK><NEW_LINE>compositeKey.addKey(key);<NEW_LINE>offset += binarySerializer.getObjectSize(key);<NEW_LINE>}<NEW_LINE>return compositeKey;<NEW_LINE>} | deserializeFromByteBufferObject(buffer, walChanges, offset); |
73,490 | private String replayFiles(DateTime startTime) {<NEW_LINE>DateTime replayTimeoutTime = startTime.plus(REPLAY_TIMEOUT_DURATION);<NEW_LINE>DateTime searchStartTime = jpaTm().transact(() -> SqlReplayCheckpoint.get().plusMillis(1));<NEW_LINE>int filesProcessed = 0;<NEW_LINE>int transactionsProcessed = 0;<NEW_LINE>// Starting from one millisecond after the last file we processed, search for and import files<NEW_LINE>// one hour at a time until we catch up to the current time or we hit the replay timeout (in<NEW_LINE>// which case the next run will pick up from where we leave off).<NEW_LINE>//<NEW_LINE>// We use hour-long batches because GCS supports filename prefix-based searches.<NEW_LINE>while (true) {<NEW_LINE>if (isAtOrAfter(clock.nowUtc(), replayTimeoutTime)) {<NEW_LINE>return createResponseString(<MASK><NEW_LINE>}<NEW_LINE>if (isBeforeOrAt(clock.nowUtc(), searchStartTime)) {<NEW_LINE>return createResponseString("Caught up to current time", startTime, filesProcessed, transactionsProcessed);<NEW_LINE>}<NEW_LINE>// Search through the end of the hour<NEW_LINE>DateTime searchEndTime = searchStartTime.withMinuteOfHour(59).withSecondOfMinute(59).withMillisOfSecond(999);<NEW_LINE>ImmutableList<BlobInfo> fileBatch = diffLister.listDiffFiles(gcsBucket, searchStartTime, searchEndTime);<NEW_LINE>if (fileBatch.isEmpty()) {<NEW_LINE>logger.atInfo().log("No remaining files found in hour %s, continuing search in the next hour.", searchStartTime.toString("yyyy-MM-dd HH"));<NEW_LINE>}<NEW_LINE>for (BlobInfo file : fileBatch) {<NEW_LINE>transactionsProcessed += processFile(file);<NEW_LINE>filesProcessed++;<NEW_LINE>if (clock.nowUtc().isAfter(replayTimeoutTime)) {<NEW_LINE>return createResponseString("Reached max execution time", startTime, filesProcessed, transactionsProcessed);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>searchStartTime = searchEndTime.plusMillis(1);<NEW_LINE>}<NEW_LINE>} | "Reached max execution time", startTime, filesProcessed, transactionsProcessed); |
1,505,966 | public static void process(GrayU8 src, final int kerA, final int kerB, GrayS16 derivX, GrayS16 derivY) {<NEW_LINE>final byte[] data = src.data;<NEW_LINE>final short[] imgX = derivX.data;<NEW_LINE>final short[] imgY = derivY.data;<NEW_LINE>final <MASK><NEW_LINE>final int height = src.getHeight() - 1;<NEW_LINE>final int strideSrc = src.getStride();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(1,height,y->{<NEW_LINE>for (int y = 1; y < height; y++) {<NEW_LINE>int indexSrc = src.startIndex + src.stride * y + 1;<NEW_LINE>final int endX = indexSrc + width - 2;<NEW_LINE>int indexX = derivX.startIndex + derivX.stride * y + 1;<NEW_LINE>int indexY = derivY.startIndex + derivY.stride * y + 1;<NEW_LINE>int a11, a12, a21, a22, a31, a32;<NEW_LINE>a11 = data[indexSrc - strideSrc - 1] & 0xFF;<NEW_LINE>a12 = data[indexSrc - strideSrc] & 0xFF;<NEW_LINE>a21 = data[indexSrc - 1] & 0xFF;<NEW_LINE>a22 = data[indexSrc] & 0xFF;<NEW_LINE>a31 = data[indexSrc + strideSrc - 1] & 0xFF;<NEW_LINE>a32 = data[indexSrc + strideSrc] & 0xFF;<NEW_LINE>for (; indexSrc < endX; indexSrc++) {<NEW_LINE>int a13 = data[indexSrc - strideSrc + 1] & 0xFF;<NEW_LINE>int a23 = data[indexSrc + 1] & 0xFF;<NEW_LINE>int a33 = data[indexSrc + strideSrc + 1] & 0xFF;<NEW_LINE>int v = (a33 - a11) * kerA;<NEW_LINE>int w = (a31 - a13) * kerA;<NEW_LINE>imgY[indexY++] = (short) ((a32 - a12) * kerB + v + w);<NEW_LINE>imgX[indexX++] = (short) ((a23 - a21) * kerB + v - w);<NEW_LINE>a11 = a12;<NEW_LINE>a12 = a13;<NEW_LINE>a21 = a22;<NEW_LINE>a22 = a23;<NEW_LINE>a31 = a32;<NEW_LINE>a32 = a33;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | int width = src.getWidth(); |
951,448 | private void loadNode131() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_EnableCount, new QualifiedName(0, "EnableCount"), new LocalizedText("en", "EnableCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UInt32, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_EnableCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_EnableCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_EnableCount, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | (1), 0.0, false); |
668,614 | private List<LSCompletionItem> populateSelfClassSymbolCompletionItems(Symbol symbol, BallerinaCompletionContext ctx, TypeSymbol rawType) {<NEW_LINE>Optional<ModuleMemberDeclarationNode<MASK><NEW_LINE>if (moduleMember.isEmpty() || (!CommonUtil.isSelfClassSymbol(symbol, ctx, moduleMember.get()) && !CommonUtil.isSelfObjectSymbol(symbol, ctx.getNodeAtCursor()))) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>List<LSCompletionItem> completionItems = new ArrayList<>();<NEW_LINE>ObjectTypeSymbol objectTypeDesc = (ObjectTypeSymbol) rawType;<NEW_LINE>objectTypeDesc.fieldDescriptors().values().stream().map(classFieldSymbol -> {<NEW_LINE>CompletionItem completionItem = FieldCompletionItemBuilder.build(classFieldSymbol, true);<NEW_LINE>return new ObjectFieldCompletionItem(ctx, classFieldSymbol, completionItem);<NEW_LINE>}).forEach(completionItems::add);<NEW_LINE>objectTypeDesc.methods().values().stream().map(methodSymbol -> {<NEW_LINE>CompletionItem completionItem = FunctionCompletionItemBuilder.buildMethod(methodSymbol, ctx);<NEW_LINE>return new SymbolCompletionItem(ctx, methodSymbol, completionItem);<NEW_LINE>}).forEach(completionItems::add);<NEW_LINE>return completionItems;<NEW_LINE>} | > moduleMember = ctx.enclosedModuleMember(); |
514,834 | // Implement the pointer assignment inference rules<NEW_LINE>private static boolean add_new_points_to_tuple(SegmentNode pts, SegmentNode pe, AllocNode obj, PtInsNode qn) {<NEW_LINE>long interI, interJ;<NEW_LINE>int code = 0;<NEW_LINE>// Special Cases<NEW_LINE>if (pts.I1 == 0 || pe.I1 == 0) {<NEW_LINE>// Make it pointer insensitive but heap sensitive<NEW_LINE>pres.I1 = 0;<NEW_LINE>pres.I2 = pts.I2;<NEW_LINE>pres.L = pts.L;<NEW_LINE>code = (pts.I2 == 0 ? PtInsIntervalManager.ALL_TO_ALL : PtInsIntervalManager.ALL_TO_MANY);<NEW_LINE>} else {<NEW_LINE>// The left-end is the larger one<NEW_LINE>interI = pe.I1 < pts.I1 ? pts.I1 : pe.I1;<NEW_LINE>// The right-end is the smaller one<NEW_LINE>interJ = (pe.I1 + pe.L < pts.I1 + pts.L ? pe.I1 + pe.L : <MASK><NEW_LINE>if (interI >= interJ) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// The intersection is non-empty<NEW_LINE>pres.I1 = (pe.I2 == 0 ? 0 : interI - pe.I1 + pe.I2);<NEW_LINE>pres.I2 = (pts.I2 == 0 ? 0 : interI - pts.I1 + pts.I2);<NEW_LINE>pres.L = interJ - interI;<NEW_LINE>code = (pres.I2 == 0 ? PtInsIntervalManager.MANY_TO_ALL : PtInsIntervalManager.ONE_TO_ONE);<NEW_LINE>}<NEW_LINE>return qn.addPointsTo(code, obj);<NEW_LINE>} | pts.I1 + pts.L); |
310,131 | public Response play(final Request request) {<NEW_LINE>if (!mode.isReadable()) {<NEW_LINE>throw new IllegalStateException("the tape is not readable");<NEW_LINE>}<NEW_LINE>if (mode.isSequential()) {<NEW_LINE>int nextIndex = orderedIndex.getAndIncrement();<NEW_LINE>RecordedInteraction nextInteraction = interactions.get(nextIndex).toImmutable();<NEW_LINE>if (nextInteraction == null) {<NEW_LINE>throw new IllegalStateException(String.format("No recording found at position %s", nextIndex));<NEW_LINE>}<NEW_LINE>if (!matchRule.isMatch(request, nextInteraction.request())) {<NEW_LINE>throw new IllegalStateException(String.format("Request %s does not match recorded " + "request" + " %s", stringify(request), stringify(<MASK><NEW_LINE>}<NEW_LINE>return nextInteraction.response();<NEW_LINE>} else {<NEW_LINE>int position = findMatch(request);<NEW_LINE>if (position < 0) {<NEW_LINE>throw new IllegalStateException("no matching recording found");<NEW_LINE>} else {<NEW_LINE>return interactions.get(position).toImmutable().response();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | nextInteraction.request()))); |
1,735,290 | public ApiResponse<ExtendedUser> usersPostWithHttpInfo(CreateUserRequest createUserRequest) throws ApiException {<NEW_LINE>Object localVarPostBody = createUserRequest;<NEW_LINE>// verify the required parameter 'createUserRequest' is set<NEW_LINE>if (createUserRequest == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'createUserRequest' when calling usersPost");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/users";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "text/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json", "text/json" };<NEW_LINE>final String <MASK><NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<ExtendedUser> localVarReturnType = new GenericType<ExtendedUser>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
1,548,377 | protected StringBuilder renderWrappedText(StringBuilder sb, int width, int nextLineTabStop, String text) {<NEW_LINE>int pos = findWrapPos(text, width, 0);<NEW_LINE>if (pos == -1) {<NEW_LINE>sb.append(rtrim(text));<NEW_LINE>return sb;<NEW_LINE>}<NEW_LINE>sb.append(rtrim(text.substring(0, pos))<MASK><NEW_LINE>if (nextLineTabStop >= width) {<NEW_LINE>// stops infinite loop happening<NEW_LINE>nextLineTabStop = 1;<NEW_LINE>}<NEW_LINE>// all following lines must be padded with nextLineTabStop space characters<NEW_LINE>final String padding = createPadding(nextLineTabStop);<NEW_LINE>while (true) {<NEW_LINE>text = padding + text.substring(pos).trim();<NEW_LINE>pos = findWrapPos(text, width, 0);<NEW_LINE>if (pos == -1) {<NEW_LINE>sb.append(text);<NEW_LINE>return sb;<NEW_LINE>}<NEW_LINE>if (text.length() > width && pos == nextLineTabStop - 1) {<NEW_LINE>pos = width;<NEW_LINE>}<NEW_LINE>sb.append(rtrim(text.substring(0, pos))).append(getNewLine());<NEW_LINE>}<NEW_LINE>} | ).append(getNewLine()); |
755,632 | void constructPointWKT(int pointIndex) {<NEW_LINE>if (xValues[pointIndex] % 1 == 0) {<NEW_LINE>appendToWKTBuffers((int) xValues[pointIndex]);<NEW_LINE>} else {<NEW_LINE>appendToWKTBuffers(xValues[pointIndex]);<NEW_LINE>}<NEW_LINE>appendToWKTBuffers(" ");<NEW_LINE>if (yValues[pointIndex] % 1 == 0) {<NEW_LINE>appendToWKTBuffers((int) yValues[pointIndex]);<NEW_LINE>} else {<NEW_LINE>appendToWKTBuffers(yValues[pointIndex]);<NEW_LINE>}<NEW_LINE>appendToWKTBuffers(" ");<NEW_LINE>if (hasZvalues && !Double.isNaN(zValues[pointIndex])) {<NEW_LINE>if (zValues[pointIndex] % 1 == 0) {<NEW_LINE>WKTsb.append((long) zValues[pointIndex]);<NEW_LINE>} else {<NEW_LINE>WKTsb.append(zValues[pointIndex]);<NEW_LINE>}<NEW_LINE>WKTsb.append(" ");<NEW_LINE>} else if (hasMvalues && !Double.isNaN(mValues[pointIndex])) {<NEW_LINE>// Handle the case where the user has POINT (1 2 NULL M) value.<NEW_LINE>WKTsb.append("NULL ");<NEW_LINE>}<NEW_LINE>if (hasMvalues && !Double.isNaN(mValues[pointIndex])) {<NEW_LINE>if (mValues[pointIndex] % 1 == 0) {<NEW_LINE>WKTsb.append((long) mValues[pointIndex]);<NEW_LINE>} else {<NEW_LINE>WKTsb.append(mValues[pointIndex]);<NEW_LINE>}<NEW_LINE>WKTsb.append(" ");<NEW_LINE>}<NEW_LINE>currentPointIndex++;<NEW_LINE>// truncate last space<NEW_LINE>WKTsb.setLength(WKTsb.length() - 1);<NEW_LINE>WKTsbNoZM.setLength(<MASK><NEW_LINE>} | WKTsbNoZM.length() - 1); |
1,368,748 | protected boolean handleProcess(Set<? extends TypeElement> annotations, RoundEnvironment env) throws LayerGenerationException {<NEW_LINE>if (env.processingOver()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int cnt = 0;<NEW_LINE>for (Element e : env.getElementsAnnotatedWith(JPDADebugger.Registration.class)) {<NEW_LINE>JPDADebugger.Registration reg = e.getAnnotation(JPDADebugger.Registration.class);<NEW_LINE>final String path = reg.path();<NEW_LINE>handleProviderRegistration(<MASK><NEW_LINE>cnt++;<NEW_LINE>}<NEW_LINE>for (Element e : env.getElementsAnnotatedWith(SmartSteppingCallback.Registration.class)) {<NEW_LINE>SmartSteppingCallback.Registration reg = e.getAnnotation(SmartSteppingCallback.Registration.class);<NEW_LINE>final String path = reg.path();<NEW_LINE>handleProviderRegistration(e, SmartSteppingCallback.class, path);<NEW_LINE>cnt++;<NEW_LINE>}<NEW_LINE>for (Element e : env.getElementsAnnotatedWith(SourcePathProvider.Registration.class)) {<NEW_LINE>SourcePathProvider.Registration reg = e.getAnnotation(SourcePathProvider.Registration.class);<NEW_LINE>final String path = reg.path();<NEW_LINE>handleProviderRegistration(e, SourcePathProvider.class, path);<NEW_LINE>cnt++;<NEW_LINE>}<NEW_LINE>for (Element e : env.getElementsAnnotatedWith(EditorContext.Registration.class)) {<NEW_LINE>EditorContext.Registration reg = e.getAnnotation(EditorContext.Registration.class);<NEW_LINE>final String path = reg.path();<NEW_LINE>handleProviderRegistration(e, EditorContext.class, path);<NEW_LINE>cnt++;<NEW_LINE>}<NEW_LINE>for (Element e : env.getElementsAnnotatedWith(Evaluator.Registration.class)) {<NEW_LINE>Evaluator.Registration reg = e.getAnnotation(Evaluator.Registration.class);<NEW_LINE>final String language = reg.language();<NEW_LINE>handleEvaluatorRegistration(e, language);<NEW_LINE>cnt++;<NEW_LINE>}<NEW_LINE>for (Element e : env.getElementsAnnotatedWith(BreakpointsClassFilter.Registration.class)) {<NEW_LINE>BreakpointsClassFilter.Registration reg = e.getAnnotation(BreakpointsClassFilter.Registration.class);<NEW_LINE>final String path = reg.path();<NEW_LINE>handleProviderRegistration(e, BreakpointsClassFilter.class, path);<NEW_LINE>cnt++;<NEW_LINE>}<NEW_LINE>return cnt == annotations.size();<NEW_LINE>} | e, JPDADebugger.class, path); |
1,599,828 | ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>EntityManager em = emc.get(FileInfo.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<FileInfo> cq = cb.createQuery(FileInfo.class);<NEW_LINE>Root<FileInfo> root = <MASK><NEW_LINE>Predicate p = cb.conjunction();<NEW_LINE>boolean flag = false;<NEW_LINE>if (StringUtils.isNotBlank(wi.getAppId())) {<NEW_LINE>flag = true;<NEW_LINE>p = cb.and(p, cb.equal(root.get(FileInfo_.appId), wi.getAppId()));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(wi.getCategoryId())) {<NEW_LINE>flag = true;<NEW_LINE>p = cb.and(p, cb.equal(root.get(FileInfo_.categoryId), wi.getCategoryId()));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(wi.getDocumentId())) {<NEW_LINE>flag = true;<NEW_LINE>p = cb.and(p, cb.equal(root.get(FileInfo_.documentId), wi.getDocumentId()));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(wi.getName())) {<NEW_LINE>flag = true;<NEW_LINE>String key = StringTools.escapeSqlLikeKey(wi.getName());<NEW_LINE>p = cb.and(p, cb.like(root.get(FileInfo_.name), "%" + key + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>}<NEW_LINE>List<Wo> wos = new ArrayList<>();<NEW_LINE>if (flag) {<NEW_LINE>wos = emc.fetch(FileInfo.class, Wo.copier, p);<NEW_LINE>}<NEW_LINE>result.setData(wos);<NEW_LINE>result.setCount(Long.valueOf(wos.size()));<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | cq.from(FileInfo.class); |
371,509 | private void loadNode57() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerConfigurationType_UpdateCertificate_OutputArguments, new QualifiedName(0, "OutputArguments"), new LocalizedText("en", "OutputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_UpdateCertificate_OutputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_UpdateCertificate_OutputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_UpdateCertificate_OutputArguments, Identifiers.HasProperty, Identifiers.ServerConfigurationType_UpdateCertificate.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>ApplyChangesRequired</Name><DataType><Identifier>i=1</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE><MASK><NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | String xml = sb.toString(); |
597,560 | private void editAlias() {<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(this);<NEW_LINE>builder.setTitle(R.string.edit_alias);<NEW_LINE>final EditText input = new EditText(this);<NEW_LINE>input.setInputType(InputType.TYPE_TEXT_VARIATION_PERSON_NAME);<NEW_LINE>RosterContact rosterContact = RosterManager.getInstance().getRosterContact(getAccount(), getUser());<NEW_LINE>input.setText(rosterContact.getName());<NEW_LINE>builder.setView(input);<NEW_LINE>builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>RosterManager.getInstance().setName(getAccount(), getUser(), input.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>dialog.cancel();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.show();<NEW_LINE>} | getText().toString()); |
459,601 | public void onListContributorsClicked() {<NEW_LINE>_adapter.clear();<NEW_LINE>//<NEW_LINE>//<NEW_LINE>_disposables.add(_githubService.contributors(_username.getText().toString(), _repo.getText().toString()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribeWith(new DisposableObserver<List<Contributor>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete() {<NEW_LINE>Timber.d("Retrofit call 1 completed");<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onNext(List<Contributor> contributors) {<NEW_LINE>for (Contributor c : contributors) {<NEW_LINE>_adapter.add(format("%s has made %d contributions to %s", c.login, c.contributions, _repo.getText().toString()));<NEW_LINE>Timber.d("%s has made %d contributions to %s", c.login, c.contributions, _repo.getText().toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>} | Timber.e(e, "woops we got an error while getting the list of contributors"); |
18,066 | public void fill(float[] vertices, float[] texture_uv, int voff, int[] index, int[] stype, int ioff, float z, boolean blue) {<NEW_LINE><MASK><NEW_LINE>z += mZ;<NEW_LINE>float[] v = new float[] { x, y, z, x + width, y, z, x + width, y + height, z, x, y + height, z, x, y, z - d, x + width, y, z - d, x + width, y + height, z - d, x, y + height, z - d };<NEW_LINE>for (int i = 0; i < v.length; i++) {<NEW_LINE>texture_uv[i + voff] = vertices[i + voff] = v[i];<NEW_LINE>if (i % 3 == 2) {<NEW_LINE>texture_uv[i + voff] = java.lang.Float.NaN;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int[] ind = new int[] { 2, 1, 0, 0, 3, 2, 7, 4, 5, 5, 6, 7, 1, 2, 6, 6, 5, 1, 4, 7, 3, 3, 0, 4, 2, 3, 7, 7, 6, 2, 0, 1, 5, 5, 4, 0 };<NEW_LINE>int[] type = { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };<NEW_LINE>for (int i = 0; i < ind.length; i++) {<NEW_LINE>index[i + ioff] = ind[i] * 3 + voff;<NEW_LINE>stype[(i + ioff) / 3] = blue ? 2 : type[i / 3];<NEW_LINE>}<NEW_LINE>} | float d = blue ? 1 : DEPTH; |
960,818 | final TransferInputDeviceResult executeTransferInputDevice(TransferInputDeviceRequest transferInputDeviceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(transferInputDeviceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TransferInputDeviceRequest> request = null;<NEW_LINE>Response<TransferInputDeviceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TransferInputDeviceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(transferInputDeviceRequest));<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, "MediaLive");<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>HttpResponseHandler<AmazonWebServiceResponse<TransferInputDeviceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TransferInputDeviceResultJsonUnmarshaller());<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, "TransferInputDevice"); |
379,723 | public static <T> T fromJson(String json, Class<?> clazz, Class<?>... parameters) throws JsonErrorException {<NEW_LINE>if (StringUtils.isNotBlank(json)) {<NEW_LINE>try {<NEW_LINE>if (parameters.length > 0) {<NEW_LINE>return (T) mapper.readValue(json, mapper.getTypeFactory().constructParametricType(clazz, parameters));<NEW_LINE>}<NEW_LINE>if (json.startsWith(PREFIX) && json.endsWith(SUFFIX)) {<NEW_LINE>JavaType javaType = mapper.getTypeFactory().constructParametricType(ArrayList.class, clazz);<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>return (T) mapper.readValue(json, clazz);<NEW_LINE>} catch (Exception e) {<NEW_LINE>String message = "Unable to deserialize to object from string(json) in type: [" + (null != clazz ? clazz.getSimpleName() : "UNKNOWN") + "], parameters size: " + parameters.length;<NEW_LINE>throw new JsonErrorException(-1, message, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | mapper.readValue(json, javaType); |
80,887 | public void operationComplete(CommandFuture<PrimaryDcChangeMessage> commandFuture) throws Exception {<NEW_LINE>if (commandFuture.isSuccess()) {<NEW_LINE>PrimaryDcChangeMessage res = commandFuture.get();<NEW_LINE>logger.info("[doNewPrimaryDcMigrate]{},{},{},{}", cluster, shard, newPrimaryDc, res);<NEW_LINE>if (PRIMARY_DC_CHANGE_RESULT.SUCCESS.equals(res.getErrorType())) {<NEW_LINE>shardMigrationResult.updateStepResult(ShardMigrationStep.MIGRATE_NEW_PRIMARY_DC, true, res.getErrorMessage());<NEW_LINE>shardMigrationResult.setNewMaster(new HostPort(res.getNewMasterIp(), res.getNewMasterPort()));<NEW_LINE>} else {<NEW_LINE>logger.error("[doNewPrimaryDcMigrate][fail]{},{}", cluster, shard);<NEW_LINE>shardMigrationResult.updateStepResult(ShardMigrationStep.MIGRATE_NEW_PRIMARY_DC, <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Throwable cause = commandFuture.cause();<NEW_LINE>logger.error("[doNewPrimaryDcMigrate][fail]{},{}", cluster, shard, cause);<NEW_LINE>shardMigrationResult.updateStepResult(ShardMigrationStep.MIGRATE_NEW_PRIMARY_DC, false, LogUtils.error(String.format("%s:%s", cause.getClass().getSimpleName(), cause.getMessage())));<NEW_LINE>}<NEW_LINE>notifyObservers(new ShardObserverEvent(shardName(), ShardMigrationStep.MIGRATE_NEW_PRIMARY_DC));<NEW_LINE>} | false, res.getErrorMessage()); |
1,737,105 | private static void configureNodesUsingUserIntent(Cluster cluster, Collection<NodeDetails> nodeDetailsSet, boolean isEditUniverse) {<NEW_LINE>UserIntent userIntent = cluster.userIntent;<NEW_LINE>Set<NodeDetails> nodesInCluster = nodeDetailsSet.stream().filter(n -> n.placementUuid.equals(cluster.uuid)).collect(Collectors.toSet());<NEW_LINE>long numTservers = getNumTserverNodes(nodesInCluster);<NEW_LINE>long numDeltaNodes = userIntent.numNodes - numTservers;<NEW_LINE>Map<String, NodeDetails> deltaNodesMap = new HashMap<>();<NEW_LINE>Map<UUID, Integer> azUuidToNumNodes = getAzUuidToNumNodes(nodesInCluster);<NEW_LINE>LOG.info("Nodes desired={} vs existing={}.", userIntent.numNodes, numTservers);<NEW_LINE>if (numDeltaNodes < 0) {<NEW_LINE>// Desired action is to remove nodes from a given cluster.<NEW_LINE>Iterator<NodeDetails> nodeIter = nodeDetailsSet.iterator();<NEW_LINE>int deleteCounter = 0;<NEW_LINE>while (nodeIter.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (currentNode.isMaster || !currentNode.placementUuid.equals(cluster.uuid)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (isEditUniverse) {<NEW_LINE>if (currentNode.isActive()) {<NEW_LINE>currentNode.state = NodeDetails.NodeState.ToBeRemoved;<NEW_LINE>LOG.trace("Removing node [{}].", currentNode);<NEW_LINE>deleteCounter++;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>nodeIter.remove();<NEW_LINE>deleteCounter++;<NEW_LINE>}<NEW_LINE>if (deleteCounter == -numDeltaNodes) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (numDeltaNodes > 0) {<NEW_LINE>// Desired action is to add nodes.<NEW_LINE>LinkedHashSet<PlacementIndexes> indexes = findPlacementsOfAZUuid(sortByValues(azUuidToNumNodes), cluster);<NEW_LINE>// If we cannot find enough nodes to do the expand we would return an error.<NEW_LINE>if (indexes.size() != azUuidToNumNodes.size()) {<NEW_LINE>throw new IllegalStateException("Couldn't find enough nodes to perform expand/shrink");<NEW_LINE>}<NEW_LINE>int startIndex = getNextIndexToConfigure(nodeDetailsSet);<NEW_LINE>addNodeDetailSetToTaskParams(indexes, startIndex, numDeltaNodes, cluster, nodeDetailsSet, deltaNodesMap);<NEW_LINE>}<NEW_LINE>} | NodeDetails currentNode = nodeIter.next(); |
389,282 | public void process(T gray, GrayU8 binary) {<NEW_LINE>results.reset();<NEW_LINE>ellipseDetector.process(binary);<NEW_LINE>if (ellipseRefiner != null)<NEW_LINE>ellipseRefiner.setImage(gray);<NEW_LINE>intensityCheck.setImage(gray);<NEW_LINE>List<BinaryEllipseDetectorPixel.Found> found = ellipseDetector.getFound();<NEW_LINE>for (BinaryEllipseDetectorPixel.Found f : found) {<NEW_LINE>if (!intensityCheck.process(f.ellipse)) {<NEW_LINE>if (verbose)<NEW_LINE>System.out.println("Rejecting ellipse. Initial fit didn't have intense enough edge");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>EllipseInfo r = results.grow();<NEW_LINE>r.contour = f.contour;<NEW_LINE>if (ellipseRefiner != null) {<NEW_LINE>if (!ellipseRefiner.process(f.ellipse, r.ellipse)) {<NEW_LINE>if (verbose)<NEW_LINE><MASK><NEW_LINE>results.removeTail();<NEW_LINE>continue;<NEW_LINE>} else if (!intensityCheck.process(f.ellipse)) {<NEW_LINE>if (verbose)<NEW_LINE>System.out.println("Rejecting ellipse. Refined fit didn't have an intense enough edge");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>r.ellipse.setTo(f.ellipse);<NEW_LINE>}<NEW_LINE>r.averageInside = intensityCheck.averageInside;<NEW_LINE>r.averageOutside = intensityCheck.averageOutside;<NEW_LINE>}<NEW_LINE>} | System.out.println("Rejecting ellipse. Refined fit didn't have an intense enough edge"); |
514,745 | public void enterCip_transform_set(Cip_transform_setContext ctx) {<NEW_LINE>if (_currentIpsecTransformSet != null) {<NEW_LINE>throw new BatfishException("IpsecTransformSet should be null!");<NEW_LINE>}<NEW_LINE>_currentIpsecTransformSet = new IpsecTransformSet(ctx.name.getText());<NEW_LINE>_configuration.defineStructure(IPSEC_TRANSFORM_SET, ctx.name.getText(), ctx);<NEW_LINE>if (ctx.ipsec_encryption() != null) {<NEW_LINE>_currentIpsecTransformSet.setEncryptionAlgorithm(toEncryptionAlgorithm(ctx.ipsec_encryption()));<NEW_LINE>} else if (ctx.ipsec_encryption_aruba() != null) {<NEW_LINE>_currentIpsecTransformSet.setEncryptionAlgorithm(toEncryptionAlgorithm(ctx.ipsec_encryption_aruba()));<NEW_LINE>}<NEW_LINE>// If any encryption algorithm was set then ESP protocol is used<NEW_LINE>if (_currentIpsecTransformSet.getEncryptionAlgorithm() != null) {<NEW_LINE>_currentIpsecTransformSet.getProtocols().add(IpsecProtocol.ESP);<NEW_LINE>}<NEW_LINE>if (ctx.ipsec_authentication() != null) {<NEW_LINE>_currentIpsecTransformSet.setAuthenticationAlgorithm(toIpsecAuthenticationAlgorithm(ctx.ipsec_authentication()));<NEW_LINE>_currentIpsecTransformSet.getProtocols().add(toProtocol<MASK><NEW_LINE>}<NEW_LINE>} | (ctx.ipsec_authentication())); |
524,165 | public static List<WordDistances> readFromBinary(Path binFile, Path vocabFile) throws IOException {<NEW_LINE>LmVocabulary vocabulary = LmVocabulary.loadFromBinary(vocabFile.toFile());<NEW_LINE>try (DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(binFile.toFile()), 100000))) {<NEW_LINE>int wordSize = in.readInt();<NEW_LINE>int vectorSize = in.readInt();<NEW_LINE>List<WordDistances> distLists = new ArrayList<>(wordSize);<NEW_LINE>for (int i = 0; i < wordSize; i++) {<NEW_LINE>String s = vocabulary.getWord(in.readInt());<NEW_LINE>Distance[] distances = new Distance[vectorSize];<NEW_LINE>for (int j = 0; j < vectorSize; j++) {<NEW_LINE>String word = vocabulary.getWord(in.readInt());<NEW_LINE>Float f = in.readFloat();<NEW_LINE>distances[j] <MASK><NEW_LINE>}<NEW_LINE>if (i % 10000 == 0) {<NEW_LINE>Log.info("%d completed", i);<NEW_LINE>}<NEW_LINE>distLists.add(new WordDistances(s, distances));<NEW_LINE>}<NEW_LINE>return distLists;<NEW_LINE>}<NEW_LINE>} | = new Distance(word, f); |
541,650 | public static Version.Match versionFilter(String spec) {<NEW_LINE>if (spec == null || spec.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>int moreIndex = spec.indexOf(GREATER_VERSION);<NEW_LINE>int compatibleIndex = spec.indexOf(COMPATIBLE_VERSION);<NEW_LINE>int i = -1;<NEW_LINE>Version.Match.Type type = null;<NEW_LINE>if (eqIndex >= 0) {<NEW_LINE>type = Match.Type.EXACT;<NEW_LINE>i = eqIndex;<NEW_LINE>} else if (moreIndex >= 0) {<NEW_LINE>type = Match.Type.INSTALLABLE;<NEW_LINE>i = moreIndex;<NEW_LINE>} else if (compatibleIndex >= 0) {<NEW_LINE>type = Match.Type.COMPATIBLE;<NEW_LINE>i = compatibleIndex;<NEW_LINE>} else {<NEW_LINE>if (Character.isDigit(spec.charAt(0))) {<NEW_LINE>return Version.fromString(spec).match(Match.Type.COMPATIBLE);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Version.fromString(spec.substring(i + 1)).match(type);<NEW_LINE>} | eqIndex = spec.indexOf(EXACT_VERSION); |
1,585,390 | public AbstractTypeProgramInterface parse(AbstractPdb pdb, TaskMonitor monitor) throws IOException, PdbException, CancelledException {<NEW_LINE>AbstractTypeProgramInterface typeProgramInterface;<NEW_LINE>int versionNumberSize = AbstractTypeProgramInterface.getVersionNumberSize();<NEW_LINE>int streamNumber = getStreamNumber();<NEW_LINE>PdbByteReader reader = pdb.getReaderForStreamNumber(streamNumber, 0, versionNumberSize, monitor);<NEW_LINE>if (reader.getLimit() < versionNumberSize) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int versionNumber = AbstractTypeProgramInterface.deserializeVersionNumber(reader);<NEW_LINE>// TODO: we do not know where the line should be drawn for each of these<NEW_LINE>// AbstractTypeProgramInterface instantiations. Had a TI50_ID that was not an 800<NEW_LINE>// instead of a 500. Also believe that TI42_ID was seen to have 500. Rest is guess<NEW_LINE>// until we can validate with real data.<NEW_LINE>switch(versionNumber) {<NEW_LINE>case TI20_ID:<NEW_LINE>case TI40_ID:<NEW_LINE>case TI41_ID:<NEW_LINE>typeProgramInterface = new TypeProgramInterface200(pdb, getCategory(), streamNumber);<NEW_LINE>break;<NEW_LINE>case TI42_ID:<NEW_LINE>case TI50DEP_ID:<NEW_LINE>typeProgramInterface = new TypeProgramInterface500(pdb, getCategory(), streamNumber);<NEW_LINE>break;<NEW_LINE>case TI50_ID:<NEW_LINE>case TI70_ID:<NEW_LINE>case TI80_ID:<NEW_LINE>typeProgramInterface = new TypeProgramInterface800(<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new PdbException("Unknown TPI Version: " + versionNumber);<NEW_LINE>}<NEW_LINE>return typeProgramInterface;<NEW_LINE>} | pdb, getCategory(), streamNumber); |
484,255 | protected void installStrings(JFileChooser fc) {<NEW_LINE>super.installStrings(fc);<NEW_LINE>Locale l = fc.getLocale();<NEW_LINE>lookInLabelMnemonic = UIManager.getInt("FileChooser.lookInLabelMnemonic");<NEW_LINE>lookInLabelText = UIManager.getString("FileChooser.lookInLabelText", l);<NEW_LINE>saveInLabelText = UIManager.getString("FileChooser.saveInLabelText", l);<NEW_LINE>fileNameLabelMnemonic = UIManager.getInt("FileChooser.fileNameLabelMnemonic");<NEW_LINE>fileNameLabelText = UIManager.getString("FileChooser.fileNameLabelText", l);<NEW_LINE>filesOfTypeLabelMnemonic = UIManager.getInt("FileChooser.filesOfTypeLabelMnemonic");<NEW_LINE>filesOfTypeLabelText = UIManager.getString("FileChooser.filesOfTypeLabelText", l);<NEW_LINE>upFolderToolTipText = UIManager.getString("FileChooser.upFolderToolTipText", l);<NEW_LINE>if (null == upFolderToolTipText)<NEW_LINE>// NOI18N<NEW_LINE>upFolderToolTipText = NbBundle.getMessage(DirectoryChooserUI.class, "TLTP_UpFolder");<NEW_LINE>upFolderAccessibleName = UIManager.getString("FileChooser.upFolderAccessibleName", l);<NEW_LINE>if (null == upFolderAccessibleName)<NEW_LINE>// NOI18N<NEW_LINE>upFolderAccessibleName = NbBundle.<MASK><NEW_LINE>newFolderToolTipText = UIManager.getString("FileChooser.newFolderToolTipText", l);<NEW_LINE>if (null == newFolderToolTipText)<NEW_LINE>// NOI18N<NEW_LINE>newFolderToolTipText = NbBundle.getMessage(DirectoryChooserUI.class, "TLTP_NewFolder");<NEW_LINE>// NOI18N<NEW_LINE>newFolderAccessibleName = NbBundle.getMessage(DirectoryChooserUI.class, "ACN_NewFolder");<NEW_LINE>homeFolderTooltipText = UIManager.getString("FileChooser.homeFolderToolTipText", l);<NEW_LINE>if (null == homeFolderTooltipText)<NEW_LINE>// NOI18N<NEW_LINE>homeFolderTooltipText = NbBundle.getMessage(DirectoryChooserUI.class, "TLTP_HomeFolder");<NEW_LINE>// NOI18N<NEW_LINE>homeFolderAccessibleName = NbBundle.getMessage(DirectoryChooserUI.class, "ACN_HomeFolder");<NEW_LINE>} | getMessage(DirectoryChooserUI.class, "ACN_UpFolder"); |
409,947 | public Token apply(Credential credential) {<NEW_LINE>final String account = credential.getAccount();<NEW_LINE>final <MASK><NEW_LINE>if (StringUtils.isEmpty(account) || StringUtils.isEmpty(pwd)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Hashtable<String, String> env = new Hashtable<String, String>();<NEW_LINE>env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");<NEW_LINE>// LDAP server<NEW_LINE>env.put(Context.PROVIDER_URL, ldapUrl);<NEW_LINE>String userDn = userDnTplMatcher.replaceAll(account);<NEW_LINE>env.put(Context.SECURITY_PRINCIPAL, pwd);<NEW_LINE>env.put(Context.SECURITY_CREDENTIALS, pwd);<NEW_LINE>try {<NEW_LINE>InitialLdapContext context = new InitialLdapContext(env, null);<NEW_LINE>final String baseDn = context.getNameInNamespace();<NEW_LINE>if (userDn.endsWith(baseDn)) {<NEW_LINE>userDn = userDn.substring(0, userDn.length() - baseDn.length() - 1);<NEW_LINE>}<NEW_LINE>String displayName = null;<NEW_LINE>if (attrs != null) {<NEW_LINE>final Attributes attributes = context.getAttributes(userDn, attrs);<NEW_LINE>if (attributes.size() > 0) {<NEW_LINE>displayName = attributes.getAll().next().get().toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Token(account, displayName == null ? account : displayName);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Cat.logError(e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | String pwd = credential.getPassword(); |
1,270,461 | public Chunk readChunk(int x, int z) throws IOException {<NEW_LINE>int index = getChunkOffset(x, z);<NEW_LINE>if (index < 0 || index >= 4096) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>this.lastUsed = System.currentTimeMillis();<NEW_LINE>if (!this.isChunkGenerated(index)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Integer[] table = this.locationTable.get(index);<NEW_LINE>RandomAccessFile raf = this.getRandomAccessFile();<NEW_LINE>raf.seek(table[0] << 12);<NEW_LINE><MASK><NEW_LINE>byte compression = raf.readByte();<NEW_LINE>if (length <= 0 || length >= MAX_SECTOR_LENGTH) {<NEW_LINE>if (length >= MAX_SECTOR_LENGTH) {<NEW_LINE>table[0] = ++this.lastSector;<NEW_LINE>table[1] = 1;<NEW_LINE>this.locationTable.put(index, table);<NEW_LINE>MainLogger.getLogger().error("Corrupted chunk header detected");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (length > (table[1] << 12)) {<NEW_LINE>MainLogger.getLogger().error("Corrupted bigger chunk detected");<NEW_LINE>table[1] = length >> 12;<NEW_LINE>this.locationTable.put(index, table);<NEW_LINE>this.writeLocationIndex(index);<NEW_LINE>} else if (compression != COMPRESSION_ZLIB && compression != COMPRESSION_GZIP) {<NEW_LINE>MainLogger.getLogger().error("Invalid compression type");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>byte[] data = new byte[length - 1];<NEW_LINE>raf.readFully(data);<NEW_LINE>Chunk chunk = this.unserializeChunk(data);<NEW_LINE>if (chunk != null) {<NEW_LINE>return chunk;<NEW_LINE>} else {<NEW_LINE>MainLogger.getLogger().error("Corrupted chunk detected");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} catch (EOFException e) {<NEW_LINE>MainLogger.getLogger().error("Your world is corrupt, because some code is bad and corrupted it. oops. ");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | int length = raf.readInt(); |
1,448,091 | public static BeanComponentDefinition parseInnerHandlerDefinition(Element element, ParserContext parserContext) {<NEW_LINE>// parses out the inner bean definition for concrete implementation if defined<NEW_LINE>List<Element> childElements = DomUtils.getChildElementsByTagName(element, "bean");<NEW_LINE>BeanComponentDefinition innerComponentDefinition = null;<NEW_LINE>if (childElements.size() == 1) {<NEW_LINE>Element beanElement = childElements.get(0);<NEW_LINE><MASK><NEW_LINE>BeanDefinitionHolder bdHolder = delegate.parseBeanDefinitionElement(beanElement);<NEW_LINE>// NOSONAR never null<NEW_LINE>bdHolder = delegate.decorateBeanDefinitionIfRequired(beanElement, bdHolder);<NEW_LINE>BeanDefinition inDef = bdHolder.getBeanDefinition();<NEW_LINE>innerComponentDefinition = new BeanComponentDefinition(inDef, bdHolder.getBeanName());<NEW_LINE>}<NEW_LINE>String ref = element.getAttribute(REF_ATTRIBUTE);<NEW_LINE>if (StringUtils.hasText(ref) && innerComponentDefinition != null) {<NEW_LINE>parserContext.getReaderContext().error("Ambiguous definition. Inner bean " + (innerComponentDefinition.getBeanDefinition().getBeanClassName()) + " declaration and \"ref\" " + ref + " are not allowed together on element " + IntegrationNamespaceUtils.createElementDescription(element) + ".", parserContext.extractSource(element));<NEW_LINE>}<NEW_LINE>return innerComponentDefinition;<NEW_LINE>} | BeanDefinitionParserDelegate delegate = parserContext.getDelegate(); |
810,504 | final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<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, "Backup Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
405,562 | protected void addNewEntry(ArrayList<FileSystem.Classpath> paths, String currentClasspathName, ArrayList<String> currentRuleSpecs, String customEncoding, String destPath, boolean isSourceOnly, boolean rejectDestinationPathOnJars) {<NEW_LINE>int rulesSpecsSize = currentRuleSpecs.size();<NEW_LINE>AccessRuleSet accessRuleSet = null;<NEW_LINE>if (rulesSpecsSize != 0) {<NEW_LINE>AccessRule[] accessRules = new AccessRule[currentRuleSpecs.size()];<NEW_LINE>boolean rulesOK = true;<NEW_LINE>Iterator<String<MASK><NEW_LINE>int j = 0;<NEW_LINE>while (i.hasNext()) {<NEW_LINE>String ruleSpec = i.next();<NEW_LINE>char key = ruleSpec.charAt(0);<NEW_LINE>String pattern = ruleSpec.substring(1);<NEW_LINE>if (pattern.length() > 0) {<NEW_LINE>switch(key) {<NEW_LINE>case '+':<NEW_LINE>accessRules[j++] = new AccessRule(pattern.toCharArray(), 0);<NEW_LINE>break;<NEW_LINE>case '~':<NEW_LINE>accessRules[j++] = new AccessRule(pattern.toCharArray(), IProblem.DiscouragedReference);<NEW_LINE>break;<NEW_LINE>case '-':<NEW_LINE>accessRules[j++] = new AccessRule(pattern.toCharArray(), IProblem.ForbiddenReference);<NEW_LINE>break;<NEW_LINE>case '?':<NEW_LINE>accessRules[j++] = new AccessRule(pattern.toCharArray(), IProblem.ForbiddenReference, true);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>rulesOK = false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>rulesOK = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (rulesOK) {<NEW_LINE>accessRuleSet = new AccessRuleSet(accessRules, AccessRestriction.COMMAND_LINE, currentClasspathName);<NEW_LINE>} else {<NEW_LINE>if (currentClasspathName.length() != 0) {<NEW_LINE>// we go on anyway<NEW_LINE>// $NON-NLS-1$<NEW_LINE>addPendingErrors(this.bind("configure.incorrectClasspath", currentClasspathName));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (NONE.equals(destPath)) {<NEW_LINE>// keep == comparison valid<NEW_LINE>destPath = NONE;<NEW_LINE>}<NEW_LINE>if (rejectDestinationPathOnJars && destPath != null && Util.archiveFormat(currentClasspathName) > -1) {<NEW_LINE>throw new // $NON-NLS-1$<NEW_LINE>IllegalArgumentException(// $NON-NLS-1$<NEW_LINE>this.// $NON-NLS-1$<NEW_LINE>bind("configure.unexpectedDestinationPathEntryFile", currentClasspathName));<NEW_LINE>}<NEW_LINE>FileSystem.Classpath currentClasspath = FileSystem.getClasspath(currentClasspathName, customEncoding, isSourceOnly, accessRuleSet, destPath, this.options, this.releaseVersion);<NEW_LINE>if (currentClasspath != null) {<NEW_LINE>paths.add(currentClasspath);<NEW_LINE>} else if (currentClasspathName.length() != 0) {<NEW_LINE>// we go on anyway<NEW_LINE>// $NON-NLS-1$<NEW_LINE>addPendingErrors(this.bind("configure.incorrectClasspath", currentClasspathName));<NEW_LINE>}<NEW_LINE>} | > i = currentRuleSpecs.iterator(); |
941,669 | public static DescribeFabricConsortiumOrderersResponse unmarshall(DescribeFabricConsortiumOrderersResponse describeFabricConsortiumOrderersResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeFabricConsortiumOrderersResponse.setRequestId(_ctx.stringValue("DescribeFabricConsortiumOrderersResponse.RequestId"));<NEW_LINE>describeFabricConsortiumOrderersResponse.setSuccess(_ctx.booleanValue("DescribeFabricConsortiumOrderersResponse.Success"));<NEW_LINE>describeFabricConsortiumOrderersResponse.setErrorCode(_ctx.integerValue("DescribeFabricConsortiumOrderersResponse.ErrorCode"));<NEW_LINE>List<Orderer> result = new ArrayList<Orderer>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeFabricConsortiumOrderersResponse.Result.Length"); i++) {<NEW_LINE>Orderer orderer = new Orderer();<NEW_LINE>orderer.setDomain(_ctx.stringValue("DescribeFabricConsortiumOrderersResponse.Result[" + i + "].Domain"));<NEW_LINE>orderer.setUpdateTime(_ctx.stringValue<MASK><NEW_LINE>orderer.setOrdererName(_ctx.stringValue("DescribeFabricConsortiumOrderersResponse.Result[" + i + "].OrdererName"));<NEW_LINE>orderer.setCreateTime(_ctx.stringValue("DescribeFabricConsortiumOrderersResponse.Result[" + i + "].CreateTime"));<NEW_LINE>orderer.setPort(_ctx.integerValue("DescribeFabricConsortiumOrderersResponse.Result[" + i + "].Port"));<NEW_LINE>orderer.setInstanceType(_ctx.stringValue("DescribeFabricConsortiumOrderersResponse.Result[" + i + "].InstanceType"));<NEW_LINE>result.add(orderer);<NEW_LINE>}<NEW_LINE>describeFabricConsortiumOrderersResponse.setResult(result);<NEW_LINE>return describeFabricConsortiumOrderersResponse;<NEW_LINE>} | ("DescribeFabricConsortiumOrderersResponse.Result[" + i + "].UpdateTime")); |
816,750 | public List<DataPointGroup> group(List<GroupBy> groupBys, List<DataPointGroup> dataPointGroupList) throws IOException {<NEW_LINE>if (groupBys.size() < 1)<NEW_LINE>return dataPointGroupList;<NEW_LINE>List<DataPointGroup> dataPointGroups <MASK><NEW_LINE>for (DataPointGroup dataPointGroup : dataPointGroupList) {<NEW_LINE>Map<List<Integer>, Group> groupIdsToGroup = new LinkedHashMap<List<Integer>, Group>();<NEW_LINE>Map<String, String> tags = getTags(dataPointGroup);<NEW_LINE>while (dataPointGroup.hasNext()) {<NEW_LINE>DataPoint dataPoint = dataPointGroup.next();<NEW_LINE>List<Integer> groupIds = new ArrayList<Integer>();<NEW_LINE>List<GroupByResult> results = new ArrayList<GroupByResult>();<NEW_LINE>for (GroupBy groupBy : groupBys) {<NEW_LINE>int groupId = groupBy.getGroupId(dataPoint, tags);<NEW_LINE>groupIds.add(groupId);<NEW_LINE>results.add(groupBy.getGroupByResult(groupId));<NEW_LINE>}<NEW_LINE>// add to group<NEW_LINE>Group group = getGroup(groupIdsToGroup, dataPointGroup, groupIds, results);<NEW_LINE>group.addDataPoint(dataPoint);<NEW_LINE>}<NEW_LINE>for (Group group : groupIdsToGroup.values()) {<NEW_LINE>if (!dataPointGroup.getGroupByResult().isEmpty()) {<NEW_LINE>group.addGroupByResults(dataPointGroup.getGroupByResult());<NEW_LINE>}<NEW_LINE>dataPointGroups.add(group.getDataPointGroup());<NEW_LINE>}<NEW_LINE>dataPointGroup.close();<NEW_LINE>}<NEW_LINE>return dataPointGroups;<NEW_LINE>} | = new ArrayList<DataPointGroup>(); |
218,087 | public static void onReceive(TermuxApiReceiver apiReceiver, final Context context, Intent intent) {<NEW_LINE>Logger.logDebug(LOG_TAG, "onReceive");<NEW_LINE>final int offset = intent.getIntExtra("offset", 0);<NEW_LINE>final int limit = intent.getIntExtra("limit", 10);<NEW_LINE>final String number = intent.hasExtra("from") ? <MASK><NEW_LINE>final boolean conversation_list = intent.getBooleanExtra("conversation-list", false);<NEW_LINE>final Uri contentURI = conversation_list ? typeToContentURI(0) : typeToContentURI(number == null || number.isEmpty() ? intent.getIntExtra("type", TextBasedSmsColumns.MESSAGE_TYPE_INBOX) : 0);<NEW_LINE>ResultReturner.returnData(apiReceiver, intent, new ResultJsonWriter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void writeJson(JsonWriter out) throws Exception {<NEW_LINE>if (conversation_list)<NEW_LINE>getConversations(context, out, offset, limit);<NEW_LINE>else<NEW_LINE>getAllSms(context, out, offset, limit, number, contentURI);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | intent.getStringExtra("from") : ""; |
1,664,986 | private int computeGeneralPoints(DMatrix leftPoint, DMatrix rightView, double[] input, int observationIndex, int viewIndex, SceneStructureCommon.Camera camera, int cameraParamStartIndex) {<NEW_LINE>SceneObservations.View obsView = observations.views.get(viewIndex);<NEW_LINE>SceneStructureMetric.View strView = structure.views.get(viewIndex);<NEW_LINE>for (int i = 0; i < obsView.size(); i++) {<NEW_LINE>int featureIndex = obsView.point.get(i);<NEW_LINE>int columnOfPointInJac = featureIndex * lengthPoint;<NEW_LINE>if (structure.isHomogenous()) {<NEW_LINE>worldPt4.x = input[columnOfPointInJac];<NEW_LINE>worldPt4.y = input[columnOfPointInJac + 1];<NEW_LINE>worldPt4.z = input[columnOfPointInJac + 2];<NEW_LINE>worldPt4.w = input[columnOfPointInJac + 3];<NEW_LINE>SePointOps_F64.transformV(world_to_view, worldPt4, cameraPt);<NEW_LINE>} else {<NEW_LINE>worldPt3.x = input[columnOfPointInJac];<NEW_LINE>worldPt3.y = input[columnOfPointInJac + 1];<NEW_LINE>worldPt3.z = input[columnOfPointInJac + 2];<NEW_LINE>SePointOps_F64.<MASK><NEW_LINE>}<NEW_LINE>jacRowX = observationIndex * 2;<NEW_LINE>jacRowY = jacRowX + 1;<NEW_LINE>// ============ Partial of camera parameters<NEW_LINE>if (!camera.known) {<NEW_LINE>int N = camera.model.getIntrinsicCount();<NEW_LINE>camera.model.jacobian(cameraPt.x, cameraPt.y, cameraPt.z, pointGradX, pointGradY, true, calibGradX, calibGradY);<NEW_LINE>int location = indexLastMotion - indexFirstMotion + cameraParamStartIndex;<NEW_LINE>for (int j = 0; j < N; j++) {<NEW_LINE>set(rightView, jacRowX, location + j, calibGradX[j]);<NEW_LINE>set(rightView, jacRowY, location + j, calibGradY[j]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>camera.model.jacobian(cameraPt.x, cameraPt.y, cameraPt.z, pointGradX, pointGradY, false, null, null);<NEW_LINE>}<NEW_LINE>// ============ Partial of worldPt<NEW_LINE>if (structure.isHomogenous()) {<NEW_LINE>partialPointH(leftPoint, rightView, strView, columnOfPointInJac);<NEW_LINE>} else {<NEW_LINE>partialPoint3(leftPoint, rightView, strView, columnOfPointInJac);<NEW_LINE>}<NEW_LINE>observationIndex++;<NEW_LINE>}<NEW_LINE>return observationIndex;<NEW_LINE>} | transform(world_to_view, worldPt3, cameraPt); |
106,149 | protected boolean repack(boolean isAutoChange, boolean notify) {<NEW_LINE>lock.acquire();<NEW_LINE>try {<NEW_LINE>checkDeleted();<NEW_LINE>int oldLength = unionLength;<NEW_LINE>// lazy upgrade for v5 adapter<NEW_LINE>boolean storeAlignment = (unionAlignment <= 0);<NEW_LINE>int oldAlignment = getComputedAlignment(false);<NEW_LINE>unionLength = 0;<NEW_LINE>for (DataTypeComponent dtc : components) {<NEW_LINE>// TODO: compute alignment in this loop<NEW_LINE>int length = dtc.getLength();<NEW_LINE>if (isPackingEnabled() && dtc.isBitFieldComponent()) {<NEW_LINE>// revise length to reflect compiler bitfield allocation rules<NEW_LINE>length = getBitFieldAllocation((BitFieldDataType) dtc.getDataType());<NEW_LINE>}<NEW_LINE>unionLength = Math.max(length, unionLength);<NEW_LINE>}<NEW_LINE>// force recompute of unionAlignment<NEW_LINE>computedAlignment = -1;<NEW_LINE>unionAlignment = -1;<NEW_LINE>unionAlignment = getComputedAlignment(false);<NEW_LINE>if (isPackingEnabled()) {<NEW_LINE>unionLength = DataOrganizationImpl.getAlignedOffset(unionAlignment, unionLength);<NEW_LINE>}<NEW_LINE>boolean changed = (oldLength != <MASK><NEW_LINE>if (changed || storeAlignment) {<NEW_LINE>record.setIntValue(CompositeDBAdapter.COMPOSITE_LENGTH_COL, unionLength);<NEW_LINE>record.setIntValue(CompositeDBAdapter.COMPOSITE_ALIGNMENT_COL, unionAlignment);<NEW_LINE>try {<NEW_LINE>compositeAdapter.updateRecord(record, changed && !isAutoChange);<NEW_LINE>} catch (IOException e) {<NEW_LINE>dataMgr.dbError(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (changed & notify) {<NEW_LINE>if (oldLength != unionLength) {<NEW_LINE>notifySizeChanged(isAutoChange);<NEW_LINE>} else if (oldAlignment != unionAlignment) {<NEW_LINE>notifyAlignmentChanged(isAutoChange);<NEW_LINE>} else {<NEW_LINE>dataMgr.dataTypeChanged(this, isAutoChange);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return changed;<NEW_LINE>} finally {<NEW_LINE>lock.release();<NEW_LINE>}<NEW_LINE>} | unionLength) || (oldAlignment != unionAlignment); |
1,023,953 | public static CreateInstanceExResponse unmarshall(CreateInstanceExResponse createInstanceExResponse, UnmarshallerContext context) {<NEW_LINE>createInstanceExResponse.setRequestId(context.stringValue("CreateInstanceExResponse.RequestId"));<NEW_LINE>createInstanceExResponse.setSuccess(context.booleanValue("CreateInstanceExResponse.Success"));<NEW_LINE>createInstanceExResponse.setCode(context.stringValue("CreateInstanceExResponse.Code"));<NEW_LINE>createInstanceExResponse.setMessage(context.stringValue("CreateInstanceExResponse.Message"));<NEW_LINE>createInstanceExResponse.setHttpStatusCode(context.integerValue("CreateInstanceExResponse.HttpStatusCode"));<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setInstanceId(context.stringValue("CreateInstanceExResponse.Instance.InstanceId"));<NEW_LINE>instance.setInstanceName(context.stringValue("CreateInstanceExResponse.Instance.InstanceName"));<NEW_LINE>instance.setInstanceDescription(context.stringValue("CreateInstanceExResponse.Instance.InstanceDescription"));<NEW_LINE>instance.setDomainName(context.stringValue("CreateInstanceExResponse.Instance.DomainName"));<NEW_LINE>instance.setConsoleUrl(context.stringValue("CreateInstanceExResponse.Instance.ConsoleUrl"));<NEW_LINE>instance.setStorageBucket(context.stringValue("CreateInstanceExResponse.Instance.StorageBucket"));<NEW_LINE>instance.setStorageMaxDays(context.integerValue("CreateInstanceExResponse.Instance.StorageMaxDays"));<NEW_LINE>instance.setStorageMaxSize(context.integerValue("CreateInstanceExResponse.Instance.StorageMaxSize"));<NEW_LINE>instance.setMaxOnlineAgents(context.integerValue("CreateInstanceExResponse.Instance.MaxOnlineAgents"));<NEW_LINE>instance.setTenantId(context.stringValue("CreateInstanceExResponse.Instance.TenantId"));<NEW_LINE>instance.setDirectoryId(context.stringValue("CreateInstanceExResponse.Instance.DirectoryId"));<NEW_LINE>instance.setStatus(context.stringValue("CreateInstanceExResponse.Instance.Status"));<NEW_LINE>instance.setCreatedTime<MASK><NEW_LINE>instance.setOwner(context.stringValue("CreateInstanceExResponse.Instance.Owner"));<NEW_LINE>List<User> admin = new ArrayList<User>();<NEW_LINE>for (int i = 0; i < context.lengthValue("CreateInstanceExResponse.Instance.Admin.Length"); i++) {<NEW_LINE>User user = new User();<NEW_LINE>user.setUserId(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].UserId"));<NEW_LINE>user.setRamId(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].RamId"));<NEW_LINE>user.setInstanceId(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].InstanceId"));<NEW_LINE>Detail detail = new Detail();<NEW_LINE>detail.setLoginName(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].Detail.LoginName"));<NEW_LINE>detail.setDisplayName(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].Detail.DisplayName"));<NEW_LINE>detail.setPhone(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].Detail.Phone"));<NEW_LINE>detail.setEmail(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].Detail.Email"));<NEW_LINE>detail.setDepartment(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].Detail.Department"));<NEW_LINE>user.setDetail(detail);<NEW_LINE>admin.add(user);<NEW_LINE>}<NEW_LINE>instance.setAdmin(admin);<NEW_LINE>List<PhoneNumber> phoneNumbers = new ArrayList<PhoneNumber>();<NEW_LINE>for (int i = 0; i < context.lengthValue("CreateInstanceExResponse.Instance.PhoneNumbers.Length"); i++) {<NEW_LINE>PhoneNumber phoneNumber = new PhoneNumber();<NEW_LINE>phoneNumber.setPhoneNumberId(context.stringValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].PhoneNumberId"));<NEW_LINE>phoneNumber.setInstanceId(context.stringValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].InstanceId"));<NEW_LINE>phoneNumber.setNumber(context.stringValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].Number"));<NEW_LINE>phoneNumber.setPhoneNumberDescription(context.stringValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].PhoneNumberDescription"));<NEW_LINE>phoneNumber.setTestOnly(context.booleanValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].TestOnly"));<NEW_LINE>phoneNumber.setRemainingTime(context.integerValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].RemainingTime"));<NEW_LINE>phoneNumber.setAllowOutbound(context.booleanValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].AllowOutbound"));<NEW_LINE>phoneNumber.setUsage(context.stringValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].Usage"));<NEW_LINE>phoneNumber.setTrunks(context.integerValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].Trunks"));<NEW_LINE>phoneNumbers.add(phoneNumber);<NEW_LINE>}<NEW_LINE>instance.setPhoneNumbers(phoneNumbers);<NEW_LINE>createInstanceExResponse.setInstance(instance);<NEW_LINE>return createInstanceExResponse;<NEW_LINE>} | (context.longValue("CreateInstanceExResponse.Instance.CreatedTime")); |
1,060,069 | public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {<NEW_LINE>if (oldViews.size() <= oldItemPosition || newViews.size() <= newItemPosition) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final V oldView = oldViews.get(oldItemPosition);<NEW_LINE>final V newView = newViews.get(newItemPosition);<NEW_LINE>if (oldView == null || newView == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final KrollDict oldProperties = oldView.getProperties();<NEW_LINE>final <MASK><NEW_LINE>if (oldProperties == null || newProperties == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Calculate content specific hashes.<NEW_LINE>// Compare properties and children.<NEW_LINE>final long oldHash = oldProperties.hashCode() ^ Arrays.hashCode(oldView.getChildren());<NEW_LINE>final long newHash = newProperties.hashCode() ^ Arrays.hashCode(newView.getChildren());<NEW_LINE>return oldHash == newHash;<NEW_LINE>} | KrollDict newProperties = newView.getProperties(); |
1,278,150 | public void onSwiped(RecyclerView.ViewHolder viewHolder, final int direction) {<NEW_LINE>final <MASK><NEW_LINE>Object item = adapter.getItem(pos);<NEW_LINE>if (item instanceof MapMarker) {<NEW_LINE>final MapMarker marker = (MapMarker) item;<NEW_LINE>int snackbarStringRes;<NEW_LINE>if (direction == ItemTouchHelper.RIGHT) {<NEW_LINE>app.getMapMarkersHelper().moveMapMarkerToHistory((MapMarker) item);<NEW_LINE>snackbarStringRes = R.string.marker_moved_to_history;<NEW_LINE>} else {<NEW_LINE>app.getMapMarkersHelper().removeMarker((MapMarker) item);<NEW_LINE>snackbarStringRes = R.string.item_removed;<NEW_LINE>}<NEW_LINE>updateAdapter();<NEW_LINE>snackbar = Snackbar.make(viewHolder.itemView, snackbarStringRes, Snackbar.LENGTH_LONG).setAction(R.string.shared_string_undo, new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>if (direction == ItemTouchHelper.RIGHT) {<NEW_LINE>app.getMapMarkersHelper().restoreMarkerFromHistory(marker, 0);<NEW_LINE>} else {<NEW_LINE>app.getMapMarkersHelper().addMarker(marker);<NEW_LINE>}<NEW_LINE>updateAdapter();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>UiUtilities.setupSnackbar(snackbar, night);<NEW_LINE>snackbar.show();<NEW_LINE>}<NEW_LINE>} | int pos = viewHolder.getAdapterPosition(); |
1,131,090 | static TypeSpecDataHolder generateBindDynamicProp(SpecModel specModel) {<NEW_LINE>TypeSpecDataHolder.Builder typeSpecDataHolder = TypeSpecDataHolder.newBuilder();<NEW_LINE>final List<PropModel> dynamicProps = SpecModelUtils.getDynamicProps(specModel);<NEW_LINE>if (dynamicProps.isEmpty()) {<NEW_LINE>return typeSpecDataHolder.build();<NEW_LINE>}<NEW_LINE>final MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("bindDynamicProp").addModifiers(Modifier.PROTECTED).addAnnotation(Override.class).returns(ClassName.VOID).addParameter(ClassName.INT, "dynamicPropIndex").addParameter(ClassName.OBJECT, "value").addParameter(ClassName.OBJECT, "mountedContent");<NEW_LINE>final String sourceDelegateAccessor = SpecModelUtils.getSpecAccessor(specModel);<NEW_LINE>methodBuilder.beginControlFlow("switch (dynamicPropIndex)");<NEW_LINE>for (int index = 0, size = dynamicProps.size(); index < size; index++) {<NEW_LINE>final PropModel <MASK><NEW_LINE>final SpecMethodModel<BindDynamicValueMethod, Void> delegate = SpecModelUtils.getBindDelegateMethodForDynamicProp(specModel, prop);<NEW_LINE>methodBuilder.addCode("case $L:\n", index);<NEW_LINE>methodBuilder.addStatement("$>$L.$L(($T) mountedContent, retrieveValue($L))", sourceDelegateAccessor, delegate.name, delegate.methodParams.get(0).getTypeName(), prop.getName());<NEW_LINE>methodBuilder.addStatement("break$<");<NEW_LINE>}<NEW_LINE>methodBuilder.addCode("default:\n");<NEW_LINE>methodBuilder.addStatement("$>break$<");<NEW_LINE>methodBuilder.endControlFlow();<NEW_LINE>typeSpecDataHolder.addMethod(methodBuilder.build());<NEW_LINE>return typeSpecDataHolder.build();<NEW_LINE>} | prop = dynamicProps.get(index); |
967,503 | private void changeJobUpdateStatus(MutableStoreProvider storeProvider, IJobUpdateKey key, JobUpdateEvent proposedEvent, boolean record) throws UpdateStateException {<NEW_LINE>JobUpdateStore.Mutable updateStore = storeProvider.getJobUpdateStore();<NEW_LINE>JobUpdateStatus status = proposedEvent.getStatus();<NEW_LINE>LOG.<MASK><NEW_LINE>if (record) {<NEW_LINE>updateStore.saveJobUpdateEvent(key, IJobUpdateEvent.build(proposedEvent.setTimestampMs(clock.nowMillis()).setStatus(status)));<NEW_LINE>jobUpdateEventStats.getUnchecked(status).incrementAndGet();<NEW_LINE>}<NEW_LINE>if (JobUpdateStore.TERMINAL_STATES.contains(status)) {<NEW_LINE>pulseHandler.remove(key);<NEW_LINE>} else {<NEW_LINE>pulseHandler.updatePulseStatus(key, status);<NEW_LINE>}<NEW_LINE>MonitorAction action = JobUpdateStateMachine.getActionForStatus(status);<NEW_LINE>IJobKey job = key.getJob();<NEW_LINE>if (action == STOP_WATCHING) {<NEW_LINE>updates.remove(job);<NEW_LINE>} else if (action == ROLL_FORWARD || action == ROLL_BACK) {<NEW_LINE>if (action == ROLL_BACK) {<NEW_LINE>updates.remove(job);<NEW_LINE>} else {<NEW_LINE>checkState(!updates.containsKey(job), "Updater already exists for %s", job);<NEW_LINE>}<NEW_LINE>IJobUpdate jobUpdate = updateStore.fetchJobUpdate(key).get().getUpdate();<NEW_LINE>UpdateFactory.Update update;<NEW_LINE>try {<NEW_LINE>update = updateFactory.newUpdate(jobUpdate.getInstructions(), action == ROLL_FORWARD);<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>LOG.warn("Uncaught exception: " + e, e);<NEW_LINE>changeJobUpdateStatus(storeProvider, key, newEvent(ERROR).setMessage("Internal scheduler error: " + e.getMessage()), true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>updates.put(job, update);<NEW_LINE>evaluateUpdater(storeProvider, update, jobUpdate.getSummary(), ImmutableMap.of());<NEW_LINE>}<NEW_LINE>} | info("Update {} is now in state {}", key, status); |
133,374 | public void sync(List<File> installed) {<NEW_LINE>List<File> notSync = new ArrayList<>();<NEW_LINE>File[] paths = new File[] { new File(application, "lib"), new File(application, "modules") };<NEW_LINE>for (File path : paths) {<NEW_LINE>if (path.exists()) {<NEW_LINE>for (File f : path.listFiles()) {<NEW_LINE>if (!installed.contains(f)) {<NEW_LINE>notSync.add(f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean autoSync = System.getProperty("nosync") == null;<NEW_LINE>if (autoSync && !notSync.isEmpty()) {<NEW_LINE>System.out.println("~");<NEW_LINE>System.out.println("~ Synchronizing, deleting unknown dependencies");<NEW_LINE>System.out.println("~");<NEW_LINE>for (File f : notSync) {<NEW_LINE>Files.delete(f);<NEW_LINE>System.out.println("~ \tDeleted: " + f.getAbsolutePath());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} else if (!notSync.isEmpty()) {<NEW_LINE>System.out.println("~");<NEW_LINE>System.out.println("~ *****************************************************************************");<NEW_LINE>System.out.println("~ WARNING: Your lib/ and modules/ directories are not synced with current dependencies (don't use --nosync to automatically delete them)");<NEW_LINE>System.out.println("~");<NEW_LINE>for (File f : notSync) {<NEW_LINE>System.out.println("~ \tUnknown: " + f.getAbsolutePath());<NEW_LINE>}<NEW_LINE>System.out.println("~ *****************************************************************************");<NEW_LINE>}<NEW_LINE>} | System.out.println("~"); |
199,448 | public static ListClientSdksResponse unmarshall(ListClientSdksResponse listClientSdksResponse, UnmarshallerContext _ctx) {<NEW_LINE>listClientSdksResponse.setRequestId(_ctx.stringValue("ListClientSdksResponse.RequestId"));<NEW_LINE>List<Result> clientSdks = new ArrayList<Result>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListClientSdksResponse.ClientSdks.Length"); i++) {<NEW_LINE>Result result = new Result();<NEW_LINE>result.setId(_ctx.longValue("ListClientSdksResponse.ClientSdks[" + i + "].Id"));<NEW_LINE>result.setGmtCreate(_ctx.longValue("ListClientSdksResponse.ClientSdks[" + i + "].GmtCreate"));<NEW_LINE>result.setGmtModified(_ctx.longValue("ListClientSdksResponse.ClientSdks[" + i + "].GmtModified"));<NEW_LINE>result.setName(_ctx.stringValue("ListClientSdksResponse.ClientSdks[" + i + "].Name"));<NEW_LINE>result.setPkgName(_ctx.stringValue<MASK><NEW_LINE>result.setPkgType(_ctx.integerValue("ListClientSdksResponse.ClientSdks[" + i + "].PkgType"));<NEW_LINE>result.setOsType(_ctx.integerValue("ListClientSdksResponse.ClientSdks[" + i + "].OsType"));<NEW_LINE>clientSdks.add(result);<NEW_LINE>}<NEW_LINE>listClientSdksResponse.setClientSdks(clientSdks);<NEW_LINE>return listClientSdksResponse;<NEW_LINE>} | ("ListClientSdksResponse.ClientSdks[" + i + "].PkgName")); |
795,506 | public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>getSupportActionBar().setDisplayHomeAsUpEnabled(true);<NEW_LINE>// Load the raw preferences to show in this screen<NEW_LINE>init(R.xml.pref_seedbox_dediseedbox, SeedboxProvider.Dediseedbox.getSettings().getMaxSeedboxOrder(<MASK><NEW_LINE>initTextPreference("seedbox_dediseedbox_name");<NEW_LINE>initTextPreference("seedbox_dediseedbox_server");<NEW_LINE>initTextPreference("seedbox_dediseedbox_user");<NEW_LINE>initTextPreference("seedbox_dediseedbox_pass");<NEW_LINE>initBooleanPreference("seedbox_dediseedbox_alarmfinished", true);<NEW_LINE>initBooleanPreference("seedbox_dediseedbox_alarmnew", true);<NEW_LINE>excludeFilter = initTextPreference("seedbox_dediseedbox_alarmexclude");<NEW_LINE>includeFilter = initTextPreference("seedbox_dediseedbox_alarminclude");<NEW_LINE>} | PreferenceManager.getDefaultSharedPreferences(this))); |
1,185,599 | protected Message<?> doReceive(Long timeout) {<NEW_LINE>ChannelInterceptorList interceptorList = getIChannelInterceptorList();<NEW_LINE>Deque<ChannelInterceptor> interceptorStack = null;<NEW_LINE>AtomicBoolean counted = new AtomicBoolean();<NEW_LINE>boolean traceEnabled = isLoggingEnabled() && logger.isTraceEnabled();<NEW_LINE>try {<NEW_LINE>if (traceEnabled) {<NEW_LINE>logger.trace("preReceive on channel '" + this + "'");<NEW_LINE>}<NEW_LINE>if (interceptorList.getInterceptors().size() > 0) {<NEW_LINE>interceptorStack = new ArrayDeque<>();<NEW_LINE>if (!interceptorList.preReceive(this, interceptorStack)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Object object = performReceive(timeout);<NEW_LINE>Message<?> message = <MASK><NEW_LINE>if (message != null) {<NEW_LINE>message = interceptorList.postReceive(message, this);<NEW_LINE>}<NEW_LINE>interceptorList.afterReceiveCompletion(message, this, null, interceptorStack);<NEW_LINE>return message;<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>if (!counted.get()) {<NEW_LINE>incrementReceiveErrorCounter(ex);<NEW_LINE>}<NEW_LINE>interceptorList.afterReceiveCompletion(null, this, ex, interceptorStack);<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>} | buildMessageFromResult(object, traceEnabled, counted); |
283,998 | public void onCreate() {<NEW_LINE>super.onCreate();<NEW_LINE>setInstance(this);<NEW_LINE>Timber.i("Initializing %s", R.string.app_name);<NEW_LINE>// Init datetime<NEW_LINE>AndroidThreeTen.init(this);<NEW_LINE>// Timber<NEW_LINE>if (BuildConfig.DEBUG)<NEW_LINE>Timber.plant<MASK><NEW_LINE>Timber.plant(new CrashlyticsTree());<NEW_LINE>// Prefs<NEW_LINE>Preferences.init(this);<NEW_LINE>Preferences.performHousekeeping();<NEW_LINE>// Init version number<NEW_LINE>if (0 == Preferences.getLastKnownAppVersionCode())<NEW_LINE>Preferences.setLastKnownAppVersionCode(BuildConfig.VERSION_CODE);<NEW_LINE>// Firebase<NEW_LINE>boolean isAnalyticsEnabled = Preferences.isAnalyticsEnabled();<NEW_LINE>FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(isAnalyticsEnabled);<NEW_LINE>// Make sure the app restarts with the splash screen in case of any unhandled issue<NEW_LINE>Thread.setDefaultUncaughtExceptionHandler(new EmergencyRestartHandler(this, SplashActivity.class));<NEW_LINE>// Plug the lifecycle listener to handle locking<NEW_LINE>ProcessLifecycleOwner.get().getLifecycle().addObserver(new LifeCycleListener());<NEW_LINE>// Set RxJava's default error handler for unprocessed network and IO errors<NEW_LINE>RxJavaPlugins.setErrorHandler(e -> {<NEW_LINE>if (e instanceof UndeliverableException) {<NEW_LINE>e = e.getCause();<NEW_LINE>}<NEW_LINE>if (e instanceof IOException) {<NEW_LINE>// fine, irrelevant network problem or API that throws on cancellation<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (e instanceof InterruptedException) {<NEW_LINE>// fine, some blocking code was interrupted by a dispose call<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Timber.w(e, "Undeliverable exception received, not sure what to do");<NEW_LINE>});<NEW_LINE>// Init user agents (must be done here as some users seem not to complete AppStartup properly)<NEW_LINE>Timber.i("Init user agents : start");<NEW_LINE>HttpHelper.initUserAgents(this);<NEW_LINE>Timber.i("Init user agents : done");<NEW_LINE>} | (new Timber.DebugTree()); |
1,574,076 | private static File fileImpl(String cache, int[] len, long moduleJARs) {<NEW_LINE>File cacheFile = new File(Places.getCacheDirectory(), cache);<NEW_LINE><MASK><NEW_LINE>if (last <= 0) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.FINE, "Cache does not exist when asking for {0}", cache);<NEW_LINE>cacheFile = findFallbackCache(cache);<NEW_LINE>if (cacheFile == null || (last = cacheFile.lastModified()) <= 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>LOG.log(Level.FINE, "Found fallback cache at {0}", cacheFile);<NEW_LINE>}<NEW_LINE>if (moduleJARs > last) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.FINE, "Timestamp does not pass when asking for {0}. Newest file {1}", new Object[] { cache, moduleNewestFile });<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>long longLen = cacheFile.length();<NEW_LINE>if (longLen > Integer.MAX_VALUE) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.WARNING, "Cache file is too big: {0} bytes for {1}", new Object[] { longLen, cacheFile });<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (len != null) {<NEW_LINE>len[0] = (int) longLen;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.FINE, "Cache found: {0}", cache);<NEW_LINE>return cacheFile;<NEW_LINE>} | long last = cacheFile.lastModified(); |
1,225,379 | protected void deleteUsageVMSnapshot(UsageEventVO event) {<NEW_LINE>long accountId = event.getAccountId();<NEW_LINE>Account acct = _accountDao.findByIdIncludingRemoved(event.getAccountId());<NEW_LINE>Long domainId = acct.getDomainId();<NEW_LINE>Long diskOfferingId = event.getOfferingId();<NEW_LINE>long vmId = event.getResourceId();<NEW_LINE><MASK><NEW_LINE>List<UsageVMSnapshotVO> usageVMSnapshots = findUsageVMSnapshots(accountId, zoneId, domainId, vmId, diskOfferingId);<NEW_LINE>if (CollectionUtils.isEmpty(usageVMSnapshots)) {<NEW_LINE>s_logger.warn(String.format("No usage entry for VM snapshot for VM id [%s] assigned to account [%s] domain [%s] and zone [%s] was found.", vmId, accountId, domainId, zoneId));<NEW_LINE>}<NEW_LINE>if (usageVMSnapshots.size() > 1) {<NEW_LINE>s_logger.warn(String.format("More than one usage entry for VM snapshot for VM id [%s] assigned to account [%s] domain [%s] and zone [%s]; marking them all as deleted.", vmId, accountId, domainId, zoneId));<NEW_LINE>}<NEW_LINE>for (UsageVMSnapshotVO vmSnapshots : usageVMSnapshots) {<NEW_LINE>s_logger.debug(String.format("Deleting VM Snapshot for VM id [%s] assigned to account [%s] domain [%s] and zone [%s] that was created at [%s].", vmSnapshots.getVmId(), vmSnapshots.getAccountId(), vmSnapshots.getDomainId(), vmSnapshots.getZoneId(), vmSnapshots.getCreated()));<NEW_LINE>vmSnapshots.setProcessed(event.getCreateDate());<NEW_LINE>_usageVMSnapshotDao.update(vmSnapshots);<NEW_LINE>}<NEW_LINE>} | long zoneId = event.getZoneId(); |
1,547,792 | public void initView(int sketchWidth, int sketchHeight, boolean parentSize, LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>// https://www.bignerdranch.com/blog/understanding-androids-layoutinflater-inflate/<NEW_LINE>ViewGroup rootView = (ViewGroup) inflater.inflate(sketch.parentLayout, container, false);<NEW_LINE>View view = getSurfaceView();<NEW_LINE>if (parentSize) {<NEW_LINE>LinearLayout.LayoutParams lp;<NEW_LINE>lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);<NEW_LINE>lp.weight = 1.0f;<NEW_LINE>lp.setMargins(0, 0, 0, 0);<NEW_LINE>view.setPadding(0, 0, 0, 0);<NEW_LINE>rootView.addView(view, lp);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>lp.addRule(RelativeLayout.CENTER_IN_PARENT);<NEW_LINE>layout.addView(view, sketchWidth, sketchHeight);<NEW_LINE>rootView.addView(layout, lp);<NEW_LINE>}<NEW_LINE>rootView.setBackgroundColor(sketch.sketchWindowColor());<NEW_LINE>setRootView(rootView);<NEW_LINE>} | RelativeLayout layout = new RelativeLayout(activity); |
1,256,940 | private void ripAlbum(URL url, String subdirectory) throws IOException {<NEW_LINE>int index = 0;<NEW_LINE>this.sendUpdate(STATUS.LOADING_RESOURCE, url.toExternalForm());<NEW_LINE>index = 0;<NEW_LINE>ImgurAlbum album = getImgurAlbum(url);<NEW_LINE>for (ImgurImage imgurImage : album.images) {<NEW_LINE>stopCheck();<NEW_LINE><MASK><NEW_LINE>if (!saveAs.endsWith(File.separator)) {<NEW_LINE>saveAs += File.separator;<NEW_LINE>}<NEW_LINE>if (subdirectory != null && !subdirectory.equals("")) {<NEW_LINE>saveAs += subdirectory;<NEW_LINE>}<NEW_LINE>if (!saveAs.endsWith(File.separator)) {<NEW_LINE>saveAs += File.separator;<NEW_LINE>}<NEW_LINE>File subdirFile = new File(saveAs);<NEW_LINE>if (!subdirFile.exists()) {<NEW_LINE>subdirFile.mkdirs();<NEW_LINE>}<NEW_LINE>index += 1;<NEW_LINE>if (Utils.getConfigBoolean("download.save_order", true)) {<NEW_LINE>saveAs += String.format("%03d_", index);<NEW_LINE>}<NEW_LINE>saveAs += imgurImage.getSaveAs();<NEW_LINE>saveAs = saveAs.replaceAll("\\?\\d", "");<NEW_LINE>addURLToDownload(imgurImage.url, new File(saveAs));<NEW_LINE>}<NEW_LINE>} | String saveAs = workingDir.getCanonicalPath(); |
687,627 | final DescribePipelineResult executeDescribePipeline(DescribePipelineRequest describePipelineRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describePipelineRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribePipelineRequest> request = null;<NEW_LINE>Response<DescribePipelineResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribePipelineRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describePipelineRequest));<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, "IoTAnalytics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribePipeline");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribePipelineResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribePipelineResultJsonUnmarshaller());<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); |
793,973 | public RestLiResponseData<GetResponseEnvelope> buildRestLiResponseData(Request request, RoutingResult routingResult, Object result, Map<String, String> headers, List<HttpCookie> cookies) {<NEW_LINE>final RecordTemplate record;<NEW_LINE>final HttpStatus status;<NEW_LINE>if (result instanceof GetResult) {<NEW_LINE>final GetResult<?> getResult = (GetResult<?>) result;<NEW_LINE>record = getResult.getValue();<NEW_LINE>status = getResult.getStatus();<NEW_LINE>} else {<NEW_LINE>record = (RecordTemplate) result;<NEW_LINE>status = HttpStatus.S_200_OK;<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>DataMap rawData = record.data();<NEW_LINE>RecordDataSchema schema = record.schema();<NEW_LINE>if (resourceContext.isFillInDefaultsRequested()) {<NEW_LINE>rawData = (DataMap) ResponseUtils.fillInDataDefault(schema, rawData);<NEW_LINE>}<NEW_LINE>TimingContextUtil.beginTiming(resourceContext.getRawRequestContext(), FrameworkTimingKeys.SERVER_RESPONSE_RESTLI_PROJECTION_APPLY.key());<NEW_LINE>final DataMap data = RestUtils.projectFields(rawData, resourceContext);<NEW_LINE>TimingContextUtil.endTiming(resourceContext.getRawRequestContext(), FrameworkTimingKeys.SERVER_RESPONSE_RESTLI_PROJECTION_APPLY.key());<NEW_LINE>return new RestLiResponseDataImpl<>(new GetResponseEnvelope(status, new AnyRecord(data)), headers, cookies);<NEW_LINE>} | ResourceContext resourceContext = routingResult.getContext(); |
265,496 | private MultiplexedRequest buildSequential() throws RestLiEncodingException {<NEW_LINE>Map<Integer, Callback<RestResponse>> callbacks = new HashMap<>(_requestsWithCallbacks.size());<NEW_LINE>// Dependent requests - requests which are dependent on the current request (executed after the current request)<NEW_LINE>IndividualRequestMap dependentRequests = new IndividualRequestMap();<NEW_LINE>// We start with the last request in the list and proceed backwards because sequential ordering is built using reverse dependencies<NEW_LINE>for (int i = _requestsWithCallbacks.size() - 1; i >= 0; i--) {<NEW_LINE>RequestWithCallback<?> <MASK><NEW_LINE>IndividualRequest individualRequest = toIndividualRequest(requestWithCallback.getRequest(), dependentRequests);<NEW_LINE>dependentRequests = new IndividualRequestMap();<NEW_LINE>dependentRequests.put(Integer.toString(i), individualRequest);<NEW_LINE>callbacks.put(i, wrapCallback(requestWithCallback));<NEW_LINE>}<NEW_LINE>return toMultiplexedRequest(dependentRequests, callbacks, _requestOptions);<NEW_LINE>} | requestWithCallback = _requestsWithCallbacks.get(i); |
803,635 | public final QualifiedClassNameListContext qualifiedClassNameList() throws RecognitionException {<NEW_LINE>QualifiedClassNameListContext _localctx = new QualifiedClassNameListContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 92, RULE_qualifiedClassNameList);<NEW_LINE>try {<NEW_LINE>int _alt;<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(752);<NEW_LINE>annotatedQualifiedClassName();<NEW_LINE>setState(759);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().adaptivePredict(_input, 64, _ctx);<NEW_LINE>while (_alt != 2 && _alt != groovyjarjarantlr4.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {<NEW_LINE>if (_alt == 1) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(753);<NEW_LINE>match(COMMA);<NEW_LINE>setState(754);<NEW_LINE>nls();<NEW_LINE>setState(755);<NEW_LINE>annotatedQualifiedClassName();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(761);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | adaptivePredict(_input, 64, _ctx); |
237,614 | public Single<ContainerListBlobHierarchySegmentResponse> listBlobHierarchySegmentWithRestResponseAsync(Context context, @NonNull String delimiter, String prefix, String marker, Integer maxresults, List<ListBlobsIncludeItem> include, Integer timeout, String requestId) {<NEW_LINE>if (this.client.url() == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (delimiter == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter delimiter is required and cannot be null.");<NEW_LINE>}<NEW_LINE>Validator.validate(include);<NEW_LINE>final String restype = "container";<NEW_LINE>final String comp = "list";<NEW_LINE>String includeConverted = this.client.serializerAdapter().<MASK><NEW_LINE>return service.listBlobHierarchySegment(context, this.client.url(), prefix, delimiter, marker, maxresults, includeConverted, timeout, this.client.version(), requestId, restype, comp);<NEW_LINE>} | serializeList(include, CollectionFormat.CSV); |
479,772 | private void modifyTarget(boolean add, VolumeInfo volumeInfo, long hostId) {<NEW_LINE>StoragePoolVO storagePoolVO = storagePoolDao.findById(volumeInfo.getPoolId());<NEW_LINE>Map<String, String> details = new HashMap<>(3);<NEW_LINE>details.put(ModifyTargetsCommand.IQN, volumeInfo.get_iScsiName());<NEW_LINE>details.put(ModifyTargetsCommand.STORAGE_HOST, storagePoolVO.getHostAddress());<NEW_LINE>details.put(ModifyTargetsCommand.STORAGE_PORT, String.valueOf<MASK><NEW_LINE>List<Map<String, String>> targets = new ArrayList<>(1);<NEW_LINE>targets.add(details);<NEW_LINE>ModifyTargetsCommand cmd = new ModifyTargetsCommand();<NEW_LINE>cmd.setTargets(targets);<NEW_LINE>cmd.setApplyToAllHostsInCluster(true);<NEW_LINE>cmd.setAdd(add);<NEW_LINE>cmd.setTargetTypeToRemove(ModifyTargetsCommand.TargetTypeToRemove.BOTH);<NEW_LINE>sendModifyTargetsCommand(cmd, hostId);<NEW_LINE>} | (storagePoolVO.getPort())); |
1,122,273 | private void sortTable(Table table) {<NEW_LINE>TableItem[<MASK><NEW_LINE>Collator collator = Collator.getInstance(Locale.getDefault());<NEW_LINE>for (int i = 1; i < items.length; i++) {<NEW_LINE>String value1 = items[i].getText(0);<NEW_LINE>for (int j = 0; j < i; j++) {<NEW_LINE>String value2 = items[j].getText(0);<NEW_LINE>if (collator.compare(value1, value2) < 0) {<NEW_LINE>String text = items[i].getText(0);<NEW_LINE>Object data = items[i].getData();<NEW_LINE>Image image = items[i].getImage();<NEW_LINE>items[i].dispose();<NEW_LINE>TableItem item = new TableItem(table, SWT.NONE, j);<NEW_LINE>item.setText(text);<NEW_LINE>item.setData(data);<NEW_LINE>item.setImage(image);<NEW_LINE>items = table.getItems();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ] items = table.getItems(); |
1,855,557 | // Used for normal and bulk chunks<NEW_LINE>public static Chunk deserialize(final int chunkX, final int chunkZ, final boolean fullChunk, final boolean skyLight, final int bitmask, final byte[] data) throws Exception {<NEW_LINE>final ByteBuf input = Unpooled.wrappedBuffer(data);<NEW_LINE>final ChunkSection[] sections = new ChunkSection[16];<NEW_LINE>int[] biomeData = null;<NEW_LINE>// Read blocks<NEW_LINE>for (int i = 0; i < sections.length; i++) {<NEW_LINE>if ((bitmask & 1 << i) == 0)<NEW_LINE>continue;<NEW_LINE>sections[i] = Types1_8.CHUNK_SECTION.read(input);<NEW_LINE>}<NEW_LINE>// Read block light<NEW_LINE>for (int i = 0; i < sections.length; i++) {<NEW_LINE>if ((bitmask & 1 << i) == 0)<NEW_LINE>continue;<NEW_LINE>sections[i].getLight().readBlockLight(input);<NEW_LINE>}<NEW_LINE>// Read sky light<NEW_LINE>if (skyLight) {<NEW_LINE>for (int i = 0; i < sections.length; i++) {<NEW_LINE>if ((bitmask & 1 << i) == 0)<NEW_LINE>continue;<NEW_LINE>sections[i].<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Read biome data<NEW_LINE>if (fullChunk) {<NEW_LINE>biomeData = new int[256];<NEW_LINE>for (int i = 0; i < 256; i++) {<NEW_LINE>biomeData[i] = input.readUnsignedByte();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>input.release();<NEW_LINE>return new BaseChunk(chunkX, chunkZ, fullChunk, false, bitmask, sections, biomeData, new ArrayList<>());<NEW_LINE>} | getLight().readSkyLight(input); |
883,168 | private void doExperiment(Map<Integer, Comparable[]> allInputArrays) {<NEW_LINE>StdOut.printf("%13s %25s %25s %25s\n", "Array Size | ", "Number of Compares Std Impl | ", "Number of Compares 3-Ary Heap | ", "Number of Compares 4-Ary Heap");<NEW_LINE>for (int i = 0; i < allInputArrays.size(); i++) {<NEW_LINE>Comparable[] originalArray = allInputArrays.get(i);<NEW_LINE>Comparable[] arrayCopy1 = new Comparable[originalArray.length];<NEW_LINE>System.arraycopy(originalArray, 0, <MASK><NEW_LINE>Comparable[] arrayCopy2 = new Comparable[originalArray.length];<NEW_LINE>System.arraycopy(originalArray, 0, arrayCopy2, 0, originalArray.length);<NEW_LINE>numberOfCompares = 0;<NEW_LINE>// 3-ary heap<NEW_LINE>DWayPriorityQueue threeWayPriorityQueue = new DWayPriorityQueue(originalArray, 3);<NEW_LINE>threeWayPriorityQueue.heapSort();<NEW_LINE>long numberOfCompares3AryHeap = numberOfCompares;<NEW_LINE>numberOfCompares = 0;<NEW_LINE>// 4-ary heap<NEW_LINE>DWayPriorityQueue fourWayPriorityQueue = new DWayPriorityQueue(arrayCopy1, 4);<NEW_LINE>fourWayPriorityQueue.heapSort();<NEW_LINE>long numberOfCompares4AryHeap = numberOfCompares;<NEW_LINE>numberOfCompares = 0;<NEW_LINE>// Standard implementation - binary heap<NEW_LINE>DWayPriorityQueue twoWayPriorityQueue = new DWayPriorityQueue(arrayCopy2, 2);<NEW_LINE>twoWayPriorityQueue.heapSort();<NEW_LINE>printResults(originalArray.length, numberOfCompares, numberOfCompares3AryHeap, numberOfCompares4AryHeap);<NEW_LINE>}<NEW_LINE>} | arrayCopy1, 0, originalArray.length); |
1,415,941 | private static WasmExpression comparison(WasmIntBinaryOperation intOp, WasmFloatBinaryOperation floatOp, InvocationExpr invocation, WasmIntrinsicManager manager) {<NEW_LINE>WasmType type = WasmGeneratorUtil.mapType(invocation.getMethod<MASK><NEW_LINE>WasmExpression first = manager.generate(invocation.getArguments().get(0));<NEW_LINE>WasmExpression second = manager.generate(invocation.getArguments().get(1));<NEW_LINE>switch(type) {<NEW_LINE>case INT32:<NEW_LINE>return new WasmIntBinary(WasmIntType.INT32, intOp, first, second);<NEW_LINE>case INT64:<NEW_LINE>return new WasmIntBinary(WasmIntType.INT64, intOp, first, second);<NEW_LINE>case FLOAT32:<NEW_LINE>return new WasmFloatBinary(WasmFloatType.FLOAT32, floatOp, first, second);<NEW_LINE>case FLOAT64:<NEW_LINE>return new WasmFloatBinary(WasmFloatType.FLOAT64, floatOp, first, second);<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException(type.toString());<NEW_LINE>}<NEW_LINE>} | ().parameterType(0)); |
1,001,891 | public void createPartControl(Composite parent) {<NEW_LINE>AgentObject ao = AgentModelThread.getInstance().getAgentObject(objHash);<NEW_LINE>this.setPartName("WaitCount[" + ao.getObjName() + "]");<NEW_LINE>GridLayout layout = new GridLayout(1, true);<NEW_LINE>layout.marginHeight = 5;<NEW_LINE>layout.marginWidth = 5;<NEW_LINE>parent.setLayout(layout);<NEW_LINE>parent.setBackground(ColorUtil.getInstance().getColor(SWT.COLOR_WHITE));<NEW_LINE>parent.setBackgroundMode(SWT.INHERIT_FORCE);<NEW_LINE>canvas = new FigureCanvas(parent);<NEW_LINE>canvas.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>canvas.setScrollBarVisibility(FigureCanvas.NEVER);<NEW_LINE>canvas.addControlListener(new ControlListener() {<NEW_LINE><NEW_LINE>public void controlMoved(ControlEvent arg0) {<NEW_LINE>}<NEW_LINE><NEW_LINE>public void controlResized(ControlEvent arg0) {<NEW_LINE>Rectangle r = canvas.getClientArea();<NEW_LINE>xyGraph.setSize(r.width, r.height);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>canvas.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>public void mouseDoubleClick(MouseEvent e) {<NEW_LINE>double x = xyGraph.primaryXAxis.getPositionValue(e.x, false);<NEW_LINE>((CircularBufferDataProvider) pointTrace.getDataProvider()).addSample(new Sample(x, xyGraph.primaryYAxis.getRange().getUpper()));<NEW_LINE>new OpenDbLockListAction(serverId, objHash, (long) x).run();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>xyGraph = new XYGraph();<NEW_LINE>xyGraph.setShowLegend(false);<NEW_LINE>xyGraph.setShowTitle(false);<NEW_LINE>canvas.setContents(xyGraph);<NEW_LINE>xyGraph.primaryXAxis.setDateEnabled(true);<NEW_LINE>xyGraph.primaryXAxis.setShowMajorGrid(true);<NEW_LINE>xyGraph.primaryYAxis.setAutoScale(true);<NEW_LINE>xyGraph.primaryYAxis.setShowMajorGrid(true);<NEW_LINE>xyGraph.primaryXAxis.setFormatPattern("HH:mm:ss");<NEW_LINE>xyGraph.primaryYAxis.setFormatPattern("#,##0");<NEW_LINE>xyGraph.primaryXAxis.setTitle("");<NEW_LINE>xyGraph.primaryYAxis.setTitle("");<NEW_LINE>CircularBufferDataProvider avgProvider = new CircularBufferDataProvider(true);<NEW_LINE>avgProvider.setBufferSize(((int) (TIME_RANGE / REFRESH_INTERVAL) + 1));<NEW_LINE>avgProvider.setCurrentXDataArray(new double[] {});<NEW_LINE>avgProvider.setCurrentYDataArray(new double[] {});<NEW_LINE>trace = new Trace("WAIT_COUNT_TRACE", xyGraph.primaryXAxis, xyGraph.primaryYAxis, avgProvider);<NEW_LINE>trace.setPointStyle(PointStyle.NONE);<NEW_LINE>trace.setTraceType(TraceType.SOLID_LINE);<NEW_LINE>trace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));<NEW_LINE>trace.setTraceColor(AgentColorManager.getInstance().assignColor(ao.getObjType(), objHash));<NEW_LINE>xyGraph.addTrace(trace);<NEW_LINE>CircularBufferDataProvider pointProvider = new CircularBufferDataProvider(true);<NEW_LINE>pointProvider.setBufferSize(1);<NEW_LINE>pointProvider.setCurrentXDataArray(new double[] {});<NEW_LINE>pointProvider.setCurrentYDataArray(new double[] {});<NEW_LINE>pointTrace = new Trace("POINT_TRACE", xyGraph.<MASK><NEW_LINE>pointTrace.setPointStyle(PointStyle.NONE);<NEW_LINE>pointTrace.setTraceType(TraceType.BAR);<NEW_LINE>pointTrace.setLineWidth(1);<NEW_LINE>pointTrace.setTraceColor(ColorUtil.getInstance().getColor("red"));<NEW_LINE>xyGraph.addTrace(pointTrace);<NEW_LINE>param.put("objHash", objHash);<NEW_LINE>param.put("counter", CounterConstants.DB_WAIT_COUNT);<NEW_LINE>param.put("timetype", TimeTypeEnum.REALTIME);<NEW_LINE>this.setContentDescription("Double-click to see the detail list at that time.");<NEW_LINE>thread = new RefreshThread(this, REFRESH_INTERVAL);<NEW_LINE>thread.start();<NEW_LINE>} | primaryXAxis, xyGraph.primaryYAxis, pointProvider); |
99,254 | public void sendError(int sc, String message, boolean ignoreCommittedException) throws IOException {<NEW_LINE>// LIDB1234.3 - throw exception if response already committed.<NEW_LINE>if (getResponse().isCommitted()) {<NEW_LINE>if (!ignoreCommittedException) {<NEW_LINE>throw new IllegalStateException("Response already committed.");<NEW_LINE>} else if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {<NEW_LINE>logger.logp(Level.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>getResponse().resetBuffer();<NEW_LINE>try {<NEW_LINE>((HttpServletResponse) getResponse()).setStatus(sc);<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>// failed to set staus code. This could be caused by the servlet being included.<NEW_LINE>com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(e, "com.ibm.ws.webcontainer.webapp.WebAppDispatcherResponse.sendError", "112", this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>WebApp webapp = getWebApp();<NEW_LINE>// PK69491 Start<NEW_LINE>Object fileNotFound = getRequest().getAttribute("com.ibm.ws.webcontainer.filter.filterproxyservletfilenotfound");<NEW_LINE>if (fileNotFound != null) {<NEW_LINE>getRequest().removeAttribute("com.ibm.ws.webcontainer.filter.filterproxyservletfilenotfound");<NEW_LINE>webapp.sendError((HttpServletRequest) _request, (HttpServletResponse) getResponse(), (ServletErrorReport) fileNotFound);<NEW_LINE>} else {<NEW_LINE>// PK69491 End<NEW_LINE>WebAppErrorReport error = null;<NEW_LINE>error = new WebAppErrorReport(message);<NEW_LINE>error.setErrorCode(sc);<NEW_LINE>RequestProcessor ref = getCurrentServletReference();<NEW_LINE>if (ref != null) {<NEW_LINE>error.setTargetServletName(ref.getName());<NEW_LINE>}<NEW_LINE>getWebApp().sendError((HttpServletRequest) _request, (HttpServletResponse) getResponse(), error);<NEW_LINE>}<NEW_LINE>// PK69491<NEW_LINE>getResponse().flushBuffer();<NEW_LINE>} | FINE, CLASS_NAME, "sendError", "response is committed, but not throwing ISE"); |
1,792,193 | public Request<RecordHandlerProgressRequest> marshall(RecordHandlerProgressRequest recordHandlerProgressRequest) {<NEW_LINE>if (recordHandlerProgressRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<RecordHandlerProgressRequest> request = new DefaultRequest<RecordHandlerProgressRequest>(recordHandlerProgressRequest, "AmazonCloudFormation");<NEW_LINE><MASK><NEW_LINE>request.addParameter("Version", "2010-05-15");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (recordHandlerProgressRequest.getBearerToken() != null) {<NEW_LINE>request.addParameter("BearerToken", StringUtils.fromString(recordHandlerProgressRequest.getBearerToken()));<NEW_LINE>}<NEW_LINE>if (recordHandlerProgressRequest.getOperationStatus() != null) {<NEW_LINE>request.addParameter("OperationStatus", StringUtils.fromString(recordHandlerProgressRequest.getOperationStatus()));<NEW_LINE>}<NEW_LINE>if (recordHandlerProgressRequest.getCurrentOperationStatus() != null) {<NEW_LINE>request.addParameter("CurrentOperationStatus", StringUtils.fromString(recordHandlerProgressRequest.getCurrentOperationStatus()));<NEW_LINE>}<NEW_LINE>if (recordHandlerProgressRequest.getStatusMessage() != null) {<NEW_LINE>request.addParameter("StatusMessage", StringUtils.fromString(recordHandlerProgressRequest.getStatusMessage()));<NEW_LINE>}<NEW_LINE>if (recordHandlerProgressRequest.getErrorCode() != null) {<NEW_LINE>request.addParameter("ErrorCode", StringUtils.fromString(recordHandlerProgressRequest.getErrorCode()));<NEW_LINE>}<NEW_LINE>if (recordHandlerProgressRequest.getResourceModel() != null) {<NEW_LINE>request.addParameter("ResourceModel", StringUtils.fromString(recordHandlerProgressRequest.getResourceModel()));<NEW_LINE>}<NEW_LINE>if (recordHandlerProgressRequest.getClientRequestToken() != null) {<NEW_LINE>request.addParameter("ClientRequestToken", StringUtils.fromString(recordHandlerProgressRequest.getClientRequestToken()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.addParameter("Action", "RecordHandlerProgress"); |
453,036 | private void sendUpdate() {<NEW_LINE>float[] R = new float[9];<NEW_LINE>float[] I = new float[9];<NEW_LINE>boolean success = SensorManager.getRotationMatrix(R, I, mGravity, mGeomagnetic);<NEW_LINE>if (success) {<NEW_LINE>float[] orientation = new float[3];<NEW_LINE>SensorManager.getOrientation(R, orientation);<NEW_LINE>// Make sure Delta is big enough to warrant an update<NEW_LINE>// Currently: 50ms and ~2 degrees of change (android has a lot of useless updates block up the sending)<NEW_LINE>if ((Math.abs(orientation[0] - mLastAzimuth)) > DEGREE_DELTA && (System.currentTimeMillis() - mLastUpdate) > TIME_DELTA) {<NEW_LINE>mLastAzimuth = orientation[0];<NEW_LINE>mLastUpdate = System.currentTimeMillis();<NEW_LINE>float magneticNorth = calcMagNorth(orientation[0]);<NEW_LINE>float trueNorth = calcTrueNorth(magneticNorth);<NEW_LINE>// Write data to send back to React<NEW_LINE>Bundle response = new Bundle();<NEW_LINE>Bundle heading = LocationHelpers.<MASK><NEW_LINE>response.putInt("watchId", mHeadingId);<NEW_LINE>response.putBundle("heading", heading);<NEW_LINE>mEventEmitter.emit(HEADING_EVENT_NAME, response);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | headingToBundle(trueNorth, magneticNorth, mAccuracy); |
1,451,328 | public void handle(Context ctx) throws IOException, ServletException {<NEW_LINE>boolean isTraceMode = Cat.getManager().isTraceMode();<NEW_LINE>HttpServletRequest req = ctx.getRequest();<NEW_LINE>HttpServletResponse res = ctx.getResponse();<NEW_LINE>MessageProducer producer = Cat.getProducer();<NEW_LINE>int mode = ctx.getMode();<NEW_LINE>switch(mode) {<NEW_LINE>case 0:<NEW_LINE>ctx.setId(producer.createMessageId());<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>ctx.setRootId(req.getHeader("X-CAT-ROOT-ID"));<NEW_LINE>ctx.setParentId(req.getHeader("X-CAT-PARENT-ID"));<NEW_LINE>ctx.setId(req.getHeader("X-CAT-ID"));<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>ctx.setRootId(producer.createMessageId());<NEW_LINE>ctx.setParentId(ctx.getRootId());<NEW_LINE>ctx.setId(producer.createMessageId());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException(String.format("Internal Error: unsupported mode(%s)!", mode));<NEW_LINE>}<NEW_LINE>if (isTraceMode) {<NEW_LINE>MessageTree tree = Cat.getManager().getThreadLocalMessageTree();<NEW_LINE>tree.setMessageId(ctx.getId());<NEW_LINE>tree.setParentMessageId(ctx.getParentId());<NEW_LINE>tree.setRootMessageId(ctx.getRootId());<NEW_LINE>res.setHeader("X-CAT-SERVER", getCatServer());<NEW_LINE>switch(mode) {<NEW_LINE>case 0:<NEW_LINE>res.setHeader("X-CAT-ROOT-ID", ctx.getId());<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>res.setHeader("X-CAT-ROOT-ID", ctx.getRootId());<NEW_LINE>res.setHeader("X-CAT-PARENT-ID", ctx.getParentId());<NEW_LINE>res.setHeader("X-CAT-ID", ctx.getId());<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>res.setHeader(<MASK><NEW_LINE>res.setHeader("X-CAT-PARENT-ID", ctx.getParentId());<NEW_LINE>res.setHeader("X-CAT-ID", ctx.getId());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ctx.handle();<NEW_LINE>} | "X-CAT-ROOT-ID", ctx.getRootId()); |
1,700,567 | public void finish(String title) {<NEW_LINE>EventsCollector <MASK><NEW_LINE>if (logEventListener == null) {<NEW_LINE>log.warn("Can not publish report because Selenide logger has not started.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>OptionalInt maxLineLength = logEventListener.events().stream().map(LogEvent::getElement).map(String::length).mapToInt(Integer::intValue).max();<NEW_LINE>int count = maxLineLength.orElse(0) >= 20 ? (maxLineLength.getAsInt() + 1) : 20;<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("Report for ").append(title).append('\n');<NEW_LINE>String delimiter = '+' + String.join("+", line(count), line(70), line(10), line(10)) + "+\n";<NEW_LINE>sb.append(delimiter);<NEW_LINE>sb.append(String.format("|%-" + count + "s|%-70s|%-10s|%-10s|%n", "Element", "Subject", "Status", "ms."));<NEW_LINE>sb.append(delimiter);<NEW_LINE>for (LogEvent e : logEventListener.events()) {<NEW_LINE>sb.append(String.format("|%-" + count + "s|%-70s|%-10s|%-10s|%n", e.getElement(), e.getSubject(), e.getStatus(), e.getDuration()));<NEW_LINE>}<NEW_LINE>sb.append(delimiter);<NEW_LINE>log.info(sb.toString());<NEW_LINE>} | logEventListener = SelenideLogger.removeListener("simpleReport"); |
1,262,055 | private void extractTargetPidsFromIdParams(HashSet<Long> theTargetPids) {<NEW_LINE>// get all the IQueryParameterType objects<NEW_LINE>// for _id -> these should all be StringParam values<NEW_LINE>HashSet<String> ids = new HashSet<>();<NEW_LINE>List<List<IQueryParameterType>> params = <MASK><NEW_LINE>for (List<IQueryParameterType> paramList : params) {<NEW_LINE>for (IQueryParameterType param : paramList) {<NEW_LINE>if (param instanceof StringParam) {<NEW_LINE>// we expect all _id values to be StringParams<NEW_LINE>ids.add(((StringParam) param).getValue());<NEW_LINE>} else if (param instanceof TokenParam) {<NEW_LINE>ids.add(((TokenParam) param).getValue());<NEW_LINE>} else {<NEW_LINE>// we do not expect the _id parameter to be a non-string value<NEW_LINE>throw new IllegalArgumentException(Msg.code(1193) + "_id parameter must be a StringParam or TokenParam");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// fetch our target Pids<NEW_LINE>// this will throw if an id is not found<NEW_LINE>Map<String, ResourcePersistentId> idToPid = myIdHelperService.resolveResourcePersistentIds(myRequestPartitionId, myResourceName, new ArrayList<>(ids));<NEW_LINE>if (myAlsoIncludePids == null) {<NEW_LINE>myAlsoIncludePids = new ArrayList<>();<NEW_LINE>}<NEW_LINE>// add the pids to targetPids<NEW_LINE>for (ResourcePersistentId pid : idToPid.values()) {<NEW_LINE>myAlsoIncludePids.add(pid);<NEW_LINE>theTargetPids.add(pid.getIdAsLong());<NEW_LINE>}<NEW_LINE>} | myParams.get(IAnyResource.SP_RES_ID); |
1,617,665 | public static CompareFaceResponse unmarshall(CompareFaceResponse compareFaceResponse, UnmarshallerContext _ctx) {<NEW_LINE>compareFaceResponse.setRequestId(_ctx.stringValue("CompareFaceResponse.RequestId"));<NEW_LINE>compareFaceResponse.setCode(_ctx.stringValue("CompareFaceResponse.Code"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setConfidence(_ctx.floatValue("CompareFaceResponse.Data.Confidence"));<NEW_LINE>data.setQualityScoreA(_ctx.floatValue("CompareFaceResponse.Data.QualityScoreA"));<NEW_LINE>data.setQualityScoreB(_ctx.floatValue("CompareFaceResponse.Data.QualityScoreB"));<NEW_LINE>data.setMessageTips<MASK><NEW_LINE>List<Float> thresholds = new ArrayList<Float>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CompareFaceResponse.Data.Thresholds.Length"); i++) {<NEW_LINE>thresholds.add(_ctx.floatValue("CompareFaceResponse.Data.Thresholds[" + i + "]"));<NEW_LINE>}<NEW_LINE>data.setThresholds(thresholds);<NEW_LINE>List<Integer> rectBList = new ArrayList<Integer>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CompareFaceResponse.Data.RectBList.Length"); i++) {<NEW_LINE>rectBList.add(_ctx.integerValue("CompareFaceResponse.Data.RectBList[" + i + "]"));<NEW_LINE>}<NEW_LINE>data.setRectBList(rectBList);<NEW_LINE>List<Integer> rectAList = new ArrayList<Integer>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CompareFaceResponse.Data.RectAList.Length"); i++) {<NEW_LINE>rectAList.add(_ctx.integerValue("CompareFaceResponse.Data.RectAList[" + i + "]"));<NEW_LINE>}<NEW_LINE>data.setRectAList(rectAList);<NEW_LINE>compareFaceResponse.setData(data);<NEW_LINE>return compareFaceResponse;<NEW_LINE>} | (_ctx.stringValue("CompareFaceResponse.Data.MessageTips")); |
1,550,311 | private void updateUi() {<NEW_LINE>if ((ledgerManager.getCurrentState() != AccountScanManager.Status.unableToScan) && (ledgerManager.getCurrentState() != AccountScanManager.Status.initializing)) {<NEW_LINE>findViewById(R.id.ivConnectLedger).setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>findViewById(R.id.ivConnectLedger).setVisibility(View.VISIBLE);<NEW_LINE>((TextView) findViewById(R.id.tvPluginLedger)).setText(getString(R.string.ledger_please_plug_in));<NEW_LINE>findViewById(R.id.tvPluginLedger).setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>if (showTx) {<NEW_LINE>findViewById(R.id.ivConnectLedger).setVisibility(View.GONE);<NEW_LINE>findViewById(R.id.llShowTx).setVisibility(View.VISIBLE);<NEW_LINE>ArrayList<String> toAddresses = new ArrayList<>(1);<NEW_LINE>long totalSending = 0;<NEW_LINE>UnsignedTransaction unsigned = ((BtcTransaction) _transaction).getUnsignedTx();<NEW_LINE>for (TransactionOutput o : unsigned.getOutputs()) {<NEW_LINE>BitcoinAddress toAddress;<NEW_LINE>toAddress = o.script.getAddress(_mbwManager.getNetwork());<NEW_LINE>Optional<Integer[]> addressId = ((HDAccount) _account).getAddressId(toAddress);<NEW_LINE>if (!(addressId.isPresent() && addressId.get()[0] == 1)) {<NEW_LINE>// this output goes to a foreign address (addressId[0]==1 means its internal change)<NEW_LINE>totalSending += o.value;<NEW_LINE>toAddresses.add(toAddress.toDoubleLineString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String toAddress = Joiner.on(",\n").join(toAddresses);<NEW_LINE>String amount = ValueExtensionsKt.toString(Utils.getBtcCoinType().value(totalSending));<NEW_LINE>String total = ValueExtensionsKt.toString(Utils.getBtcCoinType().value(totalSending + unsigned.calculateFee()));<NEW_LINE>String fee = ValueExtensionsKt.toString(Utils.getBtcCoinType().value(unsigned.calculateFee()));<NEW_LINE>((TextView) findViewById(R.id.tvAmount)).setText(amount);<NEW_LINE>((TextView) findViewById(R.id.tvToAddress)).setText(toAddress);<NEW_LINE>((TextView) findViewById(R.id.tvFee)).setText(fee);<NEW_LINE>((TextView) findViewById(R.id.tvTotal)).setText(total);<NEW_LINE>} else {<NEW_LINE>findViewById(R.id.llShowTx<MASK><NEW_LINE>}<NEW_LINE>} | ).setVisibility(View.GONE); |
1,673,282 | public HttpResponse handlePlayersRequest(HttpRequest request) {<NEW_LINE>if (!request.getMethod().equalsIgnoreCase("GET"))<NEW_LINE>return new HttpResponse(HttpStatusCode.BAD_REQUEST);<NEW_LINE>try (StringWriter data = new StringWriter();<NEW_LINE>JsonWriter json = new JsonWriter(data)) {<NEW_LINE>json.beginObject();<NEW_LINE>json.name("players").beginArray();<NEW_LINE>for (Player player : server.getOnlinePlayers()) {<NEW_LINE>if (!player.isOnline())<NEW_LINE>continue;<NEW_LINE>if (config.isHideInvisible() && player.isInvisible())<NEW_LINE>continue;<NEW_LINE>if (config.isHideSneaking() && player.isSneaking())<NEW_LINE>continue;<NEW_LINE>if (config.getHiddenGameModes().contains(player.getGamemode().getId()))<NEW_LINE>continue;<NEW_LINE>json.beginObject();<NEW_LINE>json.name("uuid").value(player.<MASK><NEW_LINE>json.name("name").value(player.getName().toPlainString());<NEW_LINE>json.name("world").value(player.getWorld().toString());<NEW_LINE>json.name("position").beginObject();<NEW_LINE>json.name("x").value(player.getPosition().getX());<NEW_LINE>json.name("y").value(player.getPosition().getY());<NEW_LINE>json.name("z").value(player.getPosition().getZ());<NEW_LINE>json.endObject();<NEW_LINE>json.endObject();<NEW_LINE>}<NEW_LINE>json.endArray();<NEW_LINE>json.endObject();<NEW_LINE>HttpResponse response = new HttpResponse(HttpStatusCode.OK);<NEW_LINE>response.setData(data.toString());<NEW_LINE>return response;<NEW_LINE>} catch (IOException ex) {<NEW_LINE>return new HttpResponse(HttpStatusCode.INTERNAL_SERVER_ERROR);<NEW_LINE>}<NEW_LINE>} | getUuid().toString()); |
1,584,329 | private Set<Long> matchBestPrefixIndex(Map<String, Integer> columnToIds, Map<Long, List<Column>> candidateIndexIdToSchema, Set<Integer> equivalenceColumns, Set<Integer> unequivalenceColumns) {<NEW_LINE>if (equivalenceColumns.size() == 0 && unequivalenceColumns.size() == 0) {<NEW_LINE>return candidateIndexIdToSchema.keySet();<NEW_LINE>}<NEW_LINE>Set<Long> indexesMatchingBestPrefixIndex = Sets.newHashSet();<NEW_LINE>int maxPrefixMatchCount = 0;<NEW_LINE>for (Map.Entry<Long, List<Column>> entry : candidateIndexIdToSchema.entrySet()) {<NEW_LINE>int prefixMatchCount = 0;<NEW_LINE>long indexId = entry.getKey();<NEW_LINE>List<Column> indexSchema = entry.getValue();<NEW_LINE>for (Column col : indexSchema) {<NEW_LINE>Integer columnId = columnToIds.<MASK><NEW_LINE>if (equivalenceColumns.contains(columnId)) {<NEW_LINE>prefixMatchCount++;<NEW_LINE>} else if (unequivalenceColumns.contains(columnId)) {<NEW_LINE>// Unequivalence predicate's columns can match only first column in rollup.<NEW_LINE>prefixMatchCount++;<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (prefixMatchCount == maxPrefixMatchCount) {<NEW_LINE>indexesMatchingBestPrefixIndex.add(indexId);<NEW_LINE>} else if (prefixMatchCount > maxPrefixMatchCount) {<NEW_LINE>maxPrefixMatchCount = prefixMatchCount;<NEW_LINE>indexesMatchingBestPrefixIndex.clear();<NEW_LINE>indexesMatchingBestPrefixIndex.add(indexId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return indexesMatchingBestPrefixIndex;<NEW_LINE>} | get(col.getName()); |
1,329,107 | public List<Score<I>> scoresForLaterFile(InputStream input) throws IOException {<NEW_LINE>List<Score<I>> results = new ArrayList<>();<NEW_LINE>int[] laterHashes = hashes(input);<NEW_LINE>if (isEmpty(laterHashes)) {<NEW_LINE>return ImmutableList.of();<NEW_LINE>}<NEW_LINE>for (PriorFile<I> priorFile : priorFiles) {<NEW_LINE>// Determine the number of hashes that priorFile.hashes and laterHashes have in common.<NEW_LINE>int matchCount = 0;<NEW_LINE>int priorIndex = 0;<NEW_LINE>int laterIndex = 0;<NEW_LINE>while (priorIndex < priorFile.hashes.length && laterIndex < laterHashes.length) {<NEW_LINE>int <MASK><NEW_LINE>int laterHash = laterHashes[laterIndex];<NEW_LINE>if (laterHash > priorHash) {<NEW_LINE>priorIndex++;<NEW_LINE>} else {<NEW_LINE>laterIndex++;<NEW_LINE>if (priorHash == laterHash) {<NEW_LINE>matchCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (matchCount != 0 && !isEmpty(priorFile.hashes)) {<NEW_LINE>int size = (laterHashes.length > priorFile.hashes.length) ? laterHashes.length : priorFile.hashes.length;<NEW_LINE>results.add(new Score<>(priorFile.key, matchCount * MAX_SCORE / size));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>results.sort((a, b) -> Integer.compare(b.score, a.score));<NEW_LINE>return results;<NEW_LINE>} | priorHash = priorFile.hashes[priorIndex]; |
292,293 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.<MASK><NEW_LINE>if (controller == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// put a +1/+1 counter on each creature you control if you control a creature with power 5 or greater.<NEW_LINE>FilterCreaturePermanent filter = new FilterCreaturePermanent();<NEW_LINE>filter.add(new PowerPredicate(ComparisonType.MORE_THAN, 4));<NEW_LINE>if (game.getState().getBattlefield().countAll(filter, controller.getId(), game) > 0) {<NEW_LINE>for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) {<NEW_LINE>creature.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// needed because otehrwise the +1/+1 counters wouldn't be taken into account<NEW_LINE>game.getState().processAction(game);<NEW_LINE>// Then you gain 10 life if you control a creature with power 10 or greater.<NEW_LINE>filter = new FilterCreaturePermanent();<NEW_LINE>filter.add(new PowerPredicate(ComparisonType.MORE_THAN, 9));<NEW_LINE>if (game.getState().getBattlefield().countAll(filter, controller.getId(), game) > 0) {<NEW_LINE>controller.gainLife(10, game, source);<NEW_LINE>}<NEW_LINE>// Then you win the game if you control a creature with power 20 or greater.<NEW_LINE>filter = new FilterCreaturePermanent();<NEW_LINE>filter.add(new PowerPredicate(ComparisonType.MORE_THAN, 19));<NEW_LINE>if (game.getState().getBattlefield().countAll(filter, controller.getId(), game) > 0) {<NEW_LINE>controller.won(game);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | getPlayer(source.getControllerId()); |
1,341,170 | static final void safeClose(ExecuteListener listener, ExecuteContext ctx, boolean keepStatement, boolean keepResultSet) {<NEW_LINE>// [#2523] Set JDBC objects to null, to prevent repeated closing<NEW_LINE>JDBCUtils.<MASK><NEW_LINE>ctx.resultSet(null);<NEW_LINE>PreparedStatement statement = ctx.statement();<NEW_LINE>if (statement != null)<NEW_LINE>consumeWarnings(ctx, listener);<NEW_LINE>// [#385] Close statements only if not requested to keep open<NEW_LINE>if (!keepStatement) {<NEW_LINE>if (statement != null) {<NEW_LINE>JDBCUtils.safeClose(statement);<NEW_LINE>ctx.statement(null);<NEW_LINE>} else // [#3234] We must ensure that any connection we may still have will be released,<NEW_LINE>// in the event of an exception<NEW_LINE>{<NEW_LINE>Connection connection = localConnection();<NEW_LINE>// [#4277] We must release the connection on the ExecuteContext's<NEW_LINE>// ConnectionProvider, as the ctx.configuration().connectionProvider()<NEW_LINE>// is replaced by a ExecuteContextConnectionProvider instance.<NEW_LINE>if (connection != null && ((DefaultExecuteContext) ctx).connectionProvider != null)<NEW_LINE>((DefaultExecuteContext) ctx).connectionProvider.release(connection);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// [#1868] [#2373] Terminate ExecuteListener lifecycle, if needed<NEW_LINE>if (keepResultSet)<NEW_LINE>listener.end(ctx);<NEW_LINE>// [#1326] Clean up any potentially remaining temporary lobs<NEW_LINE>DefaultExecuteContext.clean();<NEW_LINE>} | safeClose(ctx.resultSet()); |
987,134 | public Pair<Map<RandomVariable, Object>, Double> weightedSample(BayesianNetwork bn, AssignmentProposition[] e) {<NEW_LINE>// w <- 1;<NEW_LINE>double w = 1.0;<NEW_LINE>// <b>x</b> <- an event with n elements initialized from e<NEW_LINE>Map<RandomVariable, Object> x = new LinkedHashMap<RandomVariable, Object>();<NEW_LINE>for (AssignmentProposition ap : e) {<NEW_LINE>x.put(ap.getTermVariable(), ap.getValue());<NEW_LINE>}<NEW_LINE>// foreach variable X<sub>i</sub> in X<sub>1</sub>,...,X<sub>n</sub> do<NEW_LINE>for (RandomVariable Xi : bn.getVariablesInTopologicalOrder()) {<NEW_LINE>// if X<sub>i</sub> is an evidence variable with value x<sub>i</sub><NEW_LINE>// in e<NEW_LINE>if (x.containsKey(Xi)) {<NEW_LINE>// then w <- w * P(X<sub>i</sub> = x<sub>i</sub> |<NEW_LINE>// parents(X<sub>i</sub>))<NEW_LINE>w *= bn.getNode(Xi).getCPD().getValue(ProbUtil.getEventValuesForXiGivenParents(bn.getNode(Xi), x));<NEW_LINE>} else {<NEW_LINE>// else <b>x</b>[i] <- a random sample from<NEW_LINE>// <b>P</b>(X<sub>i</sub> | parents(X<sub>i</sub>))<NEW_LINE>x.put(Xi, ProbUtil.randomSample(bn.getNode(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// return <b>x</b>, w<NEW_LINE>return new Pair<Map<RandomVariable, Object>, Double>(x, w);<NEW_LINE>} | Xi), x, randomizer)); |
79,215 | public static ClaimsList parse(List<String> lines) {<NEW_LINE>ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<>();<NEW_LINE>// First line: <version>,<DNL List creation datetime><NEW_LINE>List<String> firstLine = Splitter.on(',').splitToList(lines.get(0));<NEW_LINE>checkArgument(firstLine.size() == 2, String.format("Line 1: Expected 2 elements, found %d", firstLine.size()));<NEW_LINE>int version = Integer.parseInt(firstLine.get(0));<NEW_LINE>DateTime creationTime = DateTime.parse(firstLine.get(1));<NEW_LINE>checkArgument(version == 1, String.format("Line 1: Expected version 1, found %d", version));<NEW_LINE>// Second line contains headers: DNL,lookup-key,insertion-datetime<NEW_LINE>List<String> secondLine = Splitter.on(',').splitToList(lines.get(1));<NEW_LINE>checkArgument(secondLine.size() == 3, String.format("Line 2: Expected 3 elements, found %d", secondLine.size()));<NEW_LINE>checkArgument("DNL".equals(secondLine.get(0)), String.format("Line 2: Expected header \"DNL\", found \"%s\"", secondLine.get(0)));<NEW_LINE>checkArgument("lookup-key".equals(secondLine.get(1)), String.format("Line 2: Expected header \"lookup-key\", found \"%s\"", secondLine.get(1)));<NEW_LINE>checkArgument("insertion-datetime".equals(secondLine.get(2)), String.format("Line 2: Expected header \"insertion-datetime\", found \"%s\"", secondLine.get(2)));<NEW_LINE>// Subsequent lines: <DNL>,<lookup key>,<DNL insertion datetime><NEW_LINE>for (int i = 2; i < lines.size(); i++) {<NEW_LINE>List<String> currentLine = Splitter.on(',').splitToList(lines.get(i));<NEW_LINE>checkArgument(currentLine.size() == 3, String.format("Line %d: Expected 3 elements, found %d", i + 1, currentLine.size()));<NEW_LINE>String label = currentLine.get(0);<NEW_LINE>String <MASK><NEW_LINE>// This is the insertion time, currently unused.<NEW_LINE>DateTime.parse(currentLine.get(2));<NEW_LINE>builder.put(label, lookupKey);<NEW_LINE>}<NEW_LINE>return ClaimsList.create(creationTime, builder.build());<NEW_LINE>} | lookupKey = currentLine.get(1); |
1,502,450 | void write(XMLWriter writer) throws java.io.IOException {<NEW_LINE>if (!_ephemeral) {<NEW_LINE>java.util.List<String[]> attributes = new java.util.LinkedList<String[]>();<NEW_LINE>attributes.add<MASK><NEW_LINE>writer.writeStartTag("service-template", attributes);<NEW_LINE>writeParameters(writer, _templateDescriptor.parameters, _templateDescriptor.parameterDefaults);<NEW_LINE>ServiceDescriptor descriptor = (ServiceDescriptor) _templateDescriptor.descriptor;<NEW_LINE>writer.writeStartTag("service", PlainService.createAttributes(descriptor));<NEW_LINE>if (descriptor.description.length() > 0) {<NEW_LINE>writer.writeElement("description", descriptor.description);<NEW_LINE>}<NEW_LINE>writePropertySet(writer, descriptor.propertySet, descriptor.adapters, descriptor.logs);<NEW_LINE>writeLogs(writer, descriptor.logs, descriptor.propertySet.properties);<NEW_LINE>_adapters.write(writer, descriptor.propertySet.properties);<NEW_LINE>_dbEnvs.write(writer);<NEW_LINE>writer.writeEndTag("service");<NEW_LINE>writer.writeEndTag("service-template");<NEW_LINE>}<NEW_LINE>} | (createAttribute("id", _id)); |
1,143,871 | static public CurrencyValue convertFromValue(ExchangeBasedCurrencyValue value, String targetCurrency, ExchangeRateProvider exchangeRateManager) {<NEW_LINE>if (targetCurrency.equals(value.getCurrency())) {<NEW_LINE>return value;<NEW_LINE>} else if (value.hasExactValue() && value.getExactValue().getCurrency().equals(targetCurrency)) {<NEW_LINE>return value.getExactValue();<NEW_LINE>} else {<NEW_LINE>String sourceCurrency = value.getCurrency();<NEW_LINE>GetExchangeRate fx = new GetExchangeRate(targetCurrency, sourceCurrency, exchangeRateManager).invoke();<NEW_LINE>if (fx.getSourcePrice() == null || fx.getTargetPrice() == null) {<NEW_LINE>if (targetCurrency.equals(CurrencyValue.BTC)) {<NEW_LINE>return new ExchangeBasedBitcoinValue(targetCurrency, (Long) null, value.getExactValue());<NEW_LINE>} else {<NEW_LINE>return new ExchangeBasedFiatValue(targetCurrency, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>BigDecimal fromValueDecimal = value.getValue();<NEW_LINE>BigDecimal newValue = null;<NEW_LINE>if (fromValueDecimal != null) {<NEW_LINE>newValue = fromValueDecimal.divide(fx.getSourcePrice(), 8, RoundingMode.HALF_UP).multiply(fx.getTargetPrice());<NEW_LINE>}<NEW_LINE>if (targetCurrency.equals(CurrencyValue.BTC)) {<NEW_LINE>return new ExchangeBasedBitcoinValue(targetCurrency, newValue, value.getExactValue());<NEW_LINE>} else {<NEW_LINE>return new ExchangeBasedFiatValue(targetCurrency, newValue, value.getExactValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | null, value.getExactValue()); |
703,557 | public StreamEvent find(CompiledCondition compiledCondition, StateEvent matchingEvent) throws ConnectionUnavailableException {<NEW_LINE>RecordStoreCompiledCondition recordStoreCompiledCondition = ((RecordStoreCompiledCondition) compiledCondition);<NEW_LINE>Map<String, Object> findConditionParameterMap = new HashMap<>();<NEW_LINE>for (Map.Entry<String, ExpressionExecutor> entry : recordStoreCompiledCondition.variableExpressionExecutorMap.entrySet()) {<NEW_LINE>findConditionParameterMap.put(entry.getKey(), entry.getValue().execute(matchingEvent));<NEW_LINE>}<NEW_LINE>Iterator<Object[]> records;<NEW_LINE>if (recordTableHandler != null) {<NEW_LINE>records = recordTableHandler.find(matchingEvent.getTimestamp(), <MASK><NEW_LINE>} else {<NEW_LINE>records = find(findConditionParameterMap, recordStoreCompiledCondition.getCompiledCondition());<NEW_LINE>}<NEW_LINE>ComplexEventChunk<StreamEvent> streamEventComplexEventChunk = new ComplexEventChunk<>();<NEW_LINE>if (records != null) {<NEW_LINE>while (records.hasNext()) {<NEW_LINE>Object[] record = records.next();<NEW_LINE>StreamEvent streamEvent = storeEventPool.newInstance();<NEW_LINE>System.arraycopy(record, 0, streamEvent.getOutputData(), 0, record.length);<NEW_LINE>streamEventComplexEventChunk.add(streamEvent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return streamEventComplexEventChunk.getFirst();<NEW_LINE>} | findConditionParameterMap, recordStoreCompiledCondition.getCompiledCondition()); |
1,659,722 | private static <T> IExpectationSetters<T> doExpectNew(Class<T> type, MockStrategy mockStrategy, Class<?>[] parameterTypes, Object... arguments) throws Exception {<NEW_LINE>if (type == null) {<NEW_LINE>throw new IllegalArgumentException("type cannot be null");<NEW_LINE>} else if (mockStrategy == null) {<NEW_LINE>throw new IllegalArgumentException("Internal error: Mock strategy cannot be null");<NEW_LINE>}<NEW_LINE>final boolean isNiceMock = mockStrategy instanceof NiceMockStrategy;<NEW_LINE>final Class<T> unmockedType = (Class<T>) WhiteboxImpl.getOriginalUnmockedType(type);<NEW_LINE>if (!isNiceMock) {<NEW_LINE>if (parameterTypes == null) {<NEW_LINE>WhiteboxImpl.findUniqueConstructorOrThrowException(type, arguments);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>NewInvocationControl<IExpectationSetters<T>> newInvocationControl = (NewInvocationControl<IExpectationSetters<T>>) MockRepository.getNewInstanceControl(unmockedType);<NEW_LINE>if (newInvocationControl == null) {<NEW_LINE>InvocationSubstitute<T> mock = doMock(InvocationSubstitute.class, false, mockStrategy, null, (Method[]) null);<NEW_LINE>newInvocationControl = new EasyMockNewInvocationControl<T>(mock, type);<NEW_LINE>MockRepository.putNewInstanceControl(type, newInvocationControl);<NEW_LINE>MockRepository.addObjectsToAutomaticallyReplayAndVerify(WhiteboxImpl.getOriginalUnmockedType(type));<NEW_LINE>}<NEW_LINE>if (isNiceMock && (arguments == null || arguments.length == 0)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return newInvocationControl.expectSubstitutionLogic(arguments);<NEW_LINE>} | WhiteboxImpl.getConstructor(unmockedType, parameterTypes); |
1,158,620 | private static void addBucketStats(HtmlTable.Row row, ContentNodeStats.BucketSpaceStats bucketSpaceStats, double minMergeCompletionRatio) {<NEW_LINE>if (bucketSpaceStats != null) {<NEW_LINE><MASK><NEW_LINE>long bucketsTotal = bucketSpaceStats.getBucketsTotal();<NEW_LINE>String cellValuePending = String.valueOf(bucketsPending);<NEW_LINE>String cellValueTotal = String.valueOf(bucketsTotal);<NEW_LINE>if (!bucketSpaceStats.valid()) {<NEW_LINE>cellValuePending += "?";<NEW_LINE>cellValueTotal += "?";<NEW_LINE>}<NEW_LINE>row.addCell(new HtmlTable.Cell(cellValuePending));<NEW_LINE>if (bucketSpaceStats.mayHaveBucketsPending(minMergeCompletionRatio)) {<NEW_LINE>row.getLastCell().addProperties(WARNING_PROPERTY);<NEW_LINE>}<NEW_LINE>row.addCell(new HtmlTable.Cell(cellValueTotal));<NEW_LINE>} else {<NEW_LINE>row.addCell(new HtmlTable.Cell("-").addProperties(CENTERED_PROPERTY));<NEW_LINE>row.addCell(new HtmlTable.Cell("-").addProperties(CENTERED_PROPERTY));<NEW_LINE>}<NEW_LINE>} | long bucketsPending = bucketSpaceStats.getBucketsPending(); |
920,313 | private /*<NEW_LINE>* StackFrame frame = getFrame(insn); Operand[] out = frame.out(); Operand dup, dup2 = null, dupd, dupd2 = null; if (out ==<NEW_LINE>* null) { dupd = popImmediate(); dup = new Operand(insn, dupd.stackOrValue()); if (dword) { dupd2 = peek(); if (dupd2 ==<NEW_LINE>* DWORD_DUMMY) { pop(); dupd2 = dupd; } else { dupd2 = popImmediate(); } dup2 = new Operand(insn, dupd2.stackOrValue());<NEW_LINE>* frame.out(dup, dup2); frame.in(dupd, dupd2); } else { frame.out(dup); frame.in(dupd); } } else { dupd = pop(); dup =<NEW_LINE>* out[0]; if (dword) { dupd2 = pop(); if (dupd2 == DWORD_DUMMY) dupd2 = dupd; dup2 = out[1]; frame.mergeIn(dupd, dupd2); }<NEW_LINE>* else { frame.mergeIn(dupd); } }<NEW_LINE>*/<NEW_LINE>void convertArrayLoadInsn(InsnNode insn) {<NEW_LINE>StackFrame frame = getFrame(insn);<NEW_LINE>Operand[] out = frame.out();<NEW_LINE>Operand opr;<NEW_LINE>if (out == null) {<NEW_LINE>Operand indx = popImmediate();<NEW_LINE>Operand base = popImmediate();<NEW_LINE>// We have a sample of totally broken code with a reference to a null array<NEW_LINE>// x = null[i]<NEW_LINE>// We silently fix this issue and return a null value<NEW_LINE>if (base.value == NullConstant.v()) {<NEW_LINE>opr = new Operand(<MASK><NEW_LINE>frame.in(indx, base);<NEW_LINE>frame.out(opr);<NEW_LINE>} else {<NEW_LINE>ArrayRef ar = Jimple.v().newArrayRef(base.stackOrValue(), indx.stackOrValue());<NEW_LINE>indx.addBox(ar.getIndexBox());<NEW_LINE>base.addBox(ar.getBaseBox());<NEW_LINE>opr = new Operand(insn, ar);<NEW_LINE>frame.in(indx, base);<NEW_LINE>frame.boxes(ar.getIndexBox(), ar.getBaseBox());<NEW_LINE>frame.out(opr);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>opr = out[0];<NEW_LINE>frame.mergeIn(pop(), pop());<NEW_LINE>}<NEW_LINE>int op = insn.getOpcode();<NEW_LINE>if (op == DALOAD || op == LALOAD) {<NEW_LINE>pushDual(opr);<NEW_LINE>} else {<NEW_LINE>push(opr);<NEW_LINE>}<NEW_LINE>} | insn, NullConstant.v()); |
653,369 | static MethodReader resolveMethodImplementation(ClassReaderSource classSource, String className, MethodDescriptor methodDescriptor, Set<String> visited) {<NEW_LINE>if (!visited.add(className)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ClassReader cls = classSource.get(className);<NEW_LINE>if (cls == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>MethodReader method = cls.getMethod(methodDescriptor);<NEW_LINE>if (method != null && !method.hasModifier(ElementModifier.ABSTRACT)) {<NEW_LINE>return method;<NEW_LINE>}<NEW_LINE>MethodReader mostSpecificMethod = null;<NEW_LINE>List<String> superClasses = new ArrayList<>();<NEW_LINE>if (cls.getParent() != null) {<NEW_LINE>superClasses.add(cls.getParent());<NEW_LINE>}<NEW_LINE>superClasses.<MASK><NEW_LINE>for (String superClass : superClasses) {<NEW_LINE>MethodReader resultFromSuperClass = resolveMethodImplementation(classSource, superClass, methodDescriptor, visited);<NEW_LINE>if (resultFromSuperClass != null) {<NEW_LINE>if (mostSpecificMethod == null || classSource.isSuperType(mostSpecificMethod.getOwnerName(), resultFromSuperClass.getOwnerName()).orElse(false)) {<NEW_LINE>mostSpecificMethod = resultFromSuperClass;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return mostSpecificMethod;<NEW_LINE>} | addAll(cls.getInterfaces()); |
1,480,881 | public DescribeContactFlowModuleResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeContactFlowModuleResult describeContactFlowModuleResult = new DescribeContactFlowModuleResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeContactFlowModuleResult;<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("ContactFlowModule", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeContactFlowModuleResult.setContactFlowModule(ContactFlowModuleJsonUnmarshaller.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 describeContactFlowModuleResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
590,311 | public void marshall(EdgeModelStat edgeModelStat, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (edgeModelStat == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(edgeModelStat.getModelName(), MODELNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(edgeModelStat.getOfflineDeviceCount(), OFFLINEDEVICECOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(edgeModelStat.getConnectedDeviceCount(), CONNECTEDDEVICECOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(edgeModelStat.getActiveDeviceCount(), ACTIVEDEVICECOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(edgeModelStat.getSamplingDeviceCount(), SAMPLINGDEVICECOUNT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | edgeModelStat.getModelVersion(), MODELVERSION_BINDING); |
461,691 | public void flatMap(BaseRow input, Collector<BaseRow> out) throws Exception {<NEW_LINE>GenericRow genericRow = (GenericRow) input;<NEW_LINE>Map<String, Object> refData = Maps.newHashMap();<NEW_LINE>for (int i = 0; i < sideInfo.getEqualValIndex().size(); i++) {<NEW_LINE>Integer conValIndex = sideInfo.getEqualValIndex().get(i);<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>RowDataComplete.collectBaseRow(out, data);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>refData.put(sideInfo.getEqualFieldList().get(i), equalObj);<NEW_LINE>}<NEW_LINE>String rowKeyStr = ((HbaseAllSideInfo) sideInfo).getRowKeyBuilder().getRowKey(refData);<NEW_LINE>Map<String, Object> cacheList = null;<NEW_LINE><MASK><NEW_LINE>HbaseSideTableInfo hbaseSideTableInfo = (HbaseSideTableInfo) sideTableInfo;<NEW_LINE>if (hbaseSideTableInfo.isPreRowKey()) {<NEW_LINE>for (Map.Entry<String, Map<String, Object>> entry : cacheRef.get().entrySet()) {<NEW_LINE>if (entry.getKey().startsWith(rowKeyStr)) {<NEW_LINE>cacheList = cacheRef.get().get(entry.getKey());<NEW_LINE>BaseRow row = fillData(input, cacheList);<NEW_LINE>RowDataComplete.collectBaseRow(out, row);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>cacheList = cacheRef.get().get(rowKeyStr);<NEW_LINE>BaseRow row = fillData(input, cacheList);<NEW_LINE>RowDataComplete.collectBaseRow(out, row);<NEW_LINE>}<NEW_LINE>} | AbstractSideTableInfo sideTableInfo = sideInfo.getSideTableInfo(); |
812,594 | private void initializeFilterAdd() {<NEW_LINE>final List<GeocacheFilterType> filterTypes = new ArrayList<>(CollectionStream.of(GeocacheFilterType.values()).filter(GeocacheFilterType::displayToUser).toList());<NEW_LINE>filterTypes.removeAll(INTERNAL_FILTER_TYPES_SET);<NEW_LINE>Collections.sort(filterTypes, (left, right) -> TextUtils.COLLATOR.compare(left.getUserDisplayableName(), right.getUserDisplayableName()));<NEW_LINE>addFilter.setValues(filterTypes).setDisplayMapper(GeocacheFilterType::getUserDisplayableName).setTextHideSelectionMarker(true).setView(binding.filterAdditem, (v, t) -> {<NEW_LINE>}).setTextGroupMapper(GeocacheFilterType::getUserDisplayableGroup).setChangeListener(gcf -> {<NEW_LINE>filterListAdapter.addItem(0, FilterViewHolderCreator<MASK><NEW_LINE>binding.filterList.smoothScrollToPosition(0);<NEW_LINE>adjustFilterEmptyView();<NEW_LINE>}, false);<NEW_LINE>} | .createFor(gcf, this)); |
498,889 | final CreatePackageResult executeCreatePackage(CreatePackageRequest createPackageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createPackageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreatePackageRequest> request = null;<NEW_LINE>Response<CreatePackageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreatePackageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createPackageRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "OpenSearch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreatePackage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreatePackageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreatePackageResultJsonUnmarshaller());<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>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
168,178 | private void filter() {<NEW_LINE>Map<String, String> schema = (Map<String, String>) response.getHeaders().get("schema");<NEW_LINE>if (schema == null || schema.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<PolicyInventory, List<PolicyStatement>> denyPolices = RBACManager.collectDenyStatements(RBACManager.getPoliciesByAPI(request));<NEW_LINE>denyPolices.forEach((p, sts) -> sts.forEach(s -> s.getResources().forEach(statement -> {<NEW_LINE>schema.forEach((path, type) -> {<NEW_LINE>String[] ss = <MASK><NEW_LINE>String resourceName = ss[0];<NEW_LINE>String fieldList = null;<NEW_LINE>if (ss.length > 1) {<NEW_LINE>fieldList = ss[1];<NEW_LINE>}<NEW_LINE>Pattern pattern = Pattern.compile(resourceName);<NEW_LINE>if (!pattern.matcher(type).matches()) {<NEW_LINE>// the statement not matching this inventory<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fieldList == null) {<NEW_LINE>// the whole inventory is denied<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace(String.format("[RBAC] denied inventory[%s] at %s", type, path));<NEW_LINE>}<NEW_LINE>denyTheInventory(path);<NEW_LINE>} else {<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace(String.format("[RBAC] denied fields[%s] of inventory[%s] at %s", fieldList, type, path));<NEW_LINE>}<NEW_LINE>denyFieldsOfTheInventory(path, fieldList);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>})));<NEW_LINE>} | statement.split(":", 2); |
1,062,212 | public void addInstanceRules(RuleStore rs) {<NEW_LINE>// parent rules already added<NEW_LINE>super.addInstanceRules(rs);<NEW_LINE>rs.addRule(new ElementSelector("configuration"), new ConfigurationAction());<NEW_LINE>rs.addRule(new ElementSelector("configuration/contextName"), new ContextNameAction());<NEW_LINE>rs.addRule(new ElementSelector("configuration/contextListener"), new LoggerContextListenerAction());<NEW_LINE>rs.addRule(new ElementSelector(<MASK><NEW_LINE>rs.addRule(new ElementSelector("configuration/appender/sift/*"), new NOPAction());<NEW_LINE>rs.addRule(new ElementSelector("configuration/logger"), new LoggerAction());<NEW_LINE>rs.addRule(new ElementSelector("configuration/logger/level"), new LevelAction());<NEW_LINE>rs.addRule(new ElementSelector("configuration/root"), new RootLoggerAction());<NEW_LINE>rs.addRule(new ElementSelector("configuration/root/level"), new LevelAction());<NEW_LINE>rs.addRule(new ElementSelector("configuration/logger/appender-ref"), new AppenderRefAction<ILoggingEvent>());<NEW_LINE>rs.addRule(new ElementSelector("configuration/root/appender-ref"), new AppenderRefAction<ILoggingEvent>());<NEW_LINE>rs.addRule(new ElementSelector("configuration/include"), new IncludeAction());<NEW_LINE>rs.addRule(new ElementSelector("configuration/includes"), new FindIncludeAction());<NEW_LINE>rs.addRule(new ElementSelector("configuration/includes/include"), new ConditionalIncludeAction());<NEW_LINE>rs.addRule(new ElementSelector("configuration/receiver"), new ReceiverAction());<NEW_LINE>} | "configuration/appender/sift"), new SiftAction()); |
1,321,191 | public static void main(String[] args) throws Exception {<NEW_LINE>VerifiableProperties properties = ToolUtils.getVerifiableProperties(args);<NEW_LINE>DiskReformatterConfig config = new DiskReformatterConfig(properties);<NEW_LINE>StoreConfig storeConfig = new StoreConfig(properties);<NEW_LINE>ClusterMapConfig clusterMapConfig = new ClusterMapConfig(properties);<NEW_LINE>ServerConfig serverConfig = new ServerConfig(properties);<NEW_LINE>ClusterAgentsFactory clusterAgentsFactory = Utils.getObj(clusterMapConfig.clusterMapClusterAgentsFactory, clusterMapConfig, config.hardwareLayoutFilePath, config.partitionLayoutFilePath);<NEW_LINE>try (ClusterMap clusterMap = clusterAgentsFactory.getClusterMap()) {<NEW_LINE>StoreKeyConverterFactory storeKeyConverterFactory = Utils.getObj(serverConfig.serverStoreKeyConverterFactory, properties, clusterMap.getMetricRegistry());<NEW_LINE>StoreKeyFactory storeKeyFactory = Utils.getObj(storeConfig.storeKeyFactory, clusterMap);<NEW_LINE>DataNodeId dataNodeId = clusterMap.getDataNodeId(config.datanodeHostname, config.datanodePort);<NEW_LINE>if (dataNodeId == null) {<NEW_LINE>throw new IllegalArgumentException("Did not find node in clustermap with hostname:port - " + config.datanodeHostname + ":" + config.datanodePort);<NEW_LINE>}<NEW_LINE>DiskReformatter reformatter = new DiskReformatter(dataNodeId, Collections.EMPTY_LIST, config.fetchSizeInBytes, storeConfig, storeKeyFactory, clusterMap, SystemTime.getInstance(), storeKeyConverterFactory.getStoreKeyConverter());<NEW_LINE>AtomicInteger exitStatus = new AtomicInteger(0);<NEW_LINE>CountDownLatch latch = new CountDownLatch(config.diskMountPaths.length);<NEW_LINE>for (int i = 0; i < config.diskMountPaths.length; i++) {<NEW_LINE>int finalI = i;<NEW_LINE>Runnable runnable = () -> {<NEW_LINE>try {<NEW_LINE>reformatter.reformat(config.diskMountPaths[finalI], new File(config.scratchPaths[finalI]));<NEW_LINE>latch.countDown();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Thread thread = Utils.newThread(config.diskMountPaths[finalI] + "-reformatter", runnable, true);<NEW_LINE>thread.setUncaughtExceptionHandler((t, e) -> {<NEW_LINE>exitStatus.set(1);<NEW_LINE>logger.error("Reformatting {} failed", config<MASK><NEW_LINE>latch.countDown();<NEW_LINE>});<NEW_LINE>thread.start();<NEW_LINE>}<NEW_LINE>latch.await();<NEW_LINE>System.exit(exitStatus.get());<NEW_LINE>}<NEW_LINE>} | .diskMountPaths[finalI], e); |
172,621 | public static void horizontal(Kernel1D_F64 kernel, GrayF64 src, GrayF64 dst, ImageBorder_F64 bsrc) {<NEW_LINE>dst.reshape(src.width, src.height);<NEW_LINE>// if( BOverrideConvolveImageNormalized.invokeNativeHorizontal(kernel,src,dst) )<NEW_LINE>// return;<NEW_LINE>bsrc.setImage(src);<NEW_LINE>if (kernel.width >= src.width) {<NEW_LINE>ConvolveNormalizedNaive_SB.horizontal(kernel, src, dst, bsrc);<NEW_LINE>} else {<NEW_LINE>if (Math.abs(kernel.computeSum() - 1.0f) > 1e-4f) {<NEW_LINE>Kernel1D_F64 k = kernel.copy();<NEW_LINE>KernelMath.normalizeSumToOne(k);<NEW_LINE>kernel = k;<NEW_LINE>}<NEW_LINE>ConvolveImageNoBorder.horizontal(kernel, src, dst);<NEW_LINE>ConvolveJustBorder_General_SB.<MASK><NEW_LINE>}<NEW_LINE>} | horizontal(kernel, bsrc, dst); |
1,186,272 | public List<TxEvent> sagaSuccessfulEvents(String globalTxId, String localTxId_1, String localTxId_2, String localTxId_3) {<NEW_LINE>List<TxEvent> sagaEvents = new ArrayList<>();<NEW_LINE>sagaEvents.add(new TxEvent(EventType.SagaStartedEvent, globalTxId, globalTxId, globalTxId, "", 0, null, 0, 0, 0, 0, 0));<NEW_LINE>sagaEvents.add(new TxEvent(EventType.TxStartedEvent, globalTxId, localTxId_1, globalTxId, "service a", 0, null, 0, 0, 0, 0, 0));<NEW_LINE>sagaEvents.add(new TxEvent(EventType.TxEndedEvent, globalTxId, localTxId_1, globalTxId, "service a", 0, null, 0, 0, 0, 0, 0));<NEW_LINE>sagaEvents.add(new TxEvent(EventType.TxStartedEvent, globalTxId, localTxId_2, globalTxId, "service b", 0, null, 0, 0, 0, 0, 0));<NEW_LINE>sagaEvents.add(new TxEvent(EventType.TxEndedEvent, globalTxId, localTxId_2, globalTxId, "service b", 0, null, 0, 0, 0, 0, 0));<NEW_LINE>sagaEvents.add(new TxEvent(EventType.TxStartedEvent, globalTxId, localTxId_3, globalTxId, "service c", 0, null, 0, 0, 0, 0, 0));<NEW_LINE>sagaEvents.add(new TxEvent(EventType.TxEndedEvent, globalTxId, localTxId_3, globalTxId, "service c", 0, null, 0, 0<MASK><NEW_LINE>sagaEvents.add(new TxEvent(EventType.SagaEndedEvent, globalTxId, globalTxId, globalTxId, "", 0, null, 0, 0, 0, 0, 0));<NEW_LINE>return sagaEvents;<NEW_LINE>} | , 0, 0, 0)); |
1,846,616 | public void marshall(Action action, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (action == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(action.getDynamoDB(), DYNAMODB_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(action.getLambda(), LAMBDA_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getSns(), SNS_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getSqs(), SQS_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getKinesis(), KINESIS_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getRepublish(), REPUBLISH_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getS3(), S3_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getFirehose(), FIREHOSE_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getCloudwatchMetric(), CLOUDWATCHMETRIC_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getCloudwatchAlarm(), CLOUDWATCHALARM_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getCloudwatchLogs(), CLOUDWATCHLOGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getElasticsearch(), ELASTICSEARCH_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getSalesforce(), SALESFORCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getIotAnalytics(), IOTANALYTICS_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getIotEvents(), IOTEVENTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getIotSiteWise(), IOTSITEWISE_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getStepFunctions(), STEPFUNCTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getTimestream(), TIMESTREAM_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getHttp(), HTTP_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getKafka(), KAFKA_BINDING);<NEW_LINE>protocolMarshaller.marshall(action.getOpenSearch(), OPENSEARCH_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | action.getDynamoDBv2(), DYNAMODBV2_BINDING); |
1,533,631 | public void marshall(EnhancedImageScanFinding enhancedImageScanFinding, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (enhancedImageScanFinding == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(enhancedImageScanFinding.getAwsAccountId(), AWSACCOUNTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(enhancedImageScanFinding.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(enhancedImageScanFinding.getFindingArn(), FINDINGARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(enhancedImageScanFinding.getFirstObservedAt(), FIRSTOBSERVEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(enhancedImageScanFinding.getLastObservedAt(), LASTOBSERVEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(enhancedImageScanFinding.getPackageVulnerabilityDetails(), PACKAGEVULNERABILITYDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(enhancedImageScanFinding.getResources(), RESOURCES_BINDING);<NEW_LINE>protocolMarshaller.marshall(enhancedImageScanFinding.getScore(), SCORE_BINDING);<NEW_LINE>protocolMarshaller.marshall(enhancedImageScanFinding.getScoreDetails(), SCOREDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(enhancedImageScanFinding.getSeverity(), SEVERITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(enhancedImageScanFinding.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(enhancedImageScanFinding.getTitle(), TITLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(enhancedImageScanFinding.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(enhancedImageScanFinding.getUpdatedAt(), UPDATEDAT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | enhancedImageScanFinding.getRemediation(), REMEDIATION_BINDING); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.