idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,239,846
public void initialScan(ReplayMod core) {<NEW_LINE>// Move anything which is still in the recording folder into the regular replay folder<NEW_LINE>// so it can be opened and/or recovered<NEW_LINE>try (DirectoryStream<Path> paths = Files.newDirectoryStream(folders.getRecordingFolder())) {<NEW_LINE>for (Path path : paths) {<NEW_LINE>Path destination = folders.getReplayFolder().resolve(path.getFileName());<NEW_LINE>if (Files.exists(destination)) {<NEW_LINE>// better play it save<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Files.move(path, destination);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>// Restore corrupted replays<NEW_LINE>try (DirectoryStream<Path> paths = Files.newDirectoryStream(folders.getReplayFolder())) {<NEW_LINE>for (Path path : paths) {<NEW_LINE>String name = path.getFileName().toString();<NEW_LINE>if (name.endsWith(".mcpr.tmp") && Files.isDirectory(path)) {<NEW_LINE>Path original = path.resolveSibling(FilenameUtils.getBaseName(name));<NEW_LINE>Path noRecoverMarker = original.resolveSibling(<MASK><NEW_LINE>if (Files.exists(noRecoverMarker)) {<NEW_LINE>// This file, when its markers are processed, doesn't actually result in any replays.<NEW_LINE>// So we don't really need to recover it either, let's just get rid of it.<NEW_LINE>FileUtils.deleteDirectory(path.toFile());<NEW_LINE>Files.delete(noRecoverMarker);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>new RestoreReplayGui(core, GuiScreen.wrap(core.getMinecraft().currentScreen), original.toFile()).display();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>// Run general purpose, non-essential cleanup in a background thread<NEW_LINE>new Thread(this::cleanup, "replaymod-cleanup").start();<NEW_LINE>}
original.getFileName() + ".no_recover");
1,295,037
private void loadOrgs() {<NEW_LINE>if (orgs != null && orgs.size() != 0) {<NEW_LINE>mView.showUserOrgs(orgs);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HttpObserver<ArrayList<User>> httpObserver = new HttpObserver<ArrayList<User>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable error) {<NEW_LINE>mView<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(HttpResponse<ArrayList<User>> response) {<NEW_LINE>if (response.body().size() != 0) {<NEW_LINE>orgs = response.body();<NEW_LINE>mView.showUserOrgs(orgs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>generalRxHttpExecute(new IObservableCreator<ArrayList<User>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Observable<Response<ArrayList<User>>> createObservable(boolean forceNetWork) {<NEW_LINE>return getUserService().getUserOrgs(forceNetWork, user.getLogin());<NEW_LINE>}<NEW_LINE>}, httpObserver, true);<NEW_LINE>}
.showErrorToast(getErrorTip(error));
840,761
public void emitBlockQuads(BlockAndTintGetter blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context) {<NEW_LINE>super.emitBlockQuads(blockView, state, pos, randomSupplier, context);<NEW_LINE>// Add cell models on top of the base model, if possible<NEW_LINE>Item[] cells = getCells(blockView, pos);<NEW_LINE>if (cells != null) {<NEW_LINE>for (int row = 0; row < 5; row++) {<NEW_LINE>for (int col = 0; col < 2; col++) {<NEW_LINE>int slot = getSlotIndex(row, col);<NEW_LINE>// Add the cell chassis<NEW_LINE>Item cell = slot < cells.length ? cells[slot] : null;<NEW_LINE>BakedModel cellChassisModel = getCellChassisModel(cell);<NEW_LINE>context<MASK><NEW_LINE>context.fallbackConsumer().accept(cellChassisModel);<NEW_LINE>context.meshConsumer().accept(getCellChassisMesh(cell));<NEW_LINE>context.popTransform();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.pushTransform(slotTransforms[slot]);
905,794
final UpdateConnectionResult executeUpdateConnection(UpdateConnectionRequest updateConnectionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateConnectionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateConnectionRequest> request = null;<NEW_LINE>Response<UpdateConnectionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateConnectionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateConnectionRequest));<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, "CloudWatch Events");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateConnection");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateConnectionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateConnectionResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,018,630
public boolean revokePortForwardingRulesForVm(long vmId) {<NEW_LINE>boolean success = true;<NEW_LINE>UserVmVO <MASK><NEW_LINE>if (vm == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<PortForwardingRuleVO> rules = _portForwardingDao.listByVm(vmId);<NEW_LINE>Set<Long> ipsToReprogram = new HashSet<Long>();<NEW_LINE>if (rules == null || rules.isEmpty()) {<NEW_LINE>s_logger.debug("No port forwarding rules are found for vm id=" + vmId);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>for (PortForwardingRuleVO rule : rules) {<NEW_LINE>// Mark port forwarding rule as Revoked, but don't revoke it yet (apply=false)<NEW_LINE>revokePortForwardingRuleInternal(rule.getId(), _accountMgr.getSystemAccount(), Account.ACCOUNT_ID_SYSTEM, false);<NEW_LINE>ipsToReprogram.add(rule.getSourceIpAddressId());<NEW_LINE>}<NEW_LINE>// apply rules for all ip addresses<NEW_LINE>for (Long ipId : ipsToReprogram) {<NEW_LINE>s_logger.debug("Applying port forwarding rules for ip address id=" + ipId + " as a part of vm expunge");<NEW_LINE>if (!applyPortForwardingRules(ipId, _ipAddrMgr.RulesContinueOnError.value(), _accountMgr.getSystemAccount())) {<NEW_LINE>s_logger.warn("Failed to apply port forwarding rules for ip id=" + ipId);<NEW_LINE>success = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>}
vm = _vmDao.findByIdIncludingRemoved(vmId);
424,545
public static DescribeFabricOrganizationPeersResponse unmarshall(DescribeFabricOrganizationPeersResponse describeFabricOrganizationPeersResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeFabricOrganizationPeersResponse.setRequestId(_ctx.stringValue("DescribeFabricOrganizationPeersResponse.RequestId"));<NEW_LINE>describeFabricOrganizationPeersResponse.setSuccess(_ctx.booleanValue("DescribeFabricOrganizationPeersResponse.Success"));<NEW_LINE>describeFabricOrganizationPeersResponse.setErrorCode<MASK><NEW_LINE>List<ResultItem> result = new ArrayList<ResultItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeFabricOrganizationPeersResponse.Result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>resultItem.setUpdateTime(_ctx.stringValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].UpdateTime"));<NEW_LINE>resultItem.setDomain(_ctx.stringValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].Domain"));<NEW_LINE>resultItem.setInternetIp(_ctx.stringValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].InternetIp"));<NEW_LINE>resultItem.setCreateTime(_ctx.stringValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].CreateTime"));<NEW_LINE>resultItem.setIsAnchor(_ctx.booleanValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].IsAnchor"));<NEW_LINE>resultItem.setInstanceType(_ctx.stringValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].InstanceType"));<NEW_LINE>resultItem.setPort(_ctx.integerValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].Port"));<NEW_LINE>resultItem.setOrganizationPeerName(_ctx.stringValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].OrganizationPeerName"));<NEW_LINE>resultItem.setIntranetIp(_ctx.stringValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].IntranetIp"));<NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>describeFabricOrganizationPeersResponse.setResult(result);<NEW_LINE>return describeFabricOrganizationPeersResponse;<NEW_LINE>}
(_ctx.integerValue("DescribeFabricOrganizationPeersResponse.ErrorCode"));
668,623
private void createNewConnection(final ResponseHandler handler, final Object attachment, final String schema) throws IOException {<NEW_LINE>// aysn create connection<NEW_LINE>final AtomicBoolean hasError = new AtomicBoolean(false);<NEW_LINE>MycatServer.getInstance().getBusinessExecutor().execute(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>createNewConnection(new DelegateResponseHandler(handler) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void connectionError(Throwable e, BackendConnection conn) {<NEW_LINE>if (hasError.compareAndSet(false, true)) {<NEW_LINE>handler.connectionError(e, conn);<NEW_LINE>} else {<NEW_LINE>LOGGER.info("connection connectionError ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void connectionAcquired(BackendConnection conn) {<NEW_LINE>LOGGER.info(<MASK><NEW_LINE>takeCon(conn, handler, attachment, schema);<NEW_LINE>}<NEW_LINE>}, schema);<NEW_LINE>} catch (IOException e) {<NEW_LINE>if (hasError.compareAndSet(false, true)) {<NEW_LINE>handler.connectionError(e, null);<NEW_LINE>} else {<NEW_LINE>LOGGER.info("connection connectionError ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
"connection id is " + conn.getId());
1,463,071
public void beginAnalyzeDocumentWithOptions() throws IOException {<NEW_LINE>// BEGIN: com.azure.ai.formrecognizer.DocumentAnalysisClient.beginAnalyzeDocument#string-InputStream-long-AnalyzeDocumentOptions-Context<NEW_LINE><MASK><NEW_LINE>String modelId = "{custom_trained_model_id}";<NEW_LINE>byte[] fileContent = Files.readAllBytes(document.toPath());<NEW_LINE>try (InputStream targetStream = new ByteArrayInputStream(fileContent)) {<NEW_LINE>documentAnalysisClient.beginAnalyzeDocument(modelId, targetStream, document.length(), new AnalyzeDocumentOptions().setPages(Arrays.asList("1", "3")), Context.NONE).getFinalResult().getDocuments().stream().map(AnalyzedDocument::getFields).forEach(documentFieldMap -> documentFieldMap.forEach((key, documentField) -> {<NEW_LINE>System.out.printf("Field text: %s%n", key);<NEW_LINE>System.out.printf("Field value data content: %s%n", documentField.getContent());<NEW_LINE>System.out.printf("Confidence score: %.2f%n", documentField.getConfidence());<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>// END: com.azure.ai.formrecognizer.DocumentAnalysisClient.beginAnalyzeDocument#string-InputStream-long-AnalyzeDocumentOptions-Context<NEW_LINE>}
File document = new File("{local/file_path/fileName.jpg}");
223,223
public Result send(Message msg, String routeName, boolean parseIfNotFound) {<NEW_LINE>boolean found = false;<NEW_LINE>RoutingTable table = mbus.getRoutingTable(msg.getProtocol().toString());<NEW_LINE>if (table != null) {<NEW_LINE>Route route = table.getRoute(routeName);<NEW_LINE>if (route != null) {<NEW_LINE>msg.<MASK><NEW_LINE>found = true;<NEW_LINE>} else if (!parseIfNotFound) {<NEW_LINE>return new Result(ErrorCode.ILLEGAL_ROUTE, "Route '" + routeName + "' not found for protocol '" + msg.getProtocol() + "'.");<NEW_LINE>}<NEW_LINE>} else if (!parseIfNotFound) {<NEW_LINE>return new Result(ErrorCode.ILLEGAL_ROUTE, "Protocol '" + msg.getProtocol() + "' has no routing table.");<NEW_LINE>}<NEW_LINE>if (!found) {<NEW_LINE>msg.setRoute(Route.parse(routeName));<NEW_LINE>}<NEW_LINE>return send(msg);<NEW_LINE>}
setRoute(new Route(route));
289,125
public void runMethod(Method method, Object obj, Vector values) throws ResourceException {<NEW_LINE>try {<NEW_LINE>Class[] parameters = method.getParameterTypes();<NEW_LINE>if (values.size() != parameters.length) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object[] actualValues = new Object[parameters.length];<NEW_LINE>for (int i = 0; i < parameters.length; i++) {<NEW_LINE>String val = (String) values.get(i);<NEW_LINE>if (val.trim().equals("NULL")) {<NEW_LINE>actualValues[i] = null;<NEW_LINE>} else {<NEW_LINE>actualValues[i] = convertType(parameters[i], val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>method.invoke(obj, actualValues);<NEW_LINE>} catch (IllegalAccessException iae) {<NEW_LINE>_logger.log(Level.SEVERE, "jdbc.exc_jb_val", values);<NEW_LINE>_logger.log(<MASK><NEW_LINE>String msg = sm.getString("me.access_denied", method.getName());<NEW_LINE>throw new ResourceException(msg);<NEW_LINE>} catch (IllegalArgumentException ie) {<NEW_LINE>_logger.log(Level.SEVERE, "jdbc.exc_jb_val", values);<NEW_LINE>_logger.log(Level.SEVERE, "", ie);<NEW_LINE>String msg = sm.getString("me.illegal_args", method.getName());<NEW_LINE>throw new ResourceException(msg);<NEW_LINE>} catch (InvocationTargetException ite) {<NEW_LINE>_logger.log(Level.SEVERE, "jdbc.exc_jb_val", values);<NEW_LINE>_logger.log(Level.SEVERE, "", ite);<NEW_LINE>String msg = sm.getString("me.access_denied", method.getName());<NEW_LINE>throw new ResourceException(msg);<NEW_LINE>}<NEW_LINE>}
Level.SEVERE, "", iae);
1,520,529
void handleControllerWebRtcEvents() {<NEW_LINE>ControllerToBotEventBus.subscribe("WEB_RTC_COMMANDS", event -> {<NEW_LINE>String commandType = "";<NEW_LINE>JSONObject <MASK><NEW_LINE>String type = webRtcEvent.getString("type");<NEW_LINE>switch(type) {<NEW_LINE>case "offer":<NEW_LINE>Timber.d("connectToSignallingServer: received an offer $isInitiator $isStarted");<NEW_LINE>peerConnection.setRemoteDescription(new SimpleSdpObserver(), new SessionDescription(SessionDescription.Type.OFFER, webRtcEvent.getString("sdp")));<NEW_LINE>doAnswer();<NEW_LINE>break;<NEW_LINE>case "answer":<NEW_LINE>String remoteDescr = webRtcEvent.getString("sdp");<NEW_LINE>Timber.i("Got remote description %s", remoteDescr);<NEW_LINE>peerConnection.setRemoteDescription(new SimpleSdpObserver(), new SessionDescription(SessionDescription.Type.ANSWER, remoteDescr));<NEW_LINE>break;<NEW_LINE>case "candidate":<NEW_LINE>IceCandidate candidate = new IceCandidate(webRtcEvent.getString("id"), webRtcEvent.getInt("label"), webRtcEvent.getString("candidate"));<NEW_LINE>peerConnection.addIceCandidate(candidate);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}, error -> Log.d(TAG, "Error occurred in handleControllerWebRtcEvents: %s", error), commandJsn -> commandJsn.has("webrtc_event"));<NEW_LINE>}
webRtcEvent = event.getJSONObject("webrtc_event");
248,325
private void savePreferences() {<NEW_LINE>// validate port string<NEW_LINE>try {<NEW_LINE>new PortIterator(portsText.getText());<NEW_LINE>} catch (Exception e) {<NEW_LINE>tabFolder.setSelection(portsTabItem);<NEW_LINE>portsText.forceFocus();<NEW_LINE>throw new FetcherException("unparseablePortString", e);<NEW_LINE>}<NEW_LINE>scannerConfig.selectedPinger = (String) pingersCombo.getData(Integer.toString<MASK><NEW_LINE>scannerConfig.maxThreads = parseIntValue(maxThreadsText);<NEW_LINE>scannerConfig.threadDelay = parseIntValue(threadDelayText);<NEW_LINE>scannerConfig.pingCount = parseIntValue(pingingCountText);<NEW_LINE>scannerConfig.pingTimeout = parseIntValue(pingingTimeoutText);<NEW_LINE>scannerConfig.scanDeadHosts = deadHostsCheckbox.getSelection();<NEW_LINE>scannerConfig.skipBroadcastAddresses = skipBroadcastsCheckbox.getSelection();<NEW_LINE>scannerConfig.portTimeout = parseIntValue(portTimeoutText);<NEW_LINE>scannerConfig.adaptPortTimeout = adaptTimeoutCheckbox.getSelection();<NEW_LINE>scannerConfig.minPortTimeout = parseIntValue(minPortTimeoutText);<NEW_LINE>scannerConfig.portString = portsText.getText();<NEW_LINE>scannerConfig.useRequestedPorts = addRequestedPortsCheckbox.getSelection();<NEW_LINE>scannerConfig.notAvailableText = notAvailableText.getText();<NEW_LINE>scannerConfig.notScannedText = notScannedText.getText();<NEW_LINE>for (int i = 0; i < displayMethod.length; i++) {<NEW_LINE>if (displayMethod[i].getSelection())<NEW_LINE>guiConfig.displayMethod = DisplayMethod.values()[i];<NEW_LINE>}<NEW_LINE>guiConfig.showScanStats = showInfoCheckbox.getSelection();<NEW_LINE>guiConfig.askScanConfirmation = askConfirmationCheckbox.getSelection();<NEW_LINE>guiConfig.versionCheckEnabled = versionCheckCheckbox.getSelection();<NEW_LINE>globalConfig.allowReports = allowReports.getSelection();<NEW_LINE>String newLanguage = Labels.LANGUAGES[languageCombo.getSelectionIndex()];<NEW_LINE>if (!newLanguage.equals(globalConfig.language)) {<NEW_LINE>globalConfig.language = newLanguage;<NEW_LINE>MessageBox msgBox = new MessageBox(shell);<NEW_LINE>msgBox.setMessage(Labels.getLabel("preferences.language.needsRestart"));<NEW_LINE>msgBox.open();<NEW_LINE>}<NEW_LINE>}
(pingersCombo.getSelectionIndex()));
1,131,702
private Optional<Pair<CaptureBindingPatternNode, String>> findCaptureBindingPattern(Node matchedNode, CodeActionContext context) {<NEW_LINE>Optional<Symbol> symbol = context.currentSemanticModel().flatMap(semanticModel -> semanticModel.symbol(matchedNode));<NEW_LINE>if (symbol.isEmpty() || context.currentSyntaxTree().isEmpty() || !SymbolUtil.isListener(symbol.get())) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>Optional<NonTerminalNode> foundNode;<NEW_LINE>String uri;<NEW_LINE>if (matchedNode.kind() == SyntaxKind.QUALIFIED_NAME_REFERENCE) {<NEW_LINE>// Todo: we need a proper API to get the syntax tree node.<NEW_LINE>Optional<Project> project = context.workspace().project(context.filePath());<NEW_LINE>Optional<Location> location = symbol.get().getLocation();<NEW_LINE>if (location.isEmpty() || project.isEmpty() || project.get().kind() != ProjectKind.BUILD_PROJECT || symbol.get().getModule().isEmpty()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>Path filePath = project.get().sourceRoot().resolve("modules").resolve(symbol.get().getModule().get().id().modulePrefix()).resolve(location.get().lineRange().filePath());<NEW_LINE>Optional<SyntaxTree> syntaxTree = context.workspace().syntaxTree(filePath);<NEW_LINE>if (syntaxTree.isEmpty()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>foundNode = CommonUtil.findNode(symbol.get(), syntaxTree.get());<NEW_LINE>uri = filePath.toUri().toString();<NEW_LINE>} else {<NEW_LINE>foundNode = CommonUtil.findNode(symbol.get(), context.currentSyntaxTree().get());<NEW_LINE>uri = context.fileUri();<NEW_LINE>}<NEW_LINE>if (foundNode.isEmpty() || foundNode.get().kind() != SyntaxKind.CAPTURE_BINDING_PATTERN) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>return Optional.of(Pair.of((CaptureBindingPatternNode) foundNode<MASK><NEW_LINE>}
.get(), uri));
875,997
final CreateIntegrationResponseResult executeCreateIntegrationResponse(CreateIntegrationResponseRequest createIntegrationResponseRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createIntegrationResponseRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateIntegrationResponseRequest> request = null;<NEW_LINE>Response<CreateIntegrationResponseResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateIntegrationResponseRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createIntegrationResponseRequest));<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, "ApiGatewayV2");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateIntegrationResponseResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateIntegrationResponseResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateIntegrationResponse");
355,574
public void handleOutbound(Context ctx) throws ServletException, IOException {<NEW_LINE>Model model = new Model(ctx);<NEW_LINE>Payload payload = ctx.getPayload();<NEW_LINE>Action action = payload.getAction();<NEW_LINE>normalize(model, payload);<NEW_LINE>String key = payload.getKey();<NEW_LINE>StateReport report = null;<NEW_LINE>Pair<LineChart, PieChart> pair = null;<NEW_LINE>switch(action) {<NEW_LINE>case HOURLY:<NEW_LINE>report = getHourlyReport(payload);<NEW_LINE>model.setMessage(m_stateBuilder.buildStateMessage(payload.getDate(), payload.getIpAddress()));<NEW_LINE>buildDisplayInfo(model, payload, report);<NEW_LINE>break;<NEW_LINE>case HISTORY:<NEW_LINE>report = getHistoryReport(payload);<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case GRAPH:<NEW_LINE>report = getHourlyReport(payload);<NEW_LINE>pair = m_stateGraphs.buildGraph(payload, key, report);<NEW_LINE>model.setGraph(new JsonBuilder().toJson(pair.getKey()));<NEW_LINE>model.setPieChart(new JsonBuilder().toJson(pair.getValue()));<NEW_LINE>break;<NEW_LINE>case HISTORY_GRAPH:<NEW_LINE>pair = m_stateGraphs.buildGraph(payload, key);<NEW_LINE>model.setGraph(new JsonBuilder().toJson(pair.getKey()));<NEW_LINE>model.setPieChart(new JsonBuilder().toJson(pair.getValue()));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>m_jspViewer.view(ctx, model);<NEW_LINE>}
buildDisplayInfo(model, payload, report);
1,100,865
public Result<Boolean> apiModifyClusterConfig(@RequestBody String payload) {<NEW_LINE>if (StringUtil.isBlank(payload)) {<NEW_LINE>return Result.ofFail(-1, "empty request body");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>JSONObject body = JSON.parseObject(payload);<NEW_LINE>if (body.containsKey(KEY_MODE)) {<NEW_LINE>int mode = body.getInteger(KEY_MODE);<NEW_LINE>switch(mode) {<NEW_LINE>case ClusterStateManager.CLUSTER_CLIENT:<NEW_LINE>ClusterClientModifyRequest data = JSON.parseObject(payload, ClusterClientModifyRequest.class);<NEW_LINE>Result<Boolean> res = checkValidRequest(data);<NEW_LINE>if (res != null) {<NEW_LINE>return res;<NEW_LINE>}<NEW_LINE>clusterConfigService.modifyClusterClientConfig(data).get();<NEW_LINE>return Result.ofSuccess(true);<NEW_LINE>case ClusterStateManager.CLUSTER_SERVER:<NEW_LINE>ClusterServerModifyRequest d = JSON.<MASK><NEW_LINE>Result<Boolean> r = checkValidRequest(d);<NEW_LINE>if (r != null) {<NEW_LINE>return r;<NEW_LINE>}<NEW_LINE>// TODO: bad design here, should refactor!<NEW_LINE>clusterConfigService.modifyClusterServerConfig(d).get();<NEW_LINE>return Result.ofSuccess(true);<NEW_LINE>default:<NEW_LINE>return Result.ofFail(-1, "invalid mode");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Result.ofFail(-1, "invalid parameter");<NEW_LINE>} catch (ExecutionException ex) {<NEW_LINE>logger.error("Error when modifying cluster config", ex.getCause());<NEW_LINE>return errorResponse(ex);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>logger.error("Error when modifying cluster config", ex);<NEW_LINE>return Result.ofFail(-1, ex.getMessage());<NEW_LINE>}<NEW_LINE>}
parseObject(payload, ClusterServerModifyRequest.class);
737,922
public FlowRegistrar stubFlowRegistrar(ConfigurableListableBeanFactory beanFactory, BatchStubRunner batchStubRunner) {<NEW_LINE>Map<StubConfiguration, Collection<Contract>> contracts = batchStubRunner.getContracts();<NEW_LINE>for (Entry<StubConfiguration, Collection<Contract>> entry : contracts.entrySet()) {<NEW_LINE>StubConfiguration key = entry.getKey();<NEW_LINE>Collection<Contract> value = entry.getValue();<NEW_LINE>String name = key.getGroupId() <MASK><NEW_LINE>MultiValueMap<String, Contract> map = new LinkedMultiValueMap<>();<NEW_LINE>for (Contract dsl : value) {<NEW_LINE>if (dsl == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (dsl.getInput() != null && dsl.getInput().getMessageFrom() != null && StringUtils.hasText(dsl.getInput().getMessageFrom().getClientValue())) {<NEW_LINE>String from = dsl.getInput().getMessageFrom().getClientValue();<NEW_LINE>map.add(from, dsl);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Entry<String, List<Contract>> entries : map.entrySet()) {<NEW_LINE>List<Contract> matchingContracts = entries.getValue();<NEW_LINE>final String flowName = name + "_" + entries.getKey() + "_" + Math.abs(matchingContracts.hashCode());<NEW_LINE>// listener<NEW_LINE>StubRunnerJmsRouter router = new StubRunnerJmsRouter(matchingContracts, beanFactory);<NEW_LINE>StubRunnerJmsRouter listener = (StubRunnerJmsRouter) beanFactory.initializeBean(router, flowName);<NEW_LINE>beanFactory.registerSingleton(flowName, listener);<NEW_LINE>registerContainers(beanFactory, matchingContracts, flowName, listener);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new FlowRegistrar();<NEW_LINE>}
+ "_" + key.getArtifactId();
903,634
public ListOutgoingCertificatesResult listOutgoingCertificates(ListOutgoingCertificatesRequest listOutgoingCertificatesRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listOutgoingCertificatesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListOutgoingCertificatesRequest> request = null;<NEW_LINE>Response<ListOutgoingCertificatesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListOutgoingCertificatesRequestMarshaller().marshall(listOutgoingCertificatesRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<ListOutgoingCertificatesResult, JsonUnmarshallerContext> unmarshaller = new ListOutgoingCertificatesResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListOutgoingCertificatesResult> responseHandler = new JsonResponseHandler<ListOutgoingCertificatesResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
383,358
public static void perform() throws Exception {<NEW_LINE>final String fromVer = "4.1.0";<NEW_LINE>final String toVer = "4.2.0";<NEW_LINE>LOGGER.log(Level.INFO, "Upgrading from version [" + fromVer + "] to version [" + toVer + "]....");<NEW_LINE>final BeanManager beanManager = BeanManager.getInstance();<NEW_LINE>final OptionRepository optionRepository = beanManager.getReference(OptionRepository.class);<NEW_LINE>try {<NEW_LINE>final Transaction transaction = optionRepository.beginTransaction();<NEW_LINE>JSONObject githubPATOpt = optionRepository.get(Option.ID_C_GITHUB_PAT);<NEW_LINE>if (null == githubPATOpt) {<NEW_LINE>githubPATOpt = new JSONObject();<NEW_LINE>githubPATOpt.put(Keys.OBJECT_ID, Option.ID_C_GITHUB_PAT);<NEW_LINE>githubPATOpt.put(Option.OPTION_CATEGORY, Option.CATEGORY_C_PREFERENCE);<NEW_LINE>githubPATOpt.put(Option.OPTION_VALUE, "");<NEW_LINE>optionRepository.add(githubPATOpt);<NEW_LINE>}<NEW_LINE>final JSONObject versionOpt = optionRepository.get(Option.ID_C_VERSION);<NEW_LINE>versionOpt.put(Option.OPTION_VALUE, toVer);<NEW_LINE>optionRepository.update(Option.ID_C_VERSION, versionOpt);<NEW_LINE>transaction.commit();<NEW_LINE>LOGGER.log(Level.INFO, "Upgraded from version [" + fromVer + "] to version [" + toVer + "] successfully");<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOGGER.log(Level.ERROR, "Upgrade failed!", e);<NEW_LINE>throw new Exception("Upgrade failed from version [" + <MASK><NEW_LINE>}<NEW_LINE>}
fromVer + "] to version [" + toVer + "]");
1,156,935
private void initialize() {<NEW_LINE>mBorderWidth = SettingsStore.getInstance(getContext()).getTransparentBorderWidth();<NEW_LINE><MASK><NEW_LINE>mWidgetPlacement = new WidgetPlacement(getContext());<NEW_LINE>mWidgetPlacement.name = getClass().getSimpleName();<NEW_LINE>mHandle = mWidgetManager.newWidgetHandle();<NEW_LINE>mWorldWidth = WidgetPlacement.pixelDimension(getContext(), R.dimen.world_width);<NEW_LINE>initializeWidgetPlacement(mWidgetPlacement);<NEW_LINE>mInitialWidth = mWidgetPlacement.width;<NEW_LINE>mInitialHeight = mWidgetPlacement.height;<NEW_LINE>// Transparent border useful for TimeWarp Layers and better aliasing.<NEW_LINE>final float scale = getResources().getDisplayMetrics().density;<NEW_LINE>int padding_px = (int) (mBorderWidth * scale + 0.5f);<NEW_LINE>this.setPadding(padding_px, padding_px, padding_px, padding_px);<NEW_LINE>mChildren = new HashMap<>();<NEW_LINE>mBackHandler = () -> onDismiss();<NEW_LINE>}
mWidgetManager = (WidgetManagerDelegate) getContext();
98,782
public ApkSource build() {<NEW_LINE>ApkSource apkSource;<NEW_LINE>boolean sourceIsZip = false;<NEW_LINE>if (mApkFiles != null) {<NEW_LINE>List<FileDescriptor> apkFileDescriptors = new ArrayList<>(mApkFiles.size());<NEW_LINE>for (File apkFile : mApkFiles) apkFileDescriptors.add(new NormalFileDescriptor(apkFile));<NEW_LINE>apkSource = new DefaultApkSource(apkFileDescriptors);<NEW_LINE>} else if (mZipFile != null) {<NEW_LINE>ZipBackedApkSource zipBackedApkSource;<NEW_LINE>if (mReadZipViaZipFileEnabled)<NEW_LINE>zipBackedApkSource = new ZipFileApkSource(mContext, new NormalFileDescriptor(mZipFile));<NEW_LINE>else<NEW_LINE>zipBackedApkSource = new ZipApkSource(mContext, new NormalFileDescriptor(mZipFile));<NEW_LINE>apkSource = zipBackedApkSource;<NEW_LINE>sourceIsZip = true;<NEW_LINE>} else if (mZipUri != null) {<NEW_LINE>ZipBackedApkSource zipBackedApkSource;<NEW_LINE>if (mReadZipViaZipFileEnabled)<NEW_LINE>zipBackedApkSource = new ZipFileApkSource(mContext, new ContentUriFileDescriptor(mContext, mZipUri));<NEW_LINE>else<NEW_LINE>zipBackedApkSource = new ZipApkSource(mContext, <MASK><NEW_LINE>apkSource = zipBackedApkSource;<NEW_LINE>sourceIsZip = true;<NEW_LINE>} else if (mApkUris != null) {<NEW_LINE>List<FileDescriptor> apkUriDescriptors = new ArrayList<>(mApkUris.size());<NEW_LINE>for (Uri apkUri : mApkUris) apkUriDescriptors.add(new ContentUriFileDescriptor(mContext, apkUri));<NEW_LINE>apkSource = new DefaultApkSource(apkUriDescriptors);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("No source set");<NEW_LINE>}<NEW_LINE>if (mSigningEnabled)<NEW_LINE>apkSource = new SignerApkSource(mContext, apkSource);<NEW_LINE>// Signing already uses temp files, so there's not reason to use CopyToFileApkSource with it<NEW_LINE>if (mZipExtractionEnabled && sourceIsZip && !mSigningEnabled) {<NEW_LINE>apkSource = new CopyToFileApkSource(mContext, apkSource);<NEW_LINE>}<NEW_LINE>if (mFilteredApks != null)<NEW_LINE>apkSource = new FilterApkSource(apkSource, mFilteredApks, mBlacklist);<NEW_LINE>return apkSource;<NEW_LINE>}
new ContentUriFileDescriptor(mContext, mZipUri));
512,753
final GetLicenseUsageResult executeGetLicenseUsage(GetLicenseUsageRequest getLicenseUsageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getLicenseUsageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetLicenseUsageRequest> request = null;<NEW_LINE>Response<GetLicenseUsageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetLicenseUsageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getLicenseUsageRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "License Manager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetLicenseUsage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetLicenseUsageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetLicenseUsageResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
653,839
private boolean hasSearchableColumns() {<NEW_LINE>boolean retValue = false;<NEW_LINE>m_tableName = MQuery.getZoomTableName(m_columnName);<NEW_LINE>m_keyColumnName = MQuery.getZoomColumnName(m_columnName);<NEW_LINE>if (m_columnName.equals("M_Product_ID") || m_columnName.equals("C_BPartner_ID") || m_columnName.equals("C_Order_ID") || m_columnName.equals("C_Invoice_ID") || m_columnName.equals("M_InOut_ID") || m_columnName.equals("C_Payment_ID") || m_columnName.equals("GL_JournalBatch_ID") || m_columnName.equals("SalesRep_ID")) {<NEW_LINE>retValue = true;<NEW_LINE>} else {<NEW_LINE>String query = "SELECT t.TableName, c.ColumnName " + "FROM AD_Column c " + " INNER JOIN AD_Table t ON (c.AD_Table_ID=t.AD_Table_ID AND t.IsView='N')" + " WHERE (c.ColumnName IN ('DocumentNo', 'Value', 'Name') OR c.IsIdentifier='Y')" + " AND c.AD_Reference_ID IN (10,14)" + " AND EXISTS (SELECT * FROM AD_Column cc WHERE cc.AD_Table_ID=t.AD_Table_ID" + " AND cc.IsKey='Y' AND cc.ColumnName=?)";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = <MASK><NEW_LINE>pstmt.setString(1, m_keyColumnName);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>retValue = true;<NEW_LINE>}<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>log.log(Level.SEVERE, query, ex);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return retValue;<NEW_LINE>}
DB.prepareStatement(query, null);
386,780
protected <S extends ConsumerEndpointSpec<? super S, ? extends MessageHandler>> B register(S endpointSpec, Consumer<S> endpointConfigurer) {<NEW_LINE>if (endpointConfigurer != null) {<NEW_LINE>endpointConfigurer.accept(endpointSpec);<NEW_LINE>}<NEW_LINE>MessageChannel inputChannel = getCurrentMessageChannel();<NEW_LINE>currentMessageChannel(null);<NEW_LINE>if (inputChannel == null) {<NEW_LINE>inputChannel = new DirectChannel();<NEW_LINE>this.registerOutputChannelIfCan(inputChannel);<NEW_LINE>}<NEW_LINE>Tuple2<ConsumerEndpointFactoryBean, ? extends MessageHandler<MASK><NEW_LINE>addComponents(endpointSpec.getComponentsToRegister());<NEW_LINE>if (inputChannel instanceof MessageChannelReference) {<NEW_LINE>factoryBeanTuple2.getT1().setInputChannelName(((MessageChannelReference) inputChannel).getName());<NEW_LINE>} else {<NEW_LINE>if (inputChannel instanceof FixedSubscriberChannelPrototype) {<NEW_LINE>String beanName = ((FixedSubscriberChannelPrototype) inputChannel).getName();<NEW_LINE>inputChannel = new FixedSubscriberChannel(factoryBeanTuple2.getT2());<NEW_LINE>if (beanName != null) {<NEW_LINE>((FixedSubscriberChannel) inputChannel).setBeanName(beanName);<NEW_LINE>}<NEW_LINE>registerOutputChannelIfCan(inputChannel);<NEW_LINE>}<NEW_LINE>factoryBeanTuple2.getT1().setInputChannel(inputChannel);<NEW_LINE>}<NEW_LINE>return addComponent(endpointSpec).currentComponent(factoryBeanTuple2.getT2());<NEW_LINE>}
> factoryBeanTuple2 = endpointSpec.get();
1,016,290
public void print(DebugContext debug, Graph graph, Map<Object, Object> properties, int id, String format, Object... args) throws IOException {<NEW_LINE>if (graph instanceof StructuredGraph) {<NEW_LINE>OptionValues options = graph.getOptions();<NEW_LINE>StructuredGraph structuredGraph = (StructuredGraph) graph;<NEW_LINE>String outDirectory = getDirectory(debug, structuredGraph);<NEW_LINE>String title = String.format("%03d-%s.txt", id, String.format(format, simplifyClassArgs(args)));<NEW_LINE>String filePath = PathUtilities.getPath(outDirectory, PathUtilities.sanitizeFileName(title));<NEW_LINE>try (PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(PathUtilities.openOutputStream(filePath))))) {<NEW_LINE>switch(PrintCanonicalGraphStringFlavor.getValue(options)) {<NEW_LINE>case 1:<NEW_LINE>writeCanonicalExpressionCFGString(structuredGraph, CanonicalGraphStringsCheckConstants.getValue(options), CanonicalGraphStringsRemoveIdentities<MASK><NEW_LINE>break;<NEW_LINE>case 0:<NEW_LINE>default:<NEW_LINE>writeCanonicalGraphString(structuredGraph, CanonicalGraphStringsExcludeVirtuals.getValue(options), CanonicalGraphStringsCheckConstants.getValue(options), writer);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getValue(options), writer);
1,851,244
private void addDisplayLabel(Symbol symbol, int nameLength, int typeLength, int sourceLength) {<NEW_LINE>String name = "";<NEW_LINE>String type = "";<NEW_LINE>String primary = getSpaces(7);<NEW_LINE>String source = "";<NEW_LINE>String namespace = "";<NEW_LINE>String yes = getSpaces(2) + "yes" + getSpaces(2);<NEW_LINE>String separatorSpaces = getSpaces(2);<NEW_LINE>addText(indent2);<NEW_LINE>if (symbol == null) {<NEW_LINE>// Underline the header.<NEW_LINE>underline("Name");<NEW_LINE>addText(getSpaces(nameLength - "Name".length()));<NEW_LINE>addText(separatorSpaces);<NEW_LINE>underline("Type");<NEW_LINE>addText(getSpaces(typeLength - "Type".length()));<NEW_LINE>addText(separatorSpaces);<NEW_LINE>underline("Primary");<NEW_LINE>addText(separatorSpaces);<NEW_LINE>underline("Source");<NEW_LINE>addText(getSpaces(sourceLength - "Source".length()));<NEW_LINE>addText(separatorSpaces);<NEW_LINE>underline("Namespace");<NEW_LINE>} else {<NEW_LINE>name = symbol.getName();<NEW_LINE>SymbolType symType = symbol.getSymbolType();<NEW_LINE>type = symType.toString();<NEW_LINE>source = symbol<MASK><NEW_LINE>if (symbol.isPrimary()) {<NEW_LINE>primary = yes;<NEW_LINE>}<NEW_LINE>Namespace parentNS = symbol.getParentNamespace();<NEW_LINE>namespace = ((parentNS instanceof GlobalNamespace) ? parentNS.getName() : parentNS.getName(true));<NEW_LINE>addColorText(name);<NEW_LINE>addText(getSpaces(nameLength - name.length()));<NEW_LINE>addText(separatorSpaces);<NEW_LINE>addColorText(type);<NEW_LINE>addText(getSpaces(typeLength - type.length()));<NEW_LINE>addText(separatorSpaces);<NEW_LINE>addColorText(primary);<NEW_LINE>addText(separatorSpaces);<NEW_LINE>addColorText(source);<NEW_LINE>addText(getSpaces(sourceLength - source.length()));<NEW_LINE>addText(separatorSpaces);<NEW_LINE>addColorText(namespace);<NEW_LINE>if (symbol.isPinned()) {<NEW_LINE>addText(separatorSpaces);<NEW_LINE>addColorText("(pinned)");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addText(newLine);<NEW_LINE>}
.getSource().toString();
1,302,244
public CustomSql unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CustomSql customSql = new CustomSql();<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 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("DataSourceArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>customSql.setDataSourceArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>customSql.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("SqlQuery", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>customSql.setSqlQuery(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Columns", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>customSql.setColumns(new ListUnmarshaller<InputColumn>(InputColumnJsonUnmarshaller.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 customSql;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
791,993
public void scavenge() {<NEW_LINE>// don't attempt to scavenge if we are shutting down<NEW_LINE>if (isStopping() || isStopped())<NEW_LINE>return;<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("{} scavenging sessions", this);<NEW_LINE>// Get a snapshot of the candidates as they are now. Others that<NEW_LINE>// arrive during this processing will be dealt with on<NEW_LINE>// subsequent call to scavenge<NEW_LINE>String[] ss = _candidateSessionIdsForExpiry.toArray(new String[0]);<NEW_LINE>Set<String> candidates = new HashSet<>(Arrays.asList(ss));<NEW_LINE>_candidateSessionIdsForExpiry.removeAll(candidates);<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("{} scavenging session ids {}", this, candidates);<NEW_LINE>try {<NEW_LINE>candidates = _sessionCache.checkExpiration(candidates);<NEW_LINE>for (String id : candidates) {<NEW_LINE>try {<NEW_LINE>getSessionIdManager().expireAll(id);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn("Failed to check expiration on {}", candidates.stream().map(Objects::toString).collect(Collectors.joining(", ", "[", "]")), e);<NEW_LINE>}<NEW_LINE>}
warn("Unable to expire Session {}", id, e);
355,319
private void initSuggester() {<NEW_LINE>SuggesterConfig suggesterConfig = env.getSuggesterConfig();<NEW_LINE>if (!suggesterConfig.isEnabled()) {<NEW_LINE>logger.log(Level.INFO, "Suggester disabled");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File suggesterDir = new File(env.getDataRootPath(), IndexDatabase.SUGGESTER_DIR);<NEW_LINE>int rebuildParalleismLevel = (int) (((float) suggesterConfig.getRebuildThreadPoolSizeInNcpuPercent() / 100) * Runtime.getRuntime().availableProcessors());<NEW_LINE>if (rebuildParalleismLevel == 0) {<NEW_LINE>rebuildParalleismLevel = 1;<NEW_LINE>}<NEW_LINE>logger.log(<MASK><NEW_LINE>suggester = new Suggester(suggesterDir, suggesterConfig.getMaxResults(), Duration.ofSeconds(suggesterConfig.getBuildTerminationTime()), suggesterConfig.isAllowMostPopular(), env.isProjectsEnabled(), suggesterConfig.getAllowedFields(), suggesterConfig.getTimeThreshold(), rebuildParalleismLevel, Metrics.getRegistry());<NEW_LINE>new Thread(() -> {<NEW_LINE>suggester.init(getAllProjectIndexDirs());<NEW_LINE>scheduleRebuild();<NEW_LINE>}).start();<NEW_LINE>}
Level.FINER, "Suggester rebuild parallelism level: " + rebuildParalleismLevel);
174,531
public List<List<Integer>> verticalTraversal(TreeNode root) {<NEW_LINE>List<int[]> list = new ArrayList<>();<NEW_LINE>dfs(root, 0, 0, list);<NEW_LINE>list.sort(new Comparator<int[]>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(int[] o1, int[] o2) {<NEW_LINE>if (o1[0] != o2[0])<NEW_LINE>return Integer.compare(o1[0], o2[0]);<NEW_LINE>if (o1[1] != o2[1])<NEW_LINE>return Integer.compare(o2[<MASK><NEW_LINE>return Integer.compare(o1[2], o2[2]);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>List<List<Integer>> res = new ArrayList<>();<NEW_LINE>int preX = 1;<NEW_LINE>for (int[] cur : list) {<NEW_LINE>if (preX != cur[0]) {<NEW_LINE>res.add(new ArrayList<>());<NEW_LINE>preX = cur[0];<NEW_LINE>}<NEW_LINE>res.get(res.size() - 1).add(cur[2]);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
1], o1[1]);
85,539
final DeleteOpsMetadataResult executeDeleteOpsMetadata(DeleteOpsMetadataRequest deleteOpsMetadataRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteOpsMetadataRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteOpsMetadataRequest> request = null;<NEW_LINE>Response<DeleteOpsMetadataResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteOpsMetadataRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteOpsMetadataRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteOpsMetadata");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteOpsMetadataResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteOpsMetadataResultJsonUnmarshaller());<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.SERVICE_ID, "SSM");
590,418
private boolean handleDataChange() throws Exception {<NEW_LINE>StateWrapper currentWrapper = stateRef.get();<NEW_LINE><MASK><NEW_LINE>StateWrapper newWrapper = readCurrentContext();<NEW_LINE>traceLogWrappers(currentWrapper, notifyWrapper, newWrapper);<NEW_LINE>if (currentWrapper.version + 1 == newWrapper.version && notifyWrapper.version >= currentWrapper.version && stateRef.compareAndSet(currentWrapper, newWrapper)) {<NEW_LINE>// simply used to check if we don't need to replay, if so<NEW_LINE>// we can just try to notify<NEW_LINE>mayNotifyStateChanged(newWrapper);<NEW_LINE>} else {<NEW_LINE>final int start = (notifyWrapper != null ? (notifyWrapper.version) : 0) % logSize;<NEW_LINE>int count = newWrapper.version - (notifyWrapper != null ? (notifyWrapper.version) : 0);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Events missed, trying to replay start " + start + " count " + count);<NEW_LINE>}<NEW_LINE>for (int i = start; i < (start + count); i++) {<NEW_LINE>Stat stat = new Stat();<NEW_LINE>StateMachineContext<S, E> context = ((ZookeeperStateMachinePersist<S, E>) persist).readLog(i, stat);<NEW_LINE>int ver = (stat.getVersion() - 1) * logSize + (i + 1);<NEW_LINE>// check if we're behind more than a log size meaning we can't<NEW_LINE>// replay full history, notify and break out from a loop<NEW_LINE>if (i + logSize < ver) {<NEW_LINE>notifyError(new StateMachineEnsembleException("Current version behind more than log size"));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Replay position " + i + " with version " + ver);<NEW_LINE>log.debug("Context in position " + i + " " + context);<NEW_LINE>}<NEW_LINE>StateWrapper wrapper = new StateWrapper(context, ver);<NEW_LINE>// need to set stateRef when replaying if its<NEW_LINE>// context is not set or otherwise just set<NEW_LINE>// if stateRef still is currentWrapper<NEW_LINE>StateWrapper currentWrapperx = stateRef.get();<NEW_LINE>if (currentWrapperx.context == null) {<NEW_LINE>stateRef.set(wrapper);<NEW_LINE>} else if (wrapper.version == currentWrapperx.version + 1) {<NEW_LINE>stateRef.set(wrapper);<NEW_LINE>}<NEW_LINE>mayNotifyStateChanged(wrapper);<NEW_LINE>}<NEW_LINE>// did we replay<NEW_LINE>return count > 0;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
StateWrapper notifyWrapper = notifyRef.get();
1,419,706
public IQueryBuilder<I_MD_Candidate> mkQueryBuilder(@NonNull final CandidatesQuery query) {<NEW_LINE>final IQueryBL queryBL = Services.get(IQueryBL.class);<NEW_LINE>final IQueryBuilder<I_MD_Candidate> builder = queryBL.createQueryBuilder(I_MD_Candidate.class).addOnlyActiveRecordsFilter();<NEW_LINE>if (CandidatesQuery.FALSE.equals(query)) {<NEW_LINE>builder.filter(ConstantQueryFilter.of(false));<NEW_LINE>return builder;<NEW_LINE>} else if (!query.getId().isUnspecified()) {<NEW_LINE>builder.addEqualsFilter(I_MD_Candidate.COLUMN_MD_Candidate_ID, query.getId().getRepoId());<NEW_LINE>return builder;<NEW_LINE>}<NEW_LINE>if (query.getType() != null) {<NEW_LINE>builder.addEqualsFilter(I_MD_Candidate.COLUMN_MD_Candidate_Type, query.getType().toString());<NEW_LINE>}<NEW_LINE>if (query.getBusinessCase() != null) {<NEW_LINE>builder.addEqualsFilter(I_MD_Candidate.COLUMN_MD_Candidate_BusinessCase, query.getBusinessCase().toString());<NEW_LINE>}<NEW_LINE>if (!query.getParentId().isUnspecified()) {<NEW_LINE>builder.addEqualsFilter(I_MD_Candidate.COLUMN_MD_Candidate_Parent_ID, query.getParentId().getRepoId());<NEW_LINE>}<NEW_LINE>if (query.getGroupId() != null) {<NEW_LINE>builder.addEqualsFilter(I_MD_Candidate.COLUMN_MD_Candidate_GroupId, query.getGroupId().toInt());<NEW_LINE>}<NEW_LINE>addMaterialDescriptorToQueryBuilderIfNotNull(query.getMaterialDescriptorQuery(), query.isMatchExactStorageAttributesKey(), builder);<NEW_LINE>if (query.getParentMaterialDescriptorQuery() != null) {<NEW_LINE>final IQueryBuilder<I_MD_Candidate> parentBuilder = queryBL.createQueryBuilder(I_MD_Candidate.class).addOnlyActiveRecordsFilter();<NEW_LINE>final boolean atLeastOneFilterAdded = addMaterialDescriptorToQueryBuilderIfNotNull(query.getParentMaterialDescriptorQuery(), query.isMatchExactStorageAttributesKey(), parentBuilder);<NEW_LINE>if (atLeastOneFilterAdded) {<NEW_LINE>// restrict our set of matches to those records that reference a parent record which have the give product and/or warehouse.<NEW_LINE>builder.addInSubQueryFilter(I_MD_Candidate.COLUMN_MD_Candidate_Parent_ID, I_MD_Candidate.COLUMN_MD_Candidate_ID, parentBuilder.create());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (query.getParentDemandDetailsQuery() != null) {<NEW_LINE>final IQueryBuilder<I_MD_Candidate> parentBuilder = queryBL.createQueryBuilder(I_MD_Candidate.class).addOnlyActiveRecordsFilter();<NEW_LINE>addDemandDetailToBuilder(<MASK><NEW_LINE>builder.addInSubQueryFilter(I_MD_Candidate.COLUMN_MD_Candidate_Parent_ID, I_MD_Candidate.COLUMN_MD_Candidate_ID, parentBuilder.create());<NEW_LINE>}<NEW_LINE>if (query.getDemandDetailsQuery() != null) {<NEW_LINE>addDemandDetailToBuilder(query.getDemandDetailsQuery(), builder);<NEW_LINE>}<NEW_LINE>addProductionDetailToFilter(query, builder);<NEW_LINE>addDistributionDetailToFilter(query, builder);<NEW_LINE>PurchaseDetailRepoHelper.addPurchaseDetailsQueryToFilter(query.getPurchaseDetailsQuery(), builder);<NEW_LINE>addTransactionDetailToFilter(query, builder);<NEW_LINE>addStockChangeDetailToFilter(query, builder);<NEW_LINE>return builder;<NEW_LINE>}
query.getParentDemandDetailsQuery(), parentBuilder);
442,799
public void flush(SegmentWriteState state, Sorter.DocMap sortMap, DocValuesConsumer dvConsumer) throws IOException {<NEW_LINE>bytes.freeze(false);<NEW_LINE>if (finalLengths == null) {<NEW_LINE>finalLengths = this.lengths.build();<NEW_LINE>}<NEW_LINE>final BinaryDVs sorted;<NEW_LINE>if (sortMap != null) {<NEW_LINE>sorted = new BinaryDVs(state.segmentInfo.maxDoc(), sortMap, new BufferedBinaryDocValues(finalLengths, maxLength, bytes.getDataInput(), docsWithField.iterator()));<NEW_LINE>} else {<NEW_LINE>sorted = null;<NEW_LINE>}<NEW_LINE>dvConsumer.addBinaryField(fieldInfo, new EmptyDocValuesProducer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public BinaryDocValues getBinary(FieldInfo fieldInfoIn) {<NEW_LINE>if (fieldInfoIn != fieldInfo) {<NEW_LINE>throw new IllegalArgumentException("wrong fieldInfo");<NEW_LINE>}<NEW_LINE>if (sorted == null) {<NEW_LINE>return new BufferedBinaryDocValues(finalLengths, maxLength, bytes.getDataInput(<MASK><NEW_LINE>} else {<NEW_LINE>return new SortingBinaryDocValues(sorted);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
), docsWithField.iterator());
628,065
public void encode(MessageTree tree, ByteBuf buf) {<NEW_LINE>Message message = tree.getMessage();<NEW_LINE>if (message instanceof Transaction) {<NEW_LINE>int count = 0;<NEW_LINE>int index = buf.writerIndex();<NEW_LINE>BufferHelper helper = m_bufferHelper;<NEW_LINE>Transaction t = (Transaction) message;<NEW_LINE>Locator locator = new Locator();<NEW_LINE>Ruler ruler = new Ruler((int) t.getDurationInMicros());<NEW_LINE>ruler.setWidth(1400);<NEW_LINE>ruler.setHeight(18 <MASK><NEW_LINE>ruler.setOffsetX(200);<NEW_LINE>ruler.setOffsetY(10);<NEW_LINE>// place-holder<NEW_LINE>buf.writeInt(0);<NEW_LINE>count += helper.table1(buf);<NEW_LINE>count += helper.crlf(buf);<NEW_LINE>count += encodeHeader(tree, buf, ruler);<NEW_LINE>count += encodeRuler(buf, locator, ruler);<NEW_LINE>count += encodeTransaction(tree, t, buf, locator, ruler);<NEW_LINE>count += encodeFooter(tree, buf);<NEW_LINE>count += helper.table2(buf);<NEW_LINE>buf.setInt(index, count);<NEW_LINE>}<NEW_LINE>}
* calculateLines(t) + 10);
1,202,009
public // TODO Can we optimize this algo?<NEW_LINE>Token findToken(int position) {<NEW_LINE>TextRange textRangeWithMinutiae = textRangeWithMinutiae();<NEW_LINE>// Check whether this position is the same as the end text position of the text.<NEW_LINE>// If that is the case, return the eof token.<NEW_LINE>// Fixes 24905<NEW_LINE>if (textRangeWithMinutiae.endOffset() == position && this instanceof ModulePartNode) {<NEW_LINE>ModulePartNode modulePartNode = (ModulePartNode) this;<NEW_LINE>return modulePartNode.eofToken();<NEW_LINE>}<NEW_LINE>if (!textRangeWithMinutiae.contains(position)) {<NEW_LINE>throw new IndexOutOfBoundsException("Index: '" + position + "', Size: '" + <MASK><NEW_LINE>}<NEW_LINE>Node foundNode = this;<NEW_LINE>while (!SyntaxUtils.isToken(foundNode)) {<NEW_LINE>foundNode = ((NonTerminalNode) foundNode).findChildNode(position);<NEW_LINE>}<NEW_LINE>return (Token) foundNode;<NEW_LINE>}
textRangeWithMinutiae.endOffset() + "'");
1,529,641
public void execute(Project project) {<NEW_LINE>SwiftXCTestSuite component = project.getExtensions().getByType(SwiftXCTestSuite.class);<NEW_LINE>FileCollection sources = component.getSwiftSource();<NEW_LINE>xcodeProject.getGroups().getTests().from(sources);<NEW_LINE>String targetName = component.getModule().get();<NEW_LINE>final XcodeTarget target = newTarget(targetName, component.getModule().get(), toGradleCommand(project)<MASK><NEW_LINE>target.getSwiftSourceCompatibility().convention(component.getSourceCompatibility());<NEW_LINE>if (component.getTestBinary().isPresent()) {<NEW_LINE>target.addBinary(DefaultXcodeProject.BUILD_DEBUG, component.getTestBinary().get().getInstallDirectory(), component.getTestBinary().get().getTargetMachine().getArchitecture().getName());<NEW_LINE>target.addBinary(DefaultXcodeProject.BUILD_RELEASE, component.getTestBinary().get().getInstallDirectory(), component.getTestBinary().get().getTargetMachine().getArchitecture().getName());<NEW_LINE>target.setProductType(PBXTarget.ProductType.UNIT_TEST);<NEW_LINE>target.getCompileModules().from(component.getTestBinary().get().getCompileModules());<NEW_LINE>target.addTaskDependency(filterArtifactsFromImplicitBuilds(((DefaultSwiftBinary) component.getTestBinary().get()).getImportPathConfiguration()).getBuildDependencies());<NEW_LINE>}<NEW_LINE>component.getBinaries().whenElementFinalized(new Action<SwiftBinary>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void execute(SwiftBinary swiftBinary) {<NEW_LINE>target.getSwiftSourceCompatibility().set(swiftBinary.getTargetPlatform().getSourceCompatibility());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>xcodeProject.addTarget(target);<NEW_LINE>}
, getBridgeTaskPath(project), sources);
1,786,878
private static void tryMT(RegressionEnvironment env, int numSeconds, int numWriteThreads) throws InterruptedException {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String eplCreateVariable = "@public create table varagg (c0 int, c1 int, c2 int, c3 int, c4 int, c5 int)";<NEW_LINE>env.compileDeploy(eplCreateVariable, path);<NEW_LINE><MASK><NEW_LINE>env.compileDeploy(eplMerge, path);<NEW_LINE>String eplQuery = "@name('s0') select varagg.c0 as c0, varagg.c1 as c1, varagg.c2 as c2," + "varagg.c3 as c3, varagg.c4 as c4, varagg.c5 as c5 from SupportBean_S1";<NEW_LINE>env.compileDeploy(eplQuery, path).addListener("s0");<NEW_LINE>Thread[] writeThreads = new Thread[numWriteThreads];<NEW_LINE>WriteRunnable[] writeRunnables = new WriteRunnable[numWriteThreads];<NEW_LINE>for (int i = 0; i < writeThreads.length; i++) {<NEW_LINE>writeRunnables[i] = new WriteRunnable(env, i);<NEW_LINE>writeThreads[i] = new Thread(writeRunnables[i], InfraTableMTUngroupedAccessReadMergeWrite.class.getSimpleName() + "-write");<NEW_LINE>writeThreads[i].start();<NEW_LINE>}<NEW_LINE>ReadRunnable readRunnable = new ReadRunnable(env, env.listener("s0"));<NEW_LINE>Thread readThread = new Thread(readRunnable, InfraTableMTUngroupedAccessReadMergeWrite.class.getSimpleName() + "-read");<NEW_LINE>readThread.start();<NEW_LINE>Thread.sleep(numSeconds * 1000);<NEW_LINE>// join<NEW_LINE>log.info("Waiting for completion");<NEW_LINE>for (int i = 0; i < writeThreads.length; i++) {<NEW_LINE>writeRunnables[i].setShutdown(true);<NEW_LINE>writeThreads[i].join();<NEW_LINE>assertNull(writeRunnables[i].getException());<NEW_LINE>}<NEW_LINE>readRunnable.setShutdown(true);<NEW_LINE>readThread.join();<NEW_LINE>env.undeployAll();<NEW_LINE>assertNull(readRunnable.getException());<NEW_LINE>}
String eplMerge = "on SupportBean_S0 merge varagg " + "when not matched then insert select -1 as c0, -1 as c1, -1 as c2, -1 as c3, -1 as c4, -1 as c5 " + "when matched then update set c0=id, c1=id, c2=id, c3=id, c4=id, c5=id";
1,479,061
public void packColumn(final TableColumn column) {<NEW_LINE>//<NEW_LINE>// Check if we have fixed length set from GridField<NEW_LINE>final int widthFixed = getFixedWidth(column);<NEW_LINE>if (widthFixed > 0) {<NEW_LINE>column.setPreferredWidth(widthFixed);<NEW_LINE>column.setWidth(widthFixed);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int width = 0;<NEW_LINE>// Header<NEW_LINE>TableCellRenderer renderer = column.getHeaderRenderer();<NEW_LINE>if (renderer == null)<NEW_LINE>renderer = new DefaultTableCellRenderer();<NEW_LINE>Component comp = null;<NEW_LINE>if (renderer != null) {<NEW_LINE>comp = // isSelected<NEW_LINE>renderer.// isSelected<NEW_LINE>getTableCellRendererComponent(// isSelected<NEW_LINE>this, // isSelected<NEW_LINE>column.getHeaderValue(), // hasFocus<NEW_LINE>false, // row<NEW_LINE>false, // column<NEW_LINE>0, 0);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (comp != null) {<NEW_LINE>width = comp.getPreferredSize().width;<NEW_LINE>width = Math.max(width, comp.getWidth());<NEW_LINE>// Cells<NEW_LINE>int col = column.getModelIndex();<NEW_LINE>int maxRow = Math.min(20, getRowCount());<NEW_LINE>try {<NEW_LINE>for (int row = 0; row < maxRow; row++) {<NEW_LINE>renderer = getCellRenderer(row, col);<NEW_LINE>comp = renderer.getTableCellRendererComponent(this, getValueAt(row, col), false, false, row, col);<NEW_LINE>if (comp != null) {<NEW_LINE>int rowWidth = comp.getPreferredSize().width;<NEW_LINE>width = Math.max(width, rowWidth);<NEW_LINE>// start: metas-2009_0021_AP1_CR52<NEW_LINE>// if (comp instanceof VCellRenderer) {<NEW_LINE>// Lookup lk = ((VCellRenderer) comp).getLookup();<NEW_LINE>// if (lk instanceof MLookup && ((MLookup) lk).getDisplayType() != DisplayType.Search) {<NEW_LINE>// ((MLookup) lk).refresh(true);<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// end: metas-2009_0021_AP1_CR52<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error when packing column " + column.getIdentifier().toString(), e);<NEW_LINE>}<NEW_LINE>// Width not greater than 250<NEW_LINE>width = Math.<MASK><NEW_LINE>}<NEW_LINE>//<NEW_LINE>column.setPreferredWidth(width);<NEW_LINE>}
min(MAXSIZE, width + SLACK);
1,585,848
private String buildQualifiedName(DeclaredType type, TypeElement typeElement, ExecutableElement enclosedElement) {<NEW_LINE>String qualifiedName = enclosedElement.getSimpleName().toString();<NEW_LINE>qualifiedName += "(" + enclosedElement.getParameters().stream().map(variableElement -> types.erasure(variableElement.asType()).toString()).collect(Collectors.joining(",")) + ")";<NEW_LINE>TypeMirror returnTypeMirror = enclosedElement.getReturnType();<NEW_LINE>String returnType = null;<NEW_LINE>if (returnTypeMirror.getKind() == TypeKind.TYPEVAR) {<NEW_LINE>Map<String, TypeMirror> generics = genericUtils.buildGenericTypeArgumentInfo(type).get(typeElement.getQualifiedName().toString());<NEW_LINE>if (generics != null) {<NEW_LINE>String key = returnTypeMirror.toString();<NEW_LINE>if (generics.containsKey(key)) {<NEW_LINE>returnType = generics.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (returnType == null) {<NEW_LINE>returnType = modelUtils.resolveTypeName(returnTypeMirror);<NEW_LINE>}<NEW_LINE>qualifiedName = returnType + "." + qualifiedName;<NEW_LINE>return qualifiedName;<NEW_LINE>}
get(key).toString();
1,367,983
private void refreshRemoteVideo() {<NEW_LINE>if (mRemoteUserIdList.size() > 0) {<NEW_LINE>for (int i = 0; i < mRemoteUserIdList.size() || i < 6; i++) {<NEW_LINE>if (i < mRemoteUserIdList.size() && !TextUtils.isEmpty(mRemoteUserIdList.get(i))) {<NEW_LINE>mRemoteVideoList.get(i).setVisibility(View.VISIBLE);<NEW_LINE>mRemoteUserviewList.get(i).setText(mRemoteUserIdList.get(i) + "");<NEW_LINE>mTRTCCloud.startRemoteView(mRemoteUserIdList.get(i), TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_BIG, mRemoteVideoList.get(i));<NEW_LINE>} else {<NEW_LINE>mRemoteUserviewList.get(i).setText("");<NEW_LINE>mRemoteVideoList.get(i<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < 6; i++) {<NEW_LINE>mRemoteVideoList.get(i).setVisibility(View.GONE);<NEW_LINE>mRemoteUserviewList.get(i).setText("");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).setVisibility(View.GONE);
666,114
// The tested exceptions cause FFDC so we have to allow for this.<NEW_LINE>@AllowedFFDC<NEW_LINE>public void launchFaultToleranceTCK() throws Exception {<NEW_LINE>boolean isFullMode = TestModeFilter.shouldRun(TestMode.FULL);<NEW_LINE>String suiteFileName = isFullMode ? "tck-suite.xml" : "tck-suite-lite.xml";<NEW_LINE>MvnUtils.runTCKMvnCmd(server, "com.ibm.ws.microprofile.faulttolerance.2.1_fat_tck", this.getClass() + ":launchFaultToleranceTCK", suiteFileName, Collections.emptyMap(), Collections.emptySet());<NEW_LINE>Map<String, String> resultInfo = MvnUtils.getResultInfo(server);<NEW_LINE><MASK><NEW_LINE>resultInfo.put("feature_name", "Fault Tolerance");<NEW_LINE>resultInfo.put("feature_version", "2.1");<NEW_LINE>MvnUtils.preparePublicationFile(resultInfo);<NEW_LINE>}
resultInfo.put("results_type", "MicroProfile");
1,765,209
private void passwordWarningClicked() {<NEW_LINE>if (dialog == null) {<NEW_LINE>final String[] items = { getString(R.string.admin_password), getString(R.string.server_password) };<NEW_LINE>dialog = new MaterialAlertDialogBuilder(getActivity()).setTitle(R.string.include_password_dialog).setMultiChoiceItems(items, checkedItems, (dialog, which, isChecked) -> checkedItems[which] = isChecked).setCancelable(false).setPositiveButton(R.string.generate, (dialog, which) -> {<NEW_LINE>qrCodeViewModel.setIncludedKeys(getSelectedPasswordKeys());<NEW_LINE>dialog.dismiss();<NEW_LINE>}).setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()).create();<NEW_LINE>// disable checkbox if password not set<NEW_LINE>dialog.getListView().setOnHierarchyChangeListener(new ViewGroup.OnHierarchyChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onChildViewAdded(View parent, View child) {<NEW_LINE>CharSequence text = ((AppCompatCheckedTextView) child).getText();<NEW_LINE>int itemIndex = Arrays.asList(items).indexOf(text);<NEW_LINE>if (!passwordsSet[itemIndex]) {<NEW_LINE>child<MASK><NEW_LINE>child.setOnClickListener(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onChildViewRemoved(View view, View view1) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>dialog.show();<NEW_LINE>}
.setEnabled(passwordsSet[itemIndex]);
559,044
private Properties loadConfig() {<NEW_LINE>Properties properties = defaultProperties();<NEW_LINE>Iterator<String> it = Config.getKeys();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>final String key = it.next();<NEW_LINE>if (key == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (key.startsWith("felix.")) {<NEW_LINE>final String value = (UtilMethods.isSet(Config.getStringProperty(key, null))) ? Config.getStringProperty(key) : null;<NEW_LINE>String felixKey = key.substring(6);<NEW_LINE>properties.put(felixKey, value);<NEW_LINE>Logger.info(OSGIUtil.class, () -> "Found property " + felixKey + "=" + value);<NEW_LINE>}<NEW_LINE>if (key.startsWith("DOT_FELIX_FELIX")) {<NEW_LINE>final String felixKey = key.replace("DOT_FELIX_FELIX", "FELIX").replace("_", ".").toLowerCase();<NEW_LINE>String value = (UtilMethods.isSet(Config.getStringProperty(key, null))) ? Config.getStringProperty(key) : null;<NEW_LINE>properties.put(felixKey, value);<NEW_LINE>Logger.info(OSGIUtil.class, () -> "Found property " + felixKey + "=" + value);<NEW_LINE>}<NEW_LINE>if (key.startsWith("DOT_FELIX_OSGI")) {<NEW_LINE>final String felixKey = key.replace("DOT_FELIX_OSGI", "OSGI").replace("_", ".").toLowerCase();<NEW_LINE>String value = (UtilMethods.isSet(Config.getStringProperty(key, null))) ? <MASK><NEW_LINE>properties.put(felixKey, value);<NEW_LINE>Logger.info(OSGIUtil.class, () -> "Found property " + felixKey + "=" + value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return properties;<NEW_LINE>}
Config.getStringProperty(key) : null;
1,060,580
private void buildHeader() {<NEW_LINE>OsmandApplication app = getMyApplication();<NEW_LINE>if (app != null && view != null) {<NEW_LINE>final ImageView iconView = (ImageView) view.findViewById(R.id.context_menu_icon_view);<NEW_LINE>Drawable icon = menu.getRightIcon();<NEW_LINE>int iconId = menu.getRightIconId();<NEW_LINE>int sizeId = menu.isBigRightIcon() ? R.dimen.context_menu_big_icon_size : R.dimen.standard_icon_size;<NEW_LINE>if (menu.getPointDescription().isFavorite() || menu.getPointDescription().isWpt()) {<NEW_LINE>sizeId = R.dimen.favorites_my_places_icon_size;<NEW_LINE>}<NEW_LINE>int iconViewSize = <MASK><NEW_LINE>ViewGroup.LayoutParams params = iconView.getLayoutParams();<NEW_LINE>params.width = iconViewSize;<NEW_LINE>params.height = iconViewSize;<NEW_LINE>if (icon != null) {<NEW_LINE>iconView.setImageDrawable(icon);<NEW_LINE>iconView.setVisibility(View.VISIBLE);<NEW_LINE>} else if (iconId != 0) {<NEW_LINE>iconView.setImageDrawable(getIcon(iconId, !nightMode ? R.color.osmand_orange : R.color.osmand_orange_dark));<NEW_LINE>iconView.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>iconView.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>setAddressLocation();<NEW_LINE>}<NEW_LINE>}
getResources().getDimensionPixelSize(sizeId);
443,112
private static boolean parseAndCheckForTokenEquivalence(String first, String second, Context context) {<NEW_LINE>ImmutableList<ErrorProneToken> tokens1 = ErrorProneTokens.getTokens(SEMICOLON.trimTrailingFrom(first), context);<NEW_LINE>ImmutableList<ErrorProneToken> tokens2 = ErrorProneTokens.getTokens(SEMICOLON.trimTrailingFrom(second), context);<NEW_LINE>if (tokens1.size() != tokens2.size()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < tokens1.size(); i++) {<NEW_LINE>ErrorProneToken token1 = tokens1.get(i);<NEW_LINE>ErrorProneToken <MASK><NEW_LINE>if (!token1.kind().equals(token2.kind())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// note we specifically avoid checking ErrorProneToken::comments<NEW_LINE>if (mismatch(token1, token2, ErrorProneToken::hasName, ErrorProneToken::name) || mismatch(token1, token2, ErrorProneToken::hasStringVal, ErrorProneToken::stringVal) || mismatch(token1, token2, ErrorProneToken::hasRadix, ErrorProneToken::radix)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
token2 = tokens2.get(i);
1,625,682
public BatchGetReportsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BatchGetReportsResult batchGetReportsResult = new BatchGetReportsResult();<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 batchGetReportsResult;<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("reports", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchGetReportsResult.setReports(new ListUnmarshaller<Report>(ReportJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("reportsNotFound", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchGetReportsResult.setReportsNotFound(new ListUnmarshaller<String>(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 batchGetReportsResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,647,532
public static byte[] decryptFile(File file, byte[] encryptionKeyBytes, byte[] iv, byte[] authenticationTag) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, NoSuchPaddingException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, IOException {<NEW_LINE>Cipher cipher = Cipher.getInstance(AES_CIPHER);<NEW_LINE>Key key = new SecretKeySpec(encryptionKeyBytes, AES);<NEW_LINE>GCMParameterSpec spec = new GCMParameterSpec(128, iv);<NEW_LINE>cipher.init(<MASK><NEW_LINE>RandomAccessFile randomAccessFile = new RandomAccessFile(file, "r");<NEW_LINE>byte[] fileBytes = new byte[(int) randomAccessFile.length()];<NEW_LINE>randomAccessFile.readFully(fileBytes);<NEW_LINE>// check authentication tag<NEW_LINE>byte[] extractedAuthenticationTag = Arrays.copyOfRange(fileBytes, fileBytes.length - (128 / 8), fileBytes.length);<NEW_LINE>if (!Arrays.equals(extractedAuthenticationTag, authenticationTag)) {<NEW_LINE>throw new SecurityException("Tag not correct");<NEW_LINE>}<NEW_LINE>return cipher.doFinal(fileBytes);<NEW_LINE>}
Cipher.DECRYPT_MODE, key, spec);
1,270,607
public void loadNode(int AD_Tree_Favorite_ID) {<NEW_LINE>String displayQuery = "SELECT fn.ad_tree_favorite_node_id, fn.parent_id, fn.seqno, fn.nodename, fn.issummary, fn.ad_menu_id, iscollapsible," + " coalesce(t.name, m.name) as menuTrl " + " FROM ad_tree_favorite_node fn " + " LEFT JOIN AD_Menu m on (m.AD_Menu_ID = fn.ad_menu_ID)" + " LEFT JOIN AD_Menu_Trl t ON(t.AD_Menu_ID = fn.AD_Menu_ID AND t.AD_Language='" + Env.getAD_Language(p_ctx) + "')" + " WHERE ad_tree_favorite_id = ? " + " ORDER BY COALESCE(parent_id,-1), seqno, nodename";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(displayQuery, get_TrxName());<NEW_LINE>pstmt.setInt(1, AD_Tree_Favorite_ID);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>mroot = new MTreeNode(0, 0, "User Favourite Root", "User Favourite Root", 0, true, 0, null, false);<NEW_LINE>while (rs.next()) {<NEW_LINE>int <MASK><NEW_LINE>int parentID = rs.getInt(2);<NEW_LINE>int seqno = rs.getInt(3);<NEW_LINE>String name = rs.getString(4);<NEW_LINE>boolean isSummary = (rs.getString(5).equals("Y"));<NEW_LINE>boolean isCollapsible = rs.getString("iscollapsible").equals("Y");<NEW_LINE>String img = null;<NEW_LINE>int menuID = 0;<NEW_LINE>if (!isSummary) {<NEW_LINE>menuID = rs.getInt(6);<NEW_LINE>MMenu mMenu = new MMenu(Env.getCtx(), menuID, null);<NEW_LINE>if (Env.getLanguage(Env.getCtx()).isBaseLanguage()) {<NEW_LINE>name = mMenu.getName();<NEW_LINE>} else {<NEW_LINE>name = rs.getString(8);<NEW_LINE>}<NEW_LINE>img = mMenu.getAction();<NEW_LINE>}<NEW_LINE>if (AD_Tree_Favorite_ID == 0 && (parentID == 0 || NodeID == 0))<NEW_LINE>;<NEW_LINE>else<NEW_LINE>addToTree(NodeID, parentID, seqno, name, isSummary, menuID, img, isCollapsible);<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, displayQuery.toString(), e);<NEW_LINE>throw new AdempiereException(e);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs);<NEW_LINE>DB.close(pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>}
NodeID = rs.getInt(1);
1,623,100
Charset parseCharset(@Nullable String contentTypeValue) {<NEW_LINE>if (contentTypeValue != null) {<NEW_LINE>String charsetRaw = null;<NEW_LINE>int indexOfCharset = contentTypeValue.toLowerCase().indexOf(CHARSET_PREFIX);<NEW_LINE>if (indexOfCharset != -1) {<NEW_LINE>int indexOfEncoding = indexOfCharset + CHARSET_PREFIX.length();<NEW_LINE>if (indexOfEncoding < contentTypeValue.length()) {<NEW_LINE>String charsetCandidate = contentTypeValue.substring(indexOfEncoding);<NEW_LINE>int indexOfSemicolon = charsetCandidate.indexOf(SEMICOLON);<NEW_LINE>charsetRaw = indexOfSemicolon == -1 ? charsetCandidate : charsetCandidate.substring(0, indexOfSemicolon);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (charsetRaw != null) {<NEW_LINE>if (charsetRaw.length() > 2) {<NEW_LINE>if (charsetRaw.charAt(0) == '"' && charsetRaw.charAt(charsetRaw.length() - 1) == '"') {<NEW_LINE>charsetRaw = charsetRaw.substring(1, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return Charset.forName(charsetRaw);<NEW_LINE>} catch (IllegalCharsetNameException | UnsupportedCharsetException ignored) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
charsetRaw.length() - 1);
695,790
public static String toSdpString(final String id, List<Parameter> parameters) {<NEW_LINE>final StringBuilder stringBuilder = new StringBuilder();<NEW_LINE>stringBuilder.append(id).append(' ');<NEW_LINE>for (int i = 0; i < parameters.size(); ++i) {<NEW_LINE>final Parameter <MASK><NEW_LINE>final String name = p.getParameterName();<NEW_LINE>Preconditions.checkArgument(name != null, String.format("parameter for %s must have a name", id));<NEW_LINE>SessionDescription.checkNoWhitespace(name, String.format("parameter names for %s must not contain whitespaces", id));<NEW_LINE>final String value = p.getParameterValue();<NEW_LINE>Preconditions.checkArgument(value != null, String.format("parameter for %s must have a value", id));<NEW_LINE>SessionDescription.checkNoWhitespace(value, String.format("parameter values for %s must not contain whitespaces", id));<NEW_LINE>stringBuilder.append(name).append('=').append(value);<NEW_LINE>if (i != parameters.size() - 1) {<NEW_LINE>stringBuilder.append(';');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return stringBuilder.toString();<NEW_LINE>}
p = parameters.get(i);
160,405
public SmartHomeAppliance unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SmartHomeAppliance smartHomeAppliance = new SmartHomeAppliance();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("FriendlyName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>smartHomeAppliance.setFriendlyName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Description", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>smartHomeAppliance.setDescription(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ManufacturerName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>smartHomeAppliance.setManufacturerName(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 smartHomeAppliance;<NEW_LINE>}
class).unmarshall(context));
1,085,705
private void browseForIcons() {<NEW_LINE>GhidraFileChooser iconFileChooser = new GhidraFileChooser(getComponent());<NEW_LINE>iconFileChooser.setFileSelectionMode(GhidraFileChooser.FILES_ONLY);<NEW_LINE>iconFileChooser.setTitle("Choose Icon");<NEW_LINE>iconFileChooser.setApproveButtonToolTipText("Choose Icon");<NEW_LINE>iconFileChooser.setFileFilter(new ExtensionFileFilter(new String[] { "gif", "jpg", "bmp", "png" }, "Image Files"));<NEW_LINE>String iconDir = Preferences.getProperty(LAST_ICON_DIRECTORY);<NEW_LINE>if (iconDir != null) {<NEW_LINE>iconFileChooser.setCurrentDirectory(new File(iconDir));<NEW_LINE>}<NEW_LINE>File file = iconFileChooser.getSelectedFile();<NEW_LINE>if (file == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String filename = file.getAbsolutePath();<NEW_LINE>iconField.setText(filename);<NEW_LINE><MASK><NEW_LINE>iconListModel.addElement(url);<NEW_LINE>iconList.setSelectedValue(url, true);<NEW_LINE>setPicture(url);<NEW_LINE>Preferences.setProperty(LAST_ICON_DIRECTORY, file.getParent());<NEW_LINE>}
ToolIconURL url = new ToolIconURL(filename);
366,973
void updateRowOfSeederState(int srcId, long rowId) throws SQLException {<NEW_LINE><MASK><NEW_LINE>PreparedStatement stmt = null;<NEW_LINE>try {<NEW_LINE>StringBuilder sql = new StringBuilder();<NEW_LINE>// sql.append("insert into bootstrap_applier_state ");<NEW_LINE>// sql.append("values (?,?,?,?) ");<NEW_LINE>// sql.append("on duplicate key update rid = ?");<NEW_LINE>sql.append("insert into bootstrap_seeder_state (srcid,rid,srckey) ");<NEW_LINE>sql.append("values (?,?,'')");<NEW_LINE>sql.append("on duplicate key update rid = ?");<NEW_LINE>stmt = conn.prepareStatement(sql.toString());<NEW_LINE>stmt.setInt(1, srcId);<NEW_LINE>stmt.setLong(2, rowId);<NEW_LINE>stmt.setLong(3, rowId);<NEW_LINE>stmt.executeUpdate();<NEW_LINE>DBHelper.commit(conn);<NEW_LINE>} finally {<NEW_LINE>DBHelper.close(stmt);<NEW_LINE>}<NEW_LINE>}
Connection conn = _bootstrapConn.getDBConn();
522,424
public final static Meteor build(HttpServletRequest req, Broadcaster.SCOPE scope, List<BroadcastFilter> l, Serializer s) {<NEW_LINE>AtmosphereResource r = (AtmosphereResource) req.getAttribute(ATMOSPHERE_RESOURCE);<NEW_LINE>if (r == null)<NEW_LINE>throw new IllegalStateException("MeteorServlet not defined in web.xml");<NEW_LINE>Broadcaster b = null;<NEW_LINE>if (scope == Broadcaster.SCOPE.REQUEST) {<NEW_LINE>try {<NEW_LINE>BroadcasterFactory f = r.getAtmosphereConfig().getBroadcasterFactory();<NEW_LINE>b = f.get(DefaultBroadcaster.class, DefaultBroadcaster.class.getSimpleName() + r.getAtmosphereConfig().uuidProvider().generateUuid());<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new RuntimeException(t);<NEW_LINE>}<NEW_LINE>b.setScope(scope);<NEW_LINE>r.setBroadcaster(b);<NEW_LINE>req.setAttribute(<MASK><NEW_LINE>}<NEW_LINE>Meteor m = new Meteor(r, l, (s != null ? s : r.getSerializer()));<NEW_LINE>req.setAttribute(METEOR, m);<NEW_LINE>return m;<NEW_LINE>}
AtmosphereResourceImpl.SKIP_BROADCASTER_CREATION, Boolean.TRUE);
143,432
protected JPanel createPanel() {<NEW_LINE>JPanel panel = new JPanel();<NEW_LINE>BoxLayout boxLayout = new BoxLayout(panel, BoxLayout.Y_AXIS);<NEW_LINE>panel.setLayout(boxLayout);<NEW_LINE>panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));<NEW_LINE>for (String currentRegister : extent.getContextRegisters()) {<NEW_LINE>JPanel currentRegPanel = new JPanel();<NEW_LINE>PairLayout pairLayout = new PairLayout();<NEW_LINE>currentRegPanel.setLayout(pairLayout);<NEW_LINE>JTextField currentTextField <MASK><NEW_LINE>currentTextField.setEditable(false);<NEW_LINE>currentRegPanel.add(currentTextField);<NEW_LINE>List<BigInteger> regValues = extent.getValuesForRegister(currentRegister);<NEW_LINE>RegisterValueWrapper[] valueArray = new RegisterValueWrapper[regValues.size() + 1];<NEW_LINE>valueArray[0] = new RegisterValueWrapper(null);<NEW_LINE>for (int i = 1; i < regValues.size() + 1; ++i) {<NEW_LINE>valueArray[i] = new RegisterValueWrapper(regValues.get(i - 1));<NEW_LINE>}<NEW_LINE>GhidraComboBox<RegisterValueWrapper> currentCombo = new GhidraComboBox<RegisterValueWrapper>(valueArray);<NEW_LINE>currentRegPanel.add(currentCombo);<NEW_LINE>panel.add(currentRegPanel);<NEW_LINE>regsToBoxes.put(currentRegister, currentCombo);<NEW_LINE>}<NEW_LINE>return panel;<NEW_LINE>}
= new JTextField(currentRegister, TEXT_FIELD_COLUMNS);
769,604
protected void connect(WifiConfiguration wifiConfiguration, WifiManager.ActionListener listener) {<NEW_LINE>WifiInfo wifiInfo = getConnectionInfo();<NEW_LINE>String ssid = isQuoted(wifiConfiguration.SSID) ? stripQuotes(wifiConfiguration.SSID) : wifiConfiguration.SSID;<NEW_LINE>ShadowWifiInfo shadowWifiInfo = Shadow.extract(wifiInfo);<NEW_LINE>shadowWifiInfo.setSSID(ssid);<NEW_LINE>shadowWifiInfo.setBSSID(wifiConfiguration.BSSID);<NEW_LINE><MASK><NEW_LINE>setConnectionInfo(wifiInfo);<NEW_LINE>// Now that we're "connected" to wifi, update Dhcp and point it to localhost.<NEW_LINE>DhcpInfo dhcpInfo = new DhcpInfo();<NEW_LINE>dhcpInfo.gateway = LOCAL_HOST;<NEW_LINE>dhcpInfo.ipAddress = LOCAL_HOST;<NEW_LINE>setDhcpInfo(dhcpInfo);<NEW_LINE>// Now add the network to ConnectivityManager.<NEW_LINE>NetworkInfo networkInfo = ShadowNetworkInfo.newInstance(NetworkInfo.DetailedState.CONNECTED, ConnectivityManager.TYPE_WIFI, 0, /* subType */<NEW_LINE>true, /* isAvailable */<NEW_LINE>true);<NEW_LINE>ShadowConnectivityManager connectivityManager = Shadow.extract(RuntimeEnvironment.getApplication().getSystemService(Context.CONNECTIVITY_SERVICE));<NEW_LINE>connectivityManager.setActiveNetworkInfo(networkInfo);<NEW_LINE>if (listener != null) {<NEW_LINE>listener.onSuccess();<NEW_LINE>}<NEW_LINE>}
shadowWifiInfo.setNetworkId(wifiConfiguration.networkId);
1,291,062
public LabelNameCondition unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>LabelNameCondition labelNameCondition = new LabelNameCondition();<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 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("LabelName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>labelNameCondition.setLabelName(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 labelNameCondition;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,143,068
private boolean debugEmptyMapping(FileObject javaFile) {<NEW_LINE>JavaSource js = JavaSource.forFileObject(javaFile);<NEW_LINE>if (isWebService(js)) {<NEW_LINE>// cannot debug web service implementation file<NEW_LINE>String mes = // NOI18N<NEW_LINE>java.text.MessageFormat.// NOI18N<NEW_LINE>format(// NOI18N<NEW_LINE>NbBundle.getMessage(WebActionProvider.class, "TXT_cannotDebugWebservice"), new Object[] { javaFile.getName() });<NEW_LINE>NotifyDescriptor desc = new NotifyDescriptor.Message(mes, NotifyDescriptor.Message.ERROR_MESSAGE);<NEW_LINE>DialogDisplayer.getDefault().notify(desc);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>String mes = // NOI18N<NEW_LINE>java.text.MessageFormat.// NOI18N<NEW_LINE>format(// NOI18N<NEW_LINE>NbBundle.getMessage(WebActionProvider.class, "TXT_missingServletMappings"), new Object[] <MASK><NEW_LINE>NotifyDescriptor desc = new NotifyDescriptor.Message(mes, NotifyDescriptor.Message.ERROR_MESSAGE);<NEW_LINE>DialogDisplayer.getDefault().notify(desc);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}
{ javaFile.getName() });
1,479,751
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String factoryName, DeleteDataFlowDebugSessionRequest request, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (factoryName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter factoryName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (request == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>request.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, factoryName, this.client.getApiVersion(), request, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
1,638,045
public //<NEW_LINE>void beforeRun() {<NEW_LINE>if (this.isDynamicBackground()) {<NEW_LINE>steps = scenario.getBackgroundSteps();<NEW_LINE>} else {<NEW_LINE>steps = scenario.getStepsIncludingBackground();<NEW_LINE>}<NEW_LINE>ScenarioEngine.set(engine);<NEW_LINE>engine.init();<NEW_LINE>if (this.background != null) {<NEW_LINE>ScenarioEngine backgroundEngine = background.engine;<NEW_LINE>if (backgroundEngine.driver != null) {<NEW_LINE>engine.setDriver(backgroundEngine.driver);<NEW_LINE>}<NEW_LINE>if (backgroundEngine.robot != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.setExecutorName(Thread.currentThread().getName());<NEW_LINE>result.setStartTime(System.currentTimeMillis());<NEW_LINE>if (!dryRun) {<NEW_LINE>if (caller.isNone() && !caller.isKarateConfigDisabled()) {<NEW_LINE>// evaluate config js, variables above will apply !<NEW_LINE>evalConfigJs(featureRuntime.suite.karateBase, "karate-base.js");<NEW_LINE>evalConfigJs(featureRuntime.suite.karateConfig, "karate-config.js");<NEW_LINE>evalConfigJs(featureRuntime.suite.karateConfigEnv, "karate-config-" + featureRuntime.suite.env + ".js");<NEW_LINE>}<NEW_LINE>if (this.isDynamicBackground()) {<NEW_LINE>featureRuntime.suite.hooks.forEach(h -> h.beforeBackground(this));<NEW_LINE>if (featureRuntime.suite.debugMode) {<NEW_LINE>featureRuntime.suite.hooks.stream().filter(DebugThread.class::isInstance).forEach(h -> h.beforeScenario(this));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>featureRuntime.suite.hooks.forEach(h -> h.beforeScenario(this));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!this.isDynamicBackground()) {<NEW_LINE>// don't evaluate names when running the background section<NEW_LINE>evaluateScenarioName();<NEW_LINE>}<NEW_LINE>}
engine.setRobot(backgroundEngine.robot);
33,210
void draw(Graphics g) {<NEW_LINE>boolean selected = needsHighlight();<NEW_LINE>Font f = new Font("SansSerif", selected ? Font.BOLD : 0, 14);<NEW_LINE>g.setFont(f);<NEW_LINE>g.setColor(selected ? selectColor : whiteColor);<NEW_LINE>String s = (flags & FLAG_VALUE) != 0 ? getUnitTextWithScale(volts[0], "V", scale<MASK><NEW_LINE>// FontMetrics fm = g.getFontMetrics();<NEW_LINE>if (this == sim.plotXElm)<NEW_LINE>s = "X";<NEW_LINE>if (this == sim.plotYElm)<NEW_LINE>s = "Y";<NEW_LINE>interpPoint(point1, point2, lead1, 1 - ((int) g.context.measureText(s).getWidth() / 2 + 8) / dn);<NEW_LINE>setBbox(point1, lead1, 0);<NEW_LINE>drawCenteredText(g, s, x2, y2, true);<NEW_LINE>setVoltageColor(g, volts[0]);<NEW_LINE>if (selected)<NEW_LINE>g.setColor(selectColor);<NEW_LINE>drawThickLine(g, point1, lead1);<NEW_LINE>drawPosts(g);<NEW_LINE>}
) : sim.LS("out");
933,549
private static File createPernsistenceXml(List<Class<?>> classes, File directory) throws Exception {<NEW_LINE>Document document = DocumentHelper.createDocument();<NEW_LINE>Element persistence = document.addElement("persistence", "http://java.sun.com/xml/ns/persistence");<NEW_LINE>persistence.addAttribute(QName.get("schemaLocation", "xsi", "http://www.w3.org/2001/XMLSchema-instance"), "http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd");<NEW_LINE>persistence.addAttribute("version", "2.0");<NEW_LINE>Element unit = persistence.addElement("persistence-unit");<NEW_LINE>unit.addAttribute("name", "enhance");<NEW_LINE>Set<Class<?>> set = new HashSet<>();<NEW_LINE>for (Class<?> o : classes) {<NEW_LINE>set.addAll(scanMappedSuperclass(o));<NEW_LINE>}<NEW_LINE>for (Class<?> o : set) {<NEW_LINE>Element element = unit.addElement("class");<NEW_LINE>element.<MASK><NEW_LINE>}<NEW_LINE>OutputFormat format = OutputFormat.createPrettyPrint();<NEW_LINE>format.setEncoding("UTF-8");<NEW_LINE>File file = new File(directory, "persistence.xml");<NEW_LINE>XMLWriter writer = new XMLWriter(new FileWriter(file), format);<NEW_LINE>writer.write(document);<NEW_LINE>writer.close();<NEW_LINE>return file;<NEW_LINE>}
addText(o.getCanonicalName());
131,996
public static OrderBook adaptOrders(BitZOrders bitZOrders, CurrencyPair currencyPair) {<NEW_LINE>Date timestamp = DateUtils.fromMillisUtc(bitZOrders.getTimestamp());<NEW_LINE>List<LimitOrder> asks = new ArrayList<LimitOrder>();<NEW_LINE>List<LimitOrder> bids <MASK><NEW_LINE>for (BitZPublicOrder order : bitZOrders.getAsks()) {<NEW_LINE>asks.add(new LimitOrder.Builder(OrderType.ASK, currencyPair).averagePrice(order.getPrice()).originalAmount(order.getVolume()).build());<NEW_LINE>}<NEW_LINE>for (BitZPublicOrder order : bitZOrders.getBids()) {<NEW_LINE>bids.add(new LimitOrder.Builder(OrderType.BID, currencyPair).averagePrice(order.getPrice()).originalAmount(order.getVolume()).build());<NEW_LINE>}<NEW_LINE>return new OrderBook(timestamp, asks, bids);<NEW_LINE>}
= new ArrayList<LimitOrder>();
109,129
public void updateColors(@NonNull TextState textState) {<NEW_LINE>super.updateColors(textState);<NEW_LINE>shadowRadius = textState.textShadowRadius;<NEW_LINE>boolean <MASK><NEW_LINE>view.setBackgroundResource(portrait ? textState.boxTop : textState.boxFree);<NEW_LINE>TextView waypointText = view.findViewById(R.id.waypoint_text);<NEW_LINE>TextView waypointTextShadow = view.findViewById(R.id.waypoint_text_shadow);<NEW_LINE>updateTextColor(addressText, addressTextShadow, textState.textColor, textState.textShadowColor, textState.textBold, shadowRadius);<NEW_LINE>updateTextColor(waypointText, waypointTextShadow, textState.textColor, textState.textShadowColor, textState.textBold, shadowRadius / 2);<NEW_LINE>int exitRefTextColorId = isNightMode() ? R.color.text_color_primary_dark : R.color.color_white;<NEW_LINE>exitRefText.setTextColor(ContextCompat.getColor(app, exitRefTextColorId));<NEW_LINE>ImageView moreImage = waypointInfoBar.findViewById(R.id.waypoint_more);<NEW_LINE>ImageView removeImage = waypointInfoBar.findViewById(R.id.waypoint_close);<NEW_LINE>moreImage.setImageDrawable(iconsCache.getIcon(R.drawable.ic_overflow_menu_white, isNightMode()));<NEW_LINE>removeImage.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_remove_dark, isNightMode()));<NEW_LINE>}
portrait = AndroidUiHelper.isOrientationPortrait(mapActivity);
87,362
// Try to guess world type from Minecraft 1.16 generator settings<NEW_LINE>private static WorldType tryGuessWorldType(CompoundTag dataTag) {<NEW_LINE>// Be careful when handling null values, we don't want to trigger unwanted errors<NEW_LINE>Tag<?> generator = NBTUtils.getNestedTag(dataTag, <MASK><NEW_LINE>Tag<?> generatorType = NBTUtils.getNestedTag(generator, "type");<NEW_LINE>if (new StringTag("minecraft:flat").equals(generatorType)) {<NEW_LINE>return WorldType.FLAT;<NEW_LINE>}<NEW_LINE>if (new StringTag("minecraft:noise").equals(generatorType)) {<NEW_LINE>Tag<?> settings = NBTUtils.getNestedTag(generator, "settings");<NEW_LINE>if (new StringTag("minecraft:amplified").equals(settings)) {<NEW_LINE>return WorldType.AMPLIFIED;<NEW_LINE>}<NEW_LINE>Tag<?> largeBiomes = NBTUtils.getNestedTag(generator, "biome_source", "large_biomes");<NEW_LINE>if (new ByteTag(true).equals(largeBiomes)) {<NEW_LINE>return WorldType.LARGE_BIOMES;<NEW_LINE>} else {<NEW_LINE>return WorldType.DEFAULT;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
"WorldGenSettings", "dimensions", "minecraft:overworld", "generator");
721,301
public InspectorV3 createInspector(Context context, InspectorV3.InspectorResponse response) {<NEW_LINE>String query = uri.getQueryParameter("q");<NEW_LINE>SortType popular = SortType.findFromAddition(uri.getQueryParameter("sort"));<NEW_LINE>if (requestType == ApiRequestType.FAVORITE)<NEW_LINE>return InspectorV3.favoriteInspector(context, query, page, response);<NEW_LINE>if (requestType == ApiRequestType.BYSEARCH)<NEW_LINE>return InspectorV3.searchInspector(context, query, null, page, popular, null, response);<NEW_LINE>if (requestType == ApiRequestType.BYALL)<NEW_LINE>return InspectorV3.searchInspector(context, "", null, page, SortType.RECENT_ALL_TIME, null, response);<NEW_LINE>if (requestType == ApiRequestType.BYTAG)<NEW_LINE>return InspectorV3.searchInspector(context, "", Collections.singleton(tagVal), page, SortType.findFromAddition(this<MASK><NEW_LINE>return null;<NEW_LINE>}
.url), null, response);
236,789
protected void addCommandBrowseAction(final JPanel pane, FixedSizeButton browseCommandButton, JTextField tfCommand) {<NEW_LINE>browseCommandButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileOrExecutableAppDescriptor();<NEW_LINE>PathChooserDialog chooser = FileChooserFactory.getInstance().<MASK><NEW_LINE>chooser.choose(null, new Consumer<List<VirtualFile>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void consume(List<VirtualFile> files) {<NEW_LINE>VirtualFile file = files.size() > 0 ? files.get(0) : null;<NEW_LINE>if (file != null) {<NEW_LINE>myTfCommand.setText(file.getPresentableUrl());<NEW_LINE>String workingDirectory = myTfCommandWorkingDirectory.getText();<NEW_LINE>if (workingDirectory == null || workingDirectory.length() == 0) {<NEW_LINE>VirtualFile parent = file.getParent();<NEW_LINE>if (parent != null && parent.isDirectory()) {<NEW_LINE>myTfCommandWorkingDirectory.setText(parent.getPresentableUrl());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
createPathChooser(descriptor, myProject, pane);
800,985
final DescribeProvisioningTemplateVersionResult executeDescribeProvisioningTemplateVersion(DescribeProvisioningTemplateVersionRequest describeProvisioningTemplateVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeProvisioningTemplateVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeProvisioningTemplateVersionRequest> request = null;<NEW_LINE>Response<DescribeProvisioningTemplateVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeProvisioningTemplateVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeProvisioningTemplateVersionRequest));<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, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeProvisioningTemplateVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeProvisioningTemplateVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>}
false), new DescribeProvisioningTemplateVersionResultJsonUnmarshaller());
1,460,317
public static DescribeGroupedVulResponse unmarshall(DescribeGroupedVulResponse describeGroupedVulResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeGroupedVulResponse.setRequestId(_ctx.stringValue("DescribeGroupedVulResponse.RequestId"));<NEW_LINE>describeGroupedVulResponse.setCurrentPage(_ctx.integerValue("DescribeGroupedVulResponse.CurrentPage"));<NEW_LINE>describeGroupedVulResponse.setPageSize(_ctx.integerValue("DescribeGroupedVulResponse.PageSize"));<NEW_LINE>describeGroupedVulResponse.setTotalCount(_ctx.integerValue("DescribeGroupedVulResponse.TotalCount"));<NEW_LINE>List<GroupedVulItem> groupedVulItems = new ArrayList<GroupedVulItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeGroupedVulResponse.GroupedVulItems.Length"); i++) {<NEW_LINE>GroupedVulItem groupedVulItem = new GroupedVulItem();<NEW_LINE>groupedVulItem.setType(_ctx.stringValue("DescribeGroupedVulResponse.GroupedVulItems[" + i + "].Type"));<NEW_LINE>groupedVulItem.setNntfCount(_ctx.integerValue("DescribeGroupedVulResponse.GroupedVulItems[" + i + "].NntfCount"));<NEW_LINE>groupedVulItem.setHandledCount(_ctx.integerValue("DescribeGroupedVulResponse.GroupedVulItems[" + i + "].HandledCount"));<NEW_LINE>groupedVulItem.setGmtLast(_ctx.stringValue("DescribeGroupedVulResponse.GroupedVulItems[" + i + "].GmtLast"));<NEW_LINE>groupedVulItem.setTags(_ctx.stringValue("DescribeGroupedVulResponse.GroupedVulItems[" + i + "].Tags"));<NEW_LINE>groupedVulItem.setLaterCount(_ctx.integerValue("DescribeGroupedVulResponse.GroupedVulItems[" + i + "].LaterCount"));<NEW_LINE>groupedVulItem.setAliasName(_ctx.stringValue("DescribeGroupedVulResponse.GroupedVulItems[" + i + "].AliasName"));<NEW_LINE>groupedVulItem.setName(_ctx.stringValue("DescribeGroupedVulResponse.GroupedVulItems[" + i + "].Name"));<NEW_LINE>groupedVulItem.setAsapCount(_ctx.integerValue<MASK><NEW_LINE>groupedVulItems.add(groupedVulItem);<NEW_LINE>}<NEW_LINE>describeGroupedVulResponse.setGroupedVulItems(groupedVulItems);<NEW_LINE>return describeGroupedVulResponse;<NEW_LINE>}
("DescribeGroupedVulResponse.GroupedVulItems[" + i + "].AsapCount"));
489,617
final AddInstanceGroupsResult executeAddInstanceGroups(AddInstanceGroupsRequest addInstanceGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(addInstanceGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AddInstanceGroupsRequest> request = null;<NEW_LINE>Response<AddInstanceGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AddInstanceGroupsRequestProtocolMarshaller(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, "EMR");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AddInstanceGroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AddInstanceGroupsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AddInstanceGroupsResultJsonUnmarshaller());<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(addInstanceGroupsRequest));
1,237,510
static void displayEditPanel(TransactionNode node) {<NEW_LINE>MonitorData md = null;<NEW_LINE>// We retrieve the data from the file system, not from the<NEW_LINE>// cache<NEW_LINE>md = // from file<NEW_LINE>Controller.getInstance().// from file<NEW_LINE>getMonitorData(// from file<NEW_LINE>node, // don't cache<NEW_LINE>false, false);<NEW_LINE>if (md == null) {<NEW_LINE>// We couldn't get the data.<NEW_LINE>String msg = NbBundle.getMessage(EditPanel.class, "MSG_NoMonitorData");<NEW_LINE>Logger.getLogger("global").log(Level.INFO, msg);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (md.getRequestData().getAttributeValue(METHOD).equals(POST))<NEW_LINE>Util.<MASK><NEW_LINE>md.getRequestData().deleteCookie("jsessionid");<NEW_LINE>if (instance == null)<NEW_LINE>instance = new EditPanel();<NEW_LINE>// useBrowserCookie = MonitorAction.getController().getUseBrowserCookie();<NEW_LINE>instance.showDialog(md);<NEW_LINE>}
removeParametersFromQuery(md.getRequestData());
1,076,436
private static ReadOnlyBinaryDictionary createReadOnlyBinaryDictionary(final Context context, final Locale locale) {<NEW_LINE>AssetFileDescriptor afd = null;<NEW_LINE>try {<NEW_LINE>final int resId = DictionaryInfoUtils.getMainDictionaryResourceIdIfAvailableForLocale(context.getResources(), locale);<NEW_LINE>if (0 == resId)<NEW_LINE>return null;<NEW_LINE>afd = context.getResources().openRawResourceFd(resId);<NEW_LINE>if (afd == null) {<NEW_LINE>Log.e(TAG, "Found the resource but it is compressed. resId=" + resId);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final String sourceDir = context.getApplicationInfo().sourceDir;<NEW_LINE>final File packagePath = new File(sourceDir);<NEW_LINE>// TODO: Come up with a way to handle a directory.<NEW_LINE>if (!packagePath.isFile()) {<NEW_LINE>Log.e(TAG, "sourceDir is not a file: " + sourceDir);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new ReadOnlyBinaryDictionary(sourceDir, afd.getStartOffset(), afd.getLength(), false, /* useFullEditDistance */<NEW_LINE>locale, Dictionary.TYPE_MAIN);<NEW_LINE>} catch (android.content.res.Resources.NotFoundException e) {<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>} finally {<NEW_LINE>if (null != afd) {<NEW_LINE>try {<NEW_LINE>afd.close();<NEW_LINE>} catch (java.io.IOException e) {
Log.e(TAG, "Could not find the resource");
1,087,324
protected static String literalBitsComment(CstLiteralBits value, int width) {<NEW_LINE>StringBuffer sb = new StringBuffer(20);<NEW_LINE>sb.append("#");<NEW_LINE>long bits;<NEW_LINE>if (value instanceof CstLiteral64) {<NEW_LINE>bits = ((CstLiteral64) value).getLongBits();<NEW_LINE>} else {<NEW_LINE>bits = value.getIntBits();<NEW_LINE>}<NEW_LINE>switch(width) {<NEW_LINE>case 4:<NEW_LINE>sb.append(Hex.uNibble((int) bits));<NEW_LINE>break;<NEW_LINE>case 8:<NEW_LINE>sb.append(Hex.u1((int) bits));<NEW_LINE>break;<NEW_LINE>case 16:<NEW_LINE>sb.append(Hex.u2((int) bits));<NEW_LINE>break;<NEW_LINE>case 32:<NEW_LINE>sb.append(Hex.u4((int) bits));<NEW_LINE>break;<NEW_LINE>case 64:<NEW_LINE>sb.append<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new RuntimeException("shouldn't happen");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
(Hex.u8(bits));
1,393,824
private void toSlime(String hostname, Cursor object) {<NEW_LINE>Node node = nodeRepository.nodes().node(hostname).orElseThrow(() -> new NotFoundException("No node with hostname '" + hostname + "'"));<NEW_LINE>List<NodeAcl> acls = aclsForChildren ? nodeRepository.getChildAcls(node) : List.of(node.acl(nodeRepository.nodes().list(), nodeRepository.loadBalancers()));<NEW_LINE>Cursor trustedNodesArray = object.setArray("trustedNodes");<NEW_LINE>acls.forEach(nodeAcl -> toSlime(nodeAcl, trustedNodesArray));<NEW_LINE>Cursor trustedNetworksArray = object.setArray("trustedNetworks");<NEW_LINE>acls.forEach(nodeAcl -> toSlime(nodeAcl.trustedNetworks(), nodeAcl.node(), trustedNetworksArray));<NEW_LINE>Cursor trustedPortsArray = object.setArray("trustedPorts");<NEW_LINE>acls.forEach(nodeAcl -> toSlime(nodeAcl.trustedPorts<MASK><NEW_LINE>}
(), nodeAcl, trustedPortsArray));
822,378
protected <T extends Block> BlockEntry<?> createEntry(AbstractRegistrate<?> registrate, Variant<T> variant, WeatherState state, boolean waxed) {<NEW_LINE>String name = "";<NEW_LINE>if (waxed) {<NEW_LINE>name += "waxed_";<NEW_LINE>}<NEW_LINE>name += getWeatherStatePrefix(state);<NEW_LINE>name += this.name;<NEW_LINE>String suffix = variant.getSuffix();<NEW_LINE>if (!suffix.equals(""))<NEW_LINE>name = Lang.nonPluralId(name);<NEW_LINE>name += suffix;<NEW_LINE>Supplier<Block> baseBlock = BASE_BLOCKS.get(state);<NEW_LINE>BlockBuilder<T, ?> builder = registrate.block(name, variant.getFactory(this, state, waxed)).initialProperties(() -> baseBlock.get()).loot((lt, block) -> variant.generateLootTable(lt, block, this, state, waxed)).blockstate((ctx, prov) -> variant.generateBlockState(ctx, prov, this, state, waxed)).recipe((c, p) -> variant.generateRecipes(entries.get(BlockVariant.INSTANCE)[state.ordinal()], c, p)).transform(AllTags.pickaxeOnly()).tag(BlockTags.NEEDS_STONE_TOOL).simpleItem();<NEW_LINE>if (variant == BlockVariant.INSTANCE && state == WeatherState.UNAFFECTED)<NEW_LINE>builder.recipe((c, p) -> mainBlockRecipe.accept(c, p));<NEW_LINE>if (waxed) {<NEW_LINE>builder.recipe((ctx, prov) -> {<NEW_LINE>Block unwaxed = get(variant, state, false).get();<NEW_LINE>ShapelessRecipeBuilder.shapeless(ctx.get()).requires(unwaxed).requires(Items.HONEYCOMB).unlockedBy("has_unwaxed", RegistrateRecipeProvider.has(unwaxed)).save(prov, new ResourceLocation(ctx.getId().getNamespace(), "crafting/" + generalDirectory + ctx<MASK><NEW_LINE>});<NEW_LINE>}<NEW_LINE>return builder.register();<NEW_LINE>}
.getName() + "_from_honeycomb"));
99,893
private static void optimizeOperator(int operator, ASTNode tk, ASTNode tkOp, ASTLinkedList astLinkedList, ASTLinkedList optimizedAst, ParserContext pCtx) {<NEW_LINE>switch(operator) {<NEW_LINE>case Operator.REGEX:<NEW_LINE>optimizedAst.addTokenNode(new RegExMatchNode(tk, astLinkedList.nextNode(), pCtx));<NEW_LINE>break;<NEW_LINE>case Operator.CONTAINS:<NEW_LINE>optimizedAst.addTokenNode(new Contains(tk, astLinkedList.nextNode(), pCtx));<NEW_LINE>break;<NEW_LINE>case Operator.INSTANCEOF:<NEW_LINE>optimizedAst.addTokenNode(new Instance(tk, astLinkedList.nextNode(), pCtx));<NEW_LINE>break;<NEW_LINE>case Operator.CONVERTABLE_TO:<NEW_LINE>optimizedAst.addTokenNode((new Convertable(tk, astLinkedList.nextNode(), pCtx)));<NEW_LINE>break;<NEW_LINE>case Operator.SIMILARITY:<NEW_LINE>optimizedAst.addTokenNode(new Strsim(tk, astLinkedList<MASK><NEW_LINE>break;<NEW_LINE>case Operator.SOUNDEX:<NEW_LINE>optimizedAst.addTokenNode(new Soundslike(tk, astLinkedList.nextNode(), pCtx));<NEW_LINE>break;<NEW_LINE>case TERNARY:<NEW_LINE>if (pCtx.isStrongTyping() && tk.getEgressType() != Boolean.class && tk.getEgressType() != Boolean.TYPE)<NEW_LINE>throw new RuntimeException("Condition of ternary operator is not of type boolean. Found " + tk.getEgressType());<NEW_LINE>default:<NEW_LINE>optimizedAst.addTokenNode(tk, tkOp);<NEW_LINE>}<NEW_LINE>}
.nextNode(), pCtx));
679,801
private Set<String> parseHandlesOutput(File pluginOutputFile) {<NEW_LINE>String line;<NEW_LINE>Set<String> fileSet = new HashSet<>();<NEW_LINE>try (BufferedReader br = new BufferedReader(new FileReader(pluginOutputFile))) {<NEW_LINE>// Ignore the first two header lines<NEW_LINE>br.readLine();<NEW_LINE>br.readLine();<NEW_LINE>while ((line = br.readLine()) != null) {<NEW_LINE>// 0x89ab7878 4 0x718 0x2000003 File \Device\HarddiskVolume1\Documents and Settings\QA\Local Settings\Application<NEW_LINE>if (line.startsWith("0x") == false) {<NEW_LINE>// NON-NLS<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// NON-NLS<NEW_LINE>String TAG = " File ";<NEW_LINE>String file_path;<NEW_LINE>if ((line.contains(TAG)) && (line.length() > 57)) {<NEW_LINE>file_path = line.substring(57);<NEW_LINE>if (file_path.contains("\"")) {<NEW_LINE>// NON-NLS<NEW_LINE>// NON-NLS<NEW_LINE>file_path = file_path.substring(0<MASK><NEW_LINE>}<NEW_LINE>// this file has a lot of device entries that are not files<NEW_LINE>if (file_path.startsWith("\\Device\\")) {<NEW_LINE>// NON-NLS<NEW_LINE>if (file_path.contains("HardDiskVolume") == false) {<NEW_LINE>// NON-NLS<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fileSet.add(normalizePath(file_path));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>errorMsgs.add(Bundle.VolatilityProcessor_errorMessage_outputParsingError("handles"));<NEW_LINE>logger.log(Level.SEVERE, Bundle.VolatilityProcessor_errorMessage_outputParsingError("handles"), ex);<NEW_LINE>}<NEW_LINE>return fileSet;<NEW_LINE>}
, file_path.indexOf('\"'));
255,140
public void marshall(GeneralName generalName, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (generalName == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(generalName.getOtherName(), OTHERNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(generalName.getRfc822Name(), RFC822NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(generalName.getDnsName(), DNSNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(generalName.getDirectoryName(), DIRECTORYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(generalName.getEdiPartyName(), EDIPARTYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(generalName.getUniformResourceIdentifier(), UNIFORMRESOURCEIDENTIFIER_BINDING);<NEW_LINE>protocolMarshaller.marshall(generalName.getIpAddress(), IPADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
generalName.getRegisteredId(), REGISTEREDID_BINDING);
1,524,075
final DBSubnetGroup executeModifyDBSubnetGroup(ModifyDBSubnetGroupRequest modifyDBSubnetGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyDBSubnetGroupRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyDBSubnetGroupRequest> request = null;<NEW_LINE>Response<DBSubnetGroup> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyDBSubnetGroupRequestMarshaller().marshall(super.beforeMarshalling(modifyDBSubnetGroupRequest));<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, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyDBSubnetGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DBSubnetGroup> responseHandler = new StaxResponseHandler<DBSubnetGroup>(new DBSubnetGroupStaxUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics();
154,232
public Module commitModule(@NotNull Project project, @Nullable ModifiableModuleModel model) {<NEW_LINE>final String basePath = getModuleFileDirectory();<NEW_LINE>if (basePath == null) {<NEW_LINE>Messages.showErrorDialog("Module path not set", "Internal Error");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final VirtualFile baseDir = LocalFileSystem.getInstance().refreshAndFindFileByPath(basePath);<NEW_LINE>if (baseDir == null) {<NEW_LINE>Messages.showErrorDialog("Unable to determine Flutter project directory", "Internal Error");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final FlutterSdk sdk = getFlutterSdk();<NEW_LINE>if (sdk == null) {<NEW_LINE>Messages.showErrorDialog("Flutter SDK not found", "Error");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final OutputListener listener = new OutputListener();<NEW_LINE>@NotNull<NEW_LINE>final FlutterCreateAdditionalSettings settings = getAdditionalSettings();<NEW_LINE>settings.setProjectName(super.getName());<NEW_LINE>final PubRoot root = runFlutterCreateWithProgress(baseDir, sdk, project, listener, settings);<NEW_LINE>if (root == null) {<NEW_LINE>final String stderr = listener.getOutput().getStderr();<NEW_LINE>final String msg = stderr.isEmpty() ? "Flutter create command was unsuccessful" : stderr;<NEW_LINE>final int code = FlutterMessages.showDialog(project, msg, "Project Creation Error", new String[] { "Run Flutter Doctor", "Cancel" }, 0);<NEW_LINE>if (code == 0) {<NEW_LINE>new FlutterDoctorAction().startCommand(project, sdk, null);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>FlutterSdkUtil.<MASK><NEW_LINE>// Create the Flutter module. This indirectly calls setupRootModule, etc.<NEW_LINE>final Module flutter = super.commitModule(project, model);<NEW_LINE>if (flutter == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>FlutterModuleUtils.autoShowMain(project, root);<NEW_LINE>showProjectInProjectWindow(project);<NEW_LINE>return flutter;<NEW_LINE>}
updateKnownSdkPaths(sdk.getHomePath());
1,098,896
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>RecyclerView recyclerView = findViewById(R.id.list);<NEW_LINE>recyclerView.setLayoutManager(new LinearLayoutManager(this));<NEW_LINE>List<Type> dataSet = new ArrayList<>();<NEW_LINE>dataSet.add(Type.Mask);<NEW_LINE>dataSet.add(Type.NinePatchMask);<NEW_LINE>dataSet.add(Type.CropCenterTop);<NEW_LINE>dataSet.add(Type.CropCenterCenter);<NEW_LINE>dataSet.add(Type.CropCenterBottom);<NEW_LINE>dataSet.add(Type.CropSquare);<NEW_LINE>dataSet.add(Type.CropCircle);<NEW_LINE>dataSet.add(Type.ColorFilter);<NEW_LINE>dataSet.add(Type.Grayscale);<NEW_LINE>dataSet.add(Type.RoundedCorners);<NEW_LINE>dataSet.add(Type.Blur);<NEW_LINE>dataSet.add(Type.Toon);<NEW_LINE>dataSet.add(Type.Sepia);<NEW_LINE><MASK><NEW_LINE>dataSet.add(Type.Invert);<NEW_LINE>dataSet.add(Type.Pixel);<NEW_LINE>dataSet.add(Type.Sketch);<NEW_LINE>dataSet.add(Type.Swirl);<NEW_LINE>dataSet.add(Type.Brightness);<NEW_LINE>dataSet.add(Type.Kuawahara);<NEW_LINE>dataSet.add(Type.Vignette);<NEW_LINE>dataSet.add(Type.CropLeftTop);<NEW_LINE>dataSet.add(Type.CropLeftCenter);<NEW_LINE>dataSet.add(Type.CropLeftBottom);<NEW_LINE>dataSet.add(Type.CropRightTop);<NEW_LINE>dataSet.add(Type.CropRightCenter);<NEW_LINE>dataSet.add(Type.CropRightBottom);<NEW_LINE>dataSet.add(Type.Crop169CenterCenter);<NEW_LINE>dataSet.add(Type.Crop43CenterCenter);<NEW_LINE>dataSet.add(Type.Crop31CenterCenter);<NEW_LINE>dataSet.add(Type.Crop31CenterTop);<NEW_LINE>dataSet.add(Type.CropSquareCenterCenter);<NEW_LINE>dataSet.add(Type.CropQuarterCenterCenter);<NEW_LINE>dataSet.add(Type.CropQuarterCenterTop);<NEW_LINE>dataSet.add(Type.CropQuarterBottomRight);<NEW_LINE>dataSet.add(Type.CropHalfWidth43CenterCenter);<NEW_LINE>recyclerView.setAdapter(new MainAdapter(this, dataSet));<NEW_LINE>}
dataSet.add(Type.Contrast);
1,028,089
static Index identifyIndexToUse(List<Index> allIndexes) {<NEW_LINE>Index bestCandidateIndex = null;<NEW_LINE>double solrVerFound = 0.0;<NEW_LINE>double schemaVerFound = 0.0;<NEW_LINE>for (Index index : allIndexes) {<NEW_LINE>if (NumberUtils.toDouble(index.getSolrVersion()) > CURRENT_SOLR_VERSION_INT) {<NEW_LINE>// "legacy" Solr server cannot open "future" versions of Solr indexes<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// higher Solr version takes priority because it may negate index upgrade<NEW_LINE>if (NumberUtils.toDouble(index.getSolrVersion()) >= solrVerFound) {<NEW_LINE>// if same solr version, pick the one with highest schema version<NEW_LINE>if (NumberUtils.toDouble(index.getSchemaVersion()) >= schemaVerFound) {<NEW_LINE>bestCandidateIndex = index;<NEW_LINE>solrVerFound = NumberUtils.<MASK><NEW_LINE>schemaVerFound = NumberUtils.toDouble(index.getSchemaVersion());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bestCandidateIndex;<NEW_LINE>}
toDouble(index.getSolrVersion());
1,056,565
private void decodeDescriptorValueLabel(BufferedInputStream stream, int nvar) throws IOException {<NEW_LINE>valueLabelsLookupTable = new String[nvar];<NEW_LINE>int length_label_name = constantTable.get("NAME");<NEW_LINE>int length_label_name_list = length_label_name * nvar;<NEW_LINE>dbgLog.fine("length_label_name=" + length_label_name_list);<NEW_LINE>byte[] labelNameList = new byte[length_label_name_list];<NEW_LINE>String[<MASK><NEW_LINE>int nbytes = stream.read(labelNameList, 0, length_label_name_list);<NEW_LINE>if (nbytes == 0) {<NEW_LINE>throw new IOException("reading value-label list:: no var name was read");<NEW_LINE>}<NEW_LINE>int offset_start = 0;<NEW_LINE>int offset_end = 0;<NEW_LINE>for (int i = 0; i < nvar; i++) {<NEW_LINE>offset_end += length_label_name;<NEW_LINE>String vari = new String(Arrays.copyOfRange(labelNameList, offset_start, offset_end), "ISO-8859-1");<NEW_LINE>labelNames[i] = getNullStrippedString(vari);<NEW_LINE>dbgLog.fine(i + "-th label=[" + labelNames[i] + "]");<NEW_LINE>offset_start = offset_end;<NEW_LINE>}<NEW_LINE>dbgLog.fine("labelNames=\n" + StringUtils.join(labelNames, ",\n") + "\n");<NEW_LINE>for (int i = 0; i < nvar; i++) {<NEW_LINE>if ((labelNames[i] != null) && (!labelNames[i].isEmpty())) {<NEW_LINE>valueLabelsLookupTable[i] = labelNames[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
] labelNames = new String[nvar];
1,272,263
private void writeMetaFile(String className, List<Pair<Element, Integer>> elements, BiConsumer<Pair<Element, Integer>, Map<String, String>> processElement) {<NEW_LINE>final Pair<String, String> pair = splitClassName(className);<NEW_LINE>final String packageName = pair.first();<NEW_LINE>final String simpleClassName = pair.second();<NEW_LINE>final String metaSimpleClassName = "_" + simpleClassName.replace('.', '_') + "Meta";<NEW_LINE>final String metaClassName = packageName + "." + metaSimpleClassName;<NEW_LINE>try {<NEW_LINE>final JavaFileObject builderFile = super.processingEnv.getFiler().createSourceFile(metaClassName);<NEW_LINE>try (final PrintWriter out = new PrintWriter(builderFile.openWriter())) {<NEW_LINE>if (!packageName.isEmpty()) {<NEW_LINE>out.print("package ");<NEW_LINE>out.print(packageName);<NEW_LINE>out.println(";");<NEW_LINE>out.println();<NEW_LINE>}<NEW_LINE>out.println("// Generated at " + OffsetDateTime.now());<NEW_LINE>out.print("public class ");<NEW_LINE>out.print(metaSimpleClassName);<NEW_LINE>out.println(" {");<NEW_LINE>final Map<String, String> metas = new LinkedHashMap<>();<NEW_LINE>for (Pair<Element, Integer> element : elements) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>metas.forEach((k, v) -> out.println(" " + v + ";"));<NEW_LINE>out.println("}");<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException(e);<NEW_LINE>}<NEW_LINE>}
processElement.accept(element, metas);
609,091
public static List<RegressionExecution> executions() {<NEW_LINE>List<RegressionExecution> execs = new ArrayList<>();<NEW_LINE>execs.add(new EPLScriptScripts());<NEW_LINE>execs.add(new EPLScriptQuoteEscape());<NEW_LINE>execs.add(new EPLScriptScriptReturningEvents());<NEW_LINE>execs.add(new EPLScriptDocSamples());<NEW_LINE>execs.add(new EPLScriptInvalidRegardlessDialect());<NEW_LINE>execs.add(new EPLScriptInvalidScriptJS());<NEW_LINE>execs.add(new EPLScriptInvalidScriptMVEL());<NEW_LINE>execs.add(new EPLScriptParserMVELSelectNoArgConstant());<NEW_LINE>execs.add(new EPLScriptJavaScriptStatelessReturnPassArgs());<NEW_LINE>execs.add(new EPLScriptMVELStatelessReturnPassArgs());<NEW_LINE>execs.add(new EPLScriptSubqueryParam());<NEW_LINE>execs<MASK><NEW_LINE>if (TEST_MVEL) {<NEW_LINE>execs.add(new EPLScriptMVELMultiUseWithDeclaredExpr());<NEW_LINE>}<NEW_LINE>execs.add(new EPLScriptGenericResultType());<NEW_LINE>return execs;<NEW_LINE>}
.add(new EPLScriptReturnNullWhenNumeric());
1,235,003
public void encodeTerm(DataOutput out, FieldInfo fieldInfo, BlockTermState _state, boolean absolute) throws IOException {<NEW_LINE>IntBlockTermState state = (IntBlockTermState) _state;<NEW_LINE>if (absolute) {<NEW_LINE>lastState = emptyState;<NEW_LINE>assert lastState.docStartFP == 0;<NEW_LINE>}<NEW_LINE>if (lastState.singletonDocID != -1 && state.singletonDocID != -1 && state.docStartFP == lastState.docStartFP) {<NEW_LINE>// With runs of rare values such as ID fields, the increment of pointers in the docs file is<NEW_LINE>// often 0.<NEW_LINE>// Furthermore some ID schemes like auto-increment IDs or Flake IDs are monotonic, so we<NEW_LINE>// encode the delta<NEW_LINE>// between consecutive doc IDs to save space.<NEW_LINE>final long delta = (long) state.singletonDocID - lastState.singletonDocID;<NEW_LINE>out.writeVLong((BitUtil.zigZagEncode(delta) << 1) | 0x01);<NEW_LINE>} else {<NEW_LINE>out.writeVLong((state.docStartFP - lastState.docStartFP) << 1);<NEW_LINE>if (state.singletonDocID != -1) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (writePositions) {<NEW_LINE>out.writeVLong(state.posStartFP - lastState.posStartFP);<NEW_LINE>if (writePayloads || writeOffsets) {<NEW_LINE>out.writeVLong(state.payStartFP - lastState.payStartFP);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (writePositions) {<NEW_LINE>if (state.lastPosBlockOffset != -1) {<NEW_LINE>out.writeVLong(state.lastPosBlockOffset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (state.skipOffset != -1) {<NEW_LINE>out.writeVLong(state.skipOffset);<NEW_LINE>}<NEW_LINE>lastState = state;<NEW_LINE>}
out.writeVInt(state.singletonDocID);
604,219
public <T extends ImageBase<T>> SimpleImageSequence<T> open(String device, int width, int height, ImageType<T> imageType) {<NEW_LINE>if (device != null) {<NEW_LINE>Webcam webcam;<NEW_LINE>try {<NEW_LINE>int which = Integer.parseInt(device);<NEW_LINE>webcam = Webcam.getWebcams().get(which);<NEW_LINE>} catch (NumberFormatException ignore) {<NEW_LINE>webcam = UtilWebcamCapture.findDevice(device);<NEW_LINE>}<NEW_LINE>if (webcam == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (width >= 0 && height >= 0) {<NEW_LINE>UtilWebcamCapture.adjustResolution(webcam, width, height);<NEW_LINE>}<NEW_LINE>webcam.open();<NEW_LINE>return new SimpleSequence<>(webcam, imageType);<NEW_LINE>} catch (RuntimeException ignore) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new SimpleSequence<>(device, width, height, imageType);<NEW_LINE>}
throw new RuntimeException("Can't find webcam with ID or name at " + device);
850,821
private void writeAsPDF(File file, int w, int h) {<NEW_LINE>if (!ChartUtils.isOrsonPDFAvailable()) {<NEW_LINE>throw new IllegalStateException("OrsonPDF is not present on the classpath.");<NEW_LINE>}<NEW_LINE>Args.nullNotPermitted(file, "file");<NEW_LINE>try {<NEW_LINE>Class<?> pdfDocClass = Class.forName("com.orsonpdf.PDFDocument");<NEW_LINE>Object pdfDoc = pdfDocClass<MASK><NEW_LINE>Method m = pdfDocClass.getMethod("createPage", Rectangle2D.class);<NEW_LINE>Rectangle2D rect = new Rectangle(w, h);<NEW_LINE>Object page = m.invoke(pdfDoc, rect);<NEW_LINE>Method m2 = page.getClass().getMethod("getGraphics2D");<NEW_LINE>Graphics2D g2 = (Graphics2D) m2.invoke(page);<NEW_LINE>// we suppress shadow generation, because PDF is a vector format and<NEW_LINE>// the shadow effect is applied via bitmap effects...<NEW_LINE>g2.setRenderingHint(JFreeChart.KEY_SUPPRESS_SHADOW_GENERATION, true);<NEW_LINE>Rectangle2D drawArea = new Rectangle2D.Double(0, 0, w, h);<NEW_LINE>this.chart.draw(g2, drawArea);<NEW_LINE>Method m3 = pdfDocClass.getMethod("writeToFile", File.class);<NEW_LINE>m3.invoke(pdfDoc, file);<NEW_LINE>} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException | SecurityException | IllegalArgumentException | InvocationTargetException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>}
.getDeclaredConstructor().newInstance();
1,312,239
public static AutogenEnvironmentDiff fromProto(ai.verta.modeldb.versioning.EnvironmentDiff blob) {<NEW_LINE>if (blob == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>AutogenEnvironmentDiff obj = new AutogenEnvironmentDiff();<NEW_LINE>{<NEW_LINE>Function<ai.verta.modeldb.versioning.EnvironmentDiff, AutogenCommandLineEnvironmentDiff> f = x -> AutogenCommandLineEnvironmentDiff.fromProto(blob.getCommandLine());<NEW_LINE>obj.setCommandLine(f.apply(blob));<NEW_LINE>}<NEW_LINE>{<NEW_LINE>Function<ai.verta.modeldb.versioning.EnvironmentDiff, AutogenDockerEnvironmentDiff> f = x -> AutogenDockerEnvironmentDiff.<MASK><NEW_LINE>obj.setDocker(f.apply(blob));<NEW_LINE>}<NEW_LINE>{<NEW_LINE>Function<ai.verta.modeldb.versioning.EnvironmentDiff, List<AutogenEnvironmentVariablesDiff>> f = x -> blob.getEnvironmentVariablesList().stream().map(AutogenEnvironmentVariablesDiff::fromProto).collect(Collectors.toList());<NEW_LINE>obj.setEnvironmentVariables(f.apply(blob));<NEW_LINE>}<NEW_LINE>{<NEW_LINE>Function<ai.verta.modeldb.versioning.EnvironmentDiff, AutogenPythonEnvironmentDiff> f = x -> AutogenPythonEnvironmentDiff.fromProto(blob.getPython());<NEW_LINE>obj.setPython(f.apply(blob));<NEW_LINE>}<NEW_LINE>return obj;<NEW_LINE>}
fromProto(blob.getDocker());
996,926
public void createIcon(Context context, long did) {<NEW_LINE>// This code should not be reachable with lower versions<NEW_LINE>ShortcutInfoCompat shortcut = new ShortcutInfoCompat.Builder(this, Long.toString(did)).setIntent(new Intent(context, Reviewer.class).setAction(Intent.ACTION_VIEW).putExtra("deckId", did)).setIcon(IconCompat.createWithResource(context, R.mipmap.ic_launcher)).setShortLabel(Decks.basename(getCol().getDecks().name(did))).setLongLabel(getCol().getDecks().name(did)).build();<NEW_LINE>try {<NEW_LINE>boolean success = ShortcutManagerCompat.<MASK><NEW_LINE>// User report: "success" is true even if Vivo does not have permission<NEW_LINE>if (AdaptionUtil.isVivo()) {<NEW_LINE>UIUtils.showThemedToast(this, getString(R.string.create_shortcut_error_vivo), false);<NEW_LINE>}<NEW_LINE>if (!success) {<NEW_LINE>UIUtils.showThemedToast(this, getString(R.string.create_shortcut_failed), false);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Timber.w(e);<NEW_LINE>UIUtils.showThemedToast(this, getString(R.string.create_shortcut_error, e.getLocalizedMessage()), false);<NEW_LINE>}<NEW_LINE>}
requestPinShortcut(this, shortcut, null);
850,971
final DeleteDeploymentStrategyResult executeDeleteDeploymentStrategy(DeleteDeploymentStrategyRequest deleteDeploymentStrategyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDeploymentStrategyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDeploymentStrategyRequest> request = null;<NEW_LINE>Response<DeleteDeploymentStrategyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDeploymentStrategyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDeploymentStrategyRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AppConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDeploymentStrategy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDeploymentStrategyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>}
false), new DeleteDeploymentStrategyResultJsonUnmarshaller());
1,384,101
public HKerberosThriftClient open() {<NEW_LINE>if (isOpen()) {<NEW_LINE>throw new IllegalStateException("Open called on already open connection. You should not have gotten here.");<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Creating a new thrift connection to {}", cassandraHost);<NEW_LINE>}<NEW_LINE>TSocket socket;<NEW_LINE>try {<NEW_LINE>socket = params == null ? new TSocket(cassandraHost.getHost(), cassandraHost.getPort(), timeout) : TSSLTransportFactory.getClientSocket(cassandraHost.getHost(), cassandraHost.<MASK><NEW_LINE>} catch (TTransportException e) {<NEW_LINE>throw new HectorTransportException("Could not get client socket: ", e);<NEW_LINE>}<NEW_LINE>if (cassandraHost.getUseSocketKeepalive()) {<NEW_LINE>try {<NEW_LINE>socket.getSocket().setKeepAlive(true);<NEW_LINE>} catch (SocketException se) {<NEW_LINE>throw new HectorTransportException("Could not set SO_KEEPALIVE on socket: ", se);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO (patricioe) What should I do with it ?<NEW_LINE>// KerberosHelper.getSourcePrinciple(clientContext));<NEW_LINE>transport = maybeWrapWithTFramedTransport(socket);<NEW_LINE>try {<NEW_LINE>transport.open();<NEW_LINE>} catch (TTransportException e) {<NEW_LINE>// Thrift exceptions aren't very good in reporting, so we have to catch the exception here and<NEW_LINE>// add details to it.<NEW_LINE>log.debug("Unable to open transport to " + cassandraHost.getName());<NEW_LINE>// clientMonitor.incCounter(Counter.CONNECT_ERROR);<NEW_LINE>throw new HectorTransportException("Unable to open transport to " + cassandraHost.getName() + " , " + e.getLocalizedMessage(), e);<NEW_LINE>}<NEW_LINE>// Kerberos authentication<NEW_LINE>Socket internalSocket = socket.getSocket();<NEW_LINE>final GSSContext clientContext = KerberosHelper.authenticateClient(internalSocket, kerberosTicket, servicePrincipalName);<NEW_LINE>if (clientContext == null) {<NEW_LINE>close();<NEW_LINE>throw new HectorTransportException("Kerberos context couldn't be established with client.");<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
getPort(), timeout, params);
847,652
public List<String> watchedVideosByFriends(List<List<String>> watchedVideos, int[][] friends, int id, int level) {<NEW_LINE>int n = friends.length;<NEW_LINE>boolean[<MASK><NEW_LINE>Deque<Integer> q = new LinkedList<>();<NEW_LINE>q.offerLast(id);<NEW_LINE>vis[id] = true;<NEW_LINE>while (level-- > 0) {<NEW_LINE>for (int i = q.size(); i > 0; --i) {<NEW_LINE>int u = q.pollFirst();<NEW_LINE>for (int v : friends[u]) {<NEW_LINE>if (!vis[v]) {<NEW_LINE>q.offerLast(v);<NEW_LINE>vis[v] = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, Integer> freq = new HashMap<>();<NEW_LINE>while (!q.isEmpty()) {<NEW_LINE>for (String w : watchedVideos.get(q.pollFirst())) {<NEW_LINE>freq.put(w, freq.getOrDefault(w, 0) + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Map.Entry<String, Integer>> t = new ArrayList<>(freq.entrySet());<NEW_LINE>t.sort((a, b) -> {<NEW_LINE>if (a.getValue() > b.getValue()) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>if (a.getValue() < b.getValue()) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>return a.getKey().compareTo(b.getKey());<NEW_LINE>});<NEW_LINE>List<String> ans = new ArrayList<>();<NEW_LINE>for (Map.Entry<String, Integer> e : t) {<NEW_LINE>ans.add(e.getKey());<NEW_LINE>}<NEW_LINE>return ans;<NEW_LINE>}
] vis = new boolean[n];
1,846,194
private boolean evaluateIsoSurface(VecD up, VecD direction) {<NEW_LINE>VecD pos = getFirstIntersectionWithHint(direction);<NEW_LINE>if (pos == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>VecD right = direction.cross(up).normalize().multiply(SMOOTHNESS_ROTATION / SMOOTHNESS_GRID_SIZE);<NEW_LINE>up = up.multiply(SMOOTHNESS_ROTATION / SMOOTHNESS_GRID_SIZE);<NEW_LINE>// Generate the samples to compute the normal.<NEW_LINE>VecD[] grid = new VecD[SMOOTHNESS_GRID_SIZE * SMOOTHNESS_GRID_SIZE];<NEW_LINE>int size = (SMOOTHNESS_GRID_SIZE - 1) / 2;<NEW_LINE>for (int y = -size, index = 0; y <= size; y++) {<NEW_LINE>for (int x = -size; x <= size; x++, index++) {<NEW_LINE>grid[index] = pos.addScaled(up, y).addScaled(right, x);<NEW_LINE>VecD dir = grid[index].multiply(-1).normalize();<NEW_LINE>if ((grid[index] = rayCaster.getIntersection(grid[index], dir)) == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Compute the normal based on the sampling grid.<NEW_LINE>VecD normal = new VecD();<NEW_LINE>for (int y = 0; y < SMOOTHNESS_GRID_SIZE - 1; y++) {<NEW_LINE>for (int x = 0; x < SMOOTHNESS_GRID_SIZE - 1; x++) {<NEW_LINE>int p0 = y * SMOOTHNESS_GRID_SIZE + x;<NEW_LINE>int p1 = (y + 1) * SMOOTHNESS_GRID_SIZE + x;<NEW_LINE>int p2 = y * SMOOTHNESS_GRID_SIZE + x + 1;<NEW_LINE>VecD upOffset = grid[p1].subtract(grid[p0]);<NEW_LINE>VecD rightOffset = grid[p2].subtract(grid[p0]);<NEW_LINE>normal = normal.add(rightOffset.cross(upOffset).normalize());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>normal = normal.normalize();<NEW_LINE>up = grid[INDEX_OF_Y1_X0].subtract(pos).normalize();<NEW_LINE>pos = pos.addScaled(normal, inflation);<NEW_LINE>// Interpolate the isosurface position & direction with the base's based on the zoom amount.<NEW_LINE>double zoom = getZoom();<NEW_LINE>normal = normal.multiply(-1).lerp(direction, zoom);<NEW_LINE>pos = pos.lerp(direction.multiply(-MAX_DISTANCE), zoom);<NEW_LINE>viewTransform = MatD.lookAt(pos, pos<MASK><NEW_LINE>return true;<NEW_LINE>}
.add(normal), up);
1,502,868
public String _nextDueMsg(@NonNull Context context) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>if (revDue()) {<NEW_LINE>sb.append("\n\n");<NEW_LINE>sb.append(context.getString(R.string.studyoptions_congrats_more_rev));<NEW_LINE>}<NEW_LINE>if (newDue()) {<NEW_LINE>sb.append("\n\n");<NEW_LINE>sb.append(context.getString(R.string.studyoptions_congrats_more_new));<NEW_LINE>}<NEW_LINE>if (haveBuried()) {<NEW_LINE>String now = " " + context.<MASK><NEW_LINE>sb.append("\n\n");<NEW_LINE>sb.append("").append(context.getString(R.string.sched_has_buried)).append(now);<NEW_LINE>}<NEW_LINE>if (mCol.getDecks().current().isStd()) {<NEW_LINE>sb.append("\n\n");<NEW_LINE>sb.append(context.getString(R.string.studyoptions_congrats_custom));<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
getString(R.string.sched_unbury_action);
1,812,339
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see com.aptana.preview.IPreviewHandler#handle(com.aptana.preview.SourceConfig)<NEW_LINE>*/<NEW_LINE>public PreviewConfig handle(SourceConfig config) throws CoreException {<NEW_LINE>if (config.getContent() != null) {<NEW_LINE>// we're not handling content preview requests<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>IURIMapper serverConfiguration = ProjectPreviewUtil.<MASK><NEW_LINE>try {<NEW_LINE>if (serverConfiguration != null) {<NEW_LINE>URI uri = serverConfiguration.resolve(config.getFileStore());<NEW_LINE>if (uri != null) {<NEW_LINE>return new PreviewConfig(uri.toURL());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (IURIMapper configuration : WebServerCorePlugin.getDefault().getServerManager().getServers()) {<NEW_LINE>URI uri = configuration.resolve(config.getFileStore());<NEW_LINE>if (uri != null) {<NEW_LINE>return new PreviewConfig(uri.toURL());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>PreviewPlugin.log(e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
getServerConfiguration(config.getProject());
725,564
private void init(Context context, AttributeSet attrs) {<NEW_LINE>LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);<NEW_LINE>inflater.inflate(R.layout.layout_slidebar, this, true);<NEW_LINE>backgroundView = findViewById(R.id.slidebar_root_bg);<NEW_LINE>mText = findViewById(R.id.slidebar_text_label);<NEW_LINE>floatBackground = findViewById(R.id.slidebar_float_background);<NEW_LINE>floatView = findViewById(R.id.slidebar_float_view);<NEW_LINE>if (attrs != null) {<NEW_LINE>TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.UnlockBar);<NEW_LINE>String label = a.getString(R.styleable.UnlockBar_label);<NEW_LINE>mText.setText(label);<NEW_LINE>textAlign = a.getInt(<MASK><NEW_LINE>a.recycle();<NEW_LINE>} else {<NEW_LINE>textAlign = TEXT_ALIGN_CENTER_EXCEPT_THUMB;<NEW_LINE>}<NEW_LINE>// if (textAlign == TEXT_ALIGN_CENTER_EXCEPT_THUMB) {<NEW_LINE>// FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) mText.getLayoutParams();<NEW_LINE>// params.setMargins(context.getResources().getDimensionPixelSize(R.dimen.slidebar_thumb_width) / 2, 0, 0, 0);<NEW_LINE>// mText.setLayoutParams(params);<NEW_LINE>// }<NEW_LINE>LayoutParams params = (LayoutParams) floatView.getLayoutParams();<NEW_LINE>ViewGroup p = (ViewGroup) floatBackground.getParent();<NEW_LINE>thumbWidth = p.getPaddingLeft() + p.getPaddingRight() + params.leftMargin + params.rightMargin + context.getResources().getDimensionPixelSize(R.dimen.slidebar_thumb_width);<NEW_LINE>}
R.styleable.UnlockBar_textAlign, TEXT_ALIGN_CENTER);
1,229,022
public Message<?> postProcessResult(Object result, Message<?> input) {<NEW_LINE>Object convertedResult = result;<NEW_LINE>if (this.messageConverter != null && CLOUD_EVENT_CLASS != null && CLOUD_EVENT_CLASS.isAssignableFrom(result.getClass())) {<NEW_LINE>convertedResult = this.messageConverter.toMessage(result, input.getHeaders());<NEW_LINE>}<NEW_LINE>String targetPrefix = CloudEventMessageUtils.DEFAULT_ATTR_PREFIX;<NEW_LINE>if (input != null) {<NEW_LINE>targetPrefix = CloudEventMessageUtils.determinePrefixToUse(input.getHeaders(), true);<NEW_LINE>} else if (result instanceof Message) {<NEW_LINE>targetPrefix = CloudEventMessageUtils.determinePrefixToUse(((Message<?>) result).getHeaders(), true);<NEW_LINE>}<NEW_LINE>Assert.hasText(<MASK><NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Cloud event attributes will be prefixed with '" + targetPrefix + "'");<NEW_LINE>}<NEW_LINE>return this.doPostProcessResult(convertedResult, targetPrefix);<NEW_LINE>}
targetPrefix, "Unable to determine prefix for Cloud Event atttributes, " + "which they must have according to protocol specification. Consider adding 'target-protocol' " + "header with values of one of the supported protocols - [kafka, amqp, http]");
113,678
final GetEnabledStandardsResult executeGetEnabledStandards(GetEnabledStandardsRequest getEnabledStandardsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getEnabledStandardsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetEnabledStandardsRequest> request = null;<NEW_LINE>Response<GetEnabledStandardsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetEnabledStandardsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getEnabledStandardsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SecurityHub");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetEnabledStandards");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetEnabledStandardsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetEnabledStandardsResultJsonUnmarshaller());<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.CLIENT_ENDPOINT, endpoint);