idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,300,417 | private void registerHandlers(RaftServerProtocol protocol) {<NEW_LINE>protocol.registerOpenSessionHandler(request -> runOnContextIfReady(() -> role.onOpenSession(request), OpenSessionResponse::builder));<NEW_LINE>protocol.registerCloseSessionHandler(request -> runOnContextIfReady(() -> role.onCloseSession(request), CloseSessionResponse::builder));<NEW_LINE>protocol.registerKeepAliveHandler(request -> runOnContextIfReady(() -> role.onKeepAlive(request), KeepAliveResponse::builder));<NEW_LINE>protocol.registerMetadataHandler(request -> runOnContextIfReady(() -> role.onMetadata(request), MetadataResponse::builder));<NEW_LINE>protocol.registerConfigureHandler(request -> runOnContext(() -> role.onConfigure(request)));<NEW_LINE>protocol.registerInstallHandler(request -> runOnContext(() -> role.onInstall(request)));<NEW_LINE>protocol.registerJoinHandler(request -> runOnContext(() -> role.onJoin(request)));<NEW_LINE>protocol.registerReconfigureHandler(request -> runOnContext(() -> role.onReconfigure(request)));<NEW_LINE>protocol.registerLeaveHandler(request -> runOnContext(() -> role.onLeave(request)));<NEW_LINE>protocol.registerTransferHandler(request -> runOnContext(() -> role.onTransfer(request)));<NEW_LINE>protocol.registerAppendHandler(request -> runOnContext(() -> role.onAppend(request)));<NEW_LINE>protocol.registerPollHandler(request -> runOnContext(() -> role.onPoll(request)));<NEW_LINE>protocol.registerVoteHandler(request -> runOnContext(() -> role.onVote(request)));<NEW_LINE>protocol.registerCommandHandler(request -> runOnContextIfReady(() -> role.onCommand(request), CommandResponse::builder));<NEW_LINE>protocol.registerQueryHandler(request -> runOnContextIfReady(() -> role.onQuery(<MASK><NEW_LINE>} | request), QueryResponse::builder)); |
45,791 | public void newRevision(BimServerClientInterface bimServerClientInterface, long poid, long roid, String userToken, long soid, SObjectType settings) throws ServerException, UserException {<NEW_LINE>try {<NEW_LINE>Long topicId = bimServerClientInterface.getRegistry().registerProgressOnRevisionTopic(SProgressTopicType.RUNNING_SERVICE, poid, roid, "Running " + name);<NEW_LINE>RunningService runningService = new RunningService(topicId, bimServerClientInterface, pluginConfiguration, bimServerClientInterface.getAuthInterface().getLoggedInUser().getUsername());<NEW_LINE>try {<NEW_LINE>SLongActionState state = new SLongActionState();<NEW_LINE>state.setProgress(getProgressType() == ProgressType.KNOWN ? 0 : -1);<NEW_LINE>state.setTitle(name);<NEW_LINE>state.setState(SActionState.STARTED);<NEW_LINE>state.setStart(runningService.getStartDate());<NEW_LINE>bimServerClientInterface.getRegistry().updateProgressTopic(topicId, state);<NEW_LINE>AbstractService.this.newRevision(runningService, bimServerClientInterface, poid, roid, userToken, soid, settings);<NEW_LINE>state = new SLongActionState();<NEW_LINE>state.setProgress(100);<NEW_LINE>state.setTitle(name);<NEW_LINE>state.setState(SActionState.FINISHED);<NEW_LINE>state.setStart(runningService.getStartDate());<NEW_LINE>state.setEnd(new Date());<NEW_LINE>bimServerClientInterface.getRegistry(<MASK><NEW_LINE>} catch (BimServerClientException e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>} finally {<NEW_LINE>bimServerClientInterface.getRegistry().unregisterProgressTopic(topicId);<NEW_LINE>}<NEW_LINE>} catch (PublicInterfaceNotFoundException e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>}<NEW_LINE>} | ).updateProgressTopic(topicId, state); |
642,871 | private void flush() {<NEW_LINE>if (readOnly)<NEW_LINE>return;<NEW_LINE>if (// Append mode<NEW_LINE>out != null)<NEW_LINE>return;<NEW_LINE>if (// No file-backing<NEW_LINE>path == null)<NEW_LINE>return;<NEW_LINE>if (opts.verbose >= 2) {<NEW_LINE>LogInfo.begin_track("FileStringCache FLUSH (dump mode)");<NEW_LINE>LogInfo.logs("Size: %d", size());<NEW_LINE>if (cache instanceof LruMap)<NEW_LINE>LogInfo.logs("Memory: %d", ((LruMap<String, String>) cache).getBytes());<NEW_LINE>LogInfo.logs("Touches: %d", numTouches);<NEW_LINE>LogInfo.logs("Evictions: %d", numEvictions);<NEW_LINE>LogInfo.logs("Evicted keys: %s", keyStats);<NEW_LINE>LogInfo.logs("Evicted values: %s", valStats);<NEW_LINE>LogInfo.end_track();<NEW_LINE>}<NEW_LINE>PrintWriter dumpOut = IOUtils.openOutHard(this.path + ".tmp");<NEW_LINE>for (Map.Entry<String, String> entry : cache.entrySet()) {<NEW_LINE>dumpOut.println(entry.getKey() + <MASK><NEW_LINE>}<NEW_LINE>dumpOut.flush();<NEW_LINE>dumpOut.close();<NEW_LINE>try {<NEW_LINE>Path src = FileSystems.getDefault().getPath(this.path + ".tmp");<NEW_LINE>Path dst = FileSystems.getDefault().getPath(this.path);<NEW_LINE>Files.move(src, dst, StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | "\t" + entry.getValue()); |
1,778,824 | final UpdateJourneyResult executeUpdateJourney(UpdateJourneyRequest updateJourneyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateJourneyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateJourneyRequest> request = null;<NEW_LINE>Response<UpdateJourneyResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UpdateJourneyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateJourneyRequest));<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, "Pinpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateJourney");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateJourneyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateJourneyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,041,942 | public void itemStateChanged(ItemEvent e) {<NEW_LINE>// If selected: disable buttons, set their bg values from default setting, set sample bg & fg<NEW_LINE>// If deselected: enable buttons, set their bg values from current setting, set sample bg & bg<NEW_LINE>Color newBackground = null;<NEW_LINE>Color newForeground = null;<NEW_LINE>Font newFont = null;<NEW_LINE>if (e.getStateChange() == ItemEvent.SELECTED) {<NEW_LINE>backgroundButtons[position].setEnabled(false);<NEW_LINE>foregroundButtons[position].setEnabled(false);<NEW_LINE>fontButtons[position].setEnabled(false);<NEW_LINE>newBackground = Globals.getSettings().getDefaultColorSettingByPosition(backgroundSettingPositions[position]);<NEW_LINE>newForeground = Globals.getSettings().getDefaultColorSettingByPosition(foregroundSettingPositions[position]);<NEW_LINE>newFont = Globals.getSettings().getDefaultFontByPosition(fontSettingPositions[position]);<NEW_LINE>currentNondefaultBackground[position] = backgroundButtons[position].getBackground();<NEW_LINE>currentNondefaultForeground[position] = foregroundButtons[position].getBackground();<NEW_LINE>currentNondefaultFont[position] = samples[position].getFont();<NEW_LINE>} else {<NEW_LINE>backgroundButtons<MASK><NEW_LINE>foregroundButtons[position].setEnabled(true);<NEW_LINE>fontButtons[position].setEnabled(true);<NEW_LINE>newBackground = currentNondefaultBackground[position];<NEW_LINE>newForeground = currentNondefaultForeground[position];<NEW_LINE>newFont = currentNondefaultFont[position];<NEW_LINE>}<NEW_LINE>backgroundButtons[position].setBackground(newBackground);<NEW_LINE>foregroundButtons[position].setBackground(newForeground);<NEW_LINE>// fontButtons[position].setFont(newFont);<NEW_LINE>samples[position].setBackground(newBackground);<NEW_LINE>samples[position].setForeground(newForeground);<NEW_LINE>samples[position].setFont(newFont);<NEW_LINE>} | [position].setEnabled(true); |
734,585 | private void processIntersectingRange(@Nonnull UsageInfo2UsageAdapter usageInfo2UsageAdapter, @Nonnull final CharSequence chars, int hiStart, final int hiEnd, @Nonnull final TextAttributesKey[] tokenHighlights, final boolean selectUsageWithBold, @Nonnull final List<TextChunk> result) {<NEW_LINE>final TextAttributes originalAttrs = convertAttributes(tokenHighlights);<NEW_LINE>if (selectUsageWithBold) {<NEW_LINE>originalAttrs.setFontType(Font.PLAIN);<NEW_LINE>}<NEW_LINE>final int[] lastOffset = { hiStart };<NEW_LINE>usageInfo2UsageAdapter.processRangeMarkers(new Processor<Segment>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean process(Segment segment) {<NEW_LINE>int usageStart = segment.getStartOffset();<NEW_LINE>int usageEnd = segment.getEndOffset();<NEW_LINE>if (rangeIntersect(lastOffset[0], hiEnd, usageStart, usageEnd)) {<NEW_LINE>addChunk(chars, lastOffset[0], Math.max(lastOffset[0], usageStart), <MASK><NEW_LINE>UsageType usageType = isHighlightedAsString(tokenHighlights) ? UsageType.LITERAL_USAGE : isHighlightedAsComment(tokenHighlights) ? UsageType.COMMENT_USAGE : null;<NEW_LINE>addChunk(chars, Math.max(lastOffset[0], usageStart), Math.min(hiEnd, usageEnd), originalAttrs, selectUsageWithBold, usageType, result);<NEW_LINE>lastOffset[0] = usageEnd;<NEW_LINE>if (usageEnd > hiEnd) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (lastOffset[0] < hiEnd) {<NEW_LINE>addChunk(chars, lastOffset[0], hiEnd, originalAttrs, false, null, result);<NEW_LINE>}<NEW_LINE>} | originalAttrs, false, null, result); |
1,247,294 | private soot.Value createLiteral(polyglot.ast.Lit lit) {<NEW_LINE>if (lit instanceof polyglot.ast.IntLit) {<NEW_LINE>polyglot.ast.IntLit intLit = (polyglot.ast.IntLit) lit;<NEW_LINE>long litValue = intLit.value();<NEW_LINE>if (intLit.kind() == polyglot.ast.IntLit.INT) {<NEW_LINE>return soot.jimple.IntConstant.v((int) litValue);<NEW_LINE>} else {<NEW_LINE>// System.out.println(litValue);<NEW_LINE>return soot.jimple.LongConstant.v(litValue);<NEW_LINE>}<NEW_LINE>} else if (lit instanceof polyglot.ast.StringLit) {<NEW_LINE>String litValue = ((polyglot.ast.StringLit) lit).value();<NEW_LINE>return soot.jimple.StringConstant.v(litValue);<NEW_LINE>} else if (lit instanceof polyglot.ast.NullLit) {<NEW_LINE>return soot.jimple.NullConstant.v();<NEW_LINE>} else if (lit instanceof polyglot.ast.FloatLit) {<NEW_LINE>polyglot.ast.FloatLit floatLit = (polyglot.ast.FloatLit) lit;<NEW_LINE>double litValue = floatLit.value();<NEW_LINE>if (floatLit.kind() == polyglot.ast.FloatLit.DOUBLE) {<NEW_LINE>return soot.jimple.DoubleConstant.v(floatLit.value());<NEW_LINE>} else {<NEW_LINE>return soot.jimple.FloatConstant.v((float) (floatLit.value()));<NEW_LINE>}<NEW_LINE>} else if (lit instanceof polyglot.ast.CharLit) {<NEW_LINE>char litValue = ((polyglot.ast.CharLit) lit).value();<NEW_LINE>return soot.<MASK><NEW_LINE>} else if (lit instanceof polyglot.ast.BooleanLit) {<NEW_LINE>boolean litValue = ((polyglot.ast.BooleanLit) lit).value();<NEW_LINE>if (litValue) {<NEW_LINE>return soot.jimple.IntConstant.v(1);<NEW_LINE>} else {<NEW_LINE>return soot.jimple.IntConstant.v(0);<NEW_LINE>}<NEW_LINE>} else if (lit instanceof polyglot.ast.ClassLit) {<NEW_LINE>return getSpecialClassLitLocal((polyglot.ast.ClassLit) lit);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unknown Literal - Unhandled: " + lit.getClass());<NEW_LINE>}<NEW_LINE>} | jimple.IntConstant.v(litValue); |
1,769,345 | final GetQueryStatisticsResult executeGetQueryStatistics(GetQueryStatisticsRequest getQueryStatisticsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getQueryStatisticsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetQueryStatisticsRequest> request = null;<NEW_LINE>Response<GetQueryStatisticsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetQueryStatisticsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getQueryStatisticsRequest));<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, "LakeFormation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetQueryStatistics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "query-";<NEW_LINE>String <MASK><NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetQueryStatisticsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetQueryStatisticsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | resolvedHostPrefix = String.format("query-"); |
1,431,185 | private String createPeopleFile(String baseUrl, String containerUrl, Map<String, VCard> importedPeople, SolidUtilities utilities) throws Exception {<NEW_LINE>Model peopleModel = ModelFactory.createDefaultModel();<NEW_LINE>Resource indexResource = peopleModel.createResource("index.ttl#this");<NEW_LINE>for (String insertedId : importedPeople.keySet()) {<NEW_LINE>VCard <MASK><NEW_LINE>String relativePath = insertedId.replace(containerUrl, "");<NEW_LINE>Resource personResource = peopleModel.createResource(relativePath + "#this");<NEW_LINE>if (insertedPerson.getFormattedName() != null) {<NEW_LINE>personResource.addProperty(VCARD4.fn, insertedPerson.getFormattedName().getValue());<NEW_LINE>}<NEW_LINE>personResource.addProperty(peopleModel.createProperty(VCARD4.NS, "inAddressBook"), indexResource);<NEW_LINE>}<NEW_LINE>return utilities.postContent(baseUrl + containerUrl, "people", BASIC_RESOURCE_TYPE, peopleModel);<NEW_LINE>} | insertedPerson = importedPeople.get(insertedId); |
1,832,469 | private void write(Object msg, boolean flush, ChannelPromise promise) {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>if (isNotValidPromise(promise, true)) {<NEW_LINE>ReferenceCountUtil.release(msg);<NEW_LINE>// cancelled<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>ReferenceCountUtil.release(msg);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>final AbstractChannelHandlerContext next = findContextOutbound(flush ? (MASK_WRITE | MASK_FLUSH) : MASK_WRITE);<NEW_LINE>final Object m = pipeline.touch(msg, next);<NEW_LINE>EventExecutor executor = next.executor();<NEW_LINE>if (executor.inEventLoop()) {<NEW_LINE>if (flush) {<NEW_LINE>next.invokeWriteAndFlush(m, promise);<NEW_LINE>} else {<NEW_LINE>next.invokeWrite(m, promise);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final WriteTask task = WriteTask.newInstance(next, m, promise, flush);<NEW_LINE>if (!safeExecute(executor, task, promise, m, !flush)) {<NEW_LINE>// We failed to submit the WriteTask. We need to cancel it so we decrement the pending bytes<NEW_LINE>// and put it back in the Recycler for re-use later.<NEW_LINE>//<NEW_LINE>// See https://github.com/netty/netty/issues/8343.<NEW_LINE>task.cancel();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ObjectUtil.checkNotNull(msg, "msg"); |
130,037 | private void onShardResultConsumed(Result result, SearchShardIterator shardIt) {<NEW_LINE>successfulOps.incrementAndGet();<NEW_LINE>// clean a previous error on this shard group (note, this code will be serialized on the same shardIndex value level<NEW_LINE>// so its ok concurrency wise to miss potentially the shard failures being created because of another failure<NEW_LINE>// in the #addShardFailure, because by definition, it will happen on *another* shardIndex<NEW_LINE>AtomicArray<ShardSearchFailure> shardFailures = this.shardFailures.get();<NEW_LINE>if (shardFailures != null) {<NEW_LINE>shardFailures.set(<MASK><NEW_LINE>}<NEW_LINE>// we need to increment successful ops first before we compare the exit condition otherwise if we<NEW_LINE>// are fast we could concurrently update totalOps but then preempt one of the threads which can<NEW_LINE>// cause the successor to read a wrong value from successfulOps if second phase is very fast ie. count etc.<NEW_LINE>// increment all the "future" shards to update the total ops since we some may work and some may not...<NEW_LINE>// and when that happens, we break on total ops, so we must maintain them<NEW_LINE>successfulShardExecution(shardIt);<NEW_LINE>} | result.getShardIndex(), null); |
1,796,600 | public void handle(PrimaryStorageInventory dstPsInv, NfsToNfsMigrateBitsMsg msg, ReturnValueCompletion<NfsToNfsMigrateBitsReply> completion) {<NEW_LINE>HostVO hostVO = dbf.findByUuid(msg.<MASK><NEW_LINE>if (hostVO == null) {<NEW_LINE>throw new OperationFailureException(operr("The chosen host[uuid:%s] to perform storage migration is lost", msg.getHostUuid()));<NEW_LINE>}<NEW_LINE>HostInventory host = HostInventory.valueOf(hostVO);<NEW_LINE>// check if need to mount ps to host first<NEW_LINE>boolean mounted = Q.New(PrimaryStorageClusterRefVO.class).eq(PrimaryStorageClusterRefVO_.clusterUuid, host.getClusterUuid()).eq(PrimaryStorageClusterRefVO_.primaryStorageUuid, dstPsInv.getUuid()).isExists();<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>if (mounted) {<NEW_LINE>logger.info(String.format("no need to mount nfs ps[uuid:%s] to host[uuid:%s]", dstPsInv.getUuid(), host.getUuid()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>NfsToNfsMigrateBitsCmd cmd = new NfsToNfsMigrateBitsCmd();<NEW_LINE>cmd.srcFolderPath = msg.getSrcFolderPath();<NEW_LINE>cmd.dstFolderPath = msg.getDstFolderPath();<NEW_LINE>cmd.filtPaths = trash.findTrashInstallPath(msg.getSrcFolderPath(), msg.getSrcPrimaryStorageUuid());<NEW_LINE>cmd.isMounted = mounted;<NEW_LINE>if (!mounted) {<NEW_LINE>cmd.options = NfsSystemTags.MOUNT_OPTIONS.getTokenByResourceUuid(dstPsInv.getUuid(), NfsSystemTags.MOUNT_OPTIONS_TOKEN);<NEW_LINE>cmd.url = dstPsInv.getUrl();<NEW_LINE>cmd.mountPath = dstPsInv.getMountPath();<NEW_LINE>}<NEW_LINE>new KvmCommandSender(host.getUuid()).send(cmd, NFS_TO_NFS_MIGRATE_BITS_PATH, wrapper -> {<NEW_LINE>NfsToNfsMigrateBitsRsp rsp = wrapper.getResponse(NfsToNfsMigrateBitsRsp.class);<NEW_LINE>return rsp.isSuccess() ? null : operr("%s", rsp.getError());<NEW_LINE>}, msg.getTimeout(), new ReturnValueCompletion<KvmResponseWrapper>(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(KvmResponseWrapper w) {<NEW_LINE>logger.info("successfully copyed volume folder to nfs ps " + dstPsInv.getUuid());<NEW_LINE>NfsToNfsMigrateBitsReply reply = new NfsToNfsMigrateBitsReply();<NEW_LINE>completion.success(reply);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>logger.error("failed to copy volume folder to nfs ps " + dstPsInv.getUuid());<NEW_LINE>completion.fail(errorCode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | getHostUuid(), HostVO.class); |
168,018 | public static ReprState dict(Object key, ReprState s, @Cached LookupAndCallUnaryDynamicNode keyReprNode, @Cached LookupAndCallUnaryDynamicNode valueReprNode, @Cached CastToJavaStringNode castStr, @Cached PRaiseNode raiseNode, @Cached ConditionProfile lengthCheck, @Cached BranchProfile keyNullBranch, @Cached BranchProfile valueNullBranch, @CachedLibrary(limit = "getLimit()") HashingStorageLibrary lib) {<NEW_LINE>String keyReprString = getReprString(key, null, keyReprNode, castStr, keyNullBranch, raiseNode);<NEW_LINE>String valueReprString = getReprString(lib.getItem(s.dictStorage, key), s, valueReprNode, castStr, valueNullBranch, raiseNode);<NEW_LINE>appendSeparator(s, lengthCheck);<NEW_LINE>PythonUtils.append(s.result, keyReprString);<NEW_LINE>PythonUtils.append(s.result, ": ");<NEW_LINE>PythonUtils.<MASK><NEW_LINE>return s;<NEW_LINE>} | append(s.result, valueReprString); |
641,610 | private synchronized void updateProgressNotification() {<NEW_LINE>// refresh UI every 1 seconds to avoid too much workload on main thread<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE>if (now - lastUpdated > ONTRANSFERUPDATE_REFRESH_MILLIS) {<NEW_LINE>lastUpdated = now;<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int pendingTransfers = megaApi.getNumPendingUploads();<NEW_LINE>int totalTransfers = megaApi.getTotalUploads();<NEW_LINE>long totalSizePendingTransfer = megaApi.getTotalUploadBytes();<NEW_LINE>long totalSizeTransferred = megaApi.getTotalUploadedBytes();<NEW_LINE>int progressPercent = (int) Math.round((double) totalSizeTransferred / totalSizePendingTransfer * 100);<NEW_LINE>String message;<NEW_LINE>if (totalTransfers == 0) {<NEW_LINE>message = getString(R.string.download_preparing_files);<NEW_LINE>} else {<NEW_LINE>int inProgress;<NEW_LINE>if (pendingTransfers == 0) {<NEW_LINE>inProgress = totalTransfers - pendingTransfers;<NEW_LINE>} else {<NEW_LINE>inProgress = totalTransfers - pendingTransfers + 1;<NEW_LINE>}<NEW_LINE>sendBroadcast(new Intent(ACTION_UPDATE_CU).putExtra(PROGRESS, progressPercent).putExtra(PENDING_TRANSFERS, pendingTransfers));<NEW_LINE>if (megaApi.areTransfersPaused(MegaTransfer.TYPE_UPLOAD)) {<NEW_LINE>message = StringResourcesUtils.getString(R.string.upload_service_notification_paused, inProgress, totalTransfers);<NEW_LINE>} else {<NEW_LINE>message = StringResourcesUtils.getString(R.string.upload_service_notification, inProgress, totalTransfers);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String info = getProgressSize(this, totalSizeTransferred, totalSizePendingTransfer);<NEW_LINE>PendingIntent pendingIntent = PendingIntent.getActivity(this, <MASK><NEW_LINE>showProgressNotification(progressPercent, pendingIntent, message, info, getString(R.string.settings_camera_notif_title));<NEW_LINE>} | 0, mIntent, PendingIntent.FLAG_IMMUTABLE); |
941,899 | public void unbind(final ShaderProgram shader, final int[] locations) {<NEW_LINE>final GL20 gl = Gdx.gl20;<NEW_LINE>final int numAttributes = attributes.size();<NEW_LINE>if (locations == null) {<NEW_LINE>for (int i = 0; i < numAttributes; i++) {<NEW_LINE>final VertexAttribute attribute = attributes.get(i);<NEW_LINE>final int location = shader.getAttributeLocation(attribute.alias);<NEW_LINE>if (location < 0)<NEW_LINE>continue;<NEW_LINE>int unitOffset = +attribute.unit;<NEW_LINE>shader.disableVertexAttribute(location + unitOffset);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < numAttributes; i++) {<NEW_LINE>final VertexAttribute attribute = attributes.get(i);<NEW_LINE>final int location = locations[i];<NEW_LINE>if (location < 0)<NEW_LINE>continue;<NEW_LINE>int unitOffset = +attribute.unit;<NEW_LINE>shader.enableVertexAttribute(location + unitOffset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>gl.<MASK><NEW_LINE>isBound = false;<NEW_LINE>} | glBindBuffer(GL20.GL_ARRAY_BUFFER, 0); |
745,913 | private void patchLafFonts(UIDefaults uiDefaults) {<NEW_LINE>// if (JBUI.isHiDPI()) {<NEW_LINE>// HashMap<Object, Font> newFonts = new HashMap<Object, Font>();<NEW_LINE>// for (Object key : uiDefaults.keySet().toArray()) {<NEW_LINE>// Object val = uiDefaults.get(key);<NEW_LINE>// if (val instanceof Font) {<NEW_LINE>// newFonts.put(key, JBFont.create((Font)val));<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// for (Map.Entry<Object, Font> entry : newFonts.entrySet()) {<NEW_LINE>// uiDefaults.put(entry.getKey(), entry.getValue());<NEW_LINE>// }<NEW_LINE>// } else<NEW_LINE>UISettings uiSettings = UISettings.getInstance();<NEW_LINE>if (uiSettings.OVERRIDE_NONIDEA_LAF_FONTS) {<NEW_LINE>storeOriginalFontDefaults(uiDefaults);<NEW_LINE>JBUI.setUserScaleFactor(<MASK><NEW_LINE>initFontDefaults(uiDefaults, UIUtil.getFontWithFallback(uiSettings.FONT_FACE, Font.PLAIN, uiSettings.getFontSize()));<NEW_LINE>} else {<NEW_LINE>restoreOriginalFontDefaults(uiDefaults);<NEW_LINE>}<NEW_LINE>} | uiSettings.FONT_SIZE / UIUtil.DEF_SYSTEM_FONT_SIZE); |
615,535 | void parseChessboard(int index, String[] args) {<NEW_LINE>int rows <MASK><NEW_LINE>double width = 1;<NEW_LINE>for (; index < args.length; index++) {<NEW_LINE>String arg = args[index];<NEW_LINE>if (!arg.startsWith("--")) {<NEW_LINE>throw new RuntimeException("Expected flags for chessboard calibration fiducial");<NEW_LINE>}<NEW_LINE>splitFlag(arg);<NEW_LINE>if (flagName.compareToIgnoreCase("Shape") == 0) {<NEW_LINE>String[] words = parameters.split(":");<NEW_LINE>if (words.length != 2)<NEW_LINE>throw new RuntimeException("Expected two for rows and columns");<NEW_LINE>rows = Integer.parseInt(words[0]);<NEW_LINE>cols = Integer.parseInt(words[1]);<NEW_LINE>} else if (flagName.compareToIgnoreCase("SquareWidth") == 0) {<NEW_LINE>width = Double.parseDouble(parameters);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unknown chessboard option " + flagName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (rows < 1 || cols < 1)<NEW_LINE>throw new RuntimeException("Must specify number of rows and columns");<NEW_LINE>System.out.println("chessboard: rows = " + rows + " columns = " + cols + " square width " + width);<NEW_LINE>ConfigGridDimen config = new ConfigGridDimen(rows, cols, width);<NEW_LINE>detector = FactoryFiducial.calibChessboardX(null, config, GrayU8.class);<NEW_LINE>} | = -1, cols = -1; |
1,088,033 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see com.sitewhere.grpc.service.AssetManagementGrpc.AssetManagementImplBase#<NEW_LINE>* deleteAsset(com.sitewhere.grpc.service.GDeleteAssetRequest,<NEW_LINE>* io.grpc.stub.StreamObserver)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void deleteAsset(GDeleteAssetRequest request, StreamObserver<GDeleteAssetResponse> responseObserver) {<NEW_LINE>try {<NEW_LINE>GrpcUtils.handleServerMethodEntry(this, AssetManagementGrpc.getDeleteAssetMethod());<NEW_LINE>IAsset apiResult = getAssetManagement().deleteAsset(CommonModelConverter.asApiUuid(request.getAssetId()));<NEW_LINE>GDeleteAssetResponse.Builder response = GDeleteAssetResponse.newBuilder();<NEW_LINE>response.setAsset<MASK><NEW_LINE>responseObserver.onNext(response.build());<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>GrpcUtils.handleServerMethodException(AssetManagementGrpc.getDeleteAssetMethod(), e, responseObserver);<NEW_LINE>} finally {<NEW_LINE>GrpcUtils.handleServerMethodExit(AssetManagementGrpc.getDeleteAssetMethod());<NEW_LINE>}<NEW_LINE>} | (AssetModelConverter.asGrpcAsset(apiResult)); |
281,525 | protected String doIt() throws Exception {<NEW_LINE>String[] tables = new String[] { "AD_Window_Access", "AD_Process_Access", "AD_Form_Access", "AD_Workflow_Access", "AD_Task_Access", "AD_Document_Action_Access", X_AD_Role_Included.Table_Name };<NEW_LINE>String[] keycolumns = new String[] { "AD_Window_ID", "AD_Process_ID", "AD_Form_ID", "AD_Workflow_ID", "AD_Task_ID", "C_DocType_ID, AD_Ref_List_ID", X_AD_Role_Included.COLUMNNAME_Included_Role_ID };<NEW_LINE>int action = 0;<NEW_LINE>for (int i = 0; i < tables.length; i++) {<NEW_LINE>String table = tables[i];<NEW_LINE>String keycolumn = keycolumns[i];<NEW_LINE>String sql = "DELETE FROM " + table + " WHERE AD_Role_ID = " + m_AD_Role_ID_To;<NEW_LINE>int no = DB.executeUpdateEx(sql, get_TrxName());<NEW_LINE>addLog(action++, null, BigDecimal.valueOf(no), "Old records deleted from " + table);<NEW_LINE>final boolean column_IsReadWrite = !table.equals("AD_Document_Action_Access") && !<MASK><NEW_LINE>final boolean column_SeqNo = table.equals(X_AD_Role_Included.Table_Name);<NEW_LINE>sql = "INSERT INTO " + table + " (AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, " + "AD_Role_ID, " + keycolumn + ", isActive";<NEW_LINE>if (column_SeqNo)<NEW_LINE>sql += ", SeqNo ";<NEW_LINE>if (column_IsReadWrite)<NEW_LINE>sql += ", isReadWrite) ";<NEW_LINE>else<NEW_LINE>sql += ") ";<NEW_LINE>sql += "SELECT " + m_AD_Client_ID + ", " + m_AD_Org_ID + ", getdate(), " + Env.getAD_User_ID(Env.getCtx()) + ", getdate(), " + Env.getAD_User_ID(Env.getCtx()) + ", " + m_AD_Role_ID_To + ", " + keycolumn + ", IsActive ";<NEW_LINE>if (column_SeqNo)<NEW_LINE>sql += ", SeqNo ";<NEW_LINE>if (column_IsReadWrite)<NEW_LINE>sql += ", isReadWrite ";<NEW_LINE>sql += "FROM " + table + " WHERE AD_Role_ID = " + m_AD_Role_ID_From;<NEW_LINE>no = DB.executeUpdateEx(sql, get_TrxName());<NEW_LINE>addLog(action++, null, new BigDecimal(no), "New records inserted into " + table);<NEW_LINE>}<NEW_LINE>return "Role copied";<NEW_LINE>} | table.equals(X_AD_Role_Included.Table_Name); |
859,909 | public void visitEnd() {<NEW_LINE>checkState(!hasState || hasFactory, "Expected factory method for capturing lambda %s", getInternalName());<NEW_LINE>if (lambdaInfo.sourceFilename().isPresent()) {<NEW_LINE>super.visitSource(lambdaInfo.sourceFilename().get(), /* debug= */<NEW_LINE>null);<NEW_LINE>}<NEW_LINE>if (!hasState) {<NEW_LINE>checkState(signature == null, "Didn't expect generic constructor signature %s %s", getInternalName(), signature);<NEW_LINE>checkState(lambdaInfo.factoryMethodDesc().startsWith("()"), "Expected 0-arg factory method for %s but found %s", getInternalName(), lambdaInfo.factoryMethodDesc());<NEW_LINE>// Since this is a stateless class we populate and use a static singleton field "$instance".<NEW_LINE>// Field is package-private so we can read it from the class that had the invokedynamic.<NEW_LINE>String singletonFieldDesc = lambdaInfo.factoryMethodDesc().substring("()".length());<NEW_LINE>super.visitField(Opcodes.ACC_STATIC | Opcodes.ACC_FINAL, SINGLETON_FIELD_NAME, singletonFieldDesc, (String) null, (Object) null).visitEnd();<NEW_LINE>MethodVisitor codeBuilder = super.visitMethod(Opcodes.ACC_STATIC, "<clinit>", "()V", (String) null, new String[0]);<NEW_LINE>codeBuilder.visitTypeInsn(<MASK><NEW_LINE>codeBuilder.visitInsn(Opcodes.DUP);<NEW_LINE>codeBuilder.visitMethodInsn(Opcodes.INVOKESPECIAL, getInternalName(), "<init>", checkNotNull(desc, "didn't see a constructor for %s", getInternalName()), /*isInterface=*/<NEW_LINE>false);<NEW_LINE>codeBuilder.visitFieldInsn(Opcodes.PUTSTATIC, getInternalName(), SINGLETON_FIELD_NAME, singletonFieldDesc);<NEW_LINE>codeBuilder.visitInsn(Opcodes.RETURN);<NEW_LINE>// two values are pushed onto the stack<NEW_LINE>codeBuilder.visitMaxs(2, 0);<NEW_LINE>codeBuilder.visitEnd();<NEW_LINE>}<NEW_LINE>copyRewrittenLambdaMethods();<NEW_LINE>if (copyBridgeMethods) {<NEW_LINE>copyBridgeMethods(interfaces);<NEW_LINE>}<NEW_LINE>super.visitEnd();<NEW_LINE>} | Opcodes.NEW, getInternalName()); |
474,719 | public void createContents(Composite page) {<NEW_LINE>tagsSearchBox = new Text(page, SWT.SINGLE | SWT.BORDER | <MASK><NEW_LINE>tagsSearchBox.setMessage("Type tags, projects, or working set names to match (incl. * and ? wildcards)");<NEW_LINE>tagsSearchBox.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());<NEW_LINE>tagsSearchBox.addModifyListener(new ModifyListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void modifyText(ModifyEvent e) {<NEW_LINE>model.setValue(tagsSearchBox.getText());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>this.model.addListener(modelListener = new ValueListener<String>() {<NEW_LINE><NEW_LINE>public void gotValue(LiveExpression<String> exp, String newText) {<NEW_LINE>String oldText = tagsSearchBox.getText();<NEW_LINE>if (!oldText.equals(newText)) {<NEW_LINE>// Avoid cursor bug on macs.<NEW_LINE>tagsSearchBox.setText(newText);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>IContentProposalProvider proposalProvider = new TagContentProposalProvider(viewModel);<NEW_LINE>ContentProposalAdapter caAdapter = new ContentProposalAdapter(tagsSearchBox, new TextContentAdapter(), proposalProvider, UIUtils.CTRL_SPACE, null);<NEW_LINE>caAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);<NEW_LINE>} | SWT.SEARCH | SWT.ICON_CANCEL); |
378,704 | public GetDedicatedIpsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetDedicatedIpsResult getDedicatedIpsResult = new GetDedicatedIpsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getDedicatedIpsResult;<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("DedicatedIps", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getDedicatedIpsResult.setDedicatedIps(new ListUnmarshaller<DedicatedIp>(DedicatedIpJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getDedicatedIpsResult.setNextToken(context.getUnmarshaller(String.<MASK><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 getDedicatedIpsResult;<NEW_LINE>} | class).unmarshall(context)); |
869,982 | protected void doExecute(Editor editor, @Nullable Caret caret, DataContext dataContext) {<NEW_LINE>final TemplateState templateState = TemplateManagerImpl.getTemplateState(editor);<NEW_LINE>if (templateState != null && !templateState.isFinished()) {<NEW_LINE>final TextRange range = templateState.getCurrentVariableRange();<NEW_LINE>final int caretOffset = editor.getCaretModel().getOffset();<NEW_LINE>if (range != null && shouldStayInsideVariable(range, caretOffset)) {<NEW_LINE>int selectionOffset = editor<MASK><NEW_LINE>int offsetToMove = myIsHomeHandler ? range.getStartOffset() : range.getEndOffset();<NEW_LINE>LogicalPosition logicalPosition = editor.offsetToLogicalPosition(offsetToMove).leanForward(myIsHomeHandler);<NEW_LINE>editor.getCaretModel().moveToLogicalPosition(logicalPosition);<NEW_LINE>EditorModificationUtil.scrollToCaret(editor);<NEW_LINE>if (myWithSelection) {<NEW_LINE>editor.getSelectionModel().setSelection(selectionOffset, offsetToMove);<NEW_LINE>} else {<NEW_LINE>editor.getSelectionModel().removeSelection();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myOriginalHandler.execute(editor, caret, dataContext);<NEW_LINE>} | .getSelectionModel().getLeadSelectionOffset(); |
526,210 | public void run(RegressionEnvironment env) {<NEW_LINE>String stmtTextSet = "@name('set') on SupportBean set var1OND = intPrimitive, var2OND = var1OND + 1, var3OND = var1OND + var2OND";<NEW_LINE>env.compileDeploy(stmtTextSet).addListener("set");<NEW_LINE>String[] fieldsVar = new String[] { "var1OND", "var2OND", "var3OND" };<NEW_LINE>env.assertPropsPerRowIterator("set", fieldsVar, new Object[][] { { 12, 2, null } });<NEW_LINE><MASK><NEW_LINE>env.assertPropsNew("set", fieldsVar, new Object[] { 3, 4, 7 });<NEW_LINE>env.assertPropsPerRowIterator("set", fieldsVar, new Object[][] { { 3, 4, 7 } });<NEW_LINE>env.milestone(0);<NEW_LINE>sendSupportBean(env, "S1", -1);<NEW_LINE>env.assertPropsNew("set", fieldsVar, new Object[] { -1, 0, -1 });<NEW_LINE>env.assertPropsPerRowIterator("set", fieldsVar, new Object[][] { { -1, 0, -1 } });<NEW_LINE>sendSupportBean(env, "S1", 90);<NEW_LINE>env.assertPropsNew("set", fieldsVar, new Object[] { 90, 91, 181 });<NEW_LINE>env.assertPropsPerRowIterator("set", fieldsVar, new Object[][] { { 90, 91, 181 } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | sendSupportBean(env, "S1", 3); |
1,314,890 | public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {<NEW_LINE>final List<UpdateClasspathRequest> requests;<NEW_LINE>synchronized (this.queue) {<NEW_LINE>requests = new ArrayList<>(this.queue);<NEW_LINE>this.queue.clear();<NEW_LINE>}<NEW_LINE>Map<IJavaProject, UpdateClasspathRequest> mergedRequestPerProject = requests.stream().collect(Collectors.groupingBy(UpdateClasspathRequest::getProject, Collectors.reducing(new UpdateClasspathRequest(), (mergedRequest, request) -> {<NEW_LINE>mergedRequest.setProject(request.getProject());<NEW_LINE>mergedRequest.getInclude().<MASK><NEW_LINE>mergedRequest.getExclude().addAll(request.getExclude());<NEW_LINE>mergedRequest.getSources().putAll(request.getSources());<NEW_LINE>return mergedRequest;<NEW_LINE>})));<NEW_LINE>for (Map.Entry<IJavaProject, UpdateClasspathRequest> entry : mergedRequestPerProject.entrySet()) {<NEW_LINE>if (monitor.isCanceled()) {<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>}<NEW_LINE>if (entry.getValue() != null) {<NEW_LINE>final IJavaProject project = entry.getKey();<NEW_LINE>final UpdateClasspathRequest request = entry.getValue();<NEW_LINE>doUpdateClasspath(project, request.include, request.exclude, request.sources, monitor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>synchronized (queue) {<NEW_LINE>if (!queue.isEmpty()) {<NEW_LINE>schedule(SCHEDULE_DELAY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>} | addAll(request.getInclude()); |
1,108,700 | private void cleanup(String logicalSwitchUuid, LogicalSwitchPort lSwitchPort, NiciraNvpApi niciraNvpApi) {<NEW_LINE>s_logger.warn("Deleting previously created Logical Switch Port " + lSwitchPort.getUuid() + " (" + lSwitchPort.<MASK><NEW_LINE>try {<NEW_LINE>niciraNvpApi.deleteLogicalSwitchPort(logicalSwitchUuid, lSwitchPort.getUuid());<NEW_LINE>} catch (NiciraNvpApiException exceptionDeleteLSwitchPort) {<NEW_LINE>s_logger.error("Error while deleting Logical Switch Port " + lSwitchPort.getUuid() + " (" + lSwitchPort.getDisplayName() + ") from Logical Switch " + logicalSwitchUuid + " due to: " + exceptionDeleteLSwitchPort.getMessage());<NEW_LINE>}<NEW_LINE>s_logger.warn("Logical Switch Port " + lSwitchPort.getUuid() + " (" + lSwitchPort.getDisplayName() + ") successfully deteled");<NEW_LINE>} | getDisplayName() + ") from Logical Switch " + logicalSwitchUuid); |
46,451 | public void announcementGet(String columns, final Response.Listener<List<Announcement>> responseListener, final Response.ErrorListener errorListener) {<NEW_LINE>Object postBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String path = "/announcement".replaceAll("\\{format\\}", "json");<NEW_LINE>// query params<NEW_LINE>List<Pair> queryParams = new ArrayList<Pair>();<NEW_LINE>// header params<NEW_LINE>Map<String, String> headerParams = new HashMap<String, String>();<NEW_LINE>// form params<NEW_LINE>Map<String, String> formParams = new <MASK><NEW_LINE>queryParams.addAll(ApiInvoker.parameterToPairs("", "columns", columns));<NEW_LINE>String[] contentTypes = { "application/json", "application/x-www-form-urlencoded" };<NEW_LINE>String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";<NEW_LINE>if (contentType.startsWith("multipart/form-data")) {<NEW_LINE>// file uploading<NEW_LINE>MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();<NEW_LINE>HttpEntity httpEntity = localVarBuilder.build();<NEW_LINE>postBody = httpEntity;<NEW_LINE>} else {<NEW_LINE>// normal form params<NEW_LINE>}<NEW_LINE>String[] authNames = new String[] {};<NEW_LINE>try {<NEW_LINE>apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, new Response.Listener<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(String localVarResponse) {<NEW_LINE>try {<NEW_LINE>responseListener.onResponse((List<Announcement>) ApiInvoker.deserialize(localVarResponse, "array", Announcement.class));<NEW_LINE>} catch (ApiException exception) {<NEW_LINE>errorListener.onErrorResponse(new VolleyError(exception));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, new Response.ErrorListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onErrorResponse(VolleyError error) {<NEW_LINE>errorListener.onErrorResponse(error);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (ApiException ex) {<NEW_LINE>errorListener.onErrorResponse(new VolleyError(ex));<NEW_LINE>}<NEW_LINE>} | HashMap<String, String>(); |
932,986 | public SvmActiveDirectoryConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SvmActiveDirectoryConfiguration svmActiveDirectoryConfiguration = new SvmActiveDirectoryConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("NetBiosName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>svmActiveDirectoryConfiguration.setNetBiosName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("SelfManagedActiveDirectoryConfiguration", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>svmActiveDirectoryConfiguration.setSelfManagedActiveDirectoryConfiguration(SelfManagedActiveDirectoryAttributesJsonUnmarshaller.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 svmActiveDirectoryConfiguration;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,178,304 | public void run(ActionRequest request, ActionResponse response) {<NEW_LINE>ImportConfiguration importConfiguration = request.getContext().asType(ImportConfiguration.class);<NEW_LINE>try {<NEW_LINE>ImportHistory importHistory = Beans.get(ImportService.class).run(importConfiguration);<NEW_LINE>response.setValue("statusSelect", ImportConfigurationRepository.STATUS_COMPLETED);<NEW_LINE>response.setValue("endDateTime", Beans.get(AppBaseService.class).<MASK><NEW_LINE>response.setAttr("importHistoryList", "value:add", importHistory);<NEW_LINE>File readFile = MetaFiles.getPath(importHistory.getLogMetaFile()).toFile();<NEW_LINE>response.setNotify(FileUtils.readFileToString(readFile, StandardCharsets.UTF_8).replaceAll("(\r\n|\n\r|\r|\n)", "<br />"));<NEW_LINE>} catch (Exception e) {<NEW_LINE>response.setValue("statusSelect", ImportConfigurationRepository.STATUS_ERROR);<NEW_LINE>TraceBackService.trace(response, e);<NEW_LINE>}<NEW_LINE>} | getTodayDateTime().toLocalDateTime()); |
515,151 | private void addSslToJMXConnector(Config config, ActionReport report) {<NEW_LINE>AdminService adminService = config.getAdminService();<NEW_LINE>// ensure we have the specified listener<NEW_LINE>JmxConnector jmxConnector = null;<NEW_LINE>for (JmxConnector jmxConn : adminService.getJmxConnector()) {<NEW_LINE>if (jmxConn.getName().equals(listenerId)) {<NEW_LINE>jmxConnector = jmxConn;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (jmxConnector == null) {<NEW_LINE>report.setMessage(LOCAL_STRINGS.getLocalString("create.ssl.jmx.notfound"<MASK><NEW_LINE>report.setActionExitCode(ActionReport.ExitCode.FAILURE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (jmxConnector.getSsl() != null) {<NEW_LINE>report.setMessage(LOCAL_STRINGS.getLocalString("create.ssl.jmx.alreadyExists", "IIOP Listener named {0} to which this ssl element is " + "being added already has an ssl element.", listenerId));<NEW_LINE>report.setActionExitCode(ActionReport.ExitCode.FAILURE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ConfigSupport.apply(new SingleConfigCode<JmxConnector>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object run(JmxConnector param) throws PropertyVetoException, TransactionFailure {<NEW_LINE>Ssl newSsl = param.createChild(Ssl.class);<NEW_LINE>populateSslElement(newSsl);<NEW_LINE>param.setSsl(newSsl);<NEW_LINE>return newSsl;<NEW_LINE>}<NEW_LINE>}, jmxConnector);<NEW_LINE>} catch (TransactionFailure e) {<NEW_LINE>reportError(report, e);<NEW_LINE>}<NEW_LINE>reportSuccess(report);<NEW_LINE>} | , "JMX Connector named {0} to which this ssl element is " + "being added does not exist.", listenerId)); |
37,981 | protected void layout(GuiPanel container, int width, int height) {<NEW_LINE>size(progressBar, width, 20);<NEW_LINE>pos(title, width / 2 - width(title) / 2, 0);<NEW_LINE>pos(imagePanel, 0, y(title) + height(title) + 5);<NEW_LINE>pos(buttonPanel, width / 2 - width(buttonPanel) / 2, height - height(buttonPanel));<NEW_LINE>pos(progressBar, width / 2 - width(progressBar) / 2, y(buttonPanel) - 5 - height(progressBar));<NEW_LINE>pos(renderTime, 0, y(progressBar) - 2 - height(renderTime));<NEW_LINE>pos(remainingTime, width - width(remainingTime), y(progressBar) - 2 - height(renderTime));<NEW_LINE>pos(previewCheckbox, width / 2 - width(previewCheckbox) / 2, y(renderTime) <MASK><NEW_LINE>size(imagePanel, width, y(previewCheckbox) - 5 - y(imagePanel));<NEW_LINE>} | - 10 - height(previewCheckbox)); |
1,774,557 | public void run() {<NEW_LINE>Element <MASK><NEW_LINE>Document document = data.getOwnerDocument();<NEW_LINE>// NOI18N<NEW_LINE>NodeList nameList = data.getElementsByTagNameNS(ClientSideProjectType.PROJECT_CONFIGURATION_NAMESPACE, "name");<NEW_LINE>Element nameElement;<NEW_LINE>if (nameList.getLength() == 1) {<NEW_LINE>nameElement = (Element) nameList.item(0);<NEW_LINE>NodeList deadKids = nameElement.getChildNodes();<NEW_LINE>while (deadKids.getLength() > 0) {<NEW_LINE>nameElement.removeChild(deadKids.item(0));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>nameElement = // NOI18N<NEW_LINE>document.// NOI18N<NEW_LINE>createElementNS(// NOI18N<NEW_LINE>ClientSideProjectType.PROJECT_CONFIGURATION_NAMESPACE, "name");<NEW_LINE>data.insertBefore(nameElement, data.getChildNodes().item(0));<NEW_LINE>}<NEW_LINE>nameElement.appendChild(document.createTextNode(name));<NEW_LINE>projectHelper.putPrimaryConfigurationData(data, true);<NEW_LINE>if (saveProject) {<NEW_LINE>Project project = FileOwnerQuery.getOwner(projectHelper.getProjectDirectory());<NEW_LINE>assert project != null;<NEW_LINE>try {<NEW_LINE>ProjectManager.getDefault().saveProject(project);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.log(Level.INFO, "Cannot save project", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | data = projectHelper.getPrimaryConfigurationData(true); |
26,134 | public void forModelUpdate(Table table, Map<String, Object> attrs, Set<String> modifyFlag, StringBuilder sql, List<Object> paras) {<NEW_LINE>sql.append("update ").append(table.getName<MASK><NEW_LINE>String[] pKeys = table.getPrimaryKey();<NEW_LINE>for (Map.Entry<String, Object> e : attrs.entrySet()) {<NEW_LINE>String colName = e.getKey();<NEW_LINE>if (modifyFlag.contains(colName) && !isPrimaryKey(colName, pKeys) && table.hasColumnLabel(colName)) {<NEW_LINE>if (paras.size() > 0) {<NEW_LINE>sql.append(", ");<NEW_LINE>}<NEW_LINE>sql.append(colName).append(" = ? ");<NEW_LINE>paras.add(e.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sql.append(" where ");<NEW_LINE>for (int i = 0; i < pKeys.length; i++) {<NEW_LINE>if (i > 0) {<NEW_LINE>sql.append(" and ");<NEW_LINE>}<NEW_LINE>sql.append(pKeys[i]).append(" = ?");<NEW_LINE>paras.add(attrs.get(pKeys[i]));<NEW_LINE>}<NEW_LINE>} | ()).append(" set "); |
536,320 | public static UsersPrivilegesMetadata swapPrivileges(UsersPrivilegesMetadata usersPrivileges, RelationName source, RelationName target) {<NEW_LINE>HashMap<String, Set<Privilege>> <MASK><NEW_LINE>for (Map.Entry<String, Set<Privilege>> userPrivileges : usersPrivileges.usersPrivileges.entrySet()) {<NEW_LINE>String user = userPrivileges.getKey();<NEW_LINE>Set<Privilege> privileges = userPrivileges.getValue();<NEW_LINE>Set<Privilege> updatedPrivileges = new HashSet<>();<NEW_LINE>for (Privilege privilege : privileges) {<NEW_LINE>PrivilegeIdent ident = privilege.ident();<NEW_LINE>if (ident.clazz() == Privilege.Clazz.TABLE) {<NEW_LINE>if (source.fqn().equals(ident.ident())) {<NEW_LINE>updatedPrivileges.add(new Privilege(privilege.state(), ident.type(), ident.clazz(), target.fqn(), privilege.grantor()));<NEW_LINE>} else if (target.fqn().equals(ident.ident())) {<NEW_LINE>updatedPrivileges.add(new Privilege(privilege.state(), ident.type(), ident.clazz(), source.fqn(), privilege.grantor()));<NEW_LINE>} else {<NEW_LINE>updatedPrivileges.add(privilege);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>updatedPrivileges.add(privilege);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>privilegesByUser.put(user, updatedPrivileges);<NEW_LINE>}<NEW_LINE>return new UsersPrivilegesMetadata(privilegesByUser);<NEW_LINE>} | privilegesByUser = new HashMap<>(); |
992,041 | public ResponseEntity<Void> updateUserWithHttpInfo(String username, User body) throws RestClientException {<NEW_LINE>Object postBody = body;<NEW_LINE>// verify the required parameter 'username' is set<NEW_LINE>if (username == null) {<NEW_LINE>throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'username' when calling updateUser");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updateUser");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>final Map<String, Object> uriVariables = new HashMap<String, Object>();<NEW_LINE>uriVariables.put("username", username);<NEW_LINE>String path = <MASK><NEW_LINE>final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final HttpHeaders headerParams = new HttpHeaders();<NEW_LINE>final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap formParams = new LinkedMultiValueMap();<NEW_LINE>final String[] accepts = {};<NEW_LINE>final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);<NEW_LINE>final String[] contentTypes = { "application/json" };<NEW_LINE>final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);<NEW_LINE>String[] authNames = new String[] {};<NEW_LINE>ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType);<NEW_LINE>} | apiClient.expandPath("/user/{username}", uriVariables); |
1,742,340 | public static ProgressDialogDescriptor createProgressDialog(String title, ProgressHandle handle, ActionListener cancelationListener) {<NEW_LINE>assert SwingUtilities.isEventDispatchThread();<NEW_LINE>Component progress = ProgressHandleFactory.createProgressComponent(handle);<NEW_LINE>JLabel label = ProgressHandleFactory.createDetailLabelComponent(handle);<NEW_LINE>JPanel panel = new JPanel(new GridBagLayout());<NEW_LINE>panel.setPreferredSize(new java.awt.Dimension(450, 50));<NEW_LINE>GridBagConstraints constraintsLabel = new GridBagConstraints();<NEW_LINE>constraintsLabel.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>constraintsLabel.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>constraintsLabel.anchor <MASK><NEW_LINE>constraintsLabel.weightx = 1.0;<NEW_LINE>constraintsLabel.insets = new java.awt.Insets(8, 8, 0, 8);<NEW_LINE>constraintsLabel.gridx = 0;<NEW_LINE>constraintsLabel.gridy = 0;<NEW_LINE>panel.add(label, constraintsLabel);<NEW_LINE>GridBagConstraints constraintsProgress = new java.awt.GridBagConstraints();<NEW_LINE>constraintsProgress.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>constraintsProgress.gridheight = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>constraintsProgress.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>constraintsProgress.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>constraintsProgress.weightx = 1.0;<NEW_LINE>constraintsProgress.insets = new java.awt.Insets(6, 8, 8, 8);<NEW_LINE>constraintsProgress.gridx = 0;<NEW_LINE>constraintsProgress.gridy = 1;<NEW_LINE>panel.add(progress, constraintsProgress);<NEW_LINE>JButton cancel = new JButton(NbBundle.getMessage(ProgressSupport.class, "LBL_Cancel"));<NEW_LINE>ProgressDialogDescriptor descriptor = new ProgressDialogDescriptor(panel, title, true, new JButton[] { cancel }, cancel, DialogDescriptor.DEFAULT_ALIGN, null, cancelationListener);<NEW_LINE>return descriptor;<NEW_LINE>} | = java.awt.GridBagConstraints.WEST; |
412,909 | public void initializeChildrenFromFields(List<Field> children) {<NEW_LINE>checkArgument(children.size() == 1, "Maps have one List child. Found: %s", children.isEmpty() ? "none" : children);<NEW_LINE>Field structField = children.get(0);<NEW_LINE>MinorType minorType = Types.getMinorTypeForArrowType(structField.getType());<NEW_LINE>checkArgument(minorType == MinorType.STRUCT && !structField.isNullable(), "Map data should be a non-nullable struct type");<NEW_LINE>checkArgument(structField.getChildren().size(<MASK><NEW_LINE>Field keyField = structField.getChildren().get(0);<NEW_LINE>checkArgument(!keyField.isNullable(), "Map data key type should be a non-nullable");<NEW_LINE>AddOrGetResult<FieldVector> addOrGetVector = addOrGetVector(structField.getFieldType());<NEW_LINE>checkArgument(addOrGetVector.isCreated(), "Child vector already existed: %s", addOrGetVector.getVector());<NEW_LINE>addOrGetVector.getVector().initializeChildrenFromFields(structField.getChildren());<NEW_LINE>} | ) == 2, "Map data should be a struct with 2 children. Found: %s", children); |
449,446 | // <http://127.0.0.1:8080/lraresource/status>; rel="status"; title="status URI"; type="text/plain"<NEW_LINE>static Link valueOf(String linkVal) {<NEW_LINE>String[] <MASK><NEW_LINE>Link link = new Link();<NEW_LINE>for (String token : tokens) {<NEW_LINE>Matcher uriMatcher = URI_PROP_PATTERN.matcher(token);<NEW_LINE>if (uriMatcher.find()) {<NEW_LINE>link.uri = URI.create(uriMatcher.group("value"));<NEW_LINE>}<NEW_LINE>Matcher propMatcher = LINK_PROP_PATTERN.matcher(token);<NEW_LINE>if (propMatcher.find()) {<NEW_LINE>String key = propMatcher.group("key");<NEW_LINE>String value = propMatcher.group("value");<NEW_LINE>switch(key) {<NEW_LINE>case "rel":<NEW_LINE>link.rel = value;<NEW_LINE>break;<NEW_LINE>case "title":<NEW_LINE>link.title = value;<NEW_LINE>break;<NEW_LINE>case "type":<NEW_LINE>link.type = value;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>LOGGER.fine(() -> "Unexpected link property " + key + ": " + value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return link;<NEW_LINE>} | tokens = linkVal.split(";"); |
125,260 | protected void doIterationPDS(SparkDl4jMultiLayer network, SparkComputationGraph graph, JavaRDD<PortableDataStream> split, int splitNum, int numSplits) {<NEW_LINE>log.info("Starting training of split {} of {}. workerMiniBatchSize={}, averagingFreq={}, Configured for {} workers", splitNum, numSplits, batchSizePerWorker, averagingFrequency, numWorkers);<NEW_LINE>if (collectTrainingStats)<NEW_LINE>stats.logMapPartitionsStart();<NEW_LINE>JavaRDD<PortableDataStream> splitData = split;<NEW_LINE>if (collectTrainingStats)<NEW_LINE>stats.logRepartitionStart();<NEW_LINE>splitData = SparkUtils.repartition(splitData, repartition, repartitionStrategy, numObjectsEachWorker(rddDataSetNumExamples), numWorkers);<NEW_LINE>int nPartitions = splitData<MASK><NEW_LINE>if (collectTrainingStats && repartition != Repartition.Never)<NEW_LINE>stats.logRepartitionEnd();<NEW_LINE>FlatMapFunction<Iterator<PortableDataStream>, ParameterAveragingTrainingResult> function;<NEW_LINE>if (network != null)<NEW_LINE>function = new ExecuteWorkerPDSFlatMap<>(getWorkerInstance(network));<NEW_LINE>else<NEW_LINE>function = new ExecuteWorkerPDSFlatMap<>(getWorkerInstance(graph));<NEW_LINE>JavaRDD<ParameterAveragingTrainingResult> result = splitData.mapPartitions(function);<NEW_LINE>processResults(network, graph, result, splitNum, numSplits);<NEW_LINE>if (collectTrainingStats)<NEW_LINE>stats.logMapPartitionsEnd(nPartitions);<NEW_LINE>} | .partitions().size(); |
165,114 | public void run(RegressionEnvironment env) {<NEW_LINE>AtomicInteger milestone = new AtomicInteger();<NEW_LINE>String epl = "@name('s0') select " + "first(sa.doublePrimitive + sa.intPrimitive), " + "first(sa.intPrimitive), " + "window(sa.*), " + "last(*) from SupportBean#length(2) as sa";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>Object[][] rows = new Object[][] { { "first(sa.doublePrimitive+sa.intPrimitive)", Double.class }, { "first(sa.intPrimitive)", Integer.class }, { "window(sa.*)", SupportBean[].class }, { "last(*)", SupportBean.class } };<NEW_LINE>for (int i = 0; i < rows.length; i++) {<NEW_LINE>final int index = i;<NEW_LINE>env.assertStatement("s0", statement -> {<NEW_LINE>EventPropertyDescriptor prop = statement.getEventType().getPropertyDescriptors()[index];<NEW_LINE>assertEquals(rows[index][0], prop.getPropertyName());<NEW_LINE>assertEquals(rows[index][1], prop.getPropertyType());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>env.undeployAll();<NEW_LINE>epl = "@name('s0') select " + "first(sa.doublePrimitive + sa.intPrimitive) as f1, " + "first(sa.intPrimitive) as f2, " + "window(sa.*) as w1, " + "last(*) as l1 " + "from SupportBean#length(2) as sa";<NEW_LINE>env.compileDeploy<MASK><NEW_LINE>tryAssertionType(env, false, milestone);<NEW_LINE>env.undeployAll();<NEW_LINE>epl = "@name('s0') select " + "first(sa.doublePrimitive + sa.intPrimitive) as f1, " + "first(sa.intPrimitive) as f2, " + "window(sa.*) as w1, " + "last(*) as l1 " + "from SupportBean#length(2) as sa " + "having SupportStaticMethodLib.alwaysTrue({first(sa.doublePrimitive + sa.intPrimitive), " + "first(sa.intPrimitive), window(sa.*), last(*)})";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>tryAssertionType(env, true, milestone);<NEW_LINE>env.undeployAll();<NEW_LINE>} | (epl).addListener("s0"); |
815,468 | protected void addInfluencer(Class<Influencer> type, ParticleController controller) {<NEW_LINE>if (controller.findInfluencer(type) != null)<NEW_LINE>return;<NEW_LINE>try {<NEW_LINE>controller.end();<NEW_LINE>Influencer newInfluencer = type.newInstance();<NEW_LINE>boolean replaced = false;<NEW_LINE>if (ColorInfluencer.class.isAssignableFrom(type)) {<NEW_LINE>replaced = controller.replaceInfluencer(ColorInfluencer.class, (ColorInfluencer) newInfluencer);<NEW_LINE>} else if (RegionInfluencer.class.isAssignableFrom(type)) {<NEW_LINE>replaced = controller.replaceInfluencer(RegionInfluencer.class, (RegionInfluencer) newInfluencer);<NEW_LINE>} else if (ModelInfluencer.class.isAssignableFrom(type)) {<NEW_LINE>ModelInfluencer newModelInfluencer = (ModelInfluencer) newInfluencer;<NEW_LINE>ModelInfluencer currentInfluencer = (ModelInfluencer) controller.findInfluencer(ModelInfluencer.class);<NEW_LINE>if (currentInfluencer != null) {<NEW_LINE>newModelInfluencer.models.add(currentInfluencer.models.first());<NEW_LINE>}<NEW_LINE>replaced = controller.replaceInfluencer(ModelInfluencer.class, (ModelInfluencer) newInfluencer);<NEW_LINE>} else if (ParticleControllerInfluencer.class.isAssignableFrom(type)) {<NEW_LINE>ParticleControllerInfluencer newModelInfluencer = (ParticleControllerInfluencer) newInfluencer;<NEW_LINE>ParticleControllerInfluencer currentInfluencer = (ParticleControllerInfluencer) controller.findInfluencer(ParticleControllerInfluencer.class);<NEW_LINE>if (currentInfluencer != null) {<NEW_LINE>newModelInfluencer.templates.add(currentInfluencer.templates.first());<NEW_LINE>}<NEW_LINE>replaced = controller.replaceInfluencer(ParticleControllerInfluencer<MASK><NEW_LINE>}<NEW_LINE>if (!replaced) {<NEW_LINE>if (getControllerType() != ControllerType.ParticleController)<NEW_LINE>controller.influencers.add(newInfluencer);<NEW_LINE>else {<NEW_LINE>Influencer finalizer = controller.influencers.pop();<NEW_LINE>controller.influencers.add(newInfluencer);<NEW_LINE>controller.influencers.add(finalizer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>controller.init();<NEW_LINE>effect.start();<NEW_LINE>reloadRows();<NEW_LINE>} catch (Exception e1) {<NEW_LINE>e1.printStackTrace();<NEW_LINE>}<NEW_LINE>} | .class, (ParticleControllerInfluencer) newInfluencer); |
737,640 | public static void processOilGenExcludeIMC(IMCEvent event, IMCMessage m) {<NEW_LINE>try {<NEW_LINE>String biomeID = m.getStringValue().trim();<NEW_LINE>int id = Integer.valueOf(biomeID);<NEW_LINE>if (id >= BiomeGenBase.getBiomeGenArray().length) {<NEW_LINE>throw new IllegalArgumentException("Biome ID must be less than " + <MASK><NEW_LINE>}<NEW_LINE>OilPopulateOld.INSTANCE.excludedBiomes.add(id);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>BCLog.logger.warn(String.format("Received an invalid oil-gen-exclude request %s from mod %s", m.getStringValue(), m.getSender()));<NEW_LINE>}<NEW_LINE>BCLog.logger.info(String.format("Received a successful oil-gen-exclude request %s from mod %s", m.getStringValue(), m.getSender()));<NEW_LINE>} | BiomeGenBase.getBiomeGenArray().length); |
919,197 | public static VerifyFaceMaskResponse unmarshall(VerifyFaceMaskResponse verifyFaceMaskResponse, UnmarshallerContext _ctx) {<NEW_LINE>verifyFaceMaskResponse.setRequestId(_ctx.stringValue("VerifyFaceMaskResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setMask(_ctx.integerValue("VerifyFaceMaskResponse.Data.Mask"));<NEW_LINE>data.setConfidence(_ctx.floatValue("VerifyFaceMaskResponse.Data.Confidence"));<NEW_LINE>data.setMaskRef<MASK><NEW_LINE>List<Float> thresholds = new ArrayList<Float>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("VerifyFaceMaskResponse.Data.Thresholds.Length"); i++) {<NEW_LINE>thresholds.add(_ctx.floatValue("VerifyFaceMaskResponse.Data.Thresholds[" + i + "]"));<NEW_LINE>}<NEW_LINE>data.setThresholds(thresholds);<NEW_LINE>List<Integer> rectangle = new ArrayList<Integer>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("VerifyFaceMaskResponse.Data.Rectangle.Length"); i++) {<NEW_LINE>rectangle.add(_ctx.integerValue("VerifyFaceMaskResponse.Data.Rectangle[" + i + "]"));<NEW_LINE>}<NEW_LINE>data.setRectangle(rectangle);<NEW_LINE>List<Integer> rectangleRef = new ArrayList<Integer>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("VerifyFaceMaskResponse.Data.RectangleRef.Length"); i++) {<NEW_LINE>rectangleRef.add(_ctx.integerValue("VerifyFaceMaskResponse.Data.RectangleRef[" + i + "]"));<NEW_LINE>}<NEW_LINE>data.setRectangleRef(rectangleRef);<NEW_LINE>verifyFaceMaskResponse.setData(data);<NEW_LINE>return verifyFaceMaskResponse;<NEW_LINE>} | (_ctx.integerValue("VerifyFaceMaskResponse.Data.MaskRef")); |
1,573,489 | Mono<Response<PathInfo>> flushWithResponse(long position, boolean retainUncommittedData, boolean close, PathHttpHeaders httpHeaders, DataLakeRequestConditions requestConditions, Context context) {<NEW_LINE>httpHeaders = httpHeaders == <MASK><NEW_LINE>requestConditions = requestConditions == null ? new DataLakeRequestConditions() : requestConditions;<NEW_LINE>LeaseAccessConditions lac = new LeaseAccessConditions().setLeaseId(requestConditions.getLeaseId());<NEW_LINE>ModifiedAccessConditions mac = new ModifiedAccessConditions().setIfMatch(requestConditions.getIfMatch()).setIfNoneMatch(requestConditions.getIfNoneMatch()).setIfModifiedSince(requestConditions.getIfModifiedSince()).setIfUnmodifiedSince(requestConditions.getIfUnmodifiedSince());<NEW_LINE>context = context == null ? Context.NONE : context;<NEW_LINE>return this.dataLakeStorage.getPaths().flushDataWithResponseAsync(null, position, retainUncommittedData, close, (long) 0, null, httpHeaders, lac, mac, getCpkInfo(), context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)).map(response -> new SimpleResponse<>(response, new PathInfo(response.getDeserializedHeaders().getETag(), response.getDeserializedHeaders().getLastModified(), response.getDeserializedHeaders().isXMsRequestServerEncrypted() != null, response.getDeserializedHeaders().getXMsEncryptionKeySha256())));<NEW_LINE>} | null ? new PathHttpHeaders() : httpHeaders; |
1,473,444 | private static ITranslatableString extractDescription(final Field field) {<NEW_LINE>final ViewColumn viewColumnAnn = field.getAnnotation(ViewColumn.class);<NEW_LINE>final String captionKey = !Check.isEmpty(viewColumnAnn.captionKey()) ? viewColumnAnn.captionKey() : extractFieldName(field);<NEW_LINE>final TranslationSource captionTranslationSource = viewColumnAnn.captionTranslationSource();<NEW_LINE>if (captionTranslationSource == TranslationSource.DEFAULT) {<NEW_LINE>final IMsgBL msgBL = Services.get(IMsgBL.class);<NEW_LINE>return <MASK><NEW_LINE>} else if (captionTranslationSource == TranslationSource.ATTRIBUTE_NAME) {<NEW_LINE>final IAttributeDAO attributesRepo = Services.get(IAttributeDAO.class);<NEW_LINE>return attributesRepo.getAttributeDescriptionByValue(captionKey).orElseGet(() -> TranslatableStrings.anyLanguage(captionKey));<NEW_LINE>} else {<NEW_LINE>logger.warn("Unknown TranslationSource={} for {}. Returning the captionKey={}", captionTranslationSource, field, captionKey);<NEW_LINE>return TranslatableStrings.anyLanguage(captionKey);<NEW_LINE>}<NEW_LINE>} | msgBL.translatable(captionKey + "/Description"); |
707,790 | private IQueryFilter<I_M_Tour_Instance> createTourInstanceMatcher(final ITourInstanceQueryParams params) {<NEW_LINE>Check.assumeNotNull(params, "params not null");<NEW_LINE>final IQueryBL queryBL = Services.get(IQueryBL.class);<NEW_LINE>final ICompositeQueryFilter<I_M_Tour_Instance> filters = queryBL.createCompositeQueryFilter(I_M_Tour_Instance.class);<NEW_LINE>//<NEW_LINE>// Filter: Tour<NEW_LINE>final I_M_Tour tour = params.getM_Tour();<NEW_LINE>if (tour != null) {<NEW_LINE>final int tourId = tour.getM_Tour_ID();<NEW_LINE>Check.assume(tourId > 0, "Tour shall be saved: {}", tour);<NEW_LINE>filters.addEqualsFilter(I_M_Tour_Instance.COLUMN_M_Tour_ID, tourId);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Filter: DeliveryDate<NEW_LINE>final <MASK><NEW_LINE>if (deliveryDate != null) {<NEW_LINE>filters.addEqualsFilter(I_M_Tour_Instance.COLUMN_DeliveryDate, deliveryDate);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Filter: Processed<NEW_LINE>final Boolean processed = params.getProcessed();<NEW_LINE>if (processed != null) {<NEW_LINE>filters.addEqualsFilter(I_M_Tour_Instance.COLUMN_Processed, processed);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Filter: Generic Tour Instance (i.e. M_ShipperTransportation_ID is null)<NEW_LINE>final Boolean genericTourInstanceObj = params.getGenericTourInstance();<NEW_LINE>if (genericTourInstanceObj == null) {<NEW_LINE>// skip generic tour instance filtering<NEW_LINE>} else if (genericTourInstanceObj == true) {<NEW_LINE>filters.addEqualsFilter(I_M_Tour_Instance.COLUMN_M_ShipperTransportation_ID, null);<NEW_LINE>} else // genericTourInstance == false<NEW_LINE>{<NEW_LINE>filters.addNotEqualsFilter(I_M_Tour_Instance.COLUMN_M_ShipperTransportation_ID, null);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Filter by M_ShipperTransportation_ID<NEW_LINE>if (params.getM_ShipperTransportation_ID() > 0) {<NEW_LINE>Check.assume(!Boolean.TRUE.equals(genericTourInstanceObj), "When filtering by M_ShipperTransportation_ID, genericTourInstance shall not be true: {}", params);<NEW_LINE>filters.addEqualsFilter(I_M_Tour_Instance.COLUMN_M_ShipperTransportation_ID, params.getM_ShipperTransportation_ID());<NEW_LINE>}<NEW_LINE>return filters;<NEW_LINE>} | Date deliveryDate = params.getDeliveryDate(); |
1,054,111 | public void onBindGroupViewHolder(@NonNull MyGroupViewHolder holder, int groupPosition, int viewType) {<NEW_LINE>// child item<NEW_LINE>final AbstractExpandableDataProvider.BaseData item = mProvider.getGroupItem(groupPosition);<NEW_LINE>// set text<NEW_LINE>holder.mTextView.setText(item.getText());<NEW_LINE>// mark as clickable<NEW_LINE>holder.itemView.setClickable(true);<NEW_LINE>// set background resource (target view ID: container)<NEW_LINE>final ExpandableItemState expandState = holder.getExpandState();<NEW_LINE>if (expandState.isUpdated()) {<NEW_LINE>int bgResId;<NEW_LINE>boolean animateIndicator = expandState.hasExpandedStateChanged();<NEW_LINE>if (expandState.isExpanded()) {<NEW_LINE>bgResId = R.drawable.bg_group_item_expanded_state;<NEW_LINE>} else {<NEW_LINE>bgResId = R.drawable.bg_group_item_normal_state;<NEW_LINE>}<NEW_LINE>holder.mContainer.setBackgroundResource(bgResId);<NEW_LINE>holder.mIndicator.setExpandedState(<MASK><NEW_LINE>}<NEW_LINE>} | expandState.isExpanded(), animateIndicator); |
1,602,254 | private void addDisplay(int parentM_Product_ID, int M_Product_ID, String bomType, String name, BigDecimal lineQty, int PP_Product_BOM_ID, String M_Feature, int PP_Product_BOMLine_ID) {<NEW_LINE>log.fine("M_Product_ID=" + M_Product_ID + ",Type=" + bomType + ",Name=" + name + ",Qty=" + lineQty);<NEW_LINE>//<NEW_LINE>boolean selected = true;<NEW_LINE>if (MPPProductBOMLine.COMPONENTTYPE_Component.equals(bomType)) {<NEW_LINE>String title = "";<NEW_LINE>JCheckBox cb = new JCheckBox(title);<NEW_LINE>cb.setSelected(true);<NEW_LINE>cb.setEnabled(false);<NEW_LINE>m_selectionList.add(cb);<NEW_LINE>this.add(cb, new ALayoutConstraint(m_bomLine++, 0));<NEW_LINE>} else // FIXME: add different types for libero<NEW_LINE>if (MPPProductBOMLine.COMPONENTTYPE_Variant.equals(bomType)) {<NEW_LINE>String title = Msg.getMsg(Env.getCtx(), "Optional");<NEW_LINE><MASK><NEW_LINE>cb.setSelected(false);<NEW_LINE>selected = false;<NEW_LINE>cb.addActionListener(this);<NEW_LINE>m_selectionList.add(cb);<NEW_LINE>this.add(cb, new ALayoutConstraint(m_bomLine++, 0));<NEW_LINE>} else // Alternative<NEW_LINE>{<NEW_LINE>// String title = Msg.getMsg(Env.getCtx(), "Alternative") + " " + bomType;<NEW_LINE>String title = M_Feature;<NEW_LINE>JRadioButton b = new JRadioButton(title);<NEW_LINE>// String groupName = String.valueOf(parentM_Product_ID) + "_" + bomType;<NEW_LINE>String groupName = String.valueOf(getProductFromMPPProductBOM(PP_Product_BOM_ID).get_ID()) + "_" + bomType;<NEW_LINE>ButtonGroup group = (ButtonGroup) m_buttonGroups.get(groupName);<NEW_LINE>if (group == null) {<NEW_LINE>log.fine("ButtonGroup=" + groupName);<NEW_LINE>group = new ButtonGroup();<NEW_LINE>m_buttonGroups.put(groupName, group);<NEW_LINE>group.add(b);<NEW_LINE>// select first one<NEW_LINE>b.setSelected(true);<NEW_LINE>} else {<NEW_LINE>group.add(b);<NEW_LINE>b.setSelected(false);<NEW_LINE>selected = false;<NEW_LINE>}<NEW_LINE>b.addActionListener(this);<NEW_LINE>m_selectionList.add(b);<NEW_LINE>this.add(b, new ALayoutConstraint(m_bomLine++, 0));<NEW_LINE>}<NEW_LINE>// Add to List & display<NEW_LINE>m_productList.add(new Integer(M_Product_ID));<NEW_LINE>m_bomLineIDList.add(new Integer(PP_Product_BOMLine_ID));<NEW_LINE>CLabel label = new CLabel(name);<NEW_LINE>// label.setLabelFor(qty);<NEW_LINE>this.add(label);<NEW_LINE>// this.add(qty);<NEW_LINE>} | JCheckBox cb = new JCheckBox(title); |
112,983 | public static void main(String[] args) {<NEW_LINE>Exercise32_HamiltonianPathInDAGs hamiltonianPathInDAGs = new Exercise32_HamiltonianPathInDAGs();<NEW_LINE>Digraph digraph1 = new Digraph(5);<NEW_LINE>digraph1.addEdge(0, 1);<NEW_LINE>digraph1.addEdge(0, 2);<NEW_LINE>digraph1.addEdge(1, 2);<NEW_LINE>digraph1.addEdge(2, 3);<NEW_LINE>digraph1.addEdge(3, 4);<NEW_LINE>StdOut.println("Has Hamiltonian path: " + hamiltonianPathInDAGs.hasHamiltonianPath(digraph1) + " Expected: true");<NEW_LINE>Digraph digraph2 = new Digraph(6);<NEW_LINE>digraph2.addEdge(0, 1);<NEW_LINE>digraph2.addEdge(1, 2);<NEW_LINE>digraph2.addEdge(3, 4);<NEW_LINE>digraph2.addEdge(4, 5);<NEW_LINE>StdOut.println("Has Hamiltonian path: " + hamiltonianPathInDAGs.hasHamiltonianPath(digraph2) + " Expected: false");<NEW_LINE>Digraph digraph3 = new Digraph(9);<NEW_LINE>digraph3.addEdge(0, 1);<NEW_LINE>digraph3.addEdge(1, 2);<NEW_LINE>digraph3.addEdge(1, 3);<NEW_LINE><MASK><NEW_LINE>digraph3.addEdge(5, 6);<NEW_LINE>digraph3.addEdge(6, 8);<NEW_LINE>digraph3.addEdge(6, 7);<NEW_LINE>digraph3.addEdge(7, 2);<NEW_LINE>digraph3.addEdge(8, 3);<NEW_LINE>StdOut.println("Has Hamiltonian path: " + hamiltonianPathInDAGs.hasHamiltonianPath(digraph3) + " Expected: false");<NEW_LINE>Digraph digraph4 = new Digraph(5);<NEW_LINE>digraph4.addEdge(0, 2);<NEW_LINE>digraph4.addEdge(1, 2);<NEW_LINE>digraph4.addEdge(1, 3);<NEW_LINE>digraph4.addEdge(2, 4);<NEW_LINE>digraph4.addEdge(3, 4);<NEW_LINE>StdOut.println("Has Hamiltonian path: " + hamiltonianPathInDAGs.hasHamiltonianPath(digraph4) + " Expected: false");<NEW_LINE>} | digraph3.addEdge(4, 5); |
1,403,293 | public double calculateAverageWeightedDegree(Graph graph, boolean isDirected, boolean updateAttributes) {<NEW_LINE>double averageWeightedDegree = 0;<NEW_LINE>DirectedGraph directedGraph = null;<NEW_LINE>if (isDirected) {<NEW_LINE>directedGraph = (DirectedGraph) graph;<NEW_LINE>}<NEW_LINE>Progress.start(progress, graph.getNodeCount());<NEW_LINE>NodeIterable nodesIterable = graph.getNodes();<NEW_LINE>for (Node n : nodesIterable) {<NEW_LINE>double totalWeight = 0;<NEW_LINE>if (isDirected) {<NEW_LINE>double totalInWeight = 0;<NEW_LINE>double totalOutWeight = 0;<NEW_LINE>for (Edge e : directedGraph.getEdges(n)) {<NEW_LINE>if (e.getSource().equals(n)) {<NEW_LINE>totalOutWeight += e.getWeight();<NEW_LINE>}<NEW_LINE>if (e.getTarget().equals(n)) {<NEW_LINE>totalInWeight += e.getWeight();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>totalWeight = totalInWeight + totalOutWeight;<NEW_LINE>n.setAttribute(WINDEGREE, totalInWeight);<NEW_LINE>n.setAttribute(WOUTDEGREE, totalOutWeight);<NEW_LINE>n.setAttribute(WDEGREE, totalWeight);<NEW_LINE>updateDegreeDists(totalInWeight, totalOutWeight, totalWeight);<NEW_LINE>} else {<NEW_LINE>for (Edge e : graph.getEdges(n)) {<NEW_LINE>totalWeight += (e.isSelfLoop() ? 2 : 1) * e.getWeight();<NEW_LINE>}<NEW_LINE>n.setAttribute(WDEGREE, totalWeight);<NEW_LINE>updateDegreeDists(totalWeight);<NEW_LINE>}<NEW_LINE>averageWeightedDegree += totalWeight;<NEW_LINE>if (isCanceled) {<NEW_LINE>nodesIterable.doBreak();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Progress.progress(progress);<NEW_LINE>}<NEW_LINE>averageWeightedDegree /= (isDirected ? 2.0 : <MASK><NEW_LINE>return averageWeightedDegree;<NEW_LINE>} | 1.0) * graph.getNodeCount(); |
1,625,131 | public void deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String sharedPrivateLinkResourceName = <MASK><NEW_LINE>if (sharedPrivateLinkResourceName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'sharedPrivateLinkResources'.", id)));<NEW_LINE>}<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String resourceName = Utils.getValueFromIdByName(id, "webPubSub");<NEW_LINE>if (resourceName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id)));<NEW_LINE>}<NEW_LINE>this.delete(sharedPrivateLinkResourceName, resourceGroupName, resourceName, context);<NEW_LINE>} | Utils.getValueFromIdByName(id, "sharedPrivateLinkResources"); |
982,672 | final DescribeJobLogItemsResult executeDescribeJobLogItems(DescribeJobLogItemsRequest describeJobLogItemsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeJobLogItemsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeJobLogItemsRequest> request = null;<NEW_LINE>Response<DescribeJobLogItemsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeJobLogItemsRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "mgn");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeJobLogItems");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeJobLogItemsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeJobLogItemsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(describeJobLogItemsRequest)); |
473,046 | private boolean handleTopicAssignmentOnline(String topic, String srcCluster, String dstCluster) {<NEW_LINE>HelixMirrorMakerManager helixManager = _currentControllerInstance.getHelixResourceManager();<NEW_LINE>if (helixManager.isTopicExisted(topic)) {<NEW_LINE>LOGGER.warn("Topic {} already exists from cluster {} to {}", topic, srcCluster, dstCluster);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>TopicPartition topicPartitionInfo = null;<NEW_LINE>KafkaBrokerTopicObserver topicObserver = _currentControllerInstance.getSourceKafkaTopicObserver();<NEW_LINE>if (topicObserver == null) {<NEW_LINE>// no source partition information, use partitions=1 and depend on auto-expanding later<NEW_LINE>topicPartitionInfo = new TopicPartition(topic, 1);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>if (topicPartitionInfo == null) {<NEW_LINE>String msg = String.format("Failed to whitelist topic %s on controller because topic does not exists in src cluster %s", topic, srcCluster);<NEW_LINE>LOGGER.error(msg);<NEW_LINE>throw new IllegalArgumentException(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>helixManager.addTopicToMirrorMaker(topicPartitionInfo);<NEW_LINE>LOGGER.info("Whitelisted topic {} from cluster {} to {}", topic, srcCluster, dstCluster);<NEW_LINE>return true;<NEW_LINE>} | topicPartitionInfo = topicObserver.getTopicPartitionWithRefresh(topic); |
227,350 | private Map<String, String> parseEnvironment(final String[] entries) {<NEW_LINE>final Map<String, String> map = new HashMap<>();<NEW_LINE>if (entries.length > 1) {<NEW_LINE>// Skip the last entry it contains the cron expression no variables.<NEW_LINE>for (int i = 0; i < entries.length - 1; i++) {<NEW_LINE>final String entry = entries[i];<NEW_LINE>if (entry.startsWith("#") || entry.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final int <MASK><NEW_LINE>if (n >= 0) {<NEW_LINE>final String key = entry.substring(0, n).trim();<NEW_LINE>final String value = entry.substring(n + 1).trim();<NEW_LINE>map.put(key, value);<NEW_LINE>} else {<NEW_LINE>map.put(entry.trim(), Boolean.TRUE.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>} else {<NEW_LINE>return Collections.emptyMap();<NEW_LINE>}<NEW_LINE>} | n = entry.indexOf('='); |
1,643,289 | public void receiveEmptyMessage(final EmptyMessage message, final EndpointReceiver receiver) {<NEW_LINE>// an empty ACK or RST always is received as a reply to a message<NEW_LINE>// exchange originating locally, i.e. the message will echo an MID<NEW_LINE>// that has been created here<NEW_LINE>EndpointContext context = message.getSourceContext();<NEW_LINE>Object identity = endpointContextMatcher.getEndpointIdentity(context);<NEW_LINE>KeyMID byMID = new KeyMID(message.getMID(), identity);<NEW_LINE>Exchange tempExchange = exchangeStore.get(byMID);<NEW_LINE>if (tempExchange == null && identity != context.getPeerAddress()) {<NEW_LINE>KeyMID pongByMID = new KeyMID(message.getMID(), context.getPeerAddress());<NEW_LINE>tempExchange = exchangeStore.get(pongByMID);<NEW_LINE>if (tempExchange != null) {<NEW_LINE>byMID = pongByMID;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tempExchange == null) {<NEW_LINE>LOGGER.debug("ignoring {} message unmatchable by {}", message.getType(), byMID);<NEW_LINE>cancel(message, receiver);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final KeyMID idByMID = byMID;<NEW_LINE>final Exchange exchange = tempExchange;<NEW_LINE>exchange.execute(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>if (exchange.getCurrentRequest().isMulticast()) {<NEW_LINE>LOGGER.debug("ignoring {} message for multicast request {}", message.getType(), idByMID);<NEW_LINE>cancel(message, receiver);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (exchangeStore.get(idByMID) != exchange) {<NEW_LINE>if (running) {<NEW_LINE>LOGGER.debug("ignoring {} message not longer matching by {}", <MASK><NEW_LINE>}<NEW_LINE>cancel(message, receiver);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (endpointContextMatcher.isResponseRelatedToRequest(exchange.getEndpointContext(), message.getSourceContext())) {<NEW_LINE>exchangeStore.remove(idByMID, exchange);<NEW_LINE>LOGGER.debug("received expected {} reply for {}", message.getType(), idByMID);<NEW_LINE>receiver.receiveEmptyMessage(exchange, message);<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("ignoring potentially forged {} reply for {} with non-matching endpoint context", message.getType(), idByMID);<NEW_LINE>}<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>LOGGER.warn("error receiving {} message for {}", message.getType(), exchange, ex);<NEW_LINE>}<NEW_LINE>cancel(message, receiver);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | message.getType(), idByMID); |
714,427 | private void loadNode797() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.Server_Namespaces_OPCUANamespaceUri_NamespaceVersion, new QualifiedName(0, "NamespaceVersion"), new LocalizedText("en", "NamespaceVersion"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.String, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.Server_Namespaces_OPCUANamespaceUri_NamespaceVersion, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_Namespaces_OPCUANamespaceUri_NamespaceVersion, Identifiers.HasProperty, Identifiers.Server_Namespaces_OPCUANamespaceUri.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<String xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\">1.03</String>");<NEW_LINE>String xml = sb.toString();<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><MASK><NEW_LINE>} | this.nodeManager.addNode(node); |
1,379,378 | public // * scale(i) * (i+1)! (M+1-(i+1)-1)!/(M+1)! / (i! (M-i-1)!/ M!), whence += scale(i) * (i+1) / (M+1).<NEW_LINE>int extend(double fractionZero, double fractionOne, int featureIndex, int nextIndex) {<NEW_LINE>setValues(nextIndex, fractionOne, fractionZero, featureIndex);<NEW_LINE>setScale(nextIndex, nextIndex == 0 ? 1.0 : 0.0);<NEW_LINE>double stepDown = fractionOne / (double) (nextIndex + 1);<NEW_LINE>double stepUp = fractionZero / (double) (nextIndex + 1);<NEW_LINE>double countDown = nextIndex * stepDown;<NEW_LINE>double countUp = stepUp;<NEW_LINE>for (int i = (nextIndex - 1); i >= 0; --i, countDown -= stepDown, countUp += stepUp) {<NEW_LINE>setScale(i + 1, getScale(i + 1) <MASK><NEW_LINE>setScale(i, getScale(i) * countUp);<NEW_LINE>}<NEW_LINE>return nextIndex + 1;<NEW_LINE>} | + getScale(i) * countDown); |
798,892 | static int showBugReportDialog(final String title, final String question, final int messageType, final Object[] options, final Object firstChoice, final String reportName, final String log) {<NEW_LINE>final Box messagePane = Box.createVerticalBox();<NEW_LINE>final JLabel messageLabel = new JLabel(question);<NEW_LINE>messageLabel.setAlignmentX(JLabel.LEFT_ALIGNMENT);<NEW_LINE>messagePane.add(messageLabel);<NEW_LINE>messagePane.add(Box.createVerticalStrut(10));<NEW_LINE>final JLabel messageLabel2 = new JLabel(reportName);<NEW_LINE>messageLabel2.setAlignmentX(JLabel.LEFT_ALIGNMENT);<NEW_LINE>messagePane.add(messageLabel2);<NEW_LINE>final JTextArea historyArea = new JTextArea(log);<NEW_LINE>historyArea.setEditable(false);<NEW_LINE>final JScrollPane historyPane = new JScrollPane(historyArea);<NEW_LINE>historyPane.setPreferredSize(new Dimension(500, 300));<NEW_LINE><MASK><NEW_LINE>messagePane.add(historyPane);<NEW_LINE>final int choice = JOptionPane.showOptionDialog(UITools.getCurrentRootComponent(), messagePane, title, JOptionPane.DEFAULT_OPTION, messageType, null, options, firstChoice);<NEW_LINE>return choice;<NEW_LINE>} | historyPane.setAlignmentX(JLabel.LEFT_ALIGNMENT); |
440,678 | private int generateObjectMethodsBootStrapMethods(List<TypeBinding> recordList, int localContentsOffset, final int contentsEntries) {<NEW_LINE>ReferenceBinding javaLangRuntimeObjectMethods = this.referenceBinding.scope.getJavaLangRuntimeObjectMethods();<NEW_LINE>int numberOfBootstraps = recordList.size();<NEW_LINE>int indexForObjectMethodBootStrap = 0;<NEW_LINE>for (int i = 0; i < numberOfBootstraps; i++) {<NEW_LINE>if (contentsEntries + localContentsOffset >= this.contents.length) {<NEW_LINE>resizeContents(contentsEntries);<NEW_LINE>}<NEW_LINE>if (indexForObjectMethodBootStrap == 0) {<NEW_LINE>indexForObjectMethodBootStrap = this.constantPool.literalIndexForMethodHandle(ClassFileConstants.MethodHandleRefKindInvokeStatic, javaLangRuntimeObjectMethods, ConstantPool.BOOTSTRAP, ConstantPool.JAVA_LANG_RUNTIME_OBJECTMETHOD_BOOTSTRAP_SIGNATURE, false);<NEW_LINE>}<NEW_LINE>this.contents[localContentsOffset++] = (byte) (indexForObjectMethodBootStrap >> 8);<NEW_LINE>this.contents[localContentsOffset++] = (byte) indexForObjectMethodBootStrap;<NEW_LINE>// u2 num_bootstrap_arguments<NEW_LINE>int numArgsLocation = localContentsOffset;<NEW_LINE>localContentsOffset += 2;<NEW_LINE>TypeBinding type = recordList.get(i);<NEW_LINE>// sanity check<NEW_LINE>assert type.isRecord();<NEW_LINE>char[] recordName = type.constantPoolName();<NEW_LINE>int recordIndex = this.constantPool.literalIndexForType(recordName);<NEW_LINE>this.contents[localContentsOffset++] = (<MASK><NEW_LINE>this.contents[localContentsOffset++] = (byte) recordIndex;<NEW_LINE>assert type instanceof SourceTypeBinding;<NEW_LINE>SourceTypeBinding sourceType = (SourceTypeBinding) type;<NEW_LINE>FieldBinding[] recordComponents = sourceType.getImplicitComponentFields();<NEW_LINE>int numArgs = 2 + recordComponents.length;<NEW_LINE>this.contents[numArgsLocation++] = (byte) (numArgs >> 8);<NEW_LINE>this.contents[numArgsLocation] = (byte) numArgs;<NEW_LINE>String names = // $NON-NLS-1$<NEW_LINE>Arrays.stream(recordComponents).map(f -> new String(f.name)).// $NON-NLS-1$<NEW_LINE>reduce((s1, s2) -> {<NEW_LINE>return s1 + ";" + s2;<NEW_LINE>}).orElse(Util.EMPTY_STRING);<NEW_LINE>int namesIndex = this.constantPool.literalIndex(names);<NEW_LINE>this.contents[localContentsOffset++] = (byte) (namesIndex >> 8);<NEW_LINE>this.contents[localContentsOffset++] = (byte) namesIndex;<NEW_LINE>if (recordComponents.length * 2 + localContentsOffset >= this.contents.length) {<NEW_LINE>resizeContents(recordComponents.length * 2);<NEW_LINE>}<NEW_LINE>for (FieldBinding field : recordComponents) {<NEW_LINE>int methodHandleIndex = this.constantPool.literalIndexForMethodHandleFieldRef(ClassFileConstants.MethodHandleRefKindGetField, recordName, field.name, field.type.signature());<NEW_LINE>this.contents[localContentsOffset++] = (byte) (methodHandleIndex >> 8);<NEW_LINE>this.contents[localContentsOffset++] = (byte) methodHandleIndex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return localContentsOffset;<NEW_LINE>} | byte) (recordIndex >> 8); |
714,512 | public DeletePortfolioShareResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeletePortfolioShareResult deletePortfolioShareResult = new DeletePortfolioShareResult();<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 deletePortfolioShareResult;<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("PortfolioShareToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deletePortfolioShareResult.setPortfolioShareToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return deletePortfolioShareResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
382,512 | private String workWithFeature(HttpServletResponse res, String operation, String uid) throws IOException {<NEW_LINE>String message = null;<NEW_LINE>if (OP_DISABLE.equalsIgnoreCase(operation)) {<NEW_LINE>getFf4j().getFeatureStore().disable(uid);<NEW_LINE>res.setContentType(CONTENT_TYPE_HTML);<NEW_LINE>res.getWriter().println(renderMessageBox(msg(uid, "DISABLED"), "info"));<NEW_LINE>LOGGER.info(uid + " has been disabled");<NEW_LINE>}<NEW_LINE>if (OP_ENABLE.equalsIgnoreCase(operation)) {<NEW_LINE>getFf4j().<MASK><NEW_LINE>res.setContentType(CONTENT_TYPE_HTML);<NEW_LINE>res.getWriter().println(renderMessageBox(msg(uid, "ENABLED"), "info"));<NEW_LINE>LOGGER.info("Feature '" + uid + "' has been successfully enabled");<NEW_LINE>}<NEW_LINE>if (OP_READ_FEATURE.equalsIgnoreCase(operation)) {<NEW_LINE>Feature f = getFf4j().getFeatureStore().read(uid);<NEW_LINE>res.setContentType(CONTENT_TYPE_JSON);<NEW_LINE>res.getWriter().println(f.toJson());<NEW_LINE>}<NEW_LINE>// As no return the page is draw<NEW_LINE>if (OP_RMV_FEATURE.equalsIgnoreCase(operation)) {<NEW_LINE>getFf4j().getFeatureStore().delete(uid);<NEW_LINE>LOGGER.info(uid + " has been deleted");<NEW_LINE>message = msg(uid, "DELETED");<NEW_LINE>}<NEW_LINE>return message;<NEW_LINE>} | getFeatureStore().enable(uid); |
1,516,441 | private Map<String, Object> updateDagSchedule(User loginUser, long projectCode, long processDefinitionCode, String scheduleJson) {<NEW_LINE>Map<String, Object> result = new HashMap<>();<NEW_LINE>Schedule schedule = JSONUtils.parseObject(scheduleJson, Schedule.class);<NEW_LINE>if (schedule == null) {<NEW_LINE>putMsg(result, Status.DATA_IS_NOT_VALID, scheduleJson);<NEW_LINE>throw new ServiceException(Status.DATA_IS_NOT_VALID);<NEW_LINE>}<NEW_LINE>// set default value<NEW_LINE>FailureStrategy failureStrategy = schedule.getFailureStrategy() == null ? FailureStrategy.CONTINUE : schedule.getFailureStrategy();<NEW_LINE>WarningType warningType = schedule.getWarningType() == null ? WarningType.NONE : schedule.getWarningType();<NEW_LINE>Priority processInstancePriority = schedule.getProcessInstancePriority() == null ? Priority.MEDIUM : schedule.getProcessInstancePriority();<NEW_LINE>int warningGroupId = schedule.getWarningGroupId() == 0 ? 1 : schedule.getWarningGroupId();<NEW_LINE>String workerGroup = schedule.getWorkerGroup() == null ? "default" : schedule.getWorkerGroup();<NEW_LINE>long environmentCode = schedule.getEnvironmentCode() == null ? -1 : schedule.getEnvironmentCode();<NEW_LINE>ScheduleParam param = new ScheduleParam();<NEW_LINE>param.setStartTime(schedule.getStartTime());<NEW_LINE>param.setEndTime(schedule.getEndTime());<NEW_LINE>param.<MASK><NEW_LINE>param.setTimezoneId(schedule.getTimezoneId());<NEW_LINE>return schedulerService.updateScheduleByProcessDefinitionCode(loginUser, projectCode, processDefinitionCode, JSONUtils.toJsonString(param), warningType, warningGroupId, failureStrategy, processInstancePriority, workerGroup, environmentCode);<NEW_LINE>} | setCrontab(schedule.getCrontab()); |
1,332,119 | private SeekMap buildSeekMap(@Nullable LongArray cueTimesUs, @Nullable LongArray cueClusterPositions) {<NEW_LINE>if (segmentContentPosition == C.POSITION_UNSET || durationUs == C.TIME_UNSET || cueTimesUs == null || cueTimesUs.size() == 0 || cueClusterPositions == null || cueClusterPositions.size() != cueTimesUs.size()) {<NEW_LINE>// Cues information is missing or incomplete.<NEW_LINE>return new SeekMap.Unseekable(durationUs);<NEW_LINE>}<NEW_LINE>int cuePointsSize = cueTimesUs.size();<NEW_LINE>int[] sizes = new int[cuePointsSize];<NEW_LINE>long[] offsets = new long[cuePointsSize];<NEW_LINE>long[] durationsUs = new long[cuePointsSize];<NEW_LINE>long[] timesUs = new long[cuePointsSize];<NEW_LINE>for (int i = 0; i < cuePointsSize; i++) {<NEW_LINE>timesUs[i] = cueTimesUs.get(i);<NEW_LINE>offsets[i] = segmentContentPosition + cueClusterPositions.get(i);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < cuePointsSize - 1; i++) {<NEW_LINE>sizes[i] = (int) (offsets[i + 1] - offsets[i]);<NEW_LINE>durationsUs[i] = timesUs[i + 1] - timesUs[i];<NEW_LINE>}<NEW_LINE>sizes[cuePointsSize - 1] = (int) (segmentContentPosition + segmentContentSize - offsets[cuePointsSize - 1]);<NEW_LINE>durationsUs[cuePointsSize - 1] = durationUs - timesUs[cuePointsSize - 1];<NEW_LINE>long <MASK><NEW_LINE>if (lastDurationUs <= 0) {<NEW_LINE>Log.w(TAG, "Discarding last cue point with unexpected duration: " + lastDurationUs);<NEW_LINE>sizes = Arrays.copyOf(sizes, sizes.length - 1);<NEW_LINE>offsets = Arrays.copyOf(offsets, offsets.length - 1);<NEW_LINE>durationsUs = Arrays.copyOf(durationsUs, durationsUs.length - 1);<NEW_LINE>timesUs = Arrays.copyOf(timesUs, timesUs.length - 1);<NEW_LINE>}<NEW_LINE>return new ChunkIndex(sizes, offsets, durationsUs, timesUs);<NEW_LINE>} | lastDurationUs = durationsUs[cuePointsSize - 1]; |
1,203,904 | public static void addNodes(@Nonnull List<? extends PackagingElement<?>> elements, @Nonnull CompositePackagingElementNode parentNode, @Nonnull CompositePackagingElement parentElement, @Nonnull ArtifactEditorContext context, @Nonnull ComplexElementSubstitutionParameters substitutionParameters, @Nonnull Collection<PackagingNodeSource> nodeSources, @Nonnull List<PackagingElementNode<?>> nodes, ArtifactType artifactType, Set<PackagingElement<?>> processed) {<NEW_LINE>for (PackagingElement<?> element : elements) {<NEW_LINE>final PackagingElementNode<?> prev = findEqual(nodes, element);<NEW_LINE>if (prev != null) {<NEW_LINE>prev.addElement(element, parentElement, nodeSources);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (element instanceof ArtifactRootElement) {<NEW_LINE>throw new AssertionError("artifact root not expected here");<NEW_LINE>} else if (element instanceof CompositePackagingElement) {<NEW_LINE>nodes.add(new CompositePackagingElementNode((CompositePackagingElement<?>) element, context, parentNode, parentElement, substitutionParameters, nodeSources, artifactType));<NEW_LINE>} else if (element instanceof ComplexPackagingElement) {<NEW_LINE>final ComplexPackagingElement<?> complexElement = (ComplexPackagingElement<?>) element;<NEW_LINE>if (processed.add(element) && substitutionParameters.shouldSubstitute(complexElement)) {<NEW_LINE>final List<? extends PackagingElement<?>> substitution = complexElement.getSubstitution(context, artifactType);<NEW_LINE>if (substitution != null) {<NEW_LINE>final PackagingNodeSource source = new PackagingNodeSource(complexElement, parentNode, parentElement, nodeSources);<NEW_LINE>addNodes(substitution, parentNode, parentElement, context, substitutionParameters, Collections.singletonList(source<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>nodes.add(new ComplexPackagingElementNode(complexElement, context, parentNode, parentElement, substitutionParameters, nodeSources));<NEW_LINE>} else {<NEW_LINE>nodes.add(new PackagingElementNode<PackagingElement<?>>(element, context, parentNode, parentElement, nodeSources));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), nodes, artifactType, processed); |
1,823,755 | public com.squareup.okhttp.Call apisApiIdGetCall(String apiId, String tenantDomain, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/{apiId}".replaceAll("\\{" + "apiId" + "\\}", apiClient.escapeString(apiId.toString()));<NEW_LINE>List<Pair> localVarQueryParams <MASK><NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (tenantDomain != null)<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPair("tenantDomain", tenantDomain));<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" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>} | = new ArrayList<Pair>(); |
185,628 | private void loadNode8() {<NEW_LINE>UaVariableTypeNode node = new UaVariableTypeNode(this.context, Identifiers.ServerStatusType, new QualifiedName(0, "ServerStatusType"), new LocalizedText("en", "ServerStatusType"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.ServerStatusDataType, -1, new UInteger[] {}, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerStatusType, Identifiers.HasComponent, Identifiers.ServerStatusType_StartTime.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerStatusType, Identifiers.HasComponent, Identifiers.ServerStatusType_CurrentTime<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ServerStatusType, Identifiers.HasComponent, Identifiers.ServerStatusType_State.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerStatusType, Identifiers.HasComponent, Identifiers.ServerStatusType_BuildInfo.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerStatusType, Identifiers.HasComponent, Identifiers.ServerStatusType_SecondsTillShutdown.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerStatusType, Identifiers.HasComponent, Identifiers.ServerStatusType_ShutdownReason.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerStatusType, Identifiers.HasSubtype, Identifiers.BaseDataVariableType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), true)); |
748,380 | private Unmarshaller createUnmarshaller() {<NEW_LINE>try {<NEW_LINE>Unmarshaller um = databinding.getJAXBUnmarshaller();<NEW_LINE>if (setEventHandler) {<NEW_LINE>um.setEventHandler(new WSUIDValidationHandler(veventHandler));<NEW_LINE>}<NEW_LINE>// If the unmarshaller has already been filled with all the initializing properties<NEW_LINE>// and attributes, we don't have to set again.<NEW_LINE>if (um.getAttachmentUnmarshaller() == null) {<NEW_LINE>if (databinding.getUnmarshallerListener() != null) {<NEW_LINE>um.setListener(databinding.getUnmarshallerListener());<NEW_LINE>}<NEW_LINE>if (databinding.getUnmarshallerProperties() != null) {<NEW_LINE>for (Map.Entry<String, Object> propEntry : databinding.getUnmarshallerProperties().entrySet()) {<NEW_LINE>try {<NEW_LINE>um.setProperty(propEntry.getKey(), propEntry.getValue());<NEW_LINE>} catch (PropertyException pe) {<NEW_LINE>LOG.log(Level.INFO, "PropertyException setting Marshaller properties", pe);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>um.setSchema(schema);<NEW_LINE>um.setAttachmentUnmarshaller(getAttachmentUnmarshaller());<NEW_LINE>return um;<NEW_LINE>} catch (JAXBException ex) {<NEW_LINE>if (ex instanceof javax.xml.bind.UnmarshalException) {<NEW_LINE>javax.xml.bind.UnmarshalException unmarshalEx = (javax.xml.bind.UnmarshalException) ex;<NEW_LINE>throw new Fault(new Message("UNMARSHAL_ERROR", LOG, unmarshalEx.getLinkedException()<MASK><NEW_LINE>} else {<NEW_LINE>throw new Fault(new Message("UNMARSHAL_ERROR", LOG, ex.getMessage()), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getMessage()), ex); |
578,797 | public void onEnable() {<NEW_LINE>PlanSpongeComponent component = DaggerPlanSpongeComponent.builder().plan(this).abstractionLayer(abstractionLayer).game(Sponge.getGame()).build();<NEW_LINE>try {<NEW_LINE>system = component.system();<NEW_LINE>serverShutdownSave = component.serverShutdownSave();<NEW_LINE>locale = system.getLocaleSystem().getLocale();<NEW_LINE>system.enable();<NEW_LINE>new BStatsSponge(metrics, system.getDatabaseSystem().getDatabase()).registerMetrics();<NEW_LINE>logger.info(locale.getString(PluginLang.ENABLED));<NEW_LINE>} catch (AbstractMethodError e) {<NEW_LINE>logger.error("Plugin ran into AbstractMethodError - Server restart is required. Likely cause is updating the jar without a restart.");<NEW_LINE>} catch (EnableException e) {<NEW_LINE>logger.error("----------------------------------------");<NEW_LINE>logger.error("Error: " + e.getMessage());<NEW_LINE>logger.error("----------------------------------------");<NEW_LINE>logger.error("Plugin Failed to Initialize Correctly. If this issue is caused by config settings you can use /plan reload");<NEW_LINE>onDisable();<NEW_LINE>} catch (Exception e) {<NEW_LINE>String version = abstractionLayer<MASK><NEW_LINE>java.util.logging.Logger.getGlobal().log(Level.SEVERE, e, () -> this.getClass().getSimpleName() + "-v" + version);<NEW_LINE>logger.error("Plugin Failed to Initialize Correctly. If this issue is caused by config settings you can use /plan reload");<NEW_LINE>logger.error("This error should be reported at https://github.com/plan-player-analytics/Plan/issues");<NEW_LINE>onDisable();<NEW_LINE>}<NEW_LINE>registerCommand(component.planCommand().build());<NEW_LINE>if (system != null) {<NEW_LINE>system.getProcessing().submitNonCritical(() -> system.getListenerSystem().callEnableEvent(this));<NEW_LINE>}<NEW_LINE>} | .getPluginInformation().getVersion(); |
956,702 | public static Point2D showText(PdfContentByte cb, BaseFont baseFont, float fontSize, String text) {<NEW_LINE>GlyphVector glyphVector = computeGlyphVector(baseFont, fontSize, text);<NEW_LINE>if (!hasAdjustments(glyphVector)) {<NEW_LINE>cb.showText(glyphVector);<NEW_LINE>Point2D p = glyphVector.getGlyphPosition(glyphVector.getNumGlyphs());<NEW_LINE>float dx = (float) p.getX();<NEW_LINE>float dy = (float) p.getY();<NEW_LINE>cb.moveTextBasic(dx, -dy);<NEW_LINE>return new Point2D.Double(-dx, dy);<NEW_LINE>}<NEW_LINE>float lastX = 0f;<NEW_LINE>float lastY = 0f;<NEW_LINE>for (int i = 0; i < glyphVector.getNumGlyphs(); i++) {<NEW_LINE>Point2D p = glyphVector.getGlyphPosition(i);<NEW_LINE>float dx = (float) p.getX() - lastX;<NEW_LINE>float dy = (float) p.getY() - lastY;<NEW_LINE>cb.moveTextBasic(dx, -dy);<NEW_LINE>cb.showText(<MASK><NEW_LINE>lastX = (float) p.getX();<NEW_LINE>lastY = (float) p.getY();<NEW_LINE>}<NEW_LINE>Point2D p = glyphVector.getGlyphPosition(glyphVector.getNumGlyphs());<NEW_LINE>float dx = (float) p.getX() - lastX;<NEW_LINE>float dy = (float) p.getY() - lastY;<NEW_LINE>cb.moveTextBasic(dx, -dy);<NEW_LINE>return new Point2D.Double(-p.getX(), p.getY());<NEW_LINE>} | glyphVector, i, i + 1); |
1,399,575 | public EurekaHttpResponse<InstanceInfo> sendHeartBeat(String appName, String id, InstanceInfo info, InstanceStatus overriddenStatus) {<NEW_LINE>String urlPath = "apps/" + appName + '/' + id;<NEW_LINE>Response response = null;<NEW_LINE>try {<NEW_LINE>WebTarget webResource = jerseyClient.target(serviceUrl).path(urlPath).queryParam("status", info.getStatus().toString()).queryParam("lastDirtyTimestamp", info.getLastDirtyTimestamp().toString());<NEW_LINE>if (overriddenStatus != null) {<NEW_LINE>webResource = webResource.queryParam("overriddenstatus", overriddenStatus.name());<NEW_LINE>}<NEW_LINE>Builder requestBuilder = webResource.request();<NEW_LINE>addExtraProperties(requestBuilder);<NEW_LINE>addExtraHeaders(requestBuilder);<NEW_LINE>requestBuilder.accept(MediaType.APPLICATION_JSON_TYPE);<NEW_LINE>// Jersey2 refuses to handle PUT with no body<NEW_LINE>response = requestBuilder.put(Entity.entity<MASK><NEW_LINE>EurekaHttpResponseBuilder<InstanceInfo> eurekaResponseBuilder = anEurekaHttpResponse(response.getStatus(), InstanceInfo.class).headers(headersOf(response));<NEW_LINE>if (response.hasEntity()) {<NEW_LINE>eurekaResponseBuilder.entity(response.readEntity(InstanceInfo.class));<NEW_LINE>}<NEW_LINE>return eurekaResponseBuilder.build();<NEW_LINE>} finally {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Jersey2 HTTP PUT {}/{}; statusCode={}", serviceUrl, urlPath, response == null ? "N/A" : response.getStatus());<NEW_LINE>}<NEW_LINE>if (response != null) {<NEW_LINE>response.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ("{}", MediaType.APPLICATION_JSON_TYPE)); |
990,564 | private SolutionOrNogood<VAR, VAL> backtrack(CSP<VAR, VAL> csp, Assignment<VAR, VAL> assignment) {<NEW_LINE>SolutionOrNogood<VAR, VAL> result = new SolutionOrNogood<>();<NEW_LINE>if (assignment.isComplete(csp.getVariables()) || Tasks.currIsCancelled()) {<NEW_LINE>result.solution = assignment;<NEW_LINE>} else {<NEW_LINE>VAR var = selectUnassignedVariable(csp, assignment);<NEW_LINE>for (VAL value : orderDomainValues(csp, assignment, var)) {<NEW_LINE>assignment.add(var, value);<NEW_LINE>fireStateChanged(csp, assignment, var);<NEW_LINE>if (assignment.isConsistent(csp.getConstraints(var))) {<NEW_LINE>SolutionOrNogood<VAR, VAL> res = backtrack(csp, assignment);<NEW_LINE>if (res.hasSolution()) {<NEW_LINE>// solution found!<NEW_LINE>return res;<NEW_LINE>} else if (!res.nogood.contains(var)) {<NEW_LINE>assignment.remove(var);<NEW_LINE>// jump back!<NEW_LINE>return res;<NEW_LINE>} else {<NEW_LINE>result.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result.nogood.addAll(findCause(csp, assignment, var));<NEW_LINE>}<NEW_LINE>assignment.remove(var);<NEW_LINE>}<NEW_LINE>result.nogood.remove(var);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | nogood.addAll(res.nogood); |
817,718 | // ----- protected methods -----<NEW_LINE>static java.io.File defaultGetFileOnDisk(final File fileBase, final boolean create) {<NEW_LINE>final String uuid = fileBase.getUuid();<NEW_LINE>final String filePath = Settings.FilesPath.getValue();<NEW_LINE>final String uuidPath = AbstractFile.getDirectoryPath(uuid);<NEW_LINE>final String finalPath = filePath + "/" + uuidPath + "/" + uuid;<NEW_LINE>// final Path path = Paths.get(URI.create("file://" + finalPath));<NEW_LINE>final Path path = Paths.get(finalPath);<NEW_LINE>final java.io.File file = path.toFile();<NEW_LINE>// create parent directory tree<NEW_LINE>file<MASK><NEW_LINE>// create file only if requested<NEW_LINE>if (!file.exists() && create && !fileBase.isExternal()) {<NEW_LINE>try {<NEW_LINE>file.createNewFile();<NEW_LINE>} catch (IOException ioex) {<NEW_LINE>final Logger logger = LoggerFactory.getLogger(AbstractFile.class);<NEW_LINE>logger.error("Unable to create file {}: {}", file, ioex.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return file;<NEW_LINE>} | .getParentFile().mkdirs(); |
669,714 | public boolean onInterceptTouchEvent(MotionEvent ev) {<NEW_LINE>if (!mEnabled)<NEW_LINE>return false;<NEW_LINE>final int action = ev.getAction() & MotionEventCompat.ACTION_MASK;<NEW_LINE>if (action == MotionEvent.ACTION_DOWN && DEBUG)<NEW_LINE>Log.v(TAG, "Received ACTION_DOWN");<NEW_LINE>if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP || (action != MotionEvent.ACTION_DOWN && mIsUnableToDrag)) {<NEW_LINE>endDrag();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>switch(action) {<NEW_LINE>case MotionEvent.ACTION_MOVE:<NEW_LINE>try {<NEW_LINE>final int activePointerId = mActivePointerId;<NEW_LINE>if (activePointerId == INVALID_POINTER)<NEW_LINE>break;<NEW_LINE>final int pointerIndex = this.getPointerIndex(ev, activePointerId);<NEW_LINE>final float x = MotionEventCompat.getX(ev, pointerIndex);<NEW_LINE>final float dx = x - mLastMotionX;<NEW_LINE>final float xDiff = Math.abs(dx);<NEW_LINE>final float y = MotionEventCompat.getY(ev, pointerIndex);<NEW_LINE>final float yDiff = <MASK><NEW_LINE>if (DEBUG)<NEW_LINE>Log.v(TAG, "onInterceptTouch moved to:(" + x + ", " + y + "), diff:(" + xDiff + ", " + yDiff + "), mLastMotionX:" + mLastMotionX);<NEW_LINE>if (xDiff > mTouchSlop && xDiff > yDiff && thisSlideAllowed(dx)) {<NEW_LINE>if (DEBUG)<NEW_LINE>Log.v(TAG, "Starting drag! from onInterceptTouch");<NEW_LINE>startDrag();<NEW_LINE>mLastMotionX = x;<NEW_LINE>setScrollingCacheEnabled(true);<NEW_LINE>} else if (yDiff > mTouchSlop) {<NEW_LINE>mIsUnableToDrag = true;<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MotionEvent.ACTION_DOWN:<NEW_LINE>mActivePointerId = ev.getAction() & ((Build.VERSION.SDK_INT >= 8) ? MotionEvent.ACTION_POINTER_INDEX_MASK : MotionEvent.ACTION_POINTER_INDEX_MASK);<NEW_LINE>mLastMotionX = mInitialMotionX = MotionEventCompat.getX(ev, mActivePointerId);<NEW_LINE>mLastMotionY = MotionEventCompat.getY(ev, mActivePointerId);<NEW_LINE>if (thisTouchAllowed(ev)) {<NEW_LINE>mIsBeingDragged = false;<NEW_LINE>mIsUnableToDrag = false;<NEW_LINE>if (isMenuOpen() && mViewBehind.menuTouchInQuickReturn(mContent, mCurItem, ev.getX() + mScrollX)) {<NEW_LINE>mQuickReturn = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>mIsUnableToDrag = true;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MotionEventCompat.ACTION_POINTER_UP:<NEW_LINE>onSecondaryPointerUp(ev);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (!mIsBeingDragged) {<NEW_LINE>if (mVelocityTracker == null) {<NEW_LINE>mVelocityTracker = VelocityTracker.obtain();<NEW_LINE>}<NEW_LINE>mVelocityTracker.addMovement(ev);<NEW_LINE>}<NEW_LINE>return mIsBeingDragged || mQuickReturn;<NEW_LINE>} | Math.abs(y - mLastMotionY); |
938,519 | public static QueryTicketResponse unmarshall(QueryTicketResponse queryTicketResponse, UnmarshallerContext context) {<NEW_LINE>queryTicketResponse.setRequestId<MASK><NEW_LINE>queryTicketResponse.setPageNum(context.integerValue("QueryTicketResponse.PageNum"));<NEW_LINE>queryTicketResponse.setPageSize(context.integerValue("QueryTicketResponse.PageSize"));<NEW_LINE>queryTicketResponse.setTotalCount(context.longValue("QueryTicketResponse.TotalCount"));<NEW_LINE>List<Ticket> tickets = new ArrayList<Ticket>();<NEW_LINE>for (int i = 0; i < context.lengthValue("QueryTicketResponse.Tickets.Length"); i++) {<NEW_LINE>Ticket ticket = new Ticket();<NEW_LINE>ticket.setId(context.stringValue("QueryTicketResponse.Tickets[" + i + "].Id"));<NEW_LINE>ticket.setType(context.stringValue("QueryTicketResponse.Tickets[" + i + "].Type"));<NEW_LINE>ticket.setStage(context.stringValue("QueryTicketResponse.Tickets[" + i + "].Stage"));<NEW_LINE>ticket.setDescription(context.stringValue("QueryTicketResponse.Tickets[" + i + "].Description"));<NEW_LINE>ticket.setCreatorId(context.stringValue("QueryTicketResponse.Tickets[" + i + "].CreatorId"));<NEW_LINE>ticket.setCreateTime(context.stringValue("QueryTicketResponse.Tickets[" + i + "].CreateTime"));<NEW_LINE>ticket.setCustomFields(context.stringValue("QueryTicketResponse.Tickets[" + i + "].CustomFields"));<NEW_LINE>tickets.add(ticket);<NEW_LINE>}<NEW_LINE>queryTicketResponse.setTickets(tickets);<NEW_LINE>return queryTicketResponse;<NEW_LINE>} | (context.stringValue("QueryTicketResponse.RequestId")); |
1,629,100 | public void init(final SortedKeyValueIterator<Key, Value> source, final Map<String, String> options, final IteratorEnvironment env) throws IOException {<NEW_LINE>super.init(source, options, env);<NEW_LINE>try {<NEW_LINE>schema = Schema.fromJson(options.get(AccumuloStoreConstants.SCHEMA).getBytes(CommonConstants.UTF_8));<NEW_LINE>} catch (final UnsupportedEncodingException e) {<NEW_LINE>throw new SchemaException("Unable to deserialise the schema", e);<NEW_LINE>}<NEW_LINE>LOGGER.debug("Initialising CoreKeyGroupByCombiner with schema {}", schema);<NEW_LINE>try {<NEW_LINE>view = View.fromJson(options.get(AccumuloStoreConstants.VIEW).getBytes(CommonConstants.UTF_8));<NEW_LINE>} catch (final UnsupportedEncodingException e) {<NEW_LINE>throw new SchemaException("Unable to deserialise the view", e);<NEW_LINE>}<NEW_LINE>LOGGER.debug("Initialising CoreKeyGroupByCombiner with view {}", view);<NEW_LINE>final String elementConverterClass = options.get(AccumuloStoreConstants.ACCUMULO_ELEMENT_CONVERTER_CLASS);<NEW_LINE>try {<NEW_LINE>elementConverter = Class.forName(elementConverterClass).asSubclass(AccumuloElementConverter.class).getConstructor(Schema.class).newInstance(schema);<NEW_LINE>LOGGER.debug("Creating AccumuloElementConverter of class {}", elementConverterClass);<NEW_LINE>} catch (final ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {<NEW_LINE>throw new AggregationException("Failed to create element converter of the class name provided (" + elementConverterClass + ")", e);<NEW_LINE>}<NEW_LINE>final String encodedColumns = options.get(COLUMNS_OPTION);<NEW_LINE>if (StringUtils.isNotEmpty(encodedColumns)) {<NEW_LINE>aggregatedGroups = new ColumnSet(Lists.newArrayList(Splitter.on(","<MASK><NEW_LINE>LOGGER.debug("Setting aggregatedGroups to {}", aggregatedGroups);<NEW_LINE>}<NEW_LINE>} | ).split(encodedColumns))); |
1,037,493 | private <R> R sessionAware(UserModel user, String scopeParam, BiFunction<UserSessionModel, ClientSessionContext, R> function) {<NEW_LINE>AuthenticationSessionModel authSession = null;<NEW_LINE>AuthenticationSessionManager authSessionManager = new AuthenticationSessionManager(session);<NEW_LINE>try {<NEW_LINE>RootAuthenticationSessionModel rootAuthSession = authSessionManager.createAuthenticationSession(realm, false);<NEW_LINE>authSession = rootAuthSession.createAuthenticationSession(client);<NEW_LINE>authSession.setAuthenticatedUser(user);<NEW_LINE>authSession.setProtocol(OIDCLoginProtocol.LOGIN_PROTOCOL);<NEW_LINE>authSession.setClientNote(OIDCLoginProtocol.ISSUER, Urls.realmIssuer(uriInfo.getBaseUri(), realm.getName()));<NEW_LINE>authSession.setClientNote(OIDCLoginProtocol.SCOPE_PARAM, scopeParam);<NEW_LINE>UserSessionModel userSession = session.sessions().createUserSession(authSession.getParentSession().getId(), realm, user, user.getUsername(), clientConnection.getRemoteAddr(), "example-auth", false, null, null, UserSessionModel.SessionPersistenceState.TRANSIENT);<NEW_LINE>AuthenticationManager.setClientScopesInSession(authSession);<NEW_LINE>ClientSessionContext clientSessionCtx = TokenManager.attachAuthenticationSession(session, userSession, authSession);<NEW_LINE>return <MASK><NEW_LINE>} finally {<NEW_LINE>if (authSession != null) {<NEW_LINE>authSessionManager.removeAuthenticationSession(realm, authSession, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | function.apply(userSession, clientSessionCtx); |
1,762,397 | protected void showValueOnSummary(String prefKey) {<NEW_LINE>Preference pref = findPreference(prefKey);<NEW_LINE>if (sharedPrefs.contains(prefKey) && pref instanceof EditTextPreference && !TextUtils.isEmpty(sharedPrefs.getString(prefKey, "")) && !isPasswordPref((EditTextPreference) pref)) {<NEW_LINE>// Non-password edit preferences show the user-entered value<NEW_LINE>pref.setSummary(sharedPrefs.getString(prefKey, ""));<NEW_LINE>return;<NEW_LINE>} else if (sharedPrefs.contains(prefKey) && pref instanceof ListPreference && ((ListPreference) pref).getValue() != null) {<NEW_LINE>// List preferences show the selected list value<NEW_LINE>ListPreference listPreference = (ListPreference) pref;<NEW_LINE>pref.setSummary(listPreference.getEntries()[listPreference.findIndexOfValue(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (originalSummaries.containsKey(prefKey))<NEW_LINE>pref.setSummary(originalSummaries.get(prefKey));<NEW_LINE>} | listPreference.getValue())]); |
391,537 | public List<ProjectEntity> queryPageList(String userName, String column, String order, int pageNo, int pageSize) throws Exception {<NEW_LINE>LOG.info("queryPageList owner:{}, column:{}, order:{}, pageNo:{}, pageSize:{}", userName, column, order, pageNo, pageSize);<NEW_LINE>List<ProjectEntity> list = null;<NEW_LINE>try (SqlSession sqlSession = MyBatisUtil.getSqlSession()) {<NEW_LINE>ProjectMapper projectMapper = sqlSession.getMapper(ProjectMapper.class);<NEW_LINE>Map<String, Object> where = new HashMap<>();<NEW_LINE>where.put("userName", userName);<NEW_LINE>where.put("column", column);<NEW_LINE>where.put("order", order);<NEW_LINE>list = projectMapper.selectAll(where, new RowBounds(pageNo, pageSize));<NEW_LINE>ProjectFilesMapper projectFilesMapper = <MASK><NEW_LINE>// Query from project_files table, And set to Project Object<NEW_LINE>for (ProjectEntity project : list) {<NEW_LINE>Map<String, Object> whereMember = new HashMap<>();<NEW_LINE>whereMember.put("projectId", project.getId());<NEW_LINE>List<ProjectFilesEntity> projectFilesList = projectFilesMapper.selectAll(whereMember);<NEW_LINE>for (ProjectFilesEntity projectFiles : projectFilesList) {<NEW_LINE>project.addProjectFilesList(projectFiles);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(e.getMessage(), e);<NEW_LINE>throw new Exception(e);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} | sqlSession.getMapper(ProjectFilesMapper.class); |
70,900 | private static void addMember(PythonLanguage language, Object clsPtr, Object tpDictPtr, Object namePtr, int memberType, int offset, int canSet, Object docPtr, AsPythonObjectNode asPythonObjectNode, CastToJavaStringNode castToJavaStringNode, FromCharPointerNode fromCharPointerNode, InteropLibrary docPtrLib, PythonObjectFactory factory, WriteAttributeToDynamicObjectNode writeDocNode, HashingStorageLibrary dictStorageLib) {<NEW_LINE>Object clazz = asPythonObjectNode.execute(clsPtr);<NEW_LINE>PDict tpDict = castPDict(asPythonObjectNode.execute(tpDictPtr));<NEW_LINE>String memberName;<NEW_LINE>try {<NEW_LINE>memberName = castToJavaStringNode.execute(asPythonObjectNode.execute(namePtr));<NEW_LINE>} catch (CannotCastException e) {<NEW_LINE>throw CompilerDirectives.shouldNotReachHere("Cannot cast member name to string");<NEW_LINE>}<NEW_LINE>// note: 'doc' may be NULL; in this case, we would store 'None'<NEW_LINE>Object memberDoc = CharPtrToJavaObjectNode.run(docPtr, fromCharPointerNode, docPtrLib);<NEW_LINE>PBuiltinFunction getterObject = ReadMemberNode.createBuiltinFunction(language, clazz, memberName, memberType, offset);<NEW_LINE>Object setterObject = null;<NEW_LINE>if (canSet != 0) {<NEW_LINE>setterObject = WriteMemberNode.createBuiltinFunction(language, <MASK><NEW_LINE>}<NEW_LINE>// create member descriptor<NEW_LINE>GetSetDescriptor memberDescriptor = factory.createMemberDescriptor(getterObject, setterObject, memberName, clazz);<NEW_LINE>writeDocNode.execute(memberDescriptor, SpecialAttributeNames.__DOC__, memberDoc);<NEW_LINE>// add member descriptor to tp_dict<NEW_LINE>HashingStorage dictStorage = tpDict.getDictStorage();<NEW_LINE>HashingStorage updatedStorage = dictStorageLib.setItem(dictStorage, memberName, memberDescriptor);<NEW_LINE>if (dictStorage != updatedStorage) {<NEW_LINE>tpDict.setDictStorage(updatedStorage);<NEW_LINE>}<NEW_LINE>} | clazz, memberName, memberType, offset); |
180,113 | public <A> void createUnidirectional(DeployBeanDescriptor<?> targetDesc, Class<A> targetType, BeanTable beanTable, DeployTableJoin oneToManyJoin) {<NEW_LINE>// create the 'shadow' unidirectional property<NEW_LINE>// which is put on the target descriptor<NEW_LINE>DeployBeanPropertyAssocOne<A> unidirectional = new DeployBeanPropertyAssocOne<>(targetDesc, targetType);<NEW_LINE>unidirectional.setUndirectionalShadow();<NEW_LINE>unidirectional.setNullable(false);<NEW_LINE>unidirectional.setDbRead(true);<NEW_LINE>unidirectional.setDbInsertable(true);<NEW_LINE>unidirectional.setDbUpdateable(false);<NEW_LINE>unidirectional.setBeanTable(beanTable);<NEW_LINE>unidirectional.setName(beanTable.getBaseTable());<NEW_LINE>unidirectional.setJoinType(true);<NEW_LINE>unidirectional.setJoinColumns(<MASK><NEW_LINE>targetDesc.setUnidirectional(unidirectional);<NEW_LINE>} | oneToManyJoin.columns(), true); |
1,062,022 | private void initOrUpdateSink(InlongStreamInfo streamInfo) {<NEW_LINE>List<StreamSink> streamSinks = <MASK><NEW_LINE>// delete or update the sink info<NEW_LINE>List<String> updateSinkNames = Lists.newArrayList();<NEW_LINE>for (StreamSink sink : streamSinks) {<NEW_LINE>final String sinkName = sink.getSinkName();<NEW_LINE>final int id = sink.getId();<NEW_LINE>if (this.streamSinks.get(sinkName) == null) {<NEW_LINE>boolean isDelete = sinkClient.deleteSink(id);<NEW_LINE>if (!isDelete) {<NEW_LINE>throw new RuntimeException(String.format("Delete sink=%s failed", sink));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>StreamSink streamSink = this.streamSinks.get(sinkName);<NEW_LINE>streamSink.setId(id);<NEW_LINE>streamSink.setInlongGroupId(streamInfo.getInlongGroupId());<NEW_LINE>streamSink.setInlongStreamId(streamInfo.getInlongStreamId());<NEW_LINE>Pair<Boolean, String> updateState = sinkClient.updateSink(streamSink.genSinkRequest());<NEW_LINE>if (!updateState.getKey()) {<NEW_LINE>throw new RuntimeException(String.format("Update sink=%s failed with err=%s", streamSink, updateState.getValue()));<NEW_LINE>}<NEW_LINE>updateSinkNames.add(sinkName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// create sink info after deleting or updating<NEW_LINE>for (Map.Entry<String, StreamSink> sinkEntry : this.streamSinks.entrySet()) {<NEW_LINE>String sinkName = sinkEntry.getKey();<NEW_LINE>if (updateSinkNames.contains(sinkName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>StreamSink streamSink = sinkEntry.getValue();<NEW_LINE>streamSink.setInlongGroupId(streamInfo.getInlongGroupId());<NEW_LINE>streamSink.setInlongStreamId(streamInfo.getInlongStreamId());<NEW_LINE>sinkClient.createSink(streamSink.genSinkRequest());<NEW_LINE>}<NEW_LINE>} | sinkClient.listSinks(inlongGroupId, inlongStreamId); |
1,215,788 | public void write(SerializedFile serialized) throws IOException {<NEW_LINE>this.serialized = serialized;<NEW_LINE>// header is always big endian<NEW_LINE>out.order(ByteOrder.BIG_ENDIAN);<NEW_LINE>writeHeader(out);<NEW_LINE>SerializedFileHeader header = serialized.header();<NEW_LINE>// newer formats use little endian for the rest of the file<NEW_LINE>if (header.version() > 5) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// older formats store the object data before the structure data<NEW_LINE>if (header.version() < 9) {<NEW_LINE>header.dataOffset(0);<NEW_LINE>writeObjects(out);<NEW_LINE>out.writeUnsignedByte(header.version() > 5 ? 0 : 1);<NEW_LINE>writeMetadata(out);<NEW_LINE>out.writeUnsignedByte(0);<NEW_LINE>} else {<NEW_LINE>writeMetadata(out);<NEW_LINE>long dataOffset = out.position();<NEW_LINE>// calculate padding<NEW_LINE>if (dataOffset < META_PADDING) {<NEW_LINE>dataOffset = META_PADDING;<NEW_LINE>} else {<NEW_LINE>dataOffset += META_ALIGN - (dataOffset % META_ALIGN);<NEW_LINE>}<NEW_LINE>header.dataOffset(dataOffset);<NEW_LINE>out.position(dataOffset);<NEW_LINE>writeObjects(out);<NEW_LINE>// write updated path table<NEW_LINE>out.position(serialized.metadata().objectInfoBlock().offset());<NEW_LINE>out.writeStruct(serialized.metadata().objectInfoTable());<NEW_LINE>}<NEW_LINE>// update header<NEW_LINE>header.fileSize(out.size());<NEW_LINE>// FIXME: the metadata size is slightly off in comparison to original files<NEW_LINE>int metadataOffset = header.version() < 9 ? 2 : 1;<NEW_LINE>header.metadataSize(serialized.metadataBlock().length() + metadataOffset);<NEW_LINE>// write updated header<NEW_LINE>out.order(ByteOrder.BIG_ENDIAN);<NEW_LINE>out.position(serialized.headerBlock().offset());<NEW_LINE>out.writeStruct(header);<NEW_LINE>} | out.order(ByteOrder.LITTLE_ENDIAN); |
926,024 | final CreateExperienceResult executeCreateExperience(CreateExperienceRequest createExperienceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createExperienceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateExperienceRequest> request = null;<NEW_LINE>Response<CreateExperienceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateExperienceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createExperienceRequest));<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, "kendra");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateExperience");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateExperienceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateExperienceResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig); |
1,673,001 | private Map<String, LineageSpec> buildLineageSpecs(EntityRegistry entityRegistry) {<NEW_LINE>// 1. Flatten relationship annotations into a list of lineage edges (source, dest, type, isUpstream)<NEW_LINE>Collection<LineageEdge> lineageEdges = // If there are multiple edges with the same source, dest, edge type, get one of them<NEW_LINE>entityRegistry.getEntitySpecs().entrySet().stream().flatMap(entry -> entry.getValue().getRelationshipFieldSpecs().stream().flatMap(spec -> getLineageEdgesFromRelationshipAnnotation(entry.getKey(), spec.getRelationshipAnnotation()))).collect(Collectors.toMap(edge -> Triple.of(edge.getSourceEntity(), edge.getDestEntity(), edge.getType()), Function.identity(), (x1, x2) -> x1)).values();<NEW_LINE>// 2. Figure out the upstream and downstream edges of each entity type<NEW_LINE>Map<String, Set<EdgeInfo>> upstreamPerEntity = new HashMap<>();<NEW_LINE>Map<String, Set<EdgeInfo>> downstreamPerEntity = new HashMap<>();<NEW_LINE>// A downstreamOf B : A -> upstream (downstreamOf, OUTGOING), B -> downstream (downstreamOf, INCOMING)<NEW_LINE>// A produces B : A -> downstream (produces, OUTGOING), B -> upstream (produces, INCOMING)<NEW_LINE>for (LineageEdge edge : lineageEdges) {<NEW_LINE>if (edge.isUpstream()) {<NEW_LINE>upstreamPerEntity.computeIfAbsent(edge.sourceEntity.toLowerCase(), (k) -> new HashSet<>()).add(new EdgeInfo(edge.type, RelationshipDirection.OUTGOING));<NEW_LINE>downstreamPerEntity.computeIfAbsent(edge.destEntity.toLowerCase(), (k) -> new HashSet<>()).add(new EdgeInfo(edge<MASK><NEW_LINE>} else {<NEW_LINE>downstreamPerEntity.computeIfAbsent(edge.sourceEntity.toLowerCase(), (k) -> new HashSet<>()).add(new EdgeInfo(edge.type, RelationshipDirection.OUTGOING));<NEW_LINE>upstreamPerEntity.computeIfAbsent(edge.destEntity.toLowerCase(), (k) -> new HashSet<>()).add(new EdgeInfo(edge.type, RelationshipDirection.INCOMING));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return entityRegistry.getEntitySpecs().keySet().stream().collect(Collectors.toMap(String::toLowerCase, entityName -> new LineageSpec(new ArrayList<>(upstreamPerEntity.getOrDefault(entityName.toLowerCase(), Collections.emptySet())), new ArrayList<>(downstreamPerEntity.getOrDefault(entityName.toLowerCase(), Collections.emptySet())))));<NEW_LINE>} | .type, RelationshipDirection.INCOMING)); |
103,489 | void addSpawnResult(SpawnMetrics metrics, @Nullable String runnerName, String runnerSubtype, boolean wasRemote) {<NEW_LINE>// Mark this component as having remote components if _any_ spawn result contributing<NEW_LINE>// to it contains meaningful remote metrics. Subsequent non-remote spawns in an action<NEW_LINE>// must not reset this flag.<NEW_LINE>if (wasRemote) {<NEW_LINE>this.remote = true;<NEW_LINE>}<NEW_LINE>if (this.phaseChange) {<NEW_LINE>if (!this.phaseMaxMetrics.isEmpty()) {<NEW_LINE>this.totalSpawnMetrics = this.totalSpawnMetrics.sumDurationsMaxOther(phaseMaxMetrics);<NEW_LINE>}<NEW_LINE>this.phaseMaxMetrics = metrics;<NEW_LINE>this.phaseChange = false;<NEW_LINE>} else if (metrics.totalTime().compareTo(this.phaseMaxMetrics.totalTime()) > 0) {<NEW_LINE>this.phaseMaxMetrics = metrics;<NEW_LINE>}<NEW_LINE>if (runnerName != null && metrics.totalTime().compareTo(this.longestRunningTotalDuration) > 0) {<NEW_LINE>this.longestPhaseSpawnRunnerName = runnerName;<NEW_LINE>this.longestPhaseSpawnRunnerSubtype = runnerSubtype;<NEW_LINE>this<MASK><NEW_LINE>}<NEW_LINE>} | .longestRunningTotalDuration = metrics.totalTime(); |
598,277 | private String takeHeapdumpHit() {<NEW_LINE>TargetAppRunner runner = Profiler.getDefault().getTargetAppRunner();<NEW_LINE>if (runner.getProfilingSessionStatus().remoteProfiling) {<NEW_LINE>return Bundle.TimedTakeSnapshotProfilingPoint_NoDataRemoteMsg();<NEW_LINE>}<NEW_LINE>if (!runner.hasSupportedJDKForHeapDump()) {<NEW_LINE>return Bundle.TimedTakeSnapshotProfilingPoint_NoDataJdkMsg();<NEW_LINE>}<NEW_LINE>String dumpFileName = getCurrentHeapDumpFilename();<NEW_LINE>if (dumpFileName == null) {<NEW_LINE>return NO_DATA_AVAILABLE_MESSAGE;<NEW_LINE>}<NEW_LINE>boolean heapdumpTaken = false;<NEW_LINE>try {<NEW_LINE>heapdumpTaken = runner.getProfilerClient().takeHeapDump(dumpFileName);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ProfilerLogger.log(ex);<NEW_LINE>}<NEW_LINE>if (heapdumpTaken) {<NEW_LINE>// if (ProfilerControlPanel2.hasDefault())<NEW_LINE>// ProfilerControlPanel2.getDefault().refreshSnapshotsList();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>FileObject folder = FileUtil.toFileObject(file.getParentFile());<NEW_LINE>SnapshotsWindow.instance().refreshFolder(folder, true);<NEW_LINE>return file.toURI().toURL().toExternalForm();<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>ProfilerLogger.log(ex);<NEW_LINE>return NO_DATA_AVAILABLE_MESSAGE;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return NO_DATA_AVAILABLE_MESSAGE;<NEW_LINE>}<NEW_LINE>} | File file = new File(dumpFileName); |
1,073,414 | public static List<FilePatch> buildPatch(final Project project, final Collection<Change> changes, final String basePath, final boolean reversePatch, final boolean includeBaseText) throws VcsException {<NEW_LINE>final Collection<BeforeAfter<AirContentRevision>> revisions;<NEW_LINE>if (project != null) {<NEW_LINE>revisions = revisionsConvertor(project, new <MASK><NEW_LINE>} else {<NEW_LINE>revisions = new ArrayList<BeforeAfter<AirContentRevision>>(changes.size());<NEW_LINE>for (Change change : changes) {<NEW_LINE>revisions.add(new BeforeAfter<AirContentRevision>(convertRevisionToAir(change.getBeforeRevision()), convertRevisionToAir(change.getAfterRevision())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return TextPatchBuilder.buildPatch(revisions, basePath, reversePatch, SystemInfo.isFileSystemCaseSensitive, new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>ProgressManager.checkCanceled();<NEW_LINE>}<NEW_LINE>}, includeBaseText);<NEW_LINE>} | ArrayList<Change>(changes)); |
1,464,877 | public MergePullRequestBySquashResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>MergePullRequestBySquashResult mergePullRequestBySquashResult = new MergePullRequestBySquashResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return mergePullRequestBySquashResult;<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("pullRequest", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>mergePullRequestBySquashResult.setPullRequest(PullRequestJsonUnmarshaller.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 mergePullRequestBySquashResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,066,945 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject sourceObject = game.getObject(source);<NEW_LINE>if (controller == null || sourceObject == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (controller.getLibrary().hasCards()) {<NEW_LINE>Card card = controller.getLibrary().getFromTop(game);<NEW_LINE>Cards cards = new CardsImpl(card);<NEW_LINE>controller.revealCards(sourceObject.getIdName(), cards, game);<NEW_LINE>if (card != null) {<NEW_LINE>if (new FilterPermanentCard().match(card, game) && controller.chooseUse(Outcome.Neutral, "Put " + card.getIdName() + " onto the battlefield?", source, game)) {<NEW_LINE>controller.moveCards(card, Zone.BATTLEFIELD, source, game);<NEW_LINE>} else if (controller.chooseUse(Outcome.Neutral, "Put " + card.getIdName() + " on the bottom of your library?", source, game)) {<NEW_LINE>controller.putCardsOnBottomOfLibrary(cards, game, source, false);<NEW_LINE>} else {<NEW_LINE>game.informPlayers(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | controller.getLogName() + " puts the revealed card back to the top of the library."); |
920,566 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {<NEW_LINE>if (FlipperUtils.shouldEnableFlipper(context)) {<NEW_LINE>final FlipperClient client = AndroidFlipperClient.getInstance(context);<NEW_LINE>client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));<NEW_LINE>client.addPlugin(new ReactFlipperPlugin());<NEW_LINE>client.addPlugin(new DatabasesFlipperPlugin(context));<NEW_LINE>client.addPlugin(new SharedPreferencesFlipperPlugin(context));<NEW_LINE>client.addPlugin(CrashReporterPlugin.getInstance());<NEW_LINE>NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();<NEW_LINE>NetworkingModule.setCustomClientBuilder(new CustomClientBuilder() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void apply(OkHttpClient.Builder builder) {<NEW_LINE>builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>client.addPlugin(networkFlipperPlugin);<NEW_LINE>client.start();<NEW_LINE>// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized<NEW_LINE>// Hence we run if after all native modules have been initialized<NEW_LINE>ReactContext reactContext = reactInstanceManager.getCurrentReactContext();<NEW_LINE>if (reactContext == null) {<NEW_LINE>reactInstanceManager.addReactInstanceEventListener(new ReactInstanceManager.ReactInstanceEventListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReactContextInitialized(ReactContext reactContext) {<NEW_LINE>reactInstanceManager.removeReactInstanceEventListener(this);<NEW_LINE>reactContext.runOnNativeModulesQueueThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>client.addPlugin(new FrescoFlipperPlugin());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>client<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .addPlugin(new FrescoFlipperPlugin()); |
843,618 | public boolean updateDatabase() {<NEW_LINE>try {<NEW_LINE>if (!Files.exists(databasesDirectory)) {<NEW_LINE>Files.createDirectories(databasesDirectory);<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.error(databasesDirectory.toString() + " does not exist and cannot be created!");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final File existingDB = databasesDirectory.resolve(databaseName).toFile();<NEW_LINE>if (!isLoaded()) {<NEW_LINE>try {<NEW_LINE>setLoaded(loadDatabase());<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warn("[" + getClass().getSimpleName() + "] Failed to load existing database! " + e.getMessage());<NEW_LINE>}<NEW_LINE>} else if (!needsUpdating(existingDB)) {<NEW_LINE>LOGGER.info("[" + getClass().getSimpleName() + "] Location database does not require updating.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>File newDB = null;<NEW_LINE>boolean isModified = true;<NEW_LINE>final String databaseURL = getDataBaseURL();<NEW_LINE>if (databaseURL == null) {<NEW_LINE>LOGGER.warn("[" + getClass(<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>newDB = downloadDatabase(databaseURL, existingDB);<NEW_LINE>trafficRouterManager.trackEvent("last" + getClass().getSimpleName() + "Check");<NEW_LINE>// if the remote db's timestamp is less than or equal to ours, the above returns existingDB<NEW_LINE>if (newDB == existingDB) {<NEW_LINE>isModified = false;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.fatal("[" + getClass().getSimpleName() + "] Caught exception while attempting to download: " + getDataBaseURL(), e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!isModified || newDB == null || !newDB.exists()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!verifyDatabase(newDB)) {<NEW_LINE>LOGGER.warn("[" + getClass().getSimpleName() + "] " + newDB.getAbsolutePath() + " from " + getDataBaseURL() + " is invalid!");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("[" + getClass().getSimpleName() + "] Failed verifying database " + newDB.getAbsolutePath() + " : " + e.getMessage());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (copyDatabaseIfDifferent(existingDB, newDB)) {<NEW_LINE>setLoaded(loadDatabase());<NEW_LINE>trafficRouterManager.trackEvent("last" + getClass().getSimpleName() + "Update");<NEW_LINE>} else {<NEW_LINE>newDB.delete();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("[" + getClass().getSimpleName() + "] Failed copying and loading new database " + newDB.getAbsolutePath() + " : " + e.getMessage());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (newDB != null && newDB != existingDB && newDB.exists()) {<NEW_LINE>LOGGER.info("[" + getClass().getSimpleName() + "] Try to delete downloaded temp file");<NEW_LINE>deleteDatabase(newDB);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | ).getSimpleName() + "] Skipping download/update: database URL is null"); |
1,293,053 | protected int open(int maxRows) {<NEW_LINE>// log.config( "MTable Loader.open");<NEW_LINE>// Get Number of Rows<NEW_LINE>int rows = 0;<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(m_SQL_Count, null);<NEW_LINE>setParameter(pstmt, true);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next())<NEW_LINE>rows = rs.getInt(1);<NEW_LINE>} catch (SQLException e0) {<NEW_LINE>// Zoom Query may have invalid where clause<NEW_LINE>if (DBException.isInvalidIdentifierError(e0))<NEW_LINE>log.warning("Count - " + e0.getLocalizedMessage() + "\nSQL=" + m_SQL_Count);<NEW_LINE>else<NEW_LINE>log.log(Level.SEVERE, "Count SQL=" + m_SQL_Count, e0);<NEW_LINE>return 0;<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>}<NEW_LINE>StringBuffer info = new StringBuffer("Rows=");<NEW_LINE>info.append(rows);<NEW_LINE>if (rows == 0)<NEW_LINE>info.append(" - ").append(m_SQL_Count);<NEW_LINE>// postgresql need trx to use cursor based resultset<NEW_LINE>String trxName = m_virtual ? Trx.createTrxName("Loader") : null;<NEW_LINE>trx = trxName != null ? Trx.get(trxName, true) : null;<NEW_LINE>// open Statement (closed by Loader.close)<NEW_LINE>try {<NEW_LINE>m_pstmt = DB.prepareStatement(m_SQL, trxName);<NEW_LINE>if (maxRows > 0 && rows > maxRows) {<NEW_LINE>m_pstmt.setMaxRows(maxRows);<NEW_LINE>info.append<MASK><NEW_LINE>rows = maxRows;<NEW_LINE>}<NEW_LINE>// ensure not all row is fectch into memory for virtual table<NEW_LINE>if (m_virtual)<NEW_LINE>m_pstmt.setFetchSize(100);<NEW_LINE>setParameter(m_pstmt, false);<NEW_LINE>m_rs = m_pstmt.executeQuery();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, m_SQL, e);<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>log.fine(info.toString());<NEW_LINE>return rows;<NEW_LINE>} | (" - MaxRows=").append(maxRows); |
1,075,220 | private static Table rowPercents(Table xTabCounts) {<NEW_LINE>Table pctTable = Table.create("Crosstab Row Proportions: ");<NEW_LINE>StringColumn labels = StringColumn.create(LABEL_COLUMN_NAME);<NEW_LINE>pctTable.addColumns(labels);<NEW_LINE>for (int i = 0; i < xTabCounts.rowCount(); i++) {<NEW_LINE>labels.append(xTabCounts.column(0).getString(i));<NEW_LINE>}<NEW_LINE>// create the new cols<NEW_LINE>DoubleColumn[] newColumns = new DoubleColumn[<MASK><NEW_LINE>for (int i = 1; i < xTabCounts.columnCount(); i++) {<NEW_LINE>Column<?> column = xTabCounts.column(i);<NEW_LINE>newColumns[i - 1] = DoubleColumn.create(column.name());<NEW_LINE>}<NEW_LINE>for (int i = 0; i < xTabCounts.rowCount(); i++) {<NEW_LINE>double rowTotal = xTabCounts.numberColumn(xTabCounts.columnCount() - 1).getDouble(i);<NEW_LINE>for (int c = 0; c < newColumns.length; c++) {<NEW_LINE>if (rowTotal == 0) {<NEW_LINE>newColumns[c].append(Double.NaN);<NEW_LINE>} else {<NEW_LINE>newColumns[c].append(xTabCounts.numberColumn(c + 1).getDouble(i) / rowTotal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pctTable.addColumns(newColumns);<NEW_LINE>return pctTable;<NEW_LINE>} | xTabCounts.columnCount() - 1]; |
1,695,111 | public void handle(String method, String path, HashMap<String, String> headers, Map<String, String> queries, InputStream input, EmbedHttpServer.ResponseOutputStream response) throws Exception {<NEW_LINE>Log.<MASK><NEW_LINE>String dst = FreelineCore.getBundleFilePathByPackageId("base-res");<NEW_LINE>File dstFile = new File(dst);<NEW_LINE>Log.i(TAG, "dst path: " + dstFile.getAbsolutePath());<NEW_LINE>File pending = new File(dst + ".bak");<NEW_LINE>try {<NEW_LINE>if (!pending.exists()) {<NEW_LINE>pending.createNewFile();<NEW_LINE>}<NEW_LINE>FileOutputStream fos = new FileOutputStream(pending);<NEW_LINE>byte[] buf = new byte[4096];<NEW_LINE>int l;<NEW_LINE>while ((l = input.read(buf)) != -1) {<NEW_LINE>fos.write(buf, 0, l);<NEW_LINE>}<NEW_LINE>fos.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(TAG, "read full resource failed");<NEW_LINE>Log.d(TAG, e.getStackTrace().toString());<NEW_LINE>response.setStatusCode(500);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (dstFile.exists()) {<NEW_LINE>FileUtils.rm(dstFile);<NEW_LINE>}<NEW_LINE>pending.renameTo(dstFile);<NEW_LINE>Log.i(TAG, "receive full res pack successfully");<NEW_LINE>response.setStatusCode(201);<NEW_LINE>} | i(TAG, "receive full res pack: " + path); |
1,144,846 | private boolean addExpected(StringBuilder sb, int position, boolean expected) {<NEW_LINE>MyList<Variant> list = expected ? variants : unexpected;<NEW_LINE>String[] strings = new String[list.size()];<NEW_LINE>long[] hashes = new long[strings.length];<NEW_LINE>Arrays.fill(strings, "");<NEW_LINE>int count = 0;<NEW_LINE>loop: for (Variant variant : list) {<NEW_LINE>if (position == variant.position) {<NEW_LINE>String text = variant.object.toString();<NEW_LINE>long hash = StringHash.calc(text);<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>if (hashes[i] == hash)<NEW_LINE>continue loop;<NEW_LINE>}<NEW_LINE>hashes[count] = hash;<NEW_LINE>strings[count] = text;<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Arrays.sort(strings);<NEW_LINE>count = 0;<NEW_LINE>for (String s : strings) {<NEW_LINE>if (s.length() == 0)<NEW_LINE>continue;<NEW_LINE>if (count++ > 0) {<NEW_LINE>if (count > MAX_VARIANTS_TO_DISPLAY) {<NEW_LINE>sb.append(" and ...");<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>sb.append(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>char c = s.charAt(0);<NEW_LINE>String displayText = c == '<' || isJavaIdentifierStart(c) <MASK><NEW_LINE>sb.append(displayText);<NEW_LINE>}<NEW_LINE>if (count > 1 && count < MAX_VARIANTS_TO_DISPLAY) {<NEW_LINE>int idx = sb.lastIndexOf(", ");<NEW_LINE>sb.replace(idx, idx + 1, " or");<NEW_LINE>}<NEW_LINE>return count > 0;<NEW_LINE>} | ? s : '\'' + s + '\''; |
1,381,200 | public static void installApplication(final String url) {<NEW_LINE>Thread bgThread = new Thread(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>final RhodesService r = RhodesService.getInstance();<NEW_LINE>final File <MASK><NEW_LINE>if (tmpFile != null) {<NEW_LINE>PerformOnUiThread.exec(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>Logger.D(TAG, "Install package " + tmpFile.getAbsolutePath());<NEW_LINE>Uri uri = Uri.fromFile(tmpFile);<NEW_LINE>Intent intent = new Intent(Intent.ACTION_VIEW);<NEW_LINE>intent.setDataAndType(uri, "application/vnd.android.package-archive");<NEW_LINE>r.startActivity(intent);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(TAG, "Can't install file from " + tmpFile.getAbsolutePath(), e);<NEW_LINE>Logger.E(TAG, "Can't install file from " + tmpFile.getAbsolutePath() + ": " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.e(TAG, "Can't download package from " + url, e);<NEW_LINE>Logger.E(TAG, "Can't download package from " + url + ": " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>bgThread.setPriority(Thread.MIN_PRIORITY);<NEW_LINE>bgThread.start();<NEW_LINE>} | tmpFile = r.downloadPackage(url); |
952,459 | public void init(ServletConfig config) throws ServletException {<NEW_LINE>super.init(config);<NEW_LINE>// Verify that we were not accessed using the invoker servlet<NEW_LINE>String servletName = getServletConfig().getServletName();<NEW_LINE>if (servletName == null)<NEW_LINE>servletName = "";<NEW_LINE>if (servletName.startsWith("org.apache.catalina.INVOKER."))<NEW_LINE>throw new UnavailableException("Cannot invoke CGIServlet through the invoker");<NEW_LINE>// Set our properties from the initialization parameters<NEW_LINE>if (getServletConfig().getInitParameter("debug") != null)<NEW_LINE>debug = Integer.parseInt(getServletConfig().getInitParameter("debug"));<NEW_LINE>if (getServletConfig().getInitParameter("cgiPathPrefix") != null) {<NEW_LINE>cgiPathPrefix = getServletConfig().getInitParameter("cgiPathPrefix");<NEW_LINE>}<NEW_LINE>boolean passShellEnvironment = Boolean.valueOf(getServletConfig().getInitParameter("passShellEnvironment"));<NEW_LINE>if (passShellEnvironment) {<NEW_LINE>shellEnv.putAll(System.getenv());<NEW_LINE>}<NEW_LINE>if (getServletConfig().getInitParameter("executable") != null) {<NEW_LINE>cgiExecutable = <MASK><NEW_LINE>}<NEW_LINE>if (getServletConfig().getInitParameter("parameterEncoding") != null) {<NEW_LINE>parameterEncoding = getServletConfig().getInitParameter("parameterEncoding");<NEW_LINE>}<NEW_LINE>if (getServletConfig().getInitParameter("stderrTimeout") != null) {<NEW_LINE>stderrTimeout = Long.parseLong(getServletConfig().getInitParameter("stderrTimeout"));<NEW_LINE>}<NEW_LINE>if (getServletConfig().getInitParameter("stripRequestURI") != null) {<NEW_LINE>stripRequestURI = getServletConfig().getInitParameter("stripRequestURI");<NEW_LINE>}<NEW_LINE>} | getServletConfig().getInitParameter("executable"); |
326,550 | public void killAllProcesses(long blockTimeMS) {<NEW_LINE>// remove already dead processes from the GUI<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>DefaultListModel<ActiveProcess> model = (DefaultListModel<ActiveProcess>) processList.getModel();<NEW_LINE>for (int i = model.size() - 1; i >= 0; i--) {<NEW_LINE>removeProcessTab(model.get(i), false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// kill processes that are already running<NEW_LINE>synchronized (processes) {<NEW_LINE>for (int i = 0; i < processes.size(); i++) {<NEW_LINE>processes.get(i).requestKill();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// block until everything is dead<NEW_LINE>if (blockTimeMS > 0) {<NEW_LINE>long abortTime <MASK><NEW_LINE>while (abortTime > System.currentTimeMillis()) {<NEW_LINE>int total = 0;<NEW_LINE>synchronized (processes) {<NEW_LINE>for (int i = 0; i < processes.size(); i++) {<NEW_LINE>if (!processes.get(i).isActive()) {<NEW_LINE>total++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (processes.size() == total) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = System.currentTimeMillis() + blockTimeMS; |
829,566 | protected void exec() {<NEW_LINE>TMPDIR = super.tmpdir;<NEW_LINE>DIR = super.location;<NEW_LINE>datafile = super.filenames.get(0);<NEW_LINE>FileOps.ensureDir(TMPDIR);<NEW_LINE>FileOps.clearAll(TMPDIR);<NEW_LINE>if (!TMPDIR.equals(DIR)) {<NEW_LINE>FileOps.ensureDir(DIR);<NEW_LINE>FileOps.clearAll(DIR);<NEW_LINE>}<NEW_LINE>BulkLoaderX.DataTick = 100_000;<NEW_LINE>BulkLoader.DataTickPoint = BulkLoaderX.DataTick;<NEW_LINE>long maxMemory = Runtime.getRuntime().maxMemory();<NEW_LINE>// Java code to do all the steps.<NEW_LINE>System.out.printf("RAM = %,d\n", maxMemory);<NEW_LINE>System.out.println("STEP 1 - load node table");<NEW_LINE>step(() -> CmdxBuildNodeTable.main("--loc=" + DIR, "--threads=" + super.sortThreads, datafile));<NEW_LINE>System.out.println("STEP 2 - ingest triples and quads");<NEW_LINE>step(() -> CmdxIngestData.main("--loc=" + DIR, datafile));<NEW_LINE><MASK><NEW_LINE>if (!isEmptyFile(loaderFiles.triplesFile)) {<NEW_LINE>step(() -> CmdxBuildIndex.main("--loc=" + DIR, "--threads=" + super.sortThreads, "--index=SPO"));<NEW_LINE>step(() -> CmdxBuildIndex.main("--loc=" + DIR, "--threads=" + super.sortThreads, "--index=POS"));<NEW_LINE>step(() -> CmdxBuildIndex.main("--loc=" + DIR, "--threads=" + super.sortThreads, "--index=OSP"));<NEW_LINE>}<NEW_LINE>if (!isEmptyFile(loaderFiles.quadsFile)) {<NEW_LINE>step(() -> CmdxBuildIndex.main("--loc=" + DIR, "--threads=" + super.sortThreads, "--index=GSPO"));<NEW_LINE>step(() -> CmdxBuildIndex.main("--loc=" + DIR, "--threads=" + super.sortThreads, "--index=GPOS"));<NEW_LINE>step(() -> CmdxBuildIndex.main("--loc=" + DIR, "--threads=" + super.sortThreads, "--index=GOSP"));<NEW_LINE>step(() -> CmdxBuildIndex.main("--loc=" + DIR, "--threads=" + super.sortThreads, "--index=SPOG"));<NEW_LINE>step(() -> CmdxBuildIndex.main("--loc=" + DIR, "--threads=" + super.sortThreads, "--index=POSG"));<NEW_LINE>step(() -> CmdxBuildIndex.main("--loc=" + DIR, "--threads=" + super.sortThreads, "--index=OSPG"));<NEW_LINE>}<NEW_LINE>expel();<NEW_LINE>} | System.out.println("STEP 3 - build indexes"); |
272,091 | public static GetQosAttributeResponse unmarshall(GetQosAttributeResponse getQosAttributeResponse, UnmarshallerContext _ctx) {<NEW_LINE>getQosAttributeResponse.setRequestId(_ctx.stringValue("GetQosAttributeResponse.RequestId"));<NEW_LINE>getQosAttributeResponse.setErrorConfigSmartAGCount(_ctx.integerValue("GetQosAttributeResponse.ErrorConfigSmartAGCount"));<NEW_LINE>getQosAttributeResponse.setQosName(_ctx.stringValue("GetQosAttributeResponse.QosName"));<NEW_LINE>getQosAttributeResponse.setQosDescription(_ctx.stringValue("GetQosAttributeResponse.QosDescription"));<NEW_LINE>List<QosPolicy> qosPolicies = new ArrayList<QosPolicy>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetQosAttributeResponse.QosPolicies.Length"); i++) {<NEW_LINE>QosPolicy qosPolicy = new QosPolicy();<NEW_LINE>qosPolicy.setEndTime(_ctx.longValue("GetQosAttributeResponse.QosPolicies[" + i + "].EndTime"));<NEW_LINE>qosPolicy.setStartTime(_ctx.longValue("GetQosAttributeResponse.QosPolicies[" + i + "].StartTime"));<NEW_LINE>qosPolicy.setDestCidr(_ctx.stringValue("GetQosAttributeResponse.QosPolicies[" + i + "].DestCidr"));<NEW_LINE>qosPolicy.setDestPortRange(_ctx.stringValue("GetQosAttributeResponse.QosPolicies[" + i + "].DestPortRange"));<NEW_LINE>qosPolicy.setIpProtocol(_ctx.stringValue<MASK><NEW_LINE>qosPolicy.setPriority(_ctx.integerValue("GetQosAttributeResponse.QosPolicies[" + i + "].Priority"));<NEW_LINE>qosPolicy.setQosPolicieDescription(_ctx.stringValue("GetQosAttributeResponse.QosPolicies[" + i + "].QosPolicieDescription"));<NEW_LINE>qosPolicy.setSourceCidr(_ctx.stringValue("GetQosAttributeResponse.QosPolicies[" + i + "].SourceCidr"));<NEW_LINE>qosPolicy.setQosPolicieName(_ctx.stringValue("GetQosAttributeResponse.QosPolicies[" + i + "].QosPolicieName"));<NEW_LINE>qosPolicy.setSourcePortRange(_ctx.stringValue("GetQosAttributeResponse.QosPolicies[" + i + "].SourcePortRange"));<NEW_LINE>qosPolicies.add(qosPolicy);<NEW_LINE>}<NEW_LINE>getQosAttributeResponse.setQosPolicies(qosPolicies);<NEW_LINE>List<QosCar> qosCars = new ArrayList<QosCar>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetQosAttributeResponse.QosCars.Length"); i++) {<NEW_LINE>QosCar qosCar = new QosCar();<NEW_LINE>qosCar.setMaxBandwidthAbs(_ctx.integerValue("GetQosAttributeResponse.QosCars[" + i + "].MaxBandwidthAbs"));<NEW_LINE>qosCar.setQosCarName(_ctx.stringValue("GetQosAttributeResponse.QosCars[" + i + "].QosCarName"));<NEW_LINE>qosCar.setPercentSourceType(_ctx.stringValue("GetQosAttributeResponse.QosCars[" + i + "].PercentSourceType"));<NEW_LINE>qosCar.setMinBandwidthAbs(_ctx.integerValue("GetQosAttributeResponse.QosCars[" + i + "].MinBandwidthAbs"));<NEW_LINE>qosCar.setMaxBandwidthPercent(_ctx.integerValue("GetQosAttributeResponse.QosCars[" + i + "].MaxBandwidthPercent"));<NEW_LINE>qosCar.setQosCarDescription(_ctx.stringValue("GetQosAttributeResponse.QosCars[" + i + "].QosCarDescription"));<NEW_LINE>qosCar.setLimitType(_ctx.stringValue("GetQosAttributeResponse.QosCars[" + i + "].LimitType"));<NEW_LINE>qosCar.setPriority(_ctx.integerValue("GetQosAttributeResponse.QosCars[" + i + "].Priority"));<NEW_LINE>qosCar.setMinBandwidthPercent(_ctx.integerValue("GetQosAttributeResponse.QosCars[" + i + "].MinBandwidthPercent"));<NEW_LINE>qosCar.setQosCarId(_ctx.stringValue("GetQosAttributeResponse.QosCars[" + i + "].QosCarId"));<NEW_LINE>qosCars.add(qosCar);<NEW_LINE>}<NEW_LINE>getQosAttributeResponse.setQosCars(qosCars);<NEW_LINE>return getQosAttributeResponse;<NEW_LINE>} | ("GetQosAttributeResponse.QosPolicies[" + i + "].IpProtocol")); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.