idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,020,607 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.games_info);<NEW_LINE>WindowManager.LayoutParams lp = new WindowManager.LayoutParams();<NEW_LINE>lp.copyFrom(getWindow().getAttributes());<NEW_LINE>lp.width = WindowManager.LayoutParams.MATCH_PARENT;<NEW_LINE>lp.height = WindowManager.LayoutParams.WRAP_CONTENT;<NEW_LINE>getWindow().setAttributes(lp);<NEW_LINE>String packageName = getIntent().getStringExtra(EXTRA_GAME_PACACKE_NAME);<NEW_LINE>// receive package info<NEW_LINE>PackageManager packageManager = getPackageManager();<NEW_LINE>ApplicationInfo applicationInfo;<NEW_LINE>try {<NEW_LINE>applicationInfo = <MASK><NEW_LINE>} catch (PackageManager.NameNotFoundException e) {<NEW_LINE>Log.w(TAG, e);<NEW_LINE>finish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CharSequence appLabel = packageManager.getApplicationLabel(applicationInfo);<NEW_LINE>Drawable appIcon = packageManager.getApplicationIcon(applicationInfo);<NEW_LINE>((ImageView) findViewById(R.id.app_icon)).setImageDrawable(appIcon);<NEW_LINE>((TextView) findViewById(R.id.title)).setText(getString(R.string.games_info_title, appLabel));<NEW_LINE>findViewById(android.R.id.button1).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | packageManager.getApplicationInfo(packageName, 0); |
1,106,476 | void findHistogramPeaks() {<NEW_LINE>// reset data structures<NEW_LINE>peaks.reset();<NEW_LINE>angles.reset();<NEW_LINE>peakAngle = 0;<NEW_LINE>// identify peaks and find the highest peak<NEW_LINE>double largest = 0;<NEW_LINE>int largestIndex = -1;<NEW_LINE>double before = histogramMag[histogramMag.length - 2];<NEW_LINE>double current = histogramMag[histogramMag.length - 1];<NEW_LINE>for (int i = 0; i < histogramMag.length; i++) {<NEW_LINE>double after = histogramMag[i];<NEW_LINE>if (current > before && current > after) {<NEW_LINE>int currentIndex = CircularIndex.addOffset(i, -1, histogramMag.length);<NEW_LINE>peaks.push(currentIndex);<NEW_LINE>if (current > largest) {<NEW_LINE>largest = current;<NEW_LINE>largestIndex = currentIndex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>before = current;<NEW_LINE>current = after;<NEW_LINE>}<NEW_LINE>if (largestIndex < 0)<NEW_LINE>return;<NEW_LINE>// see if any of the other peaks are within 80% of the max peak<NEW_LINE>double threshold = largest * 0.8;<NEW_LINE>for (int i = 0; i < peaks.size; i++) {<NEW_LINE>int <MASK><NEW_LINE>current = histogramMag[index];<NEW_LINE>if (current >= threshold) {<NEW_LINE>double angle = computeAngle(index);<NEW_LINE>angles.push(angle);<NEW_LINE>if (index == largestIndex)<NEW_LINE>peakAngle = angle;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | index = peaks.data[i]; |
1,770,572 | public CoverageStringFilter unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CoverageStringFilter coverageStringFilter = new CoverageStringFilter();<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("comparison", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>coverageStringFilter.setComparison(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("value", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>coverageStringFilter.setValue(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 coverageStringFilter;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
983,050 | private void loadNode132() {<NEW_LINE>ExclusiveLimitStateMachineTypeNode node = new ExclusiveLimitStateMachineTypeNode(this.context, Identifiers.ExclusiveLimitAlarmType_LimitState, new QualifiedName(0, "LimitState"), new LocalizedText("en", "LimitState"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), UByte.valueOf(0));<NEW_LINE>node.addReference(new Reference(Identifiers.ExclusiveLimitAlarmType_LimitState, Identifiers.HasComponent, Identifiers.ExclusiveLimitAlarmType_LimitState_CurrentState.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ExclusiveLimitAlarmType_LimitState, Identifiers.HasComponent, Identifiers.ExclusiveLimitAlarmType_LimitState_LastTransition.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ExclusiveLimitAlarmType_LimitState, Identifiers.HasTrueSubState, Identifiers.ExclusiveLimitAlarmType_ActiveState<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ExclusiveLimitAlarmType_LimitState, Identifiers.HasTypeDefinition, Identifiers.ExclusiveLimitStateMachineType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ExclusiveLimitAlarmType_LimitState, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ExclusiveLimitAlarmType_LimitState, Identifiers.HasComponent, Identifiers.ExclusiveLimitAlarmType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), false)); |
498,504 | public void sendResponse(RestResponse response) {<NEW_LINE>resp.setContentType(response.contentType());<NEW_LINE>resp.addHeader("Access-Control-Allow-Origin", "*");<NEW_LINE>if (response.status() != null) {<NEW_LINE>resp.setStatus(response.status().getStatus());<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (restRequest.method() == RestRequest.Method.OPTIONS) {<NEW_LINE>// also add more access control parameters<NEW_LINE>resp.addHeader("Access-Control-Max-Age", "1728000");<NEW_LINE>resp.addHeader("Access-Control-Allow-Methods", "OPTIONS, HEAD, GET, POST, PUT, DELETE");<NEW_LINE>resp.addHeader("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, Content-Length");<NEW_LINE>}<NEW_LINE>ServletOutputStream out = null;<NEW_LINE>try {<NEW_LINE>int contentLength = response.content().length();<NEW_LINE>resp.setContentLength(contentLength);<NEW_LINE>out = resp.getOutputStream();<NEW_LINE>response.content().writeTo(out);<NEW_LINE>} catch (IOException e) {<NEW_LINE>sendFailure = e;<NEW_LINE>} finally {<NEW_LINE>if (out != null) {<NEW_LINE>try {<NEW_LINE>out.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>latch.countDown();<NEW_LINE>}<NEW_LINE>} | resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); |
176,545 | public long writeData(final InputStream data) throws IOException, ResourceModelSourceException {<NEW_LINE>if (!isDataWritable()) {<NEW_LINE>throw new IllegalArgumentException("Cannot write to file, it is not configured to be writeable");<NEW_LINE>}<NEW_LINE>ResourceFormatParser resourceFormat = getResourceFormatParser();<NEW_LINE>// validate data<NEW_LINE>File temp = Files.createTempFile("temp", "." + resourceFormat.getPreferredFileExtension()).toFile();<NEW_LINE>temp.deleteOnExit();<NEW_LINE>try {<NEW_LINE>try (FileOutputStream fos = new FileOutputStream(temp)) {<NEW_LINE>Streams.copyStream(data, fos);<NEW_LINE>}<NEW_LINE>final ResourceFormatParser parser = getResourceFormatParser();<NEW_LINE>try {<NEW_LINE>final INodeSet <MASK><NEW_LINE>} catch (ResourceFormatParserException e) {<NEW_LINE>throw new ResourceModelSourceException(e);<NEW_LINE>}<NEW_LINE>try (FileInputStream tempStream = new FileInputStream(temp)) {<NEW_LINE>return writeFileData(temp.length(), tempStream);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>temp.delete();<NEW_LINE>}<NEW_LINE>} | set = parser.parseDocument(temp); |
1,203,280 | protected String doIt() throws Exception {<NEW_LINE>final ProcessInfo processInfo = getProcessInfo();<NEW_LINE>final boolean jsonPathMissing = !processInfo.getJsonPath().isPresent();<NEW_LINE>if (jsonPathMissing) {<NEW_LINE>throw new AdempiereException("JSONPath is missing!").appendParametersToMessage(<MASK><NEW_LINE>}<NEW_LINE>final PostgRESTConfig config = configRepository.getConfigFor(processInfo.getOrgId());<NEW_LINE>final PostgRESTResponseFormat responseFormat = PostgRESTResponseFormat.ofCode(processDAO.getById(getProcessInfo().getAdProcessId()).getPostgrestResponseFormat());<NEW_LINE>final String rawJSONPath = processInfo.getJsonPath().get();<NEW_LINE>final IStringExpression pathExpression = expressionFactory.compile(prepareJSONPath(rawJSONPath), IStringExpression.class);<NEW_LINE>final String path = pathExpression.evaluate(getEvalContext(), IExpressionEvaluator.OnVariableNotFound.Fail);<NEW_LINE>final GetRequest getRequest = GetRequest.builder().baseURL(config.getBaseURL() + path).responseFormat(responseFormat).build();<NEW_LINE>final String postgRESTResponse = postgRESTClient.performGet(getRequest);<NEW_LINE>processInfo.getResult().setStringResult(postgRESTResponse, responseFormat.getContentType());<NEW_LINE>return MSG_OK;<NEW_LINE>} | ).setParameter("processInfo", processInfo); |
980,244 | private void createLogRecord(@NonNull final GOClientLogEvent event) {<NEW_LINE>final I_GO_DeliveryOrder_Log logRecord = InterfaceWrapperHelper.newInstance(I_GO_DeliveryOrder_Log.class);<NEW_LINE>logRecord.setAction(event.getAction());<NEW_LINE>logRecord.setGO_ConfigSummary(event.getConfigSummary());<NEW_LINE>logRecord.setDurationMillis((int) event.getDurationMillis());<NEW_LINE>if (event.getDeliveryOrderRepoId() > 0) {<NEW_LINE>logRecord.setGO_DeliveryOrder_ID(event.getDeliveryOrderRepoId());<NEW_LINE>}<NEW_LINE>logRecord.setRequestMessage(event.getRequestAsString());<NEW_LINE>if (event.getResponseException() != null) {<NEW_LINE>logRecord.setIsError(true);<NEW_LINE>final AdIssueId issueId = Services.get(IErrorManager.class).createIssue(event.getResponseException());<NEW_LINE>logRecord.<MASK><NEW_LINE>} else {<NEW_LINE>logRecord.setIsError(false);<NEW_LINE>logRecord.setResponseMessage(event.getResponseAsString());<NEW_LINE>}<NEW_LINE>InterfaceWrapperHelper.save(logRecord);<NEW_LINE>} | setAD_Issue_ID(issueId.getRepoId()); |
828,348 | final StopPipelineExecutionResult executeStopPipelineExecution(StopPipelineExecutionRequest stopPipelineExecutionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopPipelineExecutionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopPipelineExecutionRequest> request = null;<NEW_LINE>Response<StopPipelineExecutionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopPipelineExecutionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopPipelineExecutionRequest));<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, "CodePipeline");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopPipelineExecution");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StopPipelineExecutionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopPipelineExecutionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
766,828 | public static StdoutHandler inject(List<CliToken> tokens) {<NEW_LINE>List<String> args = StdoutHandler.parseArgs(tokens, NAME);<NEW_LINE>GrepCommand grepCommand = new GrepCommand();<NEW_LINE>if (cli == null) {<NEW_LINE>cli = CLIConfigurator.define(GrepCommand.class);<NEW_LINE>}<NEW_LINE>CommandLine commandLine = <MASK><NEW_LINE>try {<NEW_LINE>CLIConfigurator.inject(commandLine, grepCommand);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>int context = grepCommand.getContext();<NEW_LINE>int beforeLines = grepCommand.getBeforeLines();<NEW_LINE>int afterLines = grepCommand.getAfterLines();<NEW_LINE>if (context > 0) {<NEW_LINE>if (beforeLines < 1) {<NEW_LINE>beforeLines = context;<NEW_LINE>}<NEW_LINE>if (afterLines < 1) {<NEW_LINE>afterLines = context;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new GrepHandler(grepCommand.getPattern(), grepCommand.isIgnoreCase(), grepCommand.isInvertMatch(), grepCommand.isRegEx(), grepCommand.isShowLineNumber(), grepCommand.isTrimEnd(), beforeLines, afterLines, grepCommand.getMaxCount());<NEW_LINE>} | cli.parse(args, true); |
90,393 | // Initialize a BundleData from a resource quota and configurations and modify the quota accordingly.<NEW_LINE>private BundleData initializeBundleData(final ResourceQuota quota, final ShellArguments arguments) {<NEW_LINE>final double messageRate = (quota.getMsgRateIn() + quota.getMsgRateOut()) / 2;<NEW_LINE>final int messageSize = (int) Math.ceil((quota.getBandwidthIn() + quota.getBandwidthOut()) / (2 * messageRate));<NEW_LINE>arguments.rate = messageRate * arguments.rateMultiplier;<NEW_LINE>arguments.size = messageSize;<NEW_LINE>final NamespaceBundleStats startingStats = new NamespaceBundleStats();<NEW_LINE>// Modify the original quota so that new rates are set.<NEW_LINE>final <MASK><NEW_LINE>final double modifiedBandwidth = (quota.getBandwidthIn() + quota.getBandwidthOut()) * arguments.rateMultiplier / 2;<NEW_LINE>quota.setMsgRateIn(modifiedRate);<NEW_LINE>quota.setMsgRateOut(modifiedRate);<NEW_LINE>quota.setBandwidthIn(modifiedBandwidth);<NEW_LINE>quota.setBandwidthOut(modifiedBandwidth);<NEW_LINE>// Assume modified memory usage is comparable to the rate multiplier times the original usage.<NEW_LINE>quota.setMemory(quota.getMemory() * arguments.rateMultiplier);<NEW_LINE>startingStats.msgRateIn = quota.getMsgRateIn();<NEW_LINE>startingStats.msgRateOut = quota.getMsgRateOut();<NEW_LINE>startingStats.msgThroughputIn = quota.getBandwidthIn();<NEW_LINE>startingStats.msgThroughputOut = quota.getBandwidthOut();<NEW_LINE>final BundleData bundleData = new BundleData(10, 1000, startingStats);<NEW_LINE>// Assume there is ample history for the bundle.<NEW_LINE>bundleData.getLongTermData().setNumSamples(1000);<NEW_LINE>bundleData.getShortTermData().setNumSamples(10);<NEW_LINE>return bundleData;<NEW_LINE>} | double modifiedRate = messageRate * arguments.rateMultiplier; |
191,296 | public void testTwoTasksInOneTransaction(PrintWriter out) throws Exception {<NEW_LINE>DBIncrementTask taskA = new DBIncrementTask("testTwoTasksInOneTransaction-A");<NEW_LINE>DBIncrementTask taskB = new DBIncrementTask("testTwoTasksInOneTransaction-B");<NEW_LINE>taskA.getExecutionProperties().put(AutoPurge.PROPERTY_NAME, AutoPurge.NEVER.toString());<NEW_LINE>taskB.getExecutionProperties().put(AutoPurge.PROPERTY_NAME, AutoPurge.NEVER.toString());<NEW_LINE>TaskStatus<Integer> statusA;<NEW_LINE>TaskStatus<Integer> statusB;<NEW_LINE>tran.begin();<NEW_LINE>try {<NEW_LINE>statusA = scheduler.submit((Callable<Integer>) taskA);<NEW_LINE>statusB = scheduler.schedule((Callable<Integer>) taskB, 13, TimeUnit.MICROSECONDS);<NEW_LINE>statusA = scheduler.<MASK><NEW_LINE>if (statusA.hasResult())<NEW_LINE>throw new Exception("Task shouldn't start until transaction in which it was scheduled commits. " + statusA);<NEW_LINE>} finally {<NEW_LINE>tran.commit();<NEW_LINE>}<NEW_LINE>for (long start = System.nanoTime(); System.nanoTime() - start < TIMEOUT_NS && (statusA = scheduler.getStatus(statusA.getTaskId())) != null && !(statusA.hasResult() && Integer.valueOf(1).equals(statusA.getResult())); ) Thread.sleep(POLL_INTERVAL);<NEW_LINE>if (statusA == null || !statusA.isDone() || !Integer.valueOf(1).equals(statusA.getResult()))<NEW_LINE>throw new Exception("TaskA not completed with expected result in allotted interval. Status: " + statusA);<NEW_LINE>for (long start = System.nanoTime(); System.nanoTime() - start < TIMEOUT_NS && (statusB = scheduler.getStatus(statusB.getTaskId())) != null && !(statusB.hasResult() && Integer.valueOf(1).equals(statusB.getResult())); ) Thread.sleep(POLL_INTERVAL);<NEW_LINE>if (statusB == null || !statusB.isDone() || !Integer.valueOf(1).equals(statusB.getResult()))<NEW_LINE>throw new Exception("TaskB not completed with expected result in allotted interval. Status: " + statusB);<NEW_LINE>} | getStatus(statusA.getTaskId()); |
40,922 | public static void startSpringControllerMethod(String className, String methodName, String methodDesc, Object this1, Object[] arg) {<NEW_LINE>TraceContext ctx = TraceContextManager.getContext(true);<NEW_LINE>if (ctx == null)<NEW_LINE>return;<NEW_LINE>if (conf.profile_spring_controller_method_parameter_enabled) {<NEW_LINE>if (arg == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int start_time = (int) (System.currentTimeMillis() - ctx.startTime);<NEW_LINE>for (int i = 0; i < arg.length; i++) {<NEW_LINE>if (arg[i] == null)<NEW_LINE>continue;<NEW_LINE>String value = "param: " + StringUtil.limiting(arg[i<MASK><NEW_LINE>MessageStep step = new MessageStep(value);<NEW_LINE>step.start_time = start_time;<NEW_LINE>ctx.profile.add(step);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PluginSpringControllerCaptureTrace.capArgs(ctx, new HookArgs(className, methodName, methodDesc, this1, arg));<NEW_LINE>} | ].toString(), 1024); |
1,171,582 | void findUsages(@Nonnull FindUsagesProcessPresentation processPresentation, @Nonnull Processor<? super UsageInfo> consumer) {<NEW_LINE>CoreProgressManager.assertUnderProgress(myProgress);<NEW_LINE>try {<NEW_LINE>myProgress.setIndeterminate(true);<NEW_LINE>myProgress.setText<MASK><NEW_LINE>Set<VirtualFile> filesForFastWordSearch = ReadAction.compute(this::getFilesForFastWordSearch);<NEW_LINE>myProgress.setIndeterminate(false);<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Searching for " + myFindModel.getStringToFind() + " in " + filesForFastWordSearch.size() + " indexed files");<NEW_LINE>}<NEW_LINE>searchInFiles(filesForFastWordSearch, processPresentation, consumer);<NEW_LINE>myProgress.setIndeterminate(true);<NEW_LINE>myProgress.setText(FindBundle.message("progress.text.scanning.non.indexed.files"));<NEW_LINE>boolean canRelyOnIndices = canRelyOnSearchers();<NEW_LINE>final Collection<VirtualFile> otherFiles = collectFilesInScope(filesForFastWordSearch, canRelyOnIndices);<NEW_LINE>myProgress.setIndeterminate(false);<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Searching for " + myFindModel.getStringToFind() + " in " + otherFiles.size() + " non-indexed files");<NEW_LINE>}<NEW_LINE>myProgress.checkCanceled();<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>searchInFiles(otherFiles, processPresentation, consumer);<NEW_LINE>if (canRelyOnIndices && otherFiles.size() > 1000) {<NEW_LINE>long time = System.currentTimeMillis() - start;<NEW_LINE>logStats(otherFiles, time);<NEW_LINE>}<NEW_LINE>} catch (ProcessCanceledException e) {<NEW_LINE>processPresentation.setCanceled(true);<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Usage search canceled", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!myLargeFiles.isEmpty()) {<NEW_LINE>processPresentation.setLargeFilesWereNotScanned(myLargeFiles);<NEW_LINE>}<NEW_LINE>if (!myProgress.isCanceled()) {<NEW_LINE>myProgress.setText(FindBundle.message("find.progress.search.completed"));<NEW_LINE>}<NEW_LINE>} | (FindBundle.message("progress.text.scanning.indexed.files")); |
1,496,461 | private static void decode11(DataInput in, long[] tmp, long[] longs) throws IOException {<NEW_LINE>in.readLongs(tmp, 0, 22);<NEW_LINE>shiftLongs(tmp, 22, longs, 0, 5, MASK16_11);<NEW_LINE>for (int iter = 0, tmpIdx = 0, longsIdx = 22; iter < 2; ++iter, tmpIdx += 11, longsIdx += 5) {<NEW_LINE>long l0 = (tmp[tmpIdx + 0] & MASK16_5) << 6;<NEW_LINE>l0 |= (tmp[tmpIdx + 1] & MASK16_5) << 1;<NEW_LINE>l0 |= (tmp[tmpIdx + 2] >>> 4) & MASK16_1;<NEW_LINE>longs[longsIdx + 0] = l0;<NEW_LINE>long l1 = (tmp[tmpIdx + 2] & MASK16_4) << 7;<NEW_LINE>l1 |= (tmp[tmpIdx + 3] & MASK16_5) << 2;<NEW_LINE>l1 |= (tmp[tmpIdx + 4] >>> 3) & MASK16_2;<NEW_LINE>longs[longsIdx + 1] = l1;<NEW_LINE>long l2 = (tmp[tmpIdx + 4] & MASK16_3) << 8;<NEW_LINE>l2 |= (tmp[tmpIdx + 5] & MASK16_5) << 3;<NEW_LINE>l2 |= (tmp[tmpIdx + 6] >>> 2) & MASK16_3;<NEW_LINE>longs[longsIdx + 2] = l2;<NEW_LINE>long l3 = (tmp[tmpIdx + 6] & MASK16_2) << 9;<NEW_LINE>l3 |= (tmp[tmpIdx + 7] & MASK16_5) << 4;<NEW_LINE>l3 |= (tmp[tmpIdx + 8<MASK><NEW_LINE>longs[longsIdx + 3] = l3;<NEW_LINE>long l4 = (tmp[tmpIdx + 8] & MASK16_1) << 10;<NEW_LINE>l4 |= (tmp[tmpIdx + 9] & MASK16_5) << 5;<NEW_LINE>l4 |= (tmp[tmpIdx + 10] & MASK16_5) << 0;<NEW_LINE>longs[longsIdx + 4] = l4;<NEW_LINE>}<NEW_LINE>} | ] >>> 1) & MASK16_4; |
1,292,093 | public Object calculate(Context ctx) {<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("memory" + mm.getMessage("function.missingParam"));<NEW_LINE>} else if (param.getSubSize() != 2) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("memory" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>IParam <MASK><NEW_LINE>IParam varParam = param.getSub(1);<NEW_LINE>if (hubParam == null || varParam == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("memory" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object hostObj = hubParam.getLeafExpression().calculate(ctx);<NEW_LINE>Machines mc = new Machines();<NEW_LINE>if (!mc.set(hostObj)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("memory" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>String[] hosts = mc.getHosts();<NEW_LINE>int[] ports = mc.getPorts();<NEW_LINE>Cluster cluster = new Cluster(hosts, ports, ctx);<NEW_LINE>String var = varParam.getLeafExpression().toString();<NEW_LINE>return ClusterMemoryTable.memory(cluster, var);<NEW_LINE>} | hubParam = param.getSub(0); |
1,604,168 | public static void addGeoHash() {<NEW_LINE>// [START fs_geo_add_hash]<NEW_LINE>// Compute the GeoHash for a lat/lng point<NEW_LINE>double lat = 51.5074;<NEW_LINE>double lng = 0.1278;<NEW_LINE>String hash = GeoFireUtils.getGeoHashForLocation(new GeoLocation(lat, lng));<NEW_LINE>// Add the hash and the lat/lng to the document. We will use the hash<NEW_LINE>// for queries and the lat/lng for distance comparisons.<NEW_LINE>Map<String, Object> updates = new HashMap<>();<NEW_LINE><MASK><NEW_LINE>updates.put("lat", lat);<NEW_LINE>updates.put("lng", lng);<NEW_LINE>DocumentReference londonRef = db.collection("cities").document("LON");<NEW_LINE>londonRef.update(updates).addOnCompleteListener(new OnCompleteListener<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete(@NonNull Task<Void> task) {<NEW_LINE>// ...<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// [END fs_geo_add_hash]<NEW_LINE>} | updates.put("geohash", hash); |
602,297 | private byte[] genMetabitsData() throws IOException {<NEW_LINE>// the metabits is now prefixed by a long specifying the lastTxReleaseTime<NEW_LINE>// used to free the deferedFree allocations. This is used to determine<NEW_LINE>// which commitRecord to access to process the nextbatch of deferred<NEW_LINE>// frees.<NEW_LINE>// the cDefaultMetaBitsSize is also written since this can now be<NEW_LINE>// parameterized.<NEW_LINE>final int len = 4 * (cMetaHdrFields + m_allocSizes.length + m_metaBits.length);<NEW_LINE>final byte[] buf = new byte[len];<NEW_LINE>final <MASK><NEW_LINE>try {<NEW_LINE>str.writeInt(m_metaBitsAddr > 0 ? cVersionDemispace : cVersion);<NEW_LINE>str.writeLong(m_lastDeferredReleaseTime);<NEW_LINE>str.writeInt(cDefaultMetaBitsSize);<NEW_LINE>str.writeInt(m_allocSizes.length);<NEW_LINE>str.writeLong(m_storageStatsAddr);<NEW_LINE>// Let's reserve ourselves some space<NEW_LINE>for (int i = 0; i < cReservedMetaBits; i++) {<NEW_LINE>str.writeInt(0);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < m_allocSizes.length; i++) {<NEW_LINE>str.writeInt(m_allocSizes[i]);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < m_metaBits.length; i++) {<NEW_LINE>str.writeInt(m_metaBits[i]);<NEW_LINE>}<NEW_LINE>str.flush();<NEW_LINE>} finally {<NEW_LINE>str.close();<NEW_LINE>}<NEW_LINE>return buf;<NEW_LINE>} | FixedOutputStream str = new FixedOutputStream(buf); |
77,045 | protected BeanDefinitionBuilder parseHandler(Element element, ParserContext parserContext) {<NEW_LINE>BeanComponentDefinition innerHandlerDefinition = IntegrationNamespaceUtils.parseInnerHandlerDefinition(element, parserContext);<NEW_LINE>String ref = element.getAttribute(REF_ATTRIBUTE);<NEW_LINE>BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(AggregatorFactoryBean.class);<NEW_LINE>String <MASK><NEW_LINE>BeanMetadataElement processor = null;<NEW_LINE>if (innerHandlerDefinition != null || StringUtils.hasText(ref)) {<NEW_LINE>if (innerHandlerDefinition != null) {<NEW_LINE>processor = innerHandlerDefinition;<NEW_LINE>} else {<NEW_LINE>processor = new RuntimeBeanReference(ref);<NEW_LINE>}<NEW_LINE>builder.addPropertyValue("processorBean", processor);<NEW_LINE>if (StringUtils.hasText(headersFunction)) {<NEW_LINE>builder.addPropertyReference("headersFunction", headersFunction);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>BeanDefinitionBuilder groupProcessorBuilder;<NEW_LINE>if (StringUtils.hasText(element.getAttribute(EXPRESSION_ATTRIBUTE))) {<NEW_LINE>String expression = element.getAttribute(EXPRESSION_ATTRIBUTE);<NEW_LINE>groupProcessorBuilder = BeanDefinitionBuilder.genericBeanDefinition(ExpressionEvaluatingMessageGroupProcessor.class);<NEW_LINE>groupProcessorBuilder.addConstructorArgValue(expression);<NEW_LINE>} else {<NEW_LINE>groupProcessorBuilder = BeanDefinitionBuilder.genericBeanDefinition(DefaultAggregatingMessageGroupProcessor.class);<NEW_LINE>}<NEW_LINE>builder.addPropertyValue("processorBean", groupProcessorBuilder.getBeanDefinition());<NEW_LINE>if (StringUtils.hasText(headersFunction)) {<NEW_LINE>groupProcessorBuilder.addPropertyReference("headersFunction", headersFunction);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(element.getAttribute(METHOD_ATTRIBUTE))) {<NEW_LINE>String method = element.getAttribute(METHOD_ATTRIBUTE);<NEW_LINE>builder.addPropertyValue("methodName", method);<NEW_LINE>}<NEW_LINE>doParse(builder, element, processor, parserContext);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, EXPIRE_GROUPS_UPON_COMPLETION);<NEW_LINE>return builder;<NEW_LINE>} | headersFunction = element.getAttribute("headers-function"); |
832,674 | public void insertTokens(int[] tokens, int completedToken, int position) {<NEW_LINE>if (!this.record)<NEW_LINE>return;<NEW_LINE>tokens = filterTokens(tokens);<NEW_LINE>if (tokens.length == 0)<NEW_LINE>return;<NEW_LINE>if (completedToken > -1 && Parser.statements_recovery_filter[completedToken] != 0)<NEW_LINE>return;<NEW_LINE>this.data.insertedTokensPtr++;<NEW_LINE>if (this.data.insertedTokens == null) {<NEW_LINE>this.data.insertedTokens <MASK><NEW_LINE>this.data.insertedTokensPosition = new int[10];<NEW_LINE>this.data.insertedTokenUsed = new boolean[10];<NEW_LINE>} else if (this.data.insertedTokens.length == this.data.insertedTokensPtr) {<NEW_LINE>int length = this.data.insertedTokens.length;<NEW_LINE>System.arraycopy(this.data.insertedTokens, 0, this.data.insertedTokens = new int[length * 2][], 0, length);<NEW_LINE>System.arraycopy(this.data.insertedTokensPosition, 0, this.data.insertedTokensPosition = new int[length * 2], 0, length);<NEW_LINE>System.arraycopy(this.data.insertedTokenUsed, 0, this.data.insertedTokenUsed = new boolean[length * 2], 0, length);<NEW_LINE>}<NEW_LINE>this.data.insertedTokens[this.data.insertedTokensPtr] = reverse(tokens);<NEW_LINE>this.data.insertedTokensPosition[this.data.insertedTokensPtr] = position;<NEW_LINE>this.data.insertedTokenUsed[this.data.insertedTokensPtr] = false;<NEW_LINE>} | = new int[10][]; |
1,126,319 | private Variable createVar(Function func, int frameOffset, int offset, int refSize) throws InvalidInputException {<NEW_LINE>if (dontCreateNewVariables) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>StackFrame frame = func.getStackFrame();<NEW_LINE>int frameLoc = offset + frameOffset;<NEW_LINE>Variable <MASK><NEW_LINE>if (var == null) {<NEW_LINE>try {<NEW_LINE>if (!doLocals && frameLoc <= 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!doParams && frameLoc > 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// only create variables at locations where a variable doesn't exist<NEW_LINE>var = frame.createVariable(null, frameLoc, Undefined.getUndefinedDataType(refSize), SourceType.ANALYSIS);<NEW_LINE>} catch (DuplicateNameException e) {<NEW_LINE>throw new AssertException(e);<NEW_LINE>}<NEW_LINE>} else if (var.getStackOffset() == frameLoc && var.getDataType().getLength() < refSize) {<NEW_LINE>// don't get rid of existing variables, just change their size bigger<NEW_LINE>DataType dt = var.getDataType();<NEW_LINE>if (dt instanceof Undefined || dt == DefaultDataType.dataType) {<NEW_LINE>var.setDataType(Undefined.getUndefinedDataType(refSize), SourceType.ANALYSIS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return var;<NEW_LINE>} | var = frame.getVariableContaining(frameLoc); |
367,510 | Object reduceNoIterable(VirtualFrame frame, PCycle self, @Cached GetClassNode getClass, @Cached PyObjectLookupAttr lookupAttrNode, @Cached CallUnaryMethodNode callNode, @Cached PyObjectGetIter getIterNode, @Cached BranchProfile indexProfile) {<NEW_LINE>Object type = getClass.execute(self);<NEW_LINE>PList savedList = getSavedList(self);<NEW_LINE>Object it = getIterNode.execute(frame, savedList);<NEW_LINE>if (self.getIndex() > 0) {<NEW_LINE>indexProfile.enter();<NEW_LINE>Object setStateCallable = lookupAttrNode.<MASK><NEW_LINE>callNode.executeObject(frame, setStateCallable, self.getIndex());<NEW_LINE>}<NEW_LINE>PTuple iteratorTuple = factory().createTuple(new Object[] { it });<NEW_LINE>PTuple tuple = factory().createTuple(new Object[] { savedList, true });<NEW_LINE>return factory().createTuple(new Object[] { type, iteratorTuple, tuple });<NEW_LINE>} | execute(frame, it, __SETSTATE__); |
1,253,128 | private ImmutableList<JSType> parseTemplateArgs(JSType nominalType, Node typeNode, String sourceName, StaticTypedScope scope) {<NEW_LINE>Node typeList = typeNode.getFirstChild();<NEW_LINE>if (typeList == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ArrayList<JSType> <MASK><NEW_LINE>for (Node templateNode = typeList.getFirstChild(); templateNode != null; templateNode = templateNode.getNext()) {<NEW_LINE>templateArgs.add(createTypeFromCommentNode(templateNode, sourceName, scope));<NEW_LINE>}<NEW_LINE>// TODO(b/138617950): Eliminate the special case for `Object`.<NEW_LINE>boolean isObject = typeNode.getString().equals("Object") || typeNode.getString().equals("window.Object");<NEW_LINE>if (isObject && templateArgs.size() == 1) {<NEW_LINE>templateArgs.add(0, getNativeType(UNKNOWN_TYPE));<NEW_LINE>}<NEW_LINE>if (nominalType.isNamedType() && !nominalType.isResolved()) {<NEW_LINE>// The required number of template args will not be known until resolution, so just return all<NEW_LINE>// the args.<NEW_LINE>return ImmutableList.copyOf(templateArgs);<NEW_LINE>}<NEW_LINE>int requiredTemplateArgCount = nominalType.getTemplateParamCount();<NEW_LINE>if (templateArgs.size() <= requiredTemplateArgCount) {<NEW_LINE>return ImmutableList.copyOf(templateArgs);<NEW_LINE>}<NEW_LINE>if (// TODO(b/287880204): delete the following case after cleaning up the codebase<NEW_LINE>!nominalType.isUnknownType() && !isNonNullableName(scope, typeNode.getString())) {<NEW_LINE>Node firstExtraTemplateParam = typeNode.getFirstChild().getChildAtIndex(requiredTemplateArgCount);<NEW_LINE>String message = "Too many template parameters\nFound " + templateArgs.size() + ", required at most " + requiredTemplateArgCount;<NEW_LINE>reporter.warning(message, sourceName, firstExtraTemplateParam.getLineno(), firstExtraTemplateParam.getCharno());<NEW_LINE>}<NEW_LINE>return ImmutableList.copyOf(templateArgs.subList(0, requiredTemplateArgCount));<NEW_LINE>} | templateArgs = new ArrayList<>(); |
783,426 | private void initQueuesWithStartEnd(final RoutingContext ctx, RouteSegment start, RouteSegment end, RouteSegment recalculationEnd, PriorityQueue<RouteSegment> graphDirectSegments, PriorityQueue<RouteSegment> graphReverseSegments, TLongObjectHashMap<RouteSegment> visitedDirectSegments, TLongObjectHashMap<RouteSegment> visitedOppositeSegments) {<NEW_LINE>RouteSegment startPos = initRouteSegment(ctx, start, true, false);<NEW_LINE>RouteSegment startNeg = initRouteSegment(ctx, start, false, false);<NEW_LINE>RouteSegment endPos = initRouteSegment(ctx, end, true, true);<NEW_LINE>RouteSegment endNeg = initRouteSegment(ctx, end, false, true);<NEW_LINE>startPos.setParentRoute(RouteSegment.NULL);<NEW_LINE><MASK><NEW_LINE>endPos.setParentRoute(RouteSegment.NULL);<NEW_LINE>endNeg.setParentRoute(RouteSegment.NULL);<NEW_LINE>// for start : f(start) = g(start) + h(start) = 0 + h(start) = h(start)<NEW_LINE>if (ctx.config.initialDirection != null) {<NEW_LINE>// mark here as positive for further check<NEW_LINE>double plusDir = start.getRoad().directionRoute(start.getSegmentStart(), true);<NEW_LINE>double diff = plusDir - ctx.config.initialDirection;<NEW_LINE>if (Math.abs(MapUtils.alignAngleDifference(diff)) <= Math.PI / 3) {<NEW_LINE>if (startNeg != null) {<NEW_LINE>startNeg.distanceFromStart += 500;<NEW_LINE>}<NEW_LINE>} else if (Math.abs(MapUtils.alignAngleDifference(diff - Math.PI)) <= Math.PI / 3) {<NEW_LINE>if (startPos != null) {<NEW_LINE>startPos.distanceFromStart += 500;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (recalculationEnd != null) {<NEW_LINE>ctx.targetX = recalculationEnd.getRoad().getPoint31XTile(recalculationEnd.getSegmentStart());<NEW_LINE>ctx.targetY = recalculationEnd.getRoad().getPoint31YTile(recalculationEnd.getSegmentStart());<NEW_LINE>}<NEW_LINE>float estimatedDistance = (float) estimatedDistance(ctx, ctx.targetX, ctx.targetY, ctx.startX, ctx.startY);<NEW_LINE>if (startPos != null && checkMovementAllowed(ctx, false, startPos)) {<NEW_LINE>startPos.distanceToEnd = estimatedDistance;<NEW_LINE>graphDirectSegments.add(startPos);<NEW_LINE>}<NEW_LINE>if (startNeg != null && checkMovementAllowed(ctx, false, startNeg)) {<NEW_LINE>startNeg.distanceToEnd = estimatedDistance;<NEW_LINE>graphDirectSegments.add(startNeg);<NEW_LINE>}<NEW_LINE>if (recalculationEnd != null) {<NEW_LINE>graphReverseSegments.add(recalculationEnd);<NEW_LINE>} else {<NEW_LINE>if (endPos != null && checkMovementAllowed(ctx, true, endPos)) {<NEW_LINE>endPos.distanceToEnd = estimatedDistance;<NEW_LINE>graphReverseSegments.add(endPos);<NEW_LINE>}<NEW_LINE>if (endNeg != null && checkMovementAllowed(ctx, true, endNeg)) {<NEW_LINE>endNeg.distanceToEnd = estimatedDistance;<NEW_LINE>graphReverseSegments.add(endNeg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TRACE_ROUTING) {<NEW_LINE>printRoad("Initial segment start positive: ", startPos, false);<NEW_LINE>printRoad("Initial segment start negative: ", startNeg, false);<NEW_LINE>printRoad("Initial segment end positive: ", endPos, false);<NEW_LINE>printRoad("Initial segment end negative: ", endNeg, false);<NEW_LINE>}<NEW_LINE>} | startNeg.setParentRoute(RouteSegment.NULL); |
240,354 | public void drawU(UGraphic ug) {<NEW_LINE>final StringBounder stringBounder = ug.getStringBounder();<NEW_LINE>final Dimension2D dimTotal = calculateDimension(stringBounder);<NEW_LINE><MASK><NEW_LINE>if (p1 == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Point2D p2 = getP2(stringBounder);<NEW_LINE>final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);<NEW_LINE>final double x1 = p1.getX();<NEW_LINE>final double y1 = p1.getY();<NEW_LINE>final double x2 = p2.getX() + dimDiamond1.getWidth();<NEW_LINE>final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;<NEW_LINE>final double y2 = p2.getY() + dimDiamond1.getInY() + half;<NEW_LINE>final Snake snake = Snake.create(skinParam(), endInlinkColor, Arrows.asToLeft()).emphasizeDirection(Direction.UP).withLabel(back, arrowHorizontalAlignment());<NEW_LINE>snake.addPoint(x1, y1);<NEW_LINE>final double y1bis = Math.max(y1, getBottom(stringBounder)) + Hexagon.hexagonHalfSize;<NEW_LINE>snake.addPoint(x1, y1bis);<NEW_LINE>final double xx = dimTotal.getWidth();<NEW_LINE>snake.addPoint(xx, y1bis);<NEW_LINE>snake.addPoint(xx, y2);<NEW_LINE>snake.addPoint(x2, y2);<NEW_LINE>ug.draw(snake);<NEW_LINE>ug.apply(new UTranslate(x1, y1bis)).draw(new UEmpty(5, Hexagon.hexagonHalfSize));<NEW_LINE>} | final Point2D p1 = getP1(stringBounder); |
1,007,903 | protected static Row decodeRow(byte[] value, Handle handle, TiTableInfo tableInfo) {<NEW_LINE>if (handle == null && tableInfo.isPkHandle()) {<NEW_LINE>throw new IllegalArgumentException("when pk is handle, handle cannot be null");<NEW_LINE>}<NEW_LINE>int colSize = tableInfo.getColumns().size();<NEW_LINE>HashMap<Long, TiColumnInfo> idToColumn <MASK><NEW_LINE>for (TiColumnInfo col : tableInfo.getColumns()) {<NEW_LINE>idToColumn.put(col.getId(), col);<NEW_LINE>}<NEW_LINE>// decode bytes to Map<ColumnID, Data><NEW_LINE>HashMap<Long, Object> decodedDataMap = new HashMap<>(colSize);<NEW_LINE>CodecDataInput cdi = new CodecDataInput(value);<NEW_LINE>Object[] res = new Object[colSize];<NEW_LINE>while (!cdi.eof()) {<NEW_LINE>long colID = (long) IntegerType.BIGINT.decode(cdi);<NEW_LINE>Object colValue = idToColumn.get(colID).getType().decodeForBatchWrite(cdi);<NEW_LINE>decodedDataMap.put(colID, colValue);<NEW_LINE>}<NEW_LINE>// construct Row with Map<ColumnID, Data> & handle<NEW_LINE>for (int i = 0; i < colSize; i++) {<NEW_LINE>// skip pk is handle case<NEW_LINE>TiColumnInfo col = tableInfo.getColumn(i);<NEW_LINE>if (col.isPrimaryKey() && tableInfo.isPkHandle()) {<NEW_LINE>res[i] = handle;<NEW_LINE>} else {<NEW_LINE>res[i] = decodedDataMap.get(col.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ObjectRowImpl.create(res);<NEW_LINE>} | = new HashMap<>(colSize); |
1,751,448 | private void clockAllMatrix(Set<String> needFlushMatrices, boolean wait) throws Exception {<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>List<Future> clockFutures = new ArrayList<Future>();<NEW_LINE>for (Map.Entry<String, PSModel> entry : model.getPSModels().entrySet()) {<NEW_LINE>if (needFlushMatrices.contains(entry.getKey())) {<NEW_LINE>clockFutures.add(entry.getValue().clock(true));<NEW_LINE>} else {<NEW_LINE>clockFutures.add(entry.getValue().clock(false));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (wait) {<NEW_LINE>int size = clockFutures.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>clockFutures.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.info(String.format("clock and flush matrices %s cost %d ms", needFlushMatrices, System.currentTimeMillis() - startTime));<NEW_LINE>} | get(i).get(); |
1,593,043 | public static <ARR> void serLong2ArrayHashMap(Long2ObjectOpenHashMap<ARR> obj, ByteBuf buf) {<NEW_LINE>buf.writeInt(obj.size());<NEW_LINE>ObjectIterator<Long2ObjectMap.Entry<ARR>> iter = obj.long2ObjectEntrySet().fastIterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Long2ObjectMap.Entry<ARR<MASK><NEW_LINE>buf.writeLong(entry.getLongKey());<NEW_LINE>ARR value = entry.getValue();<NEW_LINE>switch(value.getClass().getSimpleName()) {<NEW_LINE>case "int[]":<NEW_LINE>serArray((int[]) value, buf);<NEW_LINE>break;<NEW_LINE>case "long[]":<NEW_LINE>serArray((long[]) value, buf);<NEW_LINE>break;<NEW_LINE>case "float[]":<NEW_LINE>serArray((float[]) value, buf);<NEW_LINE>break;<NEW_LINE>case "double[]":<NEW_LINE>serArray((double[]) value, buf);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > entry = iter.next(); |
842,378 | public void run(MessageReply reply) {<NEW_LINE>if (!reply.isSuccess()) {<NEW_LINE>String err = String.format("failed to revoke port forwarding rules %s, because %s", JSONObjectUtil.toJsonString(to<MASK><NEW_LINE>logger.warn(err);<NEW_LINE>chain.fail(reply.getError());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>VirtualRouterAsyncHttpCallReply re = reply.castReply();<NEW_LINE>RevokePortForwardingRuleRsp ret = re.toResponse(RevokePortForwardingRuleRsp.class);<NEW_LINE>if (ret.isSuccess()) {<NEW_LINE>String info = String.format("successfully revoke port forwarding rules: %s", JSONObjectUtil.toJsonString(to));<NEW_LINE>logger.debug(info);<NEW_LINE>chain.next();<NEW_LINE>FirewallCanonicalEvents.FirewallRuleChangedData data = new FirewallCanonicalEvents.FirewallRuleChangedData();<NEW_LINE>data.setVirtualRouterUuid(vr.getUuid());<NEW_LINE>evtf.fire(FirewallCanonicalEvents.FIREWALL_RULE_CHANGED_PATH, data);<NEW_LINE>} else {<NEW_LINE>ErrorCode err = operr("failed to revoke port forwarding rules %s, because %s", JSONObjectUtil.toJsonString(to), ret.getError());<NEW_LINE>chain.fail(err);<NEW_LINE>}<NEW_LINE>} | ), reply.getError()); |
1,707,719 | private <T> T attr(AttributeKey<T> key, boolean ownAttr) {<NEW_LINE>requireNonNull(key, "key");<NEW_LINE>final AtomicReferenceArray<DefaultAttribute<?>> attributes = this.attributes;<NEW_LINE>if (attributes == null) {<NEW_LINE>if (!ownAttr && rootAttributeMap != null) {<NEW_LINE>return rootAttributeMap.attr(key);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final int i = index(key);<NEW_LINE>final DefaultAttribute<?> <MASK><NEW_LINE>if (head == null) {<NEW_LINE>if (!ownAttr && rootAttributeMap != null) {<NEW_LINE>return rootAttributeMap.attr(key);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>synchronized (head) {<NEW_LINE>DefaultAttribute<?> curr = head;<NEW_LINE>for (; ; ) {<NEW_LINE>final DefaultAttribute<?> next = curr.next;<NEW_LINE>if (next == null) {<NEW_LINE>if (!ownAttr && rootAttributeMap != null) {<NEW_LINE>return rootAttributeMap.attr(key);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (next.key == key) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final T result = (T) next.getValue();<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>curr = next;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | head = attributes.get(i); |
77,646 | public static ReadyForServiceResponse unmarshall(ReadyForServiceResponse readyForServiceResponse, UnmarshallerContext _ctx) {<NEW_LINE>readyForServiceResponse.setRequestId(_ctx.stringValue("ReadyForServiceResponse.RequestId"));<NEW_LINE>readyForServiceResponse.setCode(_ctx.stringValue("ReadyForServiceResponse.Code"));<NEW_LINE>readyForServiceResponse.setHttpStatusCode(_ctx.integerValue("ReadyForServiceResponse.HttpStatusCode"));<NEW_LINE>readyForServiceResponse.setMessage(_ctx.stringValue("ReadyForServiceResponse.Message"));<NEW_LINE>List<String> params <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ReadyForServiceResponse.Params.Length"); i++) {<NEW_LINE>params.add(_ctx.stringValue("ReadyForServiceResponse.Params[" + i + "]"));<NEW_LINE>}<NEW_LINE>readyForServiceResponse.setParams(params);<NEW_LINE>Data data = new Data();<NEW_LINE>data.setExtension(_ctx.stringValue("ReadyForServiceResponse.Data.Extension"));<NEW_LINE>data.setWorkMode(_ctx.stringValue("ReadyForServiceResponse.Data.WorkMode"));<NEW_LINE>data.setDeviceId(_ctx.stringValue("ReadyForServiceResponse.Data.DeviceId"));<NEW_LINE>data.setJobId(_ctx.stringValue("ReadyForServiceResponse.Data.JobId"));<NEW_LINE>data.setUserId(_ctx.stringValue("ReadyForServiceResponse.Data.UserId"));<NEW_LINE>data.setBreakCode(_ctx.stringValue("ReadyForServiceResponse.Data.BreakCode"));<NEW_LINE>data.setInstanceId(_ctx.stringValue("ReadyForServiceResponse.Data.InstanceId"));<NEW_LINE>data.setOutboundScenario(_ctx.booleanValue("ReadyForServiceResponse.Data.OutboundScenario"));<NEW_LINE>data.setUserState(_ctx.stringValue("ReadyForServiceResponse.Data.UserState"));<NEW_LINE>List<String> signedSkillGroupIdList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ReadyForServiceResponse.Data.SignedSkillGroupIdList.Length"); i++) {<NEW_LINE>signedSkillGroupIdList.add(_ctx.stringValue("ReadyForServiceResponse.Data.SignedSkillGroupIdList[" + i + "]"));<NEW_LINE>}<NEW_LINE>data.setSignedSkillGroupIdList(signedSkillGroupIdList);<NEW_LINE>readyForServiceResponse.setData(data);<NEW_LINE>return readyForServiceResponse;<NEW_LINE>} | = new ArrayList<String>(); |
377,893 | private void addCustomFoldingRegionsRecursively(@Nonnull FoldingStack foldingStack, @Nonnull ASTNode node, @Nonnull List<FoldingDescriptor> descriptors, int currDepth) {<NEW_LINE>FoldingStack localFoldingStack = isCustomFoldingRoot(node) <MASK><NEW_LINE>for (ASTNode child = node.getFirstChildNode(); child != null; child = child.getTreeNext()) {<NEW_LINE>if (isCustomRegionStart(child)) {<NEW_LINE>localFoldingStack.push(child);<NEW_LINE>} else if (isCustomRegionEnd(child)) {<NEW_LINE>if (!localFoldingStack.isEmpty()) {<NEW_LINE>ASTNode startNode = localFoldingStack.pop();<NEW_LINE>int startOffset = startNode.getTextRange().getStartOffset();<NEW_LINE>TextRange range = new TextRange(startOffset, child.getTextRange().getEndOffset());<NEW_LINE>descriptors.add(new FoldingDescriptor(startNode, range));<NEW_LINE>Set<ASTNode> nodeSet = ourCustomRegionElements.get();<NEW_LINE>nodeSet.add(startNode);<NEW_LINE>nodeSet.add(child);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (currDepth < myMaxLookupDepth.asInteger()) {<NEW_LINE>addCustomFoldingRegionsRecursively(localFoldingStack, child, descriptors, currDepth + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ? new FoldingStack(node) : foldingStack; |
1,475,586 | private void buildSegments() {<NEW_LINE>segmentNodes.clear();<NEW_LINE>getChildren().clear();<NEW_LINE>List<T> segments = getSkinnable().getSegments();<NEW_LINE><MASK><NEW_LINE>Callback<T, Node> cellFactory = getSkinnable().getSegmentViewFactory();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>T segment = segments.get(i);<NEW_LINE>Node segmentNode = cellFactory.call(segment);<NEW_LINE>segmentNodes.put(segment, segmentNode);<NEW_LINE>getChildren().add(segmentNode);<NEW_LINE>segmentNode.getStyleClass().add("segment");<NEW_LINE>if (i == 0) {<NEW_LINE>if (size == 1) {<NEW_LINE>segmentNode.getStyleClass().add("only-segment");<NEW_LINE>} else {<NEW_LINE>segmentNode.getStyleClass().add("first-segment");<NEW_LINE>}<NEW_LINE>} else if (i == size - 1) {<NEW_LINE>segmentNode.getStyleClass().add("last-segment");<NEW_LINE>} else {<NEW_LINE>segmentNode.getStyleClass().add("middle-segment");<NEW_LINE>}<NEW_LINE>segmentNode.setOnMouseEntered(evt -> showPopOver(segmentNode, segment));<NEW_LINE>segmentNode.setOnMouseExited(evt -> hidePopOver());<NEW_LINE>}<NEW_LINE>getSkinnable().requestLayout();<NEW_LINE>} | int size = segments.size(); |
317,682 | private Element makePlacemarkWithPicture(String name, FeatureColor color, String description, Long timestamp, Element feature, Path path, String coordinates) {<NEW_LINE>// NON-NLS<NEW_LINE>Element placemark = new Element("Placemark", ns);<NEW_LINE>// NON-NLS<NEW_LINE>Element desc = new Element("description", ns);<NEW_LINE>if (name != null && !name.isEmpty()) {<NEW_LINE>// NON-NLS<NEW_LINE>placemark.addContent(new Element("name", ns).addContent(name));<NEW_LINE>// NON-NLS<NEW_LINE>String image = "<img src='" + name + "' width='400'/>";<NEW_LINE>desc.addContent(image);<NEW_LINE>}<NEW_LINE>// NON-NLS<NEW_LINE>placemark.addContent(new Element("styleUrl", ns).addContent(color.getColor()));<NEW_LINE>if (path != null) {<NEW_LINE>String pathAsString = path.toString();<NEW_LINE>if (pathAsString != null && !pathAsString.isEmpty()) {<NEW_LINE>desc.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>placemark.addContent(desc);<NEW_LINE>if (timestamp != null) {<NEW_LINE>// NON-NLS<NEW_LINE>Element time = new Element("TimeStamp", ns);<NEW_LINE>// NON-NLS<NEW_LINE>time.addContent(new Element("when", ns).addContent(getTimeStamp(timestamp)));<NEW_LINE>placemark.addContent(time);<NEW_LINE>}<NEW_LINE>placemark.addContent(feature);<NEW_LINE>if (coordinates != null && !coordinates.isEmpty()) {<NEW_LINE>// NON-NLS<NEW_LINE>placemark.addContent(new Element("snippet", ns).addContent(coordinates));<NEW_LINE>}<NEW_LINE>return placemark;<NEW_LINE>} | addContent(description + "<b>Source Path:</b> " + pathAsString); |
1,825,090 | public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException {<NEW_LINE>// NON-NLS<NEW_LINE>Preconditions.checkNotNull(sender, "Sender cannot be null");<NEW_LINE>// NON-NLS<NEW_LINE>Preconditions.checkNotNull(args, "Arguments cannot be null");<NEW_LINE>// NON-NLS<NEW_LINE>Preconditions.checkNotNull(alias, "Alias cannot be null");<NEW_LINE>switch(args.length) {<NEW_LINE>case 1:<NEW_LINE>return StringUtil.copyPartialMatches(args[0], SUBCOMMANDS, new ArrayList<><MASK><NEW_LINE>case 2:<NEW_LINE>switch(SUBCOMMAND_MAP.get(args[0])) {<NEW_LINE>case PROPERTY:<NEW_LINE>Set<String> propertyNames = System.getProperties().stringPropertyNames();<NEW_LINE>return StringUtil.copyPartialMatches(args[1], propertyNames, new ArrayList<>(propertyNames.size()));<NEW_LINE>case WORLD:<NEW_LINE>if (sender instanceof Player) {<NEW_LINE>Collection<String> worlds = getWorldNames();<NEW_LINE>return StringUtil.copyPartialMatches(args[1], worlds, new ArrayList<>(worlds.size()));<NEW_LINE>}<NEW_LINE>// else fall through<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>// fall through<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>return Collections.emptyList();<NEW_LINE>} | (SUBCOMMANDS.size())); |
1,344,184 | public void evaluateNullAnnotations() {<NEW_LINE>if (!isPrototype())<NEW_LINE>throw new IllegalStateException();<NEW_LINE>if (this.nullnessDefaultInitialized > 0 || !this.scope.compilerOptions().isAnnotationBasedNullAnalysisEnabled)<NEW_LINE>return;<NEW_LINE>if ((this.tagBits & TagBits.AnnotationNullMASK) != 0) {<NEW_LINE>Annotation[] annotations = this.scope.referenceContext.annotations;<NEW_LINE>for (int i = 0; i < annotations.length; i++) {<NEW_LINE>ReferenceBinding annotationType = annotations[i].getCompilerAnnotation().getAnnotationType();<NEW_LINE>if (annotationType != null) {<NEW_LINE>if (annotationType.hasNullBit(TypeIds.BitNonNullAnnotation | TypeIds.BitNullableAnnotation)) {<NEW_LINE>this.scope.problemReporter().nullAnnotationUnsupportedLocation(annotations[i]);<NEW_LINE>this.tagBits &= ~TagBits.AnnotationNullMASK;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean isPackageInfo = CharOperation.equals(this.sourceName, TypeConstants.PACKAGE_INFO_NAME);<NEW_LINE>PackageBinding pkg = getPackage();<NEW_LINE>boolean isInDefaultPkg = (pkg.compoundName == CharOperation.NO_CHAR_CHAR);<NEW_LINE>if (!isPackageInfo) {<NEW_LINE>boolean isInNullnessAnnotationPackage = this.scope.environment().isNullnessAnnotationPackage(pkg);<NEW_LINE>if (pkg.getDefaultNullness() == NO_NULL_DEFAULT && !isInDefaultPkg && !isInNullnessAnnotationPackage && !(this instanceof NestedTypeBinding)) {<NEW_LINE>ReferenceBinding packageInfo = pkg.getType(TypeConstants.PACKAGE_INFO_NAME, this.module);<NEW_LINE>if (packageInfo == null) {<NEW_LINE>// no pkgInfo - complain<NEW_LINE>this.scope.problemReporter().missingNonNullByDefaultAnnotation(this.scope.referenceContext);<NEW_LINE>pkg.setDefaultNullness(NULL_UNSPECIFIED_BY_DEFAULT);<NEW_LINE>} else {<NEW_LINE>// if pkgInfo has no default annot. - complain<NEW_LINE>if (packageInfo instanceof SourceTypeBinding && (packageInfo.tagBits & TagBits.EndHierarchyCheck) == 0) {<NEW_LINE>CompilationUnitScope pkgCUS = ((SourceTypeBinding) packageInfo).scope.compilationUnitScope();<NEW_LINE>boolean current = pkgCUS.connectingHierarchy;<NEW_LINE>pkgCUS.connectingHierarchy = true;<NEW_LINE>try {<NEW_LINE>packageInfo.getAnnotationTagBits();<NEW_LINE>} finally {<NEW_LINE>pkgCUS.connectingHierarchy = current;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>packageInfo.getAnnotationTagBits();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.nullnessDefaultInitialized = 1;<NEW_LINE>if (this.defaultNullness != 0) {<NEW_LINE>TypeDeclaration typeDecl = this.scope.referenceContext;<NEW_LINE>if (isPackageInfo) {<NEW_LINE>if (pkg.enclosingModule.getDefaultNullness() == this.defaultNullness) {<NEW_LINE>this.scope.problemReporter().nullDefaultAnnotationIsRedundant(typeDecl, typeDecl.annotations, pkg.enclosingModule);<NEW_LINE>} else {<NEW_LINE>pkg.setDefaultNullness(this.defaultNullness);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Binding target = this.scope.parent.checkRedundantDefaultNullness(this.defaultNullness, typeDecl.declarationSourceStart);<NEW_LINE>if (target != null) {<NEW_LINE>this.scope.problemReporter().nullDefaultAnnotationIsRedundant(typeDecl, typeDecl.annotations, target);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (isPackageInfo || (isInDefaultPkg && !(this instanceof NestedTypeBinding))) {<NEW_LINE>this.scope.problemReporter().<MASK><NEW_LINE>if (!isInDefaultPkg)<NEW_LINE>pkg.setDefaultNullness(NULL_UNSPECIFIED_BY_DEFAULT);<NEW_LINE>}<NEW_LINE>maybeMarkTypeParametersNonNull();<NEW_LINE>} | missingNonNullByDefaultAnnotation(this.scope.referenceContext); |
1,679,311 | public StopUserImportJobResult stopUserImportJob(StopUserImportJobRequest stopUserImportJobRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopUserImportJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<StopUserImportJobRequest> request = null;<NEW_LINE>Response<StopUserImportJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopUserImportJobRequestMarshaller().marshall(stopUserImportJobRequest);<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<StopUserImportJobResult, JsonUnmarshallerContext> unmarshaller = new StopUserImportJobResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<StopUserImportJobResult> responseHandler = new JsonResponseHandler<StopUserImportJobResult>(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); |
608,209 | public Object apply(final Object context, final Options options) throws IOException {<NEW_LINE>if (context == null) {<NEW_LINE>return options.hash("default", "");<NEW_LINE>}<NEW_LINE>String viewName = options.hash("view", "");<NEW_LINE>JsonGenerator generator = null;<NEW_LINE>try {<NEW_LINE>final ObjectWriter writer;<NEW_LINE>// do we need to use a view?<NEW_LINE>if (!Handlebars.Utils.isEmpty(viewName)) {<NEW_LINE>Class<?> viewClass = alias.get(viewName);<NEW_LINE>if (viewClass == null) {<NEW_LINE>viewClass = getClass().getClassLoader().loadClass(viewName);<NEW_LINE>}<NEW_LINE>writer = mapper.writerWithView(viewClass);<NEW_LINE>} else {<NEW_LINE>writer = mapper.writer();<NEW_LINE>}<NEW_LINE>JsonFactory jsonFactory = mapper.getFactory();<NEW_LINE>SegmentedStringWriter output = new SegmentedStringWriter(jsonFactory._getBufferRecycler());<NEW_LINE>// creates a json generator.<NEW_LINE><MASK><NEW_LINE>Boolean escapeHtml = options.hash("escapeHTML", Boolean.FALSE);<NEW_LINE>// do we need to escape html?<NEW_LINE>if (escapeHtml) {<NEW_LINE>generator.setCharacterEscapes(new HtmlEscapes());<NEW_LINE>}<NEW_LINE>Boolean pretty = options.hash("pretty", Boolean.FALSE);<NEW_LINE>// write the JSON output.<NEW_LINE>if (pretty) {<NEW_LINE>writer.withDefaultPrettyPrinter().writeValue(generator, context);<NEW_LINE>} else {<NEW_LINE>writer.writeValue(generator, context);<NEW_LINE>}<NEW_LINE>generator.close();<NEW_LINE>return new Handlebars.SafeString(output.getAndClear());<NEW_LINE>} catch (ClassNotFoundException ex) {<NEW_LINE>throw new IllegalArgumentException(viewName, ex);<NEW_LINE>} finally {<NEW_LINE>if (generator != null && !generator.isClosed()) {<NEW_LINE>generator.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | generator = jsonFactory.createJsonGenerator(output); |
1,605,082 | private List<HandlerMethodArgumentResolver> buildArgumentResolvers(boolean listCapable) {<NEW_LINE>List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>();<NEW_LINE>resolvers.add(new PayloadExpressionArgumentResolver());<NEW_LINE>resolvers.add(new NullAwarePayloadArgumentResolver(this.argumentResolverMessageConverter));<NEW_LINE>resolvers.add(new PayloadsArgumentResolver());<NEW_LINE>if (listCapable) {<NEW_LINE>resolvers.<MASK><NEW_LINE>}<NEW_LINE>resolvers.add(new MapArgumentResolver());<NEW_LINE>for (HandlerMethodArgumentResolver resolver : resolvers) {<NEW_LINE>if (resolver instanceof BeanFactoryAware) {<NEW_LINE>((BeanFactoryAware) resolver).setBeanFactory(this.beanFactory);<NEW_LINE>}<NEW_LINE>if (resolver instanceof InitializingBean) {<NEW_LINE>try {<NEW_LINE>((InitializingBean) resolver).afterPropertiesSet();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new BeanInitializationException("Cannot initialize 'HandlerMethodArgumentResolver'", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return resolvers;<NEW_LINE>} | add(new CollectionArgumentResolver(true)); |
318,303 | private List<Map<String, Object>> imageMatcher(List<Map<String, Object>> images, String[] text, Pattern pat) {<NEW_LINE>int lnNbr = 0;<NEW_LINE>for (String line : text) {<NEW_LINE>line = line.strip();<NEW_LINE>Matcher matcher = pat.matcher(line);<NEW_LINE>if (line.contains("\"\"\"") || line.contains("'''")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>while (matcher.find()) {<NEW_LINE>String match = matcher.group(1);<NEW_LINE>if (match != null) {<NEW_LINE>int start = matcher.start(1);<NEW_LINE>String imgName = match.substring(1, match.length() - 1);<NEW_LINE>final File imgFile = imageExists(imgName);<NEW_LINE>if (imgFile != null) {<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>options.put(IButton.TEXT, match);<NEW_LINE>options.put(IButton.LINE, lnNbr);<NEW_LINE>options.put(IButton.LOFF, start);<NEW_LINE>options.put(IButton.FILE, imgFile);<NEW_LINE>images.add(options);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lnNbr++;<NEW_LINE>}<NEW_LINE>return images;<NEW_LINE>} | options = new HashMap<>(); |
366,302 | protected void bind(SubmissionViewHolder holder, final Item item) {<NEW_LINE>super.bind(holder, item);<NEW_LINE>holder.mPostedTextView.setText(item.getDisplayedTime(mContext));<NEW_LINE>holder.mPostedTextView.append(item.getDisplayedAuthor(mContext, !TextUtils.equals(item.getBy(), mUsername), 0));<NEW_LINE>holder.mMoreButton.setVisibility(View.GONE);<NEW_LINE>if (TextUtils.equals(item.getType(), Item.COMMENT_TYPE)) {<NEW_LINE>holder.mTitleTextView.setText(null);<NEW_LINE>holder.itemView.setOnClickListener(null);<NEW_LINE>holder.mCommentButton.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>holder.mTitleTextView.setText(item.getDisplayedTitle());<NEW_LINE>holder.mCommentButton.setVisibility(View.VISIBLE);<NEW_LINE>holder.mCommentButton.setOnClickListener(v -> openItem(item));<NEW_LINE>}<NEW_LINE>holder.mTitleTextView.setVisibility(holder.mTitleTextView.length() > 0 ? View.VISIBLE : View.GONE);<NEW_LINE>holder.mContentTextView.setVisibility(holder.mContentTextView.length() > 0 ? View.VISIBLE : View.GONE);<NEW_LINE>if (!mExpanded.contains(item.getId()) && item.getParentItem() != null) {<NEW_LINE>mExpanded.<MASK><NEW_LINE>new Handler().post(() -> {<NEW_LINE>// recursive<NEW_LINE>mItems.add(0, item.getParentItem());<NEW_LINE>notifyItemInserted(0);<NEW_LINE>notifyItemRangeChanged(1, mItems.size());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | add(item.getId()); |
1,715,402 | // TODO This callback is not called (due to requestPermissions(this.getParent()?), so onCreate() is used<NEW_LINE>@Override<NEW_LINE>public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {<NEW_LINE>if (requestCode == REQUEST_LOCATION) {<NEW_LINE>// Check if the only required permission has been granted (could react on the response)<NEW_LINE>if (grantResults.length >= 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {<NEW_LINE>String s = "Permission response OK";<NEW_LINE>Log.i(getClass().getName(), s);<NEW_LINE>if (mTracker.getState() != TrackerState.CONNECTED) {<NEW_LINE>startGps();<NEW_LINE>}<NEW_LINE>updateView();<NEW_LINE>} else {<NEW_LINE>String s = "Permission was not granted: " + " (" + grantResults.length + ", " + permissions.length + ")";<NEW_LINE>Log.i(getClass().getName(), s);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String s = "Unexpected permission request: " + requestCode;<NEW_LINE>Log.w(getClass().getName(), s);<NEW_LINE>super.<MASK><NEW_LINE>}<NEW_LINE>} | onRequestPermissionsResult(requestCode, permissions, grantResults); |
677,287 | public VAdminProto.AsyncOperationStatusResponse handleRebalanceNode(VAdminProto.InitiateRebalanceNodeRequest request) {<NEW_LINE>VAdminProto.AsyncOperationStatusResponse.Builder response = VAdminProto.AsyncOperationStatusResponse.newBuilder();<NEW_LINE>try {<NEW_LINE>if (!voldemortConfig.isEnableRebalanceService())<NEW_LINE>throw new VoldemortException("Rebalance service is not enabled for node: " + metadataStore.getNodeId());<NEW_LINE>// We should be in rebalancing state to run this function<NEW_LINE>if (!metadataStore.getServerStateUnlocked().equals(MetadataStore.VoldemortState.REBALANCING_MASTER_SERVER)) {<NEW_LINE>response.setError(ProtoUtils.encodeError(errorCodeMapper, new VoldemortException("Voldemort server " + metadataStore.getNodeId() + " not in rebalancing state")));<NEW_LINE>return response.build();<NEW_LINE>}<NEW_LINE>RebalanceTaskInfo rebalanceStealInfo = ProtoUtils.decodeRebalanceTaskInfoMap(request.getRebalanceTaskInfo());<NEW_LINE>int <MASK><NEW_LINE>response.setRequestId(requestId).setDescription(rebalanceStealInfo.toString()).setStatus("Started rebalancing").setComplete(false);<NEW_LINE>} catch (VoldemortException e) {<NEW_LINE>response.setError(ProtoUtils.encodeError(errorCodeMapper, e));<NEW_LINE>logger.error("handleRebalanceNode failed for request(" + request.toString() + ")", e);<NEW_LINE>}<NEW_LINE>return response.build();<NEW_LINE>} | requestId = rebalancer.rebalanceNode(rebalanceStealInfo); |
1,620,670 | // Updates a specific notification setting after a user makes a change<NEW_LINE>public void updateSettingForChannelAndType(Channel channel, Type type, String settingName, boolean newValue, long blogId) {<NEW_LINE>String typeName = type.toString();<NEW_LINE>try {<NEW_LINE>switch(channel) {<NEW_LINE>case BLOGS:<NEW_LINE>JSONObject blogJson = getBlogSettings().get(blogId);<NEW_LINE>if (blogJson != null) {<NEW_LINE>JSONObject blogSetting = JSONUtils.queryJSON(blogJson, typeName, new JSONObject());<NEW_LINE>blogSetting.put(settingName, newValue);<NEW_LINE><MASK><NEW_LINE>getBlogSettings().put(blogId, blogJson);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case OTHER:<NEW_LINE>JSONObject otherSetting = JSONUtils.queryJSON(getOtherSettings(), typeName, new JSONObject());<NEW_LINE>otherSetting.put(settingName, newValue);<NEW_LINE>getOtherSettings().put(typeName, otherSetting);<NEW_LINE>break;<NEW_LINE>case WPCOM:<NEW_LINE>getWPComSettings().put(settingName, newValue);<NEW_LINE>}<NEW_LINE>} catch (JSONException e) {<NEW_LINE>AppLog.e(AppLog.T.NOTIFS, "Could not update notifications settings JSON");<NEW_LINE>}<NEW_LINE>} | blogJson.put(typeName, blogSetting); |
1,034,907 | public JSONObject installAllPackages(String kubeconfig, JSONObject jsonEnvMap) throws IOException, InterruptedException, TimeoutException {<NEW_LINE>JSONObject result = new JSONObject();<NEW_LINE>for (String clientName : this.clientPackageService.getNames()) {<NEW_LINE>JSONObject clientInfo = this.clientPackageService.getValue(clientName);<NEW_LINE>JSONObject resultInfo = new JSONObject();<NEW_LINE>String <MASK><NEW_LINE>if (StringUtils.isBlank(deployCommand)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>resultInfo.put("deployCommand", deployCommand);<NEW_LINE>String kubeconfigPath = "/tmp/" + System.currentTimeMillis() + ".kubeconfig";<NEW_LINE>FileUtils.writeStringToFile(new File(kubeconfigPath), kubeconfig, "utf-8");<NEW_LINE>String runCommand = deployCommand.replace("helm ", "cd /app/client-deploy-packages/" + clientName + "/; /app/helm --kubeconfig=" + kubeconfigPath + " ");<NEW_LINE>log.info("{},deployCommand={}", clientName, runCommand);<NEW_LINE>Map<String, String> envMap;<NEW_LINE>if (jsonEnvMap != null) {<NEW_LINE>envMap = JSONObject.toJavaObject(jsonEnvMap, Map.class);<NEW_LINE>} else {<NEW_LINE>envMap = new HashMap<>();<NEW_LINE>}<NEW_LINE>ProcessResult commandResult = CommandUtil.runLocalCommand(runCommand, envMap);<NEW_LINE>resultInfo.put("output", commandResult.outputUTF8());<NEW_LINE>resultInfo.put("retCode", commandResult.getExitValue());<NEW_LINE>resultInfo.put("clientName", clientName);<NEW_LINE>result.put(clientName, resultInfo);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | deployCommand = clientInfo.getString("deployCommand"); |
1,088,764 | static void updateHighlightersByTyping(@Nonnull Project project, @Nonnull DocumentEvent e) {<NEW_LINE>ApplicationManager.getApplication().assertIsDispatchThread();<NEW_LINE>final Document document = e.getDocument();<NEW_LINE>if (document instanceof DocumentEx && ((DocumentEx) document).isInBulkUpdate())<NEW_LINE>return;<NEW_LINE>final MarkupModel markup = DocumentMarkupModel.forDocument(document, project, true);<NEW_LINE>assertMarkupConsistent(markup, project);<NEW_LINE>final int start = e.getOffset() - 1;<NEW_LINE>final int end = start + e.getOldLength();<NEW_LINE>final List<HighlightInfo> toRemove = new ArrayList<>();<NEW_LINE>DaemonCodeAnalyzerEx.processHighlights(document, project, null, start, end, info -> {<NEW_LINE>if (!info.needUpdateOnTyping())<NEW_LINE>return true;<NEW_LINE><MASK><NEW_LINE>int highlighterStart = highlighter.getStartOffset();<NEW_LINE>int highlighterEnd = highlighter.getEndOffset();<NEW_LINE>if (info.isAfterEndOfLine()) {<NEW_LINE>if (highlighterStart < document.getTextLength()) {<NEW_LINE>highlighterStart += 1;<NEW_LINE>}<NEW_LINE>if (highlighterEnd < document.getTextLength()) {<NEW_LINE>highlighterEnd += 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!highlighter.isValid() || start < highlighterEnd && highlighterStart <= end) {<NEW_LINE>toRemove.add(info);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>for (HighlightInfo info : toRemove) {<NEW_LINE>if (!info.getHighlighter().isValid() || info.type.equals(HighlightInfoType.WRONG_REF)) {<NEW_LINE>info.getHighlighter().dispose();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assertMarkupConsistent(markup, project);<NEW_LINE>if (!toRemove.isEmpty()) {<NEW_LINE>disableWhiteSpaceOptimization(document);<NEW_LINE>}<NEW_LINE>} | RangeHighlighter highlighter = info.getHighlighter(); |
500,273 | protected <S> void visitDependency(RuleMethodDataCollector dataCollector, MethodRuleDefinition<?, ?> ruleDefinition, ModelType<S> expectedDependency, RuleSourceValidationProblemCollector problems) {<NEW_LINE>if (ruleDefinition.getReferences().isEmpty() && problems.hasProblems()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<ModelReference<?><MASK><NEW_LINE>ModelType<? extends S> dependency = null;<NEW_LINE>for (ModelReference<?> reference : references) {<NEW_LINE>if (expectedDependency.isAssignableFrom(reference.getType())) {<NEW_LINE>if (dependency != null) {<NEW_LINE>problems.add(ruleDefinition, String.format("A method %s must have one parameter extending %s. Found multiple parameter extending %s.", getDescription(), expectedDependency.getDisplayName(), expectedDependency.getDisplayName()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>dependency = reference.getType().asSubtype(expectedDependency);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dependency == null) {<NEW_LINE>problems.add(ruleDefinition, String.format("A method %s must have one parameter extending %s. Found no parameter extending %s.", getDescription(), expectedDependency.getDisplayName(), expectedDependency.getDisplayName()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>dataCollector.put(expectedDependency, dependency);<NEW_LINE>} | > references = ruleDefinition.getReferences(); |
1,701,069 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject <MASK><NEW_LINE>Card cardFound = null;<NEW_LINE>boolean needShuffle = false;<NEW_LINE>if (controller != null && sourceObject != null) {<NEW_LINE>if (forceToSearchBoth || controller.chooseUse(outcome, "Search your library for a " + filter.getMessage() + '?', source, game)) {<NEW_LINE>TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter);<NEW_LINE>target.clearChosen();<NEW_LINE>if (controller.searchLibrary(target, source, game)) {<NEW_LINE>if (!target.getTargets().isEmpty()) {<NEW_LINE>cardFound = game.getCard(target.getFirstTarget());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>needShuffle = true;<NEW_LINE>}<NEW_LINE>if (cardFound == null && controller.chooseUse(outcome, "Search your graveyard for a " + filter.getMessage() + '?', source, game)) {<NEW_LINE>TargetCard target = new TargetCardInYourGraveyard(0, 1, filter, true);<NEW_LINE>target.clearChosen();<NEW_LINE>if (controller.choose(outcome, controller.getGraveyard(), target, game)) {<NEW_LINE>if (!target.getTargets().isEmpty()) {<NEW_LINE>cardFound = game.getCard(target.getFirstTarget());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cardFound != null) {<NEW_LINE>controller.moveCards(cardFound, Zone.BATTLEFIELD, source, game);<NEW_LINE>}<NEW_LINE>if (needShuffle) {<NEW_LINE>controller.shuffleLibrary(source, game);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | sourceObject = source.getSourceObject(game); |
570,811 | public AuthConfig createAuthConfig() {<NEW_LINE>try {<NEW_LINE>Class<?> credentialsProviderChainClass = Class.forName("com.amazonaws.auth.DefaultAWSCredentialsProviderChain");<NEW_LINE>Object credentialsProviderChain = credentialsProviderChainClass.getDeclaredConstructor().newInstance();<NEW_LINE>Object credentials = credentialsProviderChainClass.getMethod("getCredentials").invoke(credentialsProviderChain);<NEW_LINE>if (credentials == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Class<?> sessionCredentialsClass = Class.forName("com.amazonaws.auth.AWSSessionCredentials");<NEW_LINE>String sessionToken = sessionCredentialsClass.isInstance(credentials) ? (String) sessionCredentialsClass.getMethod("getSessionToken").invoke(credentials) : null;<NEW_LINE>Class<?> credentialsClass = Class.forName("com.amazonaws.auth.AWSCredentials");<NEW_LINE>return new AuthConfig((String) credentialsClass.getMethod("getAWSAccessKeyId").invoke(credentials), (String) credentialsClass.getMethod("getAWSSecretKey").invoke(credentials), "none", sessionToken);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>String issueTitle = null;<NEW_LINE>try {<NEW_LINE>issueTitle = URLEncoder.encode("Failed calling AWS SDK: " + t.getMessage(<MASK><NEW_LINE>} catch (UnsupportedEncodingException ignore) {<NEW_LINE>}<NEW_LINE>log.warn("Failed to fetch AWS credentials: %s", t.getMessage());<NEW_LINE>if (t.getCause() != null) {<NEW_LINE>log.warn("Caused by: %s", t.getCause().getMessage());<NEW_LINE>}<NEW_LINE>log.warn("Please report a bug at https://github.com/fabric8io/docker-maven-plugin/issues/new?%s", issueTitle == null ? "" : "title=?" + issueTitle);<NEW_LINE>log.warn("%s", t);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | ), UTF_8.name()); |
1,460,381 | public Long migrate(final HaWorkVO work) {<NEW_LINE>long vmId = work.getInstanceId();<NEW_LINE>long srcHostId = work.getHostId();<NEW_LINE>VMInstanceVO vm = _instanceDao.findById(vmId);<NEW_LINE>if (vm == null) {<NEW_LINE>s_logger.info("Unable to find vm: " + vmId + ", skipping migrate.");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>s_logger.info("Migration attempt: for VM " + vm.getUuid() + "from host id " + srcHostId + ". Starting attempt: " + (1 + work.getTimesTried()) + "/" + _maxRetries + " times.");<NEW_LINE>try {<NEW_LINE>work.setStep(Step.Migrating);<NEW_LINE>_haDao.update(<MASK><NEW_LINE>// First try starting the vm with its original planner, if it doesn't succeed send HAPlanner as its an emergency.<NEW_LINE>_itMgr.migrateAway(vm.getUuid(), srcHostId);<NEW_LINE>return null;<NEW_LINE>} catch (InsufficientServerCapacityException e) {<NEW_LINE>s_logger.warn("Migration attempt: Insufficient capacity for migrating a VM " + vm.getUuid() + " from source host id " + srcHostId + ". Exception: " + e.getMessage());<NEW_LINE>_resourceMgr.migrateAwayFailed(srcHostId, vmId);<NEW_LINE>return (System.currentTimeMillis() >> 10) + _migrateRetryInterval;<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_logger.warn("Migration attempt: Unexpected exception occurred when attempting migration of " + vm.getUuid() + e.getMessage());<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | work.getId(), work); |
1,598,220 | private int countsArrayIndex(final int bucketIndex, final int subBucketIndex) {<NEW_LINE>assert (subBucketIndex < subBucketCount);<NEW_LINE>assert (bucketIndex == 0 || (subBucketIndex >= subBucketHalfCount));<NEW_LINE>// Calculate the index for the first entry that will be used in the bucket (halfway through subBucketCount).<NEW_LINE>// For bucketIndex 0, all subBucketCount entries may be used, but bucketBaseIndex is still set in the middle.<NEW_LINE>final int bucketBaseIndex <MASK><NEW_LINE>// Calculate the offset in the bucket. This subtraction will result in a positive value in all buckets except<NEW_LINE>// the 0th bucket (since a value in that bucket may be less than half the bucket's 0 to subBucketCount range).<NEW_LINE>// However, this works out since we give bucket 0 twice as much space.<NEW_LINE>final int offsetInBucket = subBucketIndex - subBucketHalfCount;<NEW_LINE>// The following is the equivalent of ((subBucketIndex - subBucketHalfCount) + bucketBaseIndex;<NEW_LINE>return bucketBaseIndex + offsetInBucket;<NEW_LINE>} | = (bucketIndex + 1) << subBucketHalfCountMagnitude; |
1,337,357 | protected void readElementsFromXml(EwsServiceXmlReader reader) throws Exception {<NEW_LINE>reader.readStartElement(XmlNamespace.Messages, XmlElementNames.RootFolder);<NEW_LINE>int totalItemsInView = reader.readAttributeValue(Integer.class, XmlAttributeNames.TotalItemsInView);<NEW_LINE>boolean moreItemsAvailable = !reader.readAttributeValue(Boolean.class, XmlAttributeNames.IncludesLastItemInRange);<NEW_LINE>// Ignore IndexedPagingOffset attribute if moreItemsAvailable is false.<NEW_LINE>Integer nextPageOffset = moreItemsAvailable ? reader.readNullableAttributeValue(Integer.<MASK><NEW_LINE>if (!this.isGrouped) {<NEW_LINE>this.results = new FindItemsResults<TItem>();<NEW_LINE>this.results.setTotalCount(totalItemsInView);<NEW_LINE>this.results.setNextPageOffset(nextPageOffset);<NEW_LINE>this.results.setMoreAvailable(moreItemsAvailable);<NEW_LINE>internalReadItemsFromXml(reader, this.propertySet, this.results.getItems());<NEW_LINE>} else {<NEW_LINE>this.groupedFindResults = new GroupedFindItemsResults<TItem>();<NEW_LINE>this.groupedFindResults.setTotalCount(totalItemsInView);<NEW_LINE>this.groupedFindResults.setNextPageOffset(nextPageOffset);<NEW_LINE>this.groupedFindResults.setMoreAvailable(moreItemsAvailable);<NEW_LINE>reader.readStartElement(XmlNamespace.Types, XmlElementNames.Groups);<NEW_LINE>if (!reader.isEmptyElement()) {<NEW_LINE>do {<NEW_LINE>reader.read();<NEW_LINE>if (reader.isStartElement(XmlNamespace.Types, XmlElementNames.GroupedItems)) {<NEW_LINE>String groupIndex = reader.readElementValue(XmlNamespace.Types, XmlElementNames.GroupIndex);<NEW_LINE>ArrayList<TItem> itemList = new ArrayList<TItem>();<NEW_LINE>internalReadItemsFromXml(reader, this.propertySet, itemList);<NEW_LINE>reader.readEndElement(XmlNamespace.Types, XmlElementNames.GroupedItems);<NEW_LINE>this.groupedFindResults.getItemGroups().add(new ItemGroup<TItem>(groupIndex, itemList));<NEW_LINE>}<NEW_LINE>} while (!reader.isEndElement(XmlNamespace.Types, XmlElementNames.Groups));<NEW_LINE>} else {<NEW_LINE>reader.read();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.readEndElement(XmlNamespace.Messages, XmlElementNames.RootFolder);<NEW_LINE>} | class, XmlAttributeNames.IndexedPagingOffset) : null; |
438,582 | public void mouseClicked(MouseEvent e) {<NEW_LINE>latestMousePositionX = e.getX();<NEW_LINE>currentMousePositionX = latestMousePositionX;<NEW_LINE>// On double click in a left/right handle, set the interval to the min/max<NEW_LINE>if (e.getClickCount() == 2) {<NEW_LINE>int x = e.getX();<NEW_LINE>int r = settings.selection.visibleHookWidth + settings.selection.invisibleHookMargin;<NEW_LINE>int width = getWidth();<NEW_LINE>double min = model.getCustomMin();<NEW_LINE>double max = model.getCustomMax();<NEW_LINE>double intervalStart = model.getIntervalStart();<NEW_LINE>double intervalEnd = model.getIntervalEnd();<NEW_LINE>int sf = Math.max(0, getPixelPosition(intervalStart, max - min, min, width));<NEW_LINE>int st = Math.min(width, getPixelPosition(intervalEnd, max - min, min, width));<NEW_LINE>int position = inPosition(x, r, sf, st);<NEW_LINE>switch(position) {<NEW_LINE>case LOC_RESIZE_FROM:<NEW_LINE>controller.setInterval(min, intervalEnd);<NEW_LINE>break;<NEW_LINE>case LOC_RESIZE_CENTER:<NEW_LINE>controller.setInterval(min, max);<NEW_LINE>break;<NEW_LINE>case LOC_RESIZE_TO:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>setInterval(model.getIntervalStart(), model.getIntervalEnd());<NEW_LINE>}<NEW_LINE>} | controller.setInterval(intervalStart, max); |
1,489,124 | private void protectControls() {<NEW_LINE>Result result = getResult();<NEW_LINE>final boolean forClass = !forInterface;<NEW_LINE>fieldCheckBox.setEnabled(forClass);<NEW_LINE>returnCheckBox.setEnabled((result.mode == PropertyPattern.READ_WRITE || result.mode == PropertyPattern.READ_ONLY<MASK><NEW_LINE>setCheckBox.setEnabled((result.mode == PropertyPattern.READ_WRITE || result.mode == PropertyPattern.WRITE_ONLY) && result.withField && forClass);<NEW_LINE>supportCheckBox.setEnabled((result.bound || result.constrained) && forClass);<NEW_LINE>niReturnCheckBox.setEnabled(fieldCheckBox.isSelected() && result.niGetter && forClass);<NEW_LINE>niSetCheckBox.setEnabled(fieldCheckBox.isSelected() && result.niSetter && forClass);<NEW_LINE>boundCheckBox.setEnabled(forClass);<NEW_LINE>constrainedCheckBox.setEnabled(forClass);<NEW_LINE>} | ) && result.withField && forClass); |
18,206 | public double distance(NumberVector v1, NumberVector v2) {<NEW_LINE>final int dim1 = v1.getDimensionality(), dim2 = v2.getDimensionality();<NEW_LINE>if (dim1 > dim2) {<NEW_LINE>return distance(v2, v1);<NEW_LINE>}<NEW_LINE>final int delta = (int) <MASK><NEW_LINE>// Compute value range, for scaling epsilon:<NEW_LINE>final double epsilon = getRange(v1, dim1, v2, dim2) * pEpsilon;<NEW_LINE>double[] curr = new double[dim2 + 1], next = new double[dim2 + 1];<NEW_LINE>for (int i = 0; i < dim1; i++) {<NEW_LINE>final double ai = v1.doubleValue(i);<NEW_LINE>for (int j = Math.max(0, i - delta); j <= Math.min(dim2 - 1, i + delta); j++) {<NEW_LINE>final double bj = v2.doubleValue(j);<NEW_LINE>if ((bj + epsilon) >= ai && (bj - epsilon) <= ai) {<NEW_LINE>// match<NEW_LINE>next[j + 1] = curr[j] + 1;<NEW_LINE>} else if (curr[j + 1] > next[j]) {<NEW_LINE>// ins<NEW_LINE>next[j + 1] = curr[j + 1];<NEW_LINE>} else {<NEW_LINE>// del<NEW_LINE>next[j + 1] = next[j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Swap<NEW_LINE>double[] tmp = curr;<NEW_LINE>curr = next;<NEW_LINE>next = tmp;<NEW_LINE>}<NEW_LINE>// search for maximum in the last line<NEW_LINE>double maxEntry = curr[1];<NEW_LINE>for (int i = 2; i < dim2 + 1; i++) {<NEW_LINE>maxEntry = (curr[i] > maxEntry) ? curr[i] : maxEntry;<NEW_LINE>}<NEW_LINE>final double sim = maxEntry / Math.min(dim1, dim2);<NEW_LINE>return 1. - sim;<NEW_LINE>} | Math.ceil(dim2 * pDelta); |
759,649 | public static BufferedImage createHeatMapImage(HeatMapDataset dataset, PaintScale paintScale) {<NEW_LINE>Args.nullNotPermitted(dataset, "dataset");<NEW_LINE>Args.nullNotPermitted(paintScale, "paintScale");<NEW_LINE>int xCount = dataset.getXSampleCount();<NEW_LINE><MASK><NEW_LINE>BufferedImage image = new BufferedImage(xCount, yCount, BufferedImage.TYPE_INT_ARGB);<NEW_LINE>Graphics2D g2 = image.createGraphics();<NEW_LINE>for (int xIndex = 0; xIndex < xCount; xIndex++) {<NEW_LINE>for (int yIndex = 0; yIndex < yCount; yIndex++) {<NEW_LINE>double z = dataset.getZValue(xIndex, yIndex);<NEW_LINE>Paint p = paintScale.getPaint(z);<NEW_LINE>g2.setPaint(p);<NEW_LINE>g2.fillRect(xIndex, yCount - yIndex - 1, 1, 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return image;<NEW_LINE>} | int yCount = dataset.getYSampleCount(); |
378,173 | public InstanceFleetModifyConfig unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InstanceFleetModifyConfig instanceFleetModifyConfig = new InstanceFleetModifyConfig();<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("InstanceFleetId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>instanceFleetModifyConfig.setInstanceFleetId(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("TargetOnDemandCapacity", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>instanceFleetModifyConfig.setTargetOnDemandCapacity(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("TargetSpotCapacity", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>instanceFleetModifyConfig.setTargetSpotCapacity(context.getUnmarshaller(Integer.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 instanceFleetModifyConfig;<NEW_LINE>} | class).unmarshall(context)); |
745,003 | // DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static com.sun.jdi.request.EventRequest request(com.sun.jdi.event.Event a) throws org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.event.Event", "request", "JDI CALL: com.sun.jdi.event.Event({0}).request()", new Object[] { a });<NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE>com.sun.jdi.request.EventRequest ret;<NEW_LINE>ret = a.request();<NEW_LINE>retValue = ret;<NEW_LINE>return ret;<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.report(ex);<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper(ex);<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.Mirror) a).virtualMachine();<NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper(ex);<NEW_LINE>} catch (Error err) {<NEW_LINE>retValue = err;<NEW_LINE>throw err;<NEW_LINE>} catch (RuntimeException rex) {<NEW_LINE>retValue = rex;<NEW_LINE>throw rex;<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | logCallEnd("com.sun.jdi.event.Event", "request", retValue); |
476,705 | private static void putDeadlineMessage(JobDataMap jobData, DeadlineMessage deadlineMessage, Serializer serializer) {<NEW_LINE>jobData.put(<MASK><NEW_LINE>jobData.put(MESSAGE_ID, deadlineMessage.getIdentifier());<NEW_LINE>jobData.put(MESSAGE_TIMESTAMP, deadlineMessage.getTimestamp().toString());<NEW_LINE>SerializedObject<byte[]> serializedDeadlinePayload = serializer.serialize(deadlineMessage.getPayload(), byte[].class);<NEW_LINE>jobData.put(SERIALIZED_MESSAGE_PAYLOAD, serializedDeadlinePayload.getData());<NEW_LINE>jobData.put(MESSAGE_TYPE, serializedDeadlinePayload.getType().getName());<NEW_LINE>jobData.put(MESSAGE_REVISION, serializedDeadlinePayload.getType().getRevision());<NEW_LINE>SerializedObject<byte[]> serializedDeadlineMetaData = serializer.serialize(deadlineMessage.getMetaData(), byte[].class);<NEW_LINE>jobData.put(MESSAGE_METADATA, serializedDeadlineMetaData.getData());<NEW_LINE>} | DEADLINE_NAME, deadlineMessage.getDeadlineName()); |
1,317,430 | public void processEvents(@Nonnull List<? extends VFileEvent> events) {<NEW_LINE>ApplicationManager.getApplication().assertWriteAccessAllowed();<NEW_LINE>int startIndex = 0;<NEW_LINE>int cappedInitialSize = Math.min(events.size(), INNER_ARRAYS_THRESHOLD);<NEW_LINE>List<Runnable> applyEvents <MASK><NEW_LINE>MostlySingularMultiMap<String, VFileEvent> files = new MostlySingularMultiMap<>() {<NEW_LINE><NEW_LINE>@Nonnull<NEW_LINE>@Override<NEW_LINE>protected Map<String, Object> createMap() {<NEW_LINE>return Maps.newHashMap(cappedInitialSize, FileUtil.PATH_HASHING_STRATEGY);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Set<String> middleDirs = Sets.newHashSet(cappedInitialSize, FileUtil.PATH_HASHING_STRATEGY);<NEW_LINE>List<VFileEvent> validated = new ArrayList<>(cappedInitialSize);<NEW_LINE>BulkFileListener publisher = getPublisher();<NEW_LINE>while (startIndex != events.size()) {<NEW_LINE>PingProgress.interactWithEdtProgress();<NEW_LINE>applyEvents.clear();<NEW_LINE>files.clear();<NEW_LINE>middleDirs.clear();<NEW_LINE>validated.clear();<NEW_LINE>startIndex = groupAndValidate(events, startIndex, applyEvents, validated, files, middleDirs);<NEW_LINE>if (!validated.isEmpty()) {<NEW_LINE>PingProgress.interactWithEdtProgress();<NEW_LINE>// do defensive copy to cope with ill-written listeners that save passed list for later processing<NEW_LINE>List<VFileEvent> toSend = ContainerUtil.immutableList(validated.toArray(new VFileEvent[0]));<NEW_LINE>publisher.before(toSend);<NEW_LINE>PingProgress.interactWithEdtProgress();<NEW_LINE>applyEvents.forEach(Runnable::run);<NEW_LINE>PingProgress.interactWithEdtProgress();<NEW_LINE>publisher.after(toSend);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new ArrayList<>(cappedInitialSize); |
1,441,517 | public int compareTo(final DeliveryServiceMatcher that) {<NEW_LINE>if (this == that || this.equals(that)) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>final Set<RequestMatcher> uniqueToThis = new HashSet<RequestMatcher>();<NEW_LINE>uniqueToThis.addAll(this.requestMatchers);<NEW_LINE>final Set<RequestMatcher> uniqueToThat = new HashSet<RequestMatcher>();<NEW_LINE>uniqueToThat.addAll(that.requestMatchers);<NEW_LINE>for (final RequestMatcher myRequestMatcher : requestMatchers) {<NEW_LINE>if (uniqueToThat.remove(myRequestMatcher)) {<NEW_LINE>uniqueToThis.remove(myRequestMatcher);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final TreeMap<RequestMatcher, DeliveryServiceMatcher> map = new TreeMap<RequestMatcher, DeliveryServiceMatcher>();<NEW_LINE>for (final RequestMatcher thisMatcher : uniqueToThis) {<NEW_LINE>map.put(thisMatcher, this);<NEW_LINE>}<NEW_LINE>for (final RequestMatcher thatMatcher : uniqueToThat) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (map.isEmpty()) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>return (this == map.firstEntry().getValue()) ? -1 : 1;<NEW_LINE>} | map.put(thatMatcher, that); |
1,337,041 | private void populatePkcs10CsrDetails() throws CryptoException {<NEW_LINE>jtfCsrFormat.setText(res.getString("DSignCsr.jtfCsrFormat.Pkcs10.text"));<NEW_LINE>jtfCsrFormat.setCaretPosition(0);<NEW_LINE>jdnCsrSubject.setDistinguishedName(pkcs10Csr.getSubject());<NEW_LINE>try {<NEW_LINE>csrPublicKey = new JcaPKCS10CertificationRequest(pkcs10Csr).getPublicKey();<NEW_LINE>} catch (GeneralSecurityException ex) {<NEW_LINE>throw new CryptoException(res.getString("DSignCsr.NoGetCsrPublicKey.message"), ex);<NEW_LINE>}<NEW_LINE>populatePublicKey();<NEW_LINE>String sigAlgId = pkcs10Csr.getSignatureAlgorithm().getAlgorithm().getId();<NEW_LINE>byte[] sigAlgParams = extractSigAlgParams();<NEW_LINE>SignatureType sigAlg = SignatureType.resolveOid(sigAlgId, sigAlgParams);<NEW_LINE>if (sigAlg != null) {<NEW_LINE>jtfCsrSignatureAlgorithm.setText(sigAlg.friendly());<NEW_LINE>} else {<NEW_LINE>jtfCsrSignatureAlgorithm.setText(sigAlgId);<NEW_LINE>}<NEW_LINE>jtfCsrSignatureAlgorithm.setCaretPosition(0);<NEW_LINE>DialogHelper.populatePkcs10Challenge(pkcs10Csr.getAttributes(), jtfCsrChallenge);<NEW_LINE>Attribute[] <MASK><NEW_LINE>if (extReqAttr != null && extReqAttr.length > 0) {<NEW_LINE>jbCsrExtensions.setEnabled(true);<NEW_LINE>jbTransferExtensions.setEnabled(true);<NEW_LINE>} else {<NEW_LINE>jbCsrExtensions.setEnabled(false);<NEW_LINE>jbTransferExtensions.setEnabled(false);<NEW_LINE>}<NEW_LINE>} | extReqAttr = pkcs10Csr.getAttributes(pkcs_9_at_extensionRequest); |
1,019,209 | public void start(Xid xid, int flag) throws XAException {<NEW_LINE>if (flag != XAResource.TMNOFLAGS && flag != XAResource.TMJOIN) {<NEW_LINE>throw new EhcacheXAException("Start flag not supported : " + xaResourceFlagsToString(flag), XAException.XAER_INVAL);<NEW_LINE>}<NEW_LINE>if (currentXid != null) {<NEW_LINE>throw new EhcacheXAException("Already started on : " + xid, XAException.XAER_PROTO);<NEW_LINE>}<NEW_LINE>TransactionId transactionId = new TransactionId(xid);<NEW_LINE>XATransactionContext<K, V> <MASK><NEW_LINE>if (flag == XAResource.TMNOFLAGS) {<NEW_LINE>if (transactionContext == null) {<NEW_LINE>transactionContext = transactionContextFactory.createTransactionContext(transactionId, underlyingStore, journal, transactionTimeoutInSeconds);<NEW_LINE>} else {<NEW_LINE>throw new EhcacheXAException("Cannot start in parallel on two XIDs : starting " + xid, XAException.XAER_RMERR);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (transactionContext == null) {<NEW_LINE>throw new EhcacheXAException("Cannot join unknown XID : " + xid, XAException.XAER_NOTA);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (transactionContext.hasTimedOut()) {<NEW_LINE>transactionContextFactory.destroy(transactionId);<NEW_LINE>throw new EhcacheXAException("Transaction timeout for XID : " + xid, XAException.XA_RBTIMEOUT);<NEW_LINE>}<NEW_LINE>currentXid = xid;<NEW_LINE>} | transactionContext = transactionContextFactory.get(transactionId); |
1,090,459 | public I_PP_Order_Candidate execute() {<NEW_LINE>// Create PP Order Candidate<NEW_LINE>final I_PP_Order_Candidate ppOrderCandidateRecord = InterfaceWrapperHelper.newInstance(I_PP_Order_Candidate.class);<NEW_LINE>PPOrderCandidatePojoConverter.setMaterialDispoGroupId(ppOrderCandidateRecord, request.getMaterialDispoGroupId());<NEW_LINE>ppOrderCandidateRecord.setPP_Product_Planning_ID(ProductPlanningId.toRepoId(request.getProductPlanningId()));<NEW_LINE>ppOrderCandidateRecord.setAD_Org_ID(request.getClientAndOrgId().getOrgId().getRepoId());<NEW_LINE>ppOrderCandidateRecord.setS_Resource_ID(request.getPlantId().getRepoId());<NEW_LINE>ppOrderCandidateRecord.setM_Warehouse_ID(request.getWarehouseId().getRepoId());<NEW_LINE>ppOrderCandidateRecord.setM_Product_ID(request.getProductId().getRepoId());<NEW_LINE>final I_PP_Product_BOM bom = getBOM(request.getProductPlanningId());<NEW_LINE>ppOrderCandidateRecord.setPP_Product_BOM_ID(bom.getPP_Product_BOM_ID());<NEW_LINE>if (bom.getM_AttributeSetInstance_ID() > 0) {<NEW_LINE>ppOrderCandidateRecord.setM_AttributeSetInstance_ID(bom.getM_AttributeSetInstance_ID());<NEW_LINE>} else {<NEW_LINE>ppOrderCandidateRecord.setM_AttributeSetInstance_ID(request.getAttributeSetInstanceId().getRepoId());<NEW_LINE>}<NEW_LINE>ppOrderCandidateRecord.setDatePromised(TimeUtil.asTimestamp(request.getDatePromised()));<NEW_LINE>ppOrderCandidateRecord.setDateStartSchedule(TimeUtil.asTimestamp(request.getDateStartSchedule()));<NEW_LINE>final Quantity qtyRounded = request.getQtyRequired().roundToUOMPrecision();<NEW_LINE>ppOrderCandidateRecord.setQtyEntered(qtyRounded.toBigDecimal());<NEW_LINE>ppOrderCandidateRecord.setC_UOM_ID(qtyRounded.getUomId().getRepoId());<NEW_LINE>ppOrderCandidateRecord.setC_OrderLine_ID(OrderLineId.toRepoId(request.getSalesOrderLineId()));<NEW_LINE>ppOrderCandidateRecord.setM_ShipmentSchedule_ID(ShipmentScheduleId.toRepoId<MASK><NEW_LINE>ppOrderCandidateDAO.save(ppOrderCandidateRecord);<NEW_LINE>Loggables.addLog("Created ppOrderCandidate; PP_Order_Candidate_ID={}", ppOrderCandidateRecord.getPP_Order_Candidate_ID());<NEW_LINE>return ppOrderCandidateRecord;<NEW_LINE>} | (request.getShipmentScheduleId())); |
182,705 | public ModelResponse<T> invoke(final ModelRequest request) {<NEW_LINE>int requireSize = 0;<NEW_LINE>final List<ModelResponse<T>> responses = Collections.synchronizedList(new ArrayList<ModelResponse<T>>());<NEW_LINE>final Semaphore semaphore = new Semaphore(0);<NEW_LINE>final Transaction t = Cat.getProducer().newTransaction("ModelService", getClass().getSimpleName());<NEW_LINE>int count = 0;<NEW_LINE>t.setStatus(Message.SUCCESS);<NEW_LINE>t.addData("request", request);<NEW_LINE>t.addData("thread", Thread.currentThread());<NEW_LINE>for (final ModelService<T> service : m_allServices) {<NEW_LINE>if (!service.isEligable(request)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// save current transaction so that child thread can access it<NEW_LINE>if (service instanceof ModelServiceWithCalSupport) {<NEW_LINE>((ModelServiceWithCalSupport) service).setParentTransaction(t);<NEW_LINE>}<NEW_LINE>requireSize++;<NEW_LINE>m_configManager.getModelServiceExecutorService().submit(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>ModelResponse<T> response = service.invoke(request);<NEW_LINE>if (response.getException() != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (response != null && response.getModel() != null) {<NEW_LINE>responses.add(response);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logError(e);<NEW_LINE>t.setStatus(e);<NEW_LINE>} finally {<NEW_LINE>semaphore.release();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// 10 seconds timeout<NEW_LINE>semaphore.tryAcquire(count, 10000, TimeUnit.MILLISECONDS);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// ignore it<NEW_LINE>t.setStatus(e);<NEW_LINE>} finally {<NEW_LINE>t.complete();<NEW_LINE>}<NEW_LINE>String requireAll = request.getProperty("requireAll");<NEW_LINE>if (requireAll != null && responses.size() != requireSize) {<NEW_LINE>String data = "require:" + requireSize + " actual:" + responses.size();<NEW_LINE>Cat.logEvent("FetchReportError:" + this.getClass().getSimpleName(), request.getDomain(), Event.SUCCESS, data);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ModelResponse<T> aggregated = new ModelResponse<T>();<NEW_LINE>T report = merge(request, responses);<NEW_LINE>aggregated.setModel(report);<NEW_LINE>return aggregated;<NEW_LINE>} | logError(response.getException()); |
345,573 | public static Set<String> attachContextPath(String contextPath, Set<String> uriResource) {<NEW_LINE>if (contextPath == null || "".equals(contextPath) || uriResource == null || uriResource.isEmpty()) {<NEW_LINE>return uriResource;<NEW_LINE>}<NEW_LINE>// format context path<NEW_LINE>contextPath = contextPath<MASK><NEW_LINE>contextPath = contextPath.replace("//", "/");<NEW_LINE>if (!contextPath.startsWith(PATH_SPLIT)) {<NEW_LINE>contextPath = PATH_SPLIT.concat(contextPath);<NEW_LINE>}<NEW_LINE>if (contextPath.endsWith(PATH_SPLIT)) {<NEW_LINE>contextPath = contextPath.substring(0, contextPath.length() - 1);<NEW_LINE>}<NEW_LINE>final String finalContextPath = contextPath;<NEW_LINE>return uriResource.stream().map(resource -> resource.startsWith(PATH_SPLIT) ? finalContextPath.concat(resource) : finalContextPath.concat(PATH_SPLIT).concat(resource)).collect(Collectors.toSet());<NEW_LINE>} | .toLowerCase().trim(); |
1,048,951 | private void onMatchLogicalView(RelOptRuleCall call) {<NEW_LINE>final LogicalSemiJoin join = call.rel(0);<NEW_LINE>RelNode <MASK><NEW_LINE>final LogicalView logicalView = call.rel(2);<NEW_LINE>RexNode newCondition = JoinConditionSimplifyRule.simplifyCondition(join.getCondition(), join.getCluster().getRexBuilder());<NEW_LINE>RexUtils.RestrictType restrictType = RexUtils.RestrictType.RIGHT;<NEW_LINE>if (!RexUtils.isBatchKeysAccessCondition(join, newCondition, join.getLeft().getRowType().getFieldCount(), restrictType, (Pair<RelDataType, RelDataType> relDataTypePair) -> CBOUtil.bkaTypeCheck(relDataTypePair))) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!canBKAJoin(join)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final RelTraitSet leftTraitSet;<NEW_LINE>final RelTraitSet rightTraitSet;<NEW_LINE>if (RelOptUtil.NO_COLLATION_AND_DISTRIBUTION.test(join)) {<NEW_LINE>leftTraitSet = join.getCluster().getPlanner().emptyTraitSet().replace(DrdsConvention.INSTANCE);<NEW_LINE>rightTraitSet = join.getCluster().getPlanner().emptyTraitSet().replace(DrdsConvention.INSTANCE);<NEW_LINE>} else {<NEW_LINE>leftTraitSet = join.getLeft().getTraitSet().replace(DrdsConvention.INSTANCE);<NEW_LINE>rightTraitSet = join.getRight().getTraitSet().replace(DrdsConvention.INSTANCE);<NEW_LINE>}<NEW_LINE>left = convert(left, leftTraitSet);<NEW_LINE>LogicalView right = logicalView.copy(rightTraitSet);<NEW_LINE>SemiBKAJoin bkaJoin = SemiBKAJoin.create(join.getTraitSet().replace(DrdsConvention.INSTANCE), left, right, newCondition, join.getVariablesSet(), join.getJoinType(), join.isSemiJoinDone(), ImmutableList.copyOf(join.getSystemFieldList()), join.getHints(), join);<NEW_LINE>RelOptCost fixedCost = CheckJoinHint.check(join, HintType.CMD_SEMI_BKA_JOIN);<NEW_LINE>if (fixedCost != null) {<NEW_LINE>bkaJoin.setFixedCost(fixedCost);<NEW_LINE>}<NEW_LINE>right.setIsMGetEnabled(true);<NEW_LINE>right.setJoin(bkaJoin);<NEW_LINE>RelUtils.changeRowType(bkaJoin, join.getRowType());<NEW_LINE>call.transformTo(bkaJoin);<NEW_LINE>} | left = call.rel(1); |
1,477,775 | PartitionReplica checkAndGetPrimaryReplicaOwner(int partitionId, int replicaIndex) {<NEW_LINE>InternalPartitionImpl partition = partitionStateManager.getPartitionImpl(partitionId);<NEW_LINE>PartitionReplica owner = partition.getOwnerReplicaOrNull();<NEW_LINE>if (owner == null) {<NEW_LINE>logger.info(<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>PartitionReplica localReplica = PartitionReplica.from(nodeEngine.getLocalMember());<NEW_LINE>if (owner.equals(localReplica)) {<NEW_LINE>if (logger.isFinestEnabled()) {<NEW_LINE>logger.finest("This node is now owner of partition, cannot sync replica -> partitionId=" + partitionId + ", replicaIndex=" + replicaIndex + ", partition-info=" + partitionStateManager.getPartitionImpl(partitionId));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!partition.isOwnerOrBackup(localReplica)) {<NEW_LINE>if (logger.isFinestEnabled()) {<NEW_LINE>logger.finest("This node is not backup replica of partitionId=" + partitionId + ", replicaIndex=" + replicaIndex + " anymore.");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return owner;<NEW_LINE>} | "Sync replica target is null, no need to sync -> partitionId=" + partitionId + ", replicaIndex=" + replicaIndex); |
307,759 | private void loadBatchVariables() {<NEW_LINE>MBPartner <MASK><NEW_LINE>List<MHRAttendanceRecord> attendanceList = getLines(false);<NEW_LINE>if (!isLeave()) {<NEW_LINE>this.firstAttendance = attendanceList.stream().findFirst().get();<NEW_LINE>this.lastAttendance = attendanceList.get(attendanceList.size() - 1);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>setHR_Employee_ID(employee.getHR_Employee_ID());<NEW_LINE>String employeePayrollValue = null;<NEW_LINE>if (employee.getHR_Payroll_ID() != 0) {<NEW_LINE>MHRPayroll employeePayroll = MHRPayroll.getById(getCtx(), employee.getHR_Payroll_ID(), get_TrxName());<NEW_LINE>employeePayrollValue = employeePayroll.getValue();<NEW_LINE>}<NEW_LINE>workShift = MHRWorkShift.getById(getCtx(), getHR_WorkShift_ID());<NEW_LINE>//<NEW_LINE>scriptCtx.put("_HR_FirstAttendanceRecord", firstAttendance);<NEW_LINE>scriptCtx.put("_HR_LastAttendanceRecord", lastAttendance);<NEW_LINE>if (firstAttendance != null) {<NEW_LINE>scriptCtx.put("_FirstAttendanceTime", firstAttendance.getAttendanceTime());<NEW_LINE>}<NEW_LINE>if (lastAttendance != null) {<NEW_LINE>scriptCtx.put("_LastAttendanceTime", lastAttendance.getAttendanceTime());<NEW_LINE>}<NEW_LINE>scriptCtx.put("_DateStart", employee.getStartDate());<NEW_LINE>scriptCtx.put("_DateEnd", employee.getEndDate());<NEW_LINE>scriptCtx.put("_C_BPartner_ID", businessPartner.getC_BPartner_ID());<NEW_LINE>scriptCtx.put("_HR_Employee_ID", employee.getHR_Employee_ID());<NEW_LINE>scriptCtx.put("_C_BPartner", businessPartner);<NEW_LINE>scriptCtx.put("_HR_Employee", employee);<NEW_LINE>scriptCtx.put("_HR_Employee_Payroll_Value", employeePayrollValue);<NEW_LINE>// Document<NEW_LINE>scriptCtx.put("_DateDoc", getDateDoc());<NEW_LINE>scriptCtx.put("_HR_AttendanceBatch_ID", getHR_AttendanceBatch_ID());<NEW_LINE>scriptCtx.put("_HR_WorkShift_ID", getHR_WorkShift_ID());<NEW_LINE>scriptCtx.put("_HR_ShiftSchedule_ID", getHR_ShiftSchedule_ID());<NEW_LINE>scriptCtx.put("process", this);<NEW_LINE>scriptCtx.put("_HR_WorkShift", workShift);<NEW_LINE>scriptCtx.put("_ShiftFromTime", workShift.getShiftFromTime());<NEW_LINE>scriptCtx.put("_ShiftToTime", workShift.getShiftToTime());<NEW_LINE>scriptCtx.put("_BreakStartTime", workShift.getBreakStartTime());<NEW_LINE>scriptCtx.put("_BreakEndTime", workShift.getBreakEndTime());<NEW_LINE>BigDecimal breakHoursNo = workShift.getBreakHoursNo();<NEW_LINE>BigDecimal hoursNo = workShift.getNoOfHours();<NEW_LINE>if (breakHoursNo == null) {<NEW_LINE>breakHoursNo = Env.ZERO;<NEW_LINE>}<NEW_LINE>if (hoursNo == null) {<NEW_LINE>hoursNo = Env.ZERO;<NEW_LINE>}<NEW_LINE>scriptCtx.put("_BreakHoursNo", breakHoursNo.doubleValue());<NEW_LINE>scriptCtx.put("_NoOfHours", hoursNo.doubleValue());<NEW_LINE>scriptCtx.put("_ExpectedShiftFromTime", TimeUtil.getDayTime(getDateDoc(), workShift.getShiftFromTime()));<NEW_LINE>scriptCtx.put("_ExpectedShiftToTime", TimeUtil.getDayTime(getDateDoc(), workShift.getShiftToTime()));<NEW_LINE>} | businessPartner = (MBPartner) getC_BPartner(); |
883,169 | private void createDropDown() {<NEW_LINE>ScrollView dropdownView = createDropDownView();<NEW_LINE>dropdownWindow = new PopupWindow();<NEW_LINE>dropdownWindow.setFocusable(true);<NEW_LINE>dropdownWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);<NEW_LINE>if (!isInEditMode()) {<NEW_LINE>dropdownWindow.setBackgroundDrawable(DrawableUtils.resolveDrawable(android.R.drawable.dialog_holo_light_frame, getContext()));<NEW_LINE>}<NEW_LINE>dropdownWindow.setContentView(dropdownView);<NEW_LINE>dropdownWindow.setOnDismissListener(this);<NEW_LINE>dropdownWindow.setAnimationStyle(android.R.style.Animation_Activity);<NEW_LINE>float longestStringWidth = measureStringWidth(getLongestString(dropdownData)) + DimenUtils.dpToPixels((baselineItemRightPadding + baselineItemLeftPadding) * bootstrapSize);<NEW_LINE>if (longestStringWidth < getMeasuredWidth()) {<NEW_LINE>dropdownWindow.setWidth(DimenUtils<MASK><NEW_LINE>} else {<NEW_LINE>dropdownWindow.setWidth((int) longestStringWidth + DimenUtils.dpToPixels(8));<NEW_LINE>}<NEW_LINE>} | .dpToPixels(getMeasuredWidth())); |
1,755,810 | public void onMessage(Session session, String message) {<NEW_LINE>if (!session.equals(this.session)) {<NEW_LINE>handleWrongSession(session, message);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>logger.trace("{} received raw data: {}", socketName, message);<NEW_LINE>try {<NEW_LINE>DeconzBaseMessage changedMessage = Objects.requireNonNull(gson.fromJson(message, DeconzBaseMessage.class));<NEW_LINE>if (changedMessage.r == ResourceType.UNKNOWN) {<NEW_LINE>logger.trace("Received message has unknown resource type. Skipping message.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>WebSocketMessageListener listener = listeners.get(getListenerId(changedMessage<MASK><NEW_LINE>if (listener == null) {<NEW_LINE>logger.trace("Couldn't find listener for id {} with resource type {}. Either no thing for this id has been defined or this is a bug.", changedMessage.id, changedMessage.r);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Class<? extends DeconzBaseMessage> expectedMessageType = changedMessage.r.getExpectedMessageType();<NEW_LINE>if (expectedMessageType == null) {<NEW_LINE>logger.warn("BUG! Could not get expected message type for resource type {}. Please report this incident.", changedMessage.r);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DeconzBaseMessage deconzMessage = gson.fromJson(message, expectedMessageType);<NEW_LINE>if (deconzMessage != null) {<NEW_LINE>listener.messageReceived(changedMessage.id, deconzMessage);<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>// we need to catch all processing exceptions, otherwise they could affect the connection<NEW_LINE>logger.warn("{} encountered an error while processing the message {}: {}", socketName, message, e.getMessage());<NEW_LINE>}<NEW_LINE>} | .r, changedMessage.id)); |
36,054 | public void init(final GLAutoDrawable drawable) {<NEW_LINE>log.trace("GL - init()");<NEW_LINE>final GL2 gl = drawable.getGL().getGL2();<NEW_LINE>// clear z-buffer to the farthest<NEW_LINE>gl.glClearDepth(1.0f);<NEW_LINE>// the type of depth test to do<NEW_LINE>gl.glDepthFunc(GL.GL_LESS);<NEW_LINE>float amb = 0.5f;<NEW_LINE>float dif = 1.0f;<NEW_LINE>gl.glLightfv(GLLightingFunc.GL_LIGHT1, GLLightingFunc.GL_AMBIENT, new float[] { amb, amb, amb, 1 }, 0);<NEW_LINE>gl.glLightfv(GLLightingFunc.GL_LIGHT1, GLLightingFunc.GL_DIFFUSE, new float[] { dif, dif, dif, 1 }, 0);<NEW_LINE>gl.glLightfv(GLLightingFunc.GL_LIGHT1, GLLightingFunc.GL_SPECULAR, new float[] { dif, dif, dif, 1 }, 0);<NEW_LINE>gl.glEnable(GLLightingFunc.GL_LIGHT1);<NEW_LINE><MASK><NEW_LINE>gl.glShadeModel(GLLightingFunc.GL_SMOOTH);<NEW_LINE>gl.glEnable(GLLightingFunc.GL_NORMALIZE);<NEW_LINE>rr.init(drawable);<NEW_LINE>extrasOverlay = new Overlay(drawable);<NEW_LINE>caretOverlay = new Overlay(drawable);<NEW_LINE>} | gl.glEnable(GLLightingFunc.GL_LIGHTING); |
1,123,532 | private synchronized void pushManifest() {<NEW_LINE>if (started.get()) {<NEW_LINE>final AgentManifestMessage jobFileManifest;<NEW_LINE>try {<NEW_LINE>jobFileManifest = manifestProtoConverter.manifestToProtoMessage(this.jobId, this.jobDirectoryManifestCreatorService.getDirectoryManifest(this.jobDirectoryPath));<NEW_LINE>} catch (final IOException e) {<NEW_LINE>log.error("Failed to construct manifest", e);<NEW_LINE>return;<NEW_LINE>} catch (GenieConversionException e) {<NEW_LINE>log.error("Failed to serialize manifest", e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (this.controlStreamObserver == null) {<NEW_LINE>log.debug("Creating new control stream");<NEW_LINE>this.controlStreamObserver = fileStreamServiceStub.sync(this.responseObserver);<NEW_LINE>if (this.controlStreamObserver instanceof ClientCallStreamObserver) {<NEW_LINE>((ClientCallStreamObserver) this.controlStreamObserver).setMessageCompression(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.debug("Sending manifest via control stream");<NEW_LINE>this.controlStreamObserver.onNext(jobFileManifest);<NEW_LINE>}<NEW_LINE>} | this.properties.isEnableCompression()); |
55,706 | public javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet, javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {<NEW_LINE>logFine("In matchManagedConnections");<NEW_LINE>if (connectionSet == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);<NEW_LINE>java.util.Iterator iter = connectionSet.iterator();<NEW_LINE>ManagedConnectionImpl mc = null;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>try {<NEW_LINE>mc = (ManagedConnectionImpl) iter.next();<NEW_LINE>} catch (java.util.NoSuchElementException nsee) {<NEW_LINE>_logger.log(Level.SEVERE, "jdbc.exc_iter");<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>if (pc == null && this.equals(mc.getManagedConnectionFactory())) {<NEW_LINE>return mc;<NEW_LINE>} else if (SecurityUtils.isPasswordCredentialEqual(pc, mc.getPasswordCredential())) {<NEW_LINE>return mc;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ResourceException(nsee.getMessage()); |
1,688,901 | public <T> long bulkGraphOperation(final SecurityContext securityContext, final Query query, final int commitCount, String description, final BulkGraphOperation<T> operation) {<NEW_LINE>final Predicate<Long> condition = operation.getCondition();<NEW_LINE>final App app = StructrApp.getInstance(securityContext);<NEW_LINE>final <MASK><NEW_LINE>final boolean doCallbacks = operation.doCallbacks();<NEW_LINE>final boolean doNotifications = operation.doNotifications();<NEW_LINE>long objectCount = 0L;<NEW_LINE>boolean active = true;<NEW_LINE>int page = 1;<NEW_LINE>if (query == null) {<NEW_LINE>info("{}: {} objects processed", description, 0);<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>// set page size to commit count<NEW_LINE>query.getQueryContext().overrideFetchSize(commitCount);<NEW_LINE>query.pageSize(commitCount);<NEW_LINE>while (active) {<NEW_LINE>active = false;<NEW_LINE>try (final Tx tx = app.tx(doValidation, doCallbacks, doNotifications)) {<NEW_LINE>query.page(page++);<NEW_LINE>final Iterable<T> iterable = query.getResultStream();<NEW_LINE>final Iterator<T> iterator = iterable.iterator();<NEW_LINE>while (iterator.hasNext() && (condition == null || condition.accept(objectCount))) {<NEW_LINE>T node = iterator.next();<NEW_LINE>active = true;<NEW_LINE>try {<NEW_LINE>boolean success = operation.handleGraphObject(securityContext, node);<NEW_LINE>if (success) {<NEW_LINE>objectCount++;<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>operation.handleThrowable(securityContext, t, node);<NEW_LINE>}<NEW_LINE>// commit transaction after commitCount<NEW_LINE>if ((objectCount % commitCount) == 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tx.success();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// bulk transaction failed, what to do?<NEW_LINE>operation.handleTransactionFailure(securityContext, t);<NEW_LINE>}<NEW_LINE>if (description != null) {<NEW_LINE>info("{}: {} objects processed", description, objectCount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return objectCount;<NEW_LINE>} | boolean doValidation = operation.doValidation(); |
758,269 | public IJavaCompletionProposal createJavaProposal(ContentAssistContext context, JavaContentAssistInvocationContext javaContext) {<NEW_LINE>if (context.location == ContentAssistLocation.METHOD_CONTEXT) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>GroovyCompletionProposal proposal = new GroovyCompletionProposal(CompletionProposal.METHOD_REF, context.completionLocation);<NEW_LINE>proposal.setName(field.getName().toCharArray());<NEW_LINE>char[] completion = proposal.getName();<NEW_LINE>if (context.location == ContentAssistLocation.STATEMENT && field.getDeclaringClass().equals(VariableScope.CLASS_CLASS_NODE)) {<NEW_LINE>// qualifier is required for references to members of java.lang.Class<NEW_LINE>completion = CharOperation.concat(<MASK><NEW_LINE>} else if (getRequiredQualifier() != null) {<NEW_LINE>completion = CharOperation.concat(getRequiredQualifier().toCharArray(), completion, '.');<NEW_LINE>}<NEW_LINE>proposal.setCompletion(completion);<NEW_LINE>proposal.setDeclarationSignature(ProposalUtils.createTypeSignature(field.getDeclaringClass()));<NEW_LINE>proposal.setFlags(field.getModifiers() | (GroovyUtils.isDeprecated(field) ? Flags.AccDeprecated : 0));<NEW_LINE>proposal.setRelevance(computeRelevance(context));<NEW_LINE>proposal.setReplaceRange(context.completionLocation - context.completionExpression.length(), context.completionEnd);<NEW_LINE>proposal.setSignature(ProposalUtils.createTypeSignature(field.getType()));<NEW_LINE>if (getRequiredStaticImport() != null) {<NEW_LINE>CompletionProposal importProposal;<NEW_LINE>if (new AssistOptions(javaContext.getProject().getOptions(true)).suggestStaticImport) {<NEW_LINE>importProposal = CompletionProposal.create(CompletionProposal.FIELD_IMPORT, context.completionLocation);<NEW_LINE>importProposal.setAdditionalFlags(CompletionFlags.StaticImport);<NEW_LINE>importProposal.setDeclarationSignature(proposal.getDeclarationSignature());<NEW_LINE>importProposal.setName(proposal.getName());<NEW_LINE>} else {<NEW_LINE>importProposal = CompletionProposal.create(CompletionProposal.TYPE_IMPORT, context.completionLocation);<NEW_LINE>importProposal.setSignature(proposal.getDeclarationSignature());<NEW_LINE>}<NEW_LINE>proposal.setRequiredProposals(new CompletionProposal[] { importProposal });<NEW_LINE>}<NEW_LINE>return new GroovyJavaFieldCompletionProposal(proposal, createDisplayString(field), javaContext);<NEW_LINE>} | "this.".toCharArray(), completion); |
695,991 | private void applyAttributes(Context context, AttributeSet attrs) {<NEW_LINE>if (attrs == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final TypedArray array = context.obtainStyledAttributes(attrs, org.rajawali3d.R.styleable.SurfaceView);<NEW_LINE>final int count = array.getIndexCount();<NEW_LINE>for (int i = 0; i < count; ++i) {<NEW_LINE>int attr = array.getIndex(i);<NEW_LINE>if (attr == org.rajawali3d.R.styleable.SurfaceView_frameRate) {<NEW_LINE>mFrameRate = array.getFloat(attr, 60.0f);<NEW_LINE>} else if (attr == org.rajawali3d.R.styleable.SurfaceView_renderMode) {<NEW_LINE>mRenderMode = array.getInt(attr, ISurface.RENDERMODE_WHEN_DIRTY);<NEW_LINE>} else if (attr == org.rajawali3d.R.styleable.SurfaceView_antiAliasingType) {<NEW_LINE>mAntiAliasingConfig = ANTI_ALIASING_CONFIG.fromInteger(array.getInteger(attr, ANTI_ALIASING_CONFIG.NONE.ordinal()));<NEW_LINE>} else if (attr == org.rajawali3d.R.styleable.SurfaceView_multiSampleCount) {<NEW_LINE>mMultiSampleCount = <MASK><NEW_LINE>} else if (attr == org.rajawali3d.R.styleable.SurfaceView_isTransparent) {<NEW_LINE>mIsTransparent = array.getBoolean(attr, false);<NEW_LINE>} else if (attr == org.rajawali3d.R.styleable.SurfaceView_bitsRed) {<NEW_LINE>mBitsRed = array.getInteger(attr, 5);<NEW_LINE>} else if (attr == org.rajawali3d.R.styleable.SurfaceView_bitsGreen) {<NEW_LINE>mBitsGreen = array.getInteger(attr, 6);<NEW_LINE>} else if (attr == org.rajawali3d.R.styleable.SurfaceView_bitsBlue) {<NEW_LINE>mBitsBlue = array.getInteger(attr, 5);<NEW_LINE>} else if (attr == org.rajawali3d.R.styleable.SurfaceView_bitsAlpha) {<NEW_LINE>mBitsAlpha = array.getInteger(attr, 0);<NEW_LINE>} else if (attr == org.rajawali3d.R.styleable.SurfaceView_bitsDepth) {<NEW_LINE>mBitsDepth = array.getInteger(attr, 16);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>array.recycle();<NEW_LINE>} | array.getInteger(attr, 0); |
585,871 | private void handle(APIRerunLongJobMsg msg) {<NEW_LINE>APIRerunLongJobEvent evt = new APIRerunLongJobEvent(msg.getId());<NEW_LINE>SubmitLongJobMsg smsg = new SubmitLongJobMsg();<NEW_LINE>LongJobVO job = dbf.findByUuid(msg.getUuid(), LongJobVO.class);<NEW_LINE>smsg.setJobUuid(job.getUuid());<NEW_LINE>smsg.setDescription(job.getDescription());<NEW_LINE>smsg.setJobData(job.getJobData());<NEW_LINE>smsg.setJobName(job.getJobName());<NEW_LINE>smsg.setName(job.getName());<NEW_LINE>smsg.setTargetResourceUuid(job.getTargetResourceUuid());<NEW_LINE>smsg.setResourceUuid(job.getUuid());<NEW_LINE>smsg.setSystemTags(msg.getSystemTags());<NEW_LINE>smsg.<MASK><NEW_LINE>smsg.setAccountUuid(msg.getSession().getAccountUuid());<NEW_LINE>bus.makeLocalServiceId(smsg, LongJobConstants.SERVICE_ID);<NEW_LINE>bus.send(smsg, new CloudBusCallBack(msg) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(MessageReply rly) {<NEW_LINE>SubmitLongJobReply reply = rly.castReply();<NEW_LINE>evt.setInventory(reply.getInventory());<NEW_LINE>bus.publish(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | setUserTags(msg.getUserTags()); |
1,046,040 | private void recoverMeta() {<NEW_LINE>if (meta != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (metaFile.exists() && metaFile.length() > 0) {<NEW_LINE>if (logger.isInfoEnabled()) {<NEW_LINE>SimpleDateFormat format = new SimpleDateFormat();<NEW_LINE>logger.info("MetaFile {} exists, last modified: {}", metaFile.getPath(), format.format(new Date(metaFile.lastModified())));<NEW_LINE>}<NEW_LINE>try (FileInputStream fileInputStream = new FileInputStream(metaFile);<NEW_LINE>BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream)) {<NEW_LINE>minAvailableVersion = ReadWriteIOUtils.readLong(bufferedInputStream);<NEW_LINE><MASK><NEW_LINE>meta = LogManagerMeta.deserialize(ByteBuffer.wrap(ReadWriteIOUtils.readBytesWithSelfDescriptionLength(bufferedInputStream)));<NEW_LINE>state = HardState.deserialize(ByteBuffer.wrap(ReadWriteIOUtils.readBytesWithSelfDescriptionLength(bufferedInputStream)));<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("Cannot recover log meta: ", e);<NEW_LINE>meta = new LogManagerMeta();<NEW_LINE>state = new HardState();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>meta = new LogManagerMeta();<NEW_LINE>state = new HardState();<NEW_LINE>}<NEW_LINE>logger.info("Recovered log meta: {}, availableVersion: [{},{}], state: {}", meta, minAvailableVersion, maxAvailableVersion, state);<NEW_LINE>} | maxAvailableVersion = ReadWriteIOUtils.readLong(bufferedInputStream); |
889,402 | private void displayRenderResult(WindowEx win, String viewerType, RmdPreviewParams params) {<NEW_LINE>if (viewerType == UserPrefs.RMD_VIEWER_TYPE_NONE)<NEW_LINE>return;<NEW_LINE><MASK><NEW_LINE>if (outputFrame_ == null)<NEW_LINE>outputFrame_ = createOutputFrame(viewerType);<NEW_LINE>// we're refreshing if the window is up and we're pulling the same<NEW_LINE>// output file as the last one<NEW_LINE>boolean isRefresh = win != null && result_ != null && result_.getOutputFile() == result.getOutputFile();<NEW_LINE>// if this isn't a refresh but there's a window up, cache the scroll<NEW_LINE>// position of the old document before we replace it<NEW_LINE>if (!isRefresh && result_ != null && win != null) {<NEW_LINE>cacheDocPosition(result_, outputFrame_.getScrollPosition(), outputFrame_.getAnchor());<NEW_LINE>}<NEW_LINE>// if it is a refresh, use the doc's existing positions<NEW_LINE>if (isRefresh) {<NEW_LINE>params.setScrollPosition(outputFrame_.getScrollPosition());<NEW_LINE>params.setAnchor(outputFrame_.getAnchor());<NEW_LINE>}<NEW_LINE>boolean isNotebook = result_ != null && FileSystemItem.getExtensionFromPath(result_.getOutputFile()) == NOTEBOOK_EXT;<NEW_LINE>// show the preview; activate the window (but not for auto-refresh of<NEW_LINE>// notebook preview)<NEW_LINE>outputFrame_.showRmdPreview(params, !(isRefresh && isNotebook && result.viewed()));<NEW_LINE>result.setViewed(true);<NEW_LINE>// reset live preview state<NEW_LINE>livePreviewRenderInProgress_ = false;<NEW_LINE>// save the result so we know if the next render is a re-render of the<NEW_LINE>// same document<NEW_LINE>result_ = result;<NEW_LINE>} | RmdRenderResult result = params.getResult(); |
836,192 | private void logBeanData() {<NEW_LINE>String methodName = "logBeanData";<NEW_LINE>logBeanData(methodName, getBeanText(constructorBean, CDICaseInjection.Constructor));<NEW_LINE>logBeanData(methodName, getBeanText(postConstruct, CDICaseInjection.PostConstruct));<NEW_LINE>// getBeanText(getPreDestroy(), CDICaseInjection.PreDestroy);<NEW_LINE>logBeanData(methodName, getBeanText(fieldBean, CDICaseInjection.Field));<NEW_LINE>logBeanData(methodName, getBeanText<MASK><NEW_LINE>logBeanData(methodName, getBeanText(dependentFieldBean, CDICaseInjection.Field));<NEW_LINE>// logBeanData(methodName, getBeanText(requestFieldBean, CDICaseInjection.Field));<NEW_LINE>// logBeanData(methodName, getBeanText(sessionFieldBean, CDICaseInjection.Field));<NEW_LINE>logBeanData(methodName, getBeanText(applicationFieldBean, CDICaseInjection.Field));<NEW_LINE>} | (methodBean, CDICaseInjection.Method)); |
917,397 | public void toSrt(Path srtFile) {<NEW_LINE>try (FileOutputStream fos = new FileOutputStream(srtFile.toFile());<NEW_LINE>OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);<NEW_LINE>PrintWriter writer = new PrintWriter(osw)) {<NEW_LINE>long counter = 1;<NEW_LINE>for (Subtitle title : subtitleList) {<NEW_LINE>writer.println(counter);<NEW_LINE>writer.println(srtFormat.format(title.begin) + " --> " + srtFormat.format(title.end));<NEW_LINE>for (StyledString entry : title.listOfStrings) {<NEW_LINE>if (!entry.color.isEmpty()) {<NEW_LINE>writer.print("<font color=\"" + entry.color + "\">");<NEW_LINE>}<NEW_LINE>writer.print(entry.text);<NEW_LINE>if (!entry.color.isEmpty()) {<NEW_LINE>writer.print("</font>");<NEW_LINE>}<NEW_LINE>writer.println();<NEW_LINE>}<NEW_LINE>writer.println("");<NEW_LINE>counter++;<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.<MASK><NEW_LINE>}<NEW_LINE>} | error("File: " + srtFile, ex); |
457,627 | public void complete(SourceOpContext sourceOpContext, IDocument document) throws CommonException {<NEW_LINE>final Location sourceFileLoc = sourceOpContext.getFileLocation();<NEW_LINE>if (!(fContextType instanceof CompilationUnitContextType))<NEW_LINE>return;<NEW_LINE>CompilationUnitContextType compilationUnitContextType = (CompilationUnitContextType) fContextType;<NEW_LINE>SourceRange selection = sourceOpContext.getSelection();<NEW_LINE>Position position = new Position(selection.getStartPos(), selection.getLength());<NEW_LINE>// remember selected text<NEW_LINE>String selectedText = null;<NEW_LINE>if (selection.getLength() != 0) {<NEW_LINE>try {<NEW_LINE>selectedText = document.get(selection.getStartPos(), selection.getLength());<NEW_LINE>document.addPosition(position);<NEW_LINE>fPositions.put(document, position);<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ISourceFile compilationUnit = new ISourceFile() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Location getLocation() {<NEW_LINE>return sourceFileLoc;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>CompilationUnitContext context = compilationUnitContextType.createContext(document, position, compilationUnit);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>context.setVariable("selection", selectedText);<NEW_LINE>int start = context.getStart();<NEW_LINE>int end = context.getEnd();<NEW_LINE>IRegion region = new Region(start, end - start);<NEW_LINE><MASK><NEW_LINE>if (selection.getLength() == 0) {<NEW_LINE>for (Template template : templates) {<NEW_LINE>if (context.canEvaluate(template)) {<NEW_LINE>fProposals.add(new LangTemplateProposal(template, context, region, getImage(), 0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (context.getKey().length() == 0)<NEW_LINE>context.setForceEvaluation(true);<NEW_LINE>boolean multipleLinesSelected = areMultipleLinesSelected(document, selection);<NEW_LINE>for (Template template : templates) {<NEW_LINE>if (context.canEvaluate(template) && (!multipleLinesSelected && template.getPattern().indexOf($_WORD_SELECTION) != -1 || (multipleLinesSelected && template.getPattern().indexOf($_LINE_SELECTION) != -1))) {<NEW_LINE>fProposals.add(new LangTemplateProposal(template, context, region, getImage(), 0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Template[] templates = getTemplates(); |
1,774,073 | private List<Object[]> gapFillAndAggregate(List<Object[]>[] timeBucketedRawRows, DataSchema dataSchemaForAggregatedResult, DataSchema dataSchema) {<NEW_LINE>List<Object[]> result = new ArrayList<>();<NEW_LINE>GapfillFilterHandler postGapfillFilterHandler = null;<NEW_LINE>if (_queryContext.getSubquery() != null && _queryContext.getFilter() != null) {<NEW_LINE>postGapfillFilterHandler = new GapfillFilterHandler(_queryContext.getFilter(), dataSchema);<NEW_LINE>}<NEW_LINE>GapfillFilterHandler postAggregateHavingFilterHandler = null;<NEW_LINE>if (_queryContext.getHavingFilter() != null) {<NEW_LINE>postAggregateHavingFilterHandler = new GapfillFilterHandler(_queryContext.getHavingFilter(), dataSchemaForAggregatedResult);<NEW_LINE>}<NEW_LINE>long start = _startMs;<NEW_LINE>ColumnDataType[] resultColumnDataTypes = dataSchema.getColumnDataTypes();<NEW_LINE>List<Object[]> bucketedResult = new ArrayList<>();<NEW_LINE>for (long time = _startMs; time < _endMs; time += _gapfillTimeBucketSize) {<NEW_LINE>int index = findGapfillBucketIndex(time);<NEW_LINE>gapfill(time, bucketedResult, timeBucketedRawRows[index], dataSchema, postGapfillFilterHandler);<NEW_LINE>if (_queryContext.getAggregationFunctions() == null) {<NEW_LINE>for (Object[] row : bucketedResult) {<NEW_LINE>Object[] resultRow = new Object[_sourceColumnIndexForResultSchema.length];<NEW_LINE>for (int i = 0; i < _sourceColumnIndexForResultSchema.length; i++) {<NEW_LINE>resultRow[i] = row[_sourceColumnIndexForResultSchema[i]];<NEW_LINE>}<NEW_LINE>result.add(resultRow);<NEW_LINE>}<NEW_LINE>bucketedResult.clear();<NEW_LINE>} else if (index % _aggregationSize == _aggregationSize - 1) {<NEW_LINE>if (bucketedResult.size() > 0) {<NEW_LINE>Object timeCol;<NEW_LINE>if (resultColumnDataTypes[_timeBucketColumnIndex] == ColumnDataType.LONG) {<NEW_LINE>timeCol = Long.valueOf(_dateTimeFormatter.fromMillisToFormat(start));<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>List<Object[]> aggregatedRows = aggregateGapfilledData(timeCol, bucketedResult, dataSchema);<NEW_LINE>for (Object[] aggregatedRow : aggregatedRows) {<NEW_LINE>if (postAggregateHavingFilterHandler == null || postAggregateHavingFilterHandler.isMatch(aggregatedRow)) {<NEW_LINE>result.add(aggregatedRow);<NEW_LINE>}<NEW_LINE>if (result.size() >= _limitForAggregatedResult) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>bucketedResult.clear();<NEW_LINE>}<NEW_LINE>start = time + _gapfillTimeBucketSize;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | timeCol = _dateTimeFormatter.fromMillisToFormat(start); |
1,041,221 | private void tryAllHandlers(final RestRequest request, final RestChannel channel, final ThreadContext threadContext) throws Exception {<NEW_LINE>try {<NEW_LINE>copyRestHeaders(request, threadContext);<NEW_LINE>validateErrorTrace(request, channel);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>channel.sendResponse(BytesRestResponse.createSimpleErrorResponse(channel, BAD_REQUEST, e.getMessage()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String rawPath = request.rawPath();<NEW_LINE>final String uri = request.uri();<NEW_LINE>final RestRequest.Method requestMethod;<NEW_LINE>RestApiVersion restApiVersion = request.getRestApiVersion();<NEW_LINE>try {<NEW_LINE>// Resolves the HTTP method and fails if the method is invalid<NEW_LINE>requestMethod = request.method();<NEW_LINE>// Loop through all possible handlers, attempting to dispatch the request<NEW_LINE>Iterator<MethodHandlers> allHandlers = getAllHandlers(request.params(), rawPath);<NEW_LINE>while (allHandlers.hasNext()) {<NEW_LINE>final RestHandler handler;<NEW_LINE>final MethodHandlers handlers = allHandlers.next();<NEW_LINE>if (handlers == null) {<NEW_LINE>handler = null;<NEW_LINE>} else {<NEW_LINE>handler = handlers.getHandler(requestMethod, restApiVersion);<NEW_LINE>}<NEW_LINE>if (handler == null) {<NEW_LINE>if (handleNoHandlerFound(rawPath, requestMethod, uri, channel)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dispatchRequest(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final IllegalArgumentException e) {<NEW_LINE>handleUnsupportedHttpMethod(uri, null, channel, getValidHandlerMethodSet(rawPath), e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// If request has not been handled, fallback to a bad request error.<NEW_LINE>handleBadRequest(uri, requestMethod, channel);<NEW_LINE>} | request, channel, handler, threadContext); |
1,672,096 | public WorkspaceResource listResource(String groupId, String type) {<NEW_LINE>Group group = groupMapper.selectByPrimaryKey(groupId);<NEW_LINE>String workspaceId = group.getScopeId();<NEW_LINE>WorkspaceResource resource = new WorkspaceResource();<NEW_LINE>if (StringUtils.equals(UserGroupType.WORKSPACE, type)) {<NEW_LINE>WorkspaceExample workspaceExample = new WorkspaceExample();<NEW_LINE>WorkspaceExample.Criteria criteria = workspaceExample.createCriteria();<NEW_LINE>if (!StringUtils.equals(workspaceId, "global")) {<NEW_LINE>criteria.andIdEqualTo(workspaceId);<NEW_LINE>}<NEW_LINE>List<Workspace> <MASK><NEW_LINE>resource.setWorkspaces(workspaces);<NEW_LINE>}<NEW_LINE>if (StringUtils.equals(UserGroupType.PROJECT, type)) {<NEW_LINE>ProjectExample projectExample = new ProjectExample();<NEW_LINE>ProjectExample.Criteria pc = projectExample.createCriteria();<NEW_LINE>WorkspaceExample workspaceExample = new WorkspaceExample();<NEW_LINE>WorkspaceExample.Criteria criteria = workspaceExample.createCriteria();<NEW_LINE>if (!StringUtils.equals(workspaceId, "global")) {<NEW_LINE>criteria.andIdEqualTo(workspaceId);<NEW_LINE>List<Workspace> workspaces = workspaceMapper.selectByExample(workspaceExample);<NEW_LINE>List<String> list = workspaces.stream().map(Workspace::getId).collect(Collectors.toList());<NEW_LINE>pc.andWorkspaceIdIn(list);<NEW_LINE>}<NEW_LINE>List<Project> projects = projectMapper.selectByExample(projectExample);<NEW_LINE>resource.setProjects(projects);<NEW_LINE>}<NEW_LINE>return resource;<NEW_LINE>} | workspaces = workspaceMapper.selectByExample(workspaceExample); |
1,593,976 | public void onRuleUpdated(RuleUpdatedEvent ruleUpdatedEvent) {<NEW_LINE>Boolean discoveryControlEnabled = pluginContextAware.isDiscoveryControlEnabled();<NEW_LINE>if (!discoveryControlEnabled) {<NEW_LINE>LOG.info("Discovery control is disabled, ignore to subscribe");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOG.info("Rule updating has been triggered");<NEW_LINE>if (ruleUpdatedEvent == null) {<NEW_LINE>throw new DiscoveryException("RuleUpdatedEvent can't be null");<NEW_LINE>}<NEW_LINE>SubscriptionType subscriptionType = ruleUpdatedEvent.getSubscriptionType();<NEW_LINE>String rule = ruleUpdatedEvent.getRule();<NEW_LINE>try {<NEW_LINE>RuleEntity ruleEntity = pluginConfigParser.parse(rule);<NEW_LINE>switch(subscriptionType) {<NEW_LINE>case GLOBAL:<NEW_LINE>pluginAdapter.setDynamicGlobalRule(ruleEntity);<NEW_LINE>break;<NEW_LINE>case PARTIAL:<NEW_LINE>pluginAdapter.setDynamicPartialRule(ruleEntity);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>pluginEventWapper.fireParameterChanged();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Parse rule xml failed", e);<NEW_LINE>pluginEventWapper.fireRuleFailure(new RuleFailureEvent<MASK><NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>refreshLoadBalancer();<NEW_LINE>} | (subscriptionType, rule, e)); |
1,207,272 | private static void AddBackupSoSource(Context context, ArrayList<SoSource> soSources, int apkSoSourceFlags) throws IOException {<NEW_LINE>if ((sFlags & SOLOADER_DISABLE_BACKUP_SOSOURCE) != 0) {<NEW_LINE>sBackupSoSources = null;<NEW_LINE>// Clean up backups<NEW_LINE>final File backupDir = UnpackingSoSource.getSoStorePath(context, SO_STORE_NAME_MAIN);<NEW_LINE>try {<NEW_LINE>SysUtil.dumbDeleteRecursive(backupDir);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.w(TAG, "Failed to delete " + <MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final File mainApkDir = new File(context.getApplicationInfo().sourceDir);<NEW_LINE>ArrayList<UnpackingSoSource> backupSources = new ArrayList<>();<NEW_LINE>ApkSoSource mainApkSource = new ApkSoSource(context, mainApkDir, SO_STORE_NAME_MAIN, apkSoSourceFlags);<NEW_LINE>backupSources.add(mainApkSource);<NEW_LINE>if (Log.isLoggable(TAG, Log.DEBUG)) {<NEW_LINE>Log.d(TAG, "adding backup source from : " + mainApkSource.toString());<NEW_LINE>}<NEW_LINE>addBackupSoSourceFromSplitApk(context, apkSoSourceFlags, backupSources);<NEW_LINE>sBackupSoSources = backupSources.toArray(new UnpackingSoSource[backupSources.size()]);<NEW_LINE>soSources.addAll(0, backupSources);<NEW_LINE>} | backupDir.getCanonicalPath(), e); |
1,384,538 | public void marshall(CalculateRouteMatrixRequest calculateRouteMatrixRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (calculateRouteMatrixRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(calculateRouteMatrixRequest.getCarModeOptions(), CARMODEOPTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(calculateRouteMatrixRequest.getDepartNow(), DEPARTNOW_BINDING);<NEW_LINE>protocolMarshaller.marshall(calculateRouteMatrixRequest.getDeparturePositions(), DEPARTUREPOSITIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(calculateRouteMatrixRequest.getDepartureTime(), DEPARTURETIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(calculateRouteMatrixRequest.getDestinationPositions(), DESTINATIONPOSITIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(calculateRouteMatrixRequest.getDistanceUnit(), DISTANCEUNIT_BINDING);<NEW_LINE>protocolMarshaller.marshall(calculateRouteMatrixRequest.getTravelMode(), TRAVELMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(calculateRouteMatrixRequest.getTruckModeOptions(), TRUCKMODEOPTIONS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | calculateRouteMatrixRequest.getCalculatorName(), CALCULATORNAME_BINDING); |
977,647 | protected static FilterSpecPlanForge planRemainingNodesBasic(FilterSpecParaForgeMap overallExpressions, FilterSpecCompilerArgs args, int filterServiceMaxFilterWidth) throws ExprValidationException {<NEW_LINE>List<ExprNode> unassigned = overallExpressions.getUnassignedExpressions();<NEW_LINE>List<ExprOrNode> orNodes = new ArrayList<>(unassigned.size());<NEW_LINE>for (ExprNode node : unassigned) {<NEW_LINE>if (node instanceof ExprOrNode) {<NEW_LINE>orNodes.add((ExprOrNode) node);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FilterSpecParaForgeMap expressionsWithoutOr = new FilterSpecParaForgeMap();<NEW_LINE>expressionsWithoutOr.add(overallExpressions);<NEW_LINE>// first dimension: or-node index<NEW_LINE>// second dimension: or child node index<NEW_LINE>FilterSpecParaForgeMap[][] orNodesMaps = new FilterSpecParaForgeMap[orNodes.size()][];<NEW_LINE>int countOr = 0;<NEW_LINE>int sizeFactorized = 1;<NEW_LINE>int[] sizePerOr = new int[orNodes.size()];<NEW_LINE>for (ExprOrNode orNode : orNodes) {<NEW_LINE>expressionsWithoutOr.removeNode(orNode);<NEW_LINE>orNodesMaps[countOr] = new FilterSpecParaForgeMap[orNode.getChildNodes().length];<NEW_LINE>int len = orNode.getChildNodes().length;<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>FilterSpecParaForgeMap map = new FilterSpecParaForgeMap();<NEW_LINE>orNodesMaps[countOr][i] = map;<NEW_LINE>List<ExprNode> nodes = Collections.singletonList(orNode.getChildNodes()[i]);<NEW_LINE>decomposePopulateConsolidate(<MASK><NEW_LINE>}<NEW_LINE>sizePerOr[countOr] = len;<NEW_LINE>sizeFactorized = sizeFactorized * len;<NEW_LINE>countOr++;<NEW_LINE>}<NEW_LINE>// we become too large<NEW_LINE>if (sizeFactorized > filterServiceMaxFilterWidth) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// combine<NEW_LINE>FilterSpecPlanPathForge[] result = new FilterSpecPlanPathForge[sizeFactorized];<NEW_LINE>CombinationEnumeration permutations = CombinationEnumeration.fromZeroBasedRanges(sizePerOr);<NEW_LINE>int count = 0;<NEW_LINE>for (; permutations.hasMoreElements(); ) {<NEW_LINE>Object[] permutation = permutations.nextElement();<NEW_LINE>result[count] = computePermutation(expressionsWithoutOr, permutation, orNodesMaps, args);<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>return new FilterSpecPlanForge(result, null, null, null);<NEW_LINE>} | map, false, nodes, args); |
1,122,892 | public Optional<BPartnerId> resolveBPartnerExternalIdentifier(@NonNull final ExternalIdentifier bPartnerExternalIdentifier, @NonNull final OrgId orgId) {<NEW_LINE>switch(bPartnerExternalIdentifier.getType()) {<NEW_LINE>case METASFRESH_ID:<NEW_LINE>final BPartnerId bPartnerId = BPartnerId.ofRepoId(bPartnerExternalIdentifier.asMetasfreshId().getValue());<NEW_LINE>return Optional.of(bPartnerId);<NEW_LINE>case EXTERNAL_REFERENCE:<NEW_LINE>return externalReferenceService.getJsonMetasfreshIdFromExternalReference(orgId, bPartnerExternalIdentifier, BPartnerExternalReferenceType.BPARTNER).map(JsonMetasfreshId::getValue).map(BPartnerId::ofRepoId);<NEW_LINE>case VALUE:<NEW_LINE>final BPartnerQuery valQuery = BPartnerQuery.builder().onlyOrgId(orgId).bpartnerValue(bPartnerExternalIdentifier.asValue()).build();<NEW_LINE>return bpartnersRepo.retrieveBPartnerIdBy(valQuery);<NEW_LINE>case GLN:<NEW_LINE>final BPartnerQuery glnQuery = BPartnerQuery.builder().onlyOrgId(orgId).gln(bPartnerExternalIdentifier.asGLN()).build();<NEW_LINE>return bpartnersRepo.retrieveBPartnerIdBy(glnQuery);<NEW_LINE>default:<NEW_LINE>throw new InvalidIdentifierException("Given external identifier type is not supported!").setParameter("externalIdentifierType", bPartnerExternalIdentifier.getType()).setParameter(<MASK><NEW_LINE>}<NEW_LINE>} | "rawExternalIdentifier", bPartnerExternalIdentifier.getRawValue()); |
1,013,028 | public static byte[] readDialogEEPROMBytes(Component parent) {<NEW_LINE>// Choose file<NEW_LINE>File file = null;<NEW_LINE>JFileChooser fileChooser = new JFileChooser();<NEW_LINE>fileChooser.setCurrentDirectory(new java<MASK><NEW_LINE>fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);<NEW_LINE>fileChooser.setDialogTitle("Select binary data");<NEW_LINE>if (fileChooser.showOpenDialog(parent) == JFileChooser.APPROVE_OPTION) {<NEW_LINE>file = fileChooser.getSelectedFile();<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Read file data<NEW_LINE>long fileSize = file.length();<NEW_LINE>byte[] fileData = new byte[(int) fileSize];<NEW_LINE>FileInputStream fileIn;<NEW_LINE>DataInputStream dataIn;<NEW_LINE>int offset = 0;<NEW_LINE>int numRead = 0;<NEW_LINE>try {<NEW_LINE>fileIn = new FileInputStream(file);<NEW_LINE>dataIn = new DataInputStream(fileIn);<NEW_LINE>while (offset < fileData.length && (numRead = dataIn.read(fileData, offset, fileData.length - offset)) >= 0) {<NEW_LINE>offset += numRead;<NEW_LINE>}<NEW_LINE>dataIn.close();<NEW_LINE>fileIn.close();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.debug("Exception ex: " + ex);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return fileData;<NEW_LINE>} | .io.File(".")); |
732,834 | private Map<FieldDescriptor, FieldAccessDescriptor> resolveNestedFieldsAccessed(Schema schema) {<NEW_LINE>Map<FieldDescriptor, FieldAccessDescriptor> nestedFields = Maps.newLinkedHashMap();<NEW_LINE>for (Map.Entry<FieldDescriptor, FieldAccessDescriptor> entry : getNestedFieldsAccessed().entrySet()) {<NEW_LINE>FieldDescriptor fieldDescriptor = entry.getKey();<NEW_LINE>FieldAccessDescriptor fieldAccessDescriptor = entry.getValue();<NEW_LINE>validateFieldDescriptor(schema, fieldDescriptor);<NEW_LINE>// Resolve the field id of the field that has nested access.<NEW_LINE>if (entry.getKey().getFieldId() == null) {<NEW_LINE>fieldDescriptor = fieldDescriptor.toBuilder().setFieldId(schema.indexOf(fieldDescriptor.getFieldName())).build();<NEW_LINE>} else if (entry.getKey().getFieldName() == null) {<NEW_LINE>fieldDescriptor = fieldDescriptor.toBuilder().setFieldName(schema.nameOf(fieldDescriptor.getFieldId())).build();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// fieldType should now be the row we are selecting from, so recursively resolve it and<NEW_LINE>// store the result in the list of resolved nested fields.<NEW_LINE>fieldAccessDescriptor = fieldAccessDescriptor.resolve(getFieldDescriptorSchema(fieldDescriptor, schema));<NEW_LINE>// We might still have duplicate FieldDescriptors, even if union was called earlier. Until<NEW_LINE>// resolving against an actual schema we might not have been to tell that two<NEW_LINE>// FieldDescriptors were equivalent.<NEW_LINE>nestedFields.merge(fieldDescriptor, fieldAccessDescriptor, (d1, d2) -> union(ImmutableList.of(d1, d2)));<NEW_LINE>}<NEW_LINE>return nestedFields;<NEW_LINE>} | fieldDescriptor = fillInMissingQualifiers(fieldDescriptor, schema); |
1,221,103 | public TaskRecord findById(long taskId, String owner, boolean includeTrigger) throws Exception {<NEW_LINE>StringBuilder find = new StringBuilder(116).append("SELECT t.LOADER,t.MBITS,t.INAME,t.NEXTEXEC,t.RESLT,t.STATES,t.VERSION");<NEW_LINE>if (includeTrigger)<NEW_LINE>find.append(",t.TRIG");<NEW_LINE>find.append(" FROM Task t WHERE t.ID=:i");<NEW_LINE>if (owner != null)<NEW_LINE>find.append(" AND t.OWNR=:o");<NEW_LINE>final boolean trace = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.entry(this, tc, "findById", taskId, owner, find);<NEW_LINE>List<Object[]> resultList;<NEW_LINE>EntityManager em <MASK><NEW_LINE>try {<NEW_LINE>TypedQuery<Object[]> query = em.createQuery(find.toString(), Object[].class);<NEW_LINE>query.setParameter("i", taskId);<NEW_LINE>if (owner != null)<NEW_LINE>query.setParameter("o", owner);<NEW_LINE>resultList = query.getResultList();<NEW_LINE>} finally {<NEW_LINE>em.close();<NEW_LINE>}<NEW_LINE>TaskRecord taskRecord;<NEW_LINE>if (resultList.isEmpty())<NEW_LINE>taskRecord = null;<NEW_LINE>else {<NEW_LINE>Object[] result = resultList.get(0);<NEW_LINE>taskRecord = new TaskRecord(false);<NEW_LINE>taskRecord.setId(taskId);<NEW_LINE>taskRecord.setIdentifierOfClassLoader((String) result[0]);<NEW_LINE>taskRecord.setMiscBinaryFlags((Short) result[1]);<NEW_LINE>taskRecord.setName((String) result[2]);<NEW_LINE>taskRecord.setNextExecutionTime((Long) result[3]);<NEW_LINE>taskRecord.setResult((byte[]) result[4]);<NEW_LINE>taskRecord.setState((Short) result[5]);<NEW_LINE>taskRecord.setVersion((Integer) result[6]);<NEW_LINE>if (includeTrigger)<NEW_LINE>taskRecord.setTrigger((byte[]) result[7]);<NEW_LINE>}<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "findById", taskRecord);<NEW_LINE>return taskRecord;<NEW_LINE>} | = getPersistenceServiceUnit().createEntityManager(); |
276,744 | public void configureSbaStructure(List<AssociatedTriple> inliersThreeView) {<NEW_LINE>final SceneStructureMetric structure = metricSba.structure;<NEW_LINE>final SceneObservations observations = metricSba.observations;<NEW_LINE>// Even if the cameras are all the same, we will tell that they are different just because the bookkeeping<NEW_LINE>// is so much easier and results are the same<NEW_LINE>structure.initialize(3, 3, usedThreeViewInliers.size);<NEW_LINE>observations.initialize(3);<NEW_LINE>// All cameras are known<NEW_LINE>structure.setCamera(0, true, camera1);<NEW_LINE>structure.setCamera(1, true, camera2);<NEW_LINE>structure.setCamera(2, true, camera3);<NEW_LINE>// All transforms are known but the target<NEW_LINE>structure.setView(0, 0, true, view1_to_view1);<NEW_LINE>structure.setView(1, 1, true, view1_to_view2);<NEW_LINE>structure.setView(2, 2, true, view1_to_target);<NEW_LINE>observations.getView(0).<MASK><NEW_LINE>observations.getView(1).resize(usedThreeViewInliers.size());<NEW_LINE>observations.getView(2).resize(usedThreeViewInliers.size());<NEW_LINE>SceneObservations.View viewObs1 = observations.getView(0);<NEW_LINE>SceneObservations.View viewObs2 = observations.getView(1);<NEW_LINE>SceneObservations.View viewObs3 = observations.getView(2);<NEW_LINE>final TriangulateNViewsMetricH triangulator = metricSba.triangulator;<NEW_LINE>var foundX = new Point4D_F64();<NEW_LINE>// Only use features that were in the inlier set for PnP<NEW_LINE>for (int inlierCnt = 0; inlierCnt < usedThreeViewInliers.size(); inlierCnt++) {<NEW_LINE>int threeViewInlierIndex = usedThreeViewInliers.get(inlierCnt);<NEW_LINE>AssociatedTriple a = inliersThreeView.get(threeViewInlierIndex);<NEW_LINE>// Pass in pixel observations for each view<NEW_LINE>viewObs1.set(inlierCnt, inlierCnt, (float) a.p1.x, (float) a.p1.y);<NEW_LINE>viewObs2.set(inlierCnt, inlierCnt, (float) a.p2.x, (float) a.p2.y);<NEW_LINE>viewObs3.set(inlierCnt, inlierCnt, (float) a.p3.x, (float) a.p3.y);<NEW_LINE>normalize1.compute(a.p1.x, a.p1.y, pixelNorms.get(0));<NEW_LINE>normalize2.compute(a.p2.x, a.p2.y, pixelNorms.get(1));<NEW_LINE>normalize3.compute(a.p3.x, a.p3.y, pixelNorms.get(2));<NEW_LINE>if (!triangulator.triangulate(pixelNorms, listMotion, foundX)) {<NEW_LINE>throw new RuntimeException("Triangulation failed. Possibly bad input. Handle this problem");<NEW_LINE>}<NEW_LINE>if (structure.isHomogenous())<NEW_LINE>structure.setPoint(inlierCnt, foundX.x, foundX.y, foundX.z, foundX.w);<NEW_LINE>else<NEW_LINE>structure.setPoint(inlierCnt, foundX.x / foundX.w, foundX.y / foundX.w, foundX.z / foundX.w);<NEW_LINE>structure.connectPointToView(inlierCnt, 0);<NEW_LINE>structure.connectPointToView(inlierCnt, 1);<NEW_LINE>structure.connectPointToView(inlierCnt, 2);<NEW_LINE>}<NEW_LINE>} | resize(usedThreeViewInliers.size()); |
1,097,058 | public synchronized void execute(ComplexEventChunk streamEventChunk) {<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Event Chunk received by " + this.duration + " incremental executor: " + streamEventChunk.toString());<NEW_LINE>}<NEW_LINE>streamEventChunk.reset();<NEW_LINE>while (streamEventChunk.hasNext()) {<NEW_LINE>StreamEvent streamEvent = (StreamEvent) streamEventChunk.next();<NEW_LINE>streamEventChunk.remove();<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>long timestamp = getTimestamp(streamEvent, executorState);<NEW_LINE>long startTime = executorState.startTimeOfAggregates;<NEW_LINE>executorState.startTimeOfAggregates = IncrementalTimeConverterUtil.getStartTimeOfAggregates(timestamp, duration, timeZone);<NEW_LINE>if (timestamp >= executorState.nextEmitTime) {<NEW_LINE>executorState.nextEmitTime = IncrementalTimeConverterUtil.getNextEmitTime(timestamp, duration, timeZone);<NEW_LINE>dispatchAggregateEvents(executorState.startTimeOfAggregates);<NEW_LINE>sendTimerEvent(executorState);<NEW_LINE>}<NEW_LINE>if (streamEvent.getType() == ComplexEvent.Type.CURRENT) {<NEW_LINE>processAggregates(streamEvent, executorState);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>stateHolder.returnState(executorState);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ExecutorState executorState = stateHolder.getState(); |
1,001,653 | public boolean performFinish() {<NEW_LINE>final IGithubManager ghManager = GitPlugin.getDefault().getGithubManager();<NEW_LINE>final String owner = cloneSource.getOwner();<NEW_LINE>final String repoName = cloneSource.getRepoName();<NEW_LINE>// TODO Allow selecting a destination org to fork to!<NEW_LINE>// cloneSource.getOrganization();<NEW_LINE>final String organization = null;<NEW_LINE>final String dest = cloneSource.getDestination();<NEW_LINE>try {<NEW_LINE>getContainer().run(true, true, new IRunnableWithProgress() {<NEW_LINE><NEW_LINE>public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {<NEW_LINE>try {<NEW_LINE>monitor.subTask(Messages.GithubForkWizard_ForkSubTaskName);<NEW_LINE>IGithubRepository repo = ghManager.fork(owner, repoName, organization);<NEW_LINE>// Now clone the repo!<NEW_LINE>CloneJob job = new CloneJob(repo.getSSHURL(), dest);<NEW_LINE>IStatus <MASK><NEW_LINE>if (!status.isOK()) {<NEW_LINE>if (status instanceof ProcessStatus) {<NEW_LINE>ProcessStatus ps = (ProcessStatus) status;<NEW_LINE>String stderr = ps.getStdErr();<NEW_LINE>throw new InvocationTargetException(new CoreException(new Status(status.getSeverity(), status.getPlugin(), stderr)));<NEW_LINE>}<NEW_LINE>throw new InvocationTargetException(new CoreException(status));<NEW_LINE>}<NEW_LINE>// Add upstream remote pointing at parent!<NEW_LINE>Set<IProject> projects = job.getCreatedProjects();<NEW_LINE>if (!CollectionsUtil.isEmpty(projects)) {<NEW_LINE>monitor.subTask(Messages.GithubForkWizard_UpstreamSubTaskName);<NEW_LINE>IProject project = projects.iterator().next();<NEW_LINE>IGitRepositoryManager grManager = GitPlugin.getDefault().getGitRepositoryManager();<NEW_LINE>GitRepository clonedRepo = grManager.getAttached(project);<NEW_LINE>if (clonedRepo != null) {<NEW_LINE>IGithubRepository parentRepo = repo.getParent();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>clonedRepo.addRemote("upstream", parentRepo.getSSHURL(), false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (CoreException e) {<NEW_LINE>throw new InvocationTargetException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>if (e.getCause() instanceof CoreException) {<NEW_LINE>CoreException ce = (CoreException) e.getCause();<NEW_LINE>MessageDialog.openError(getShell(), Messages.GithubForkWizard_FailedForkErr, ce.getMessage());<NEW_LINE>} else {<NEW_LINE>IdeLog.logError(GitUIPlugin.getDefault(), e, IDebugScopes.DEBUG);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>IdeLog.logError(GitUIPlugin.getDefault(), e, IDebugScopes.DEBUG);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | status = job.run(monitor); |
1,696,237 | @ExceptionMetered<NEW_LINE>@POST<NEW_LINE>public Response renameSecret(@Auth User user, @PathParam("secretId") LongParam secretId, @PathParam("secretName") String secretName) {<NEW_LINE>Optional<Secret> secret = secretController.getSecretByName(secretName);<NEW_LINE>if (secret.isPresent()) {<NEW_LINE>logger.info("User '{}' tried renaming a secret, but another secret with that name " + "already exists (name={})", user, secretId.get());<NEW_LINE>throw new ConflictException("That name is already taken by another secret");<NEW_LINE>}<NEW_LINE>logger.info("User '{}' renamed secret id={} to name='{}'", user, secretId, secretName);<NEW_LINE>secretDAOReadWrite.renameSecretById(secretId.get(), <MASK><NEW_LINE>// Record the rename<NEW_LINE>Map<String, String> extraInfo = new HashMap<>();<NEW_LINE>auditLog.recordEvent(new Event(Instant.now(), EventTag.SECRET_RENAME, user.getName(), secretName, extraInfo));<NEW_LINE>return Response.noContent().build();<NEW_LINE>} | secretName, user.getName()); |
1,032,272 | public Document createDocument(CoreCollection.Document coreDoc) throws GeneratorException {<NEW_LINE>String id = coreDoc.id();<NEW_LINE>String content = coreDoc.contents();<NEW_LINE>if (content == null || content.trim().isEmpty()) {<NEW_LINE>throw new EmptyDocumentException();<NEW_LINE>}<NEW_LINE>Document doc = new Document();<NEW_LINE>// Store the collection docid.<NEW_LINE>doc.add(new StringField(IndexArgs.ID, id, Field.Store.YES));<NEW_LINE>// This is needed to break score ties by docid.<NEW_LINE>doc.add(new SortedDocValuesField(IndexArgs.ID<MASK><NEW_LINE>if (args.storeRaw) {<NEW_LINE>doc.add(new StoredField(IndexArgs.RAW, coreDoc.raw()));<NEW_LINE>}<NEW_LINE>FieldType fieldType = new FieldType();<NEW_LINE>fieldType.setStored(args.storeContents);<NEW_LINE>// Are we storing document vectors?<NEW_LINE>if (args.storeDocvectors) {<NEW_LINE>fieldType.setStoreTermVectors(true);<NEW_LINE>fieldType.setStoreTermVectorPositions(true);<NEW_LINE>}<NEW_LINE>// Are we building a "positional" or "count" index?<NEW_LINE>if (args.storePositions) {<NEW_LINE>fieldType.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);<NEW_LINE>} else {<NEW_LINE>fieldType.setIndexOptions(IndexOptions.DOCS_AND_FREQS);<NEW_LINE>}<NEW_LINE>doc.add(new Field(IndexArgs.CONTENTS, content, fieldType));<NEW_LINE>coreDoc.jsonNode().fieldNames().forEachRemaining(key -> {<NEW_LINE>JsonNode value = coreDoc.jsonNode().get(key);<NEW_LINE>if (value.isArray() && value.size() > 0) {<NEW_LINE>value.elements().forEachRemaining(element -> addDocumentField(doc, key, element, fieldType));<NEW_LINE>} else {<NEW_LINE>addDocumentField(doc, key, value, fieldType);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return doc;<NEW_LINE>} | , new BytesRef(id))); |
1,618,729 | public static Object issueRequest(MessageProcessor MP, ControlMessage msg, SIBUuid8 remoteUuid, long retry, int tries, long requestID) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "issueRequest", new Object[] { MP, msg, remoteUuid, new Long(retry), new Integer(tries), new Long(requestID) });<NEW_LINE>// Short circuit ME rechability test<NEW_LINE>if (!MP.getMPIO().isMEReachable(remoteUuid)) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "issueRequest", null);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Prepare the request map<NEW_LINE>Object[] awaitResult = new Object[1];<NEW_LINE>synchronized (_requestMap) {<NEW_LINE>_requestMap.put(new Long(requestID), awaitResult);<NEW_LINE>}<NEW_LINE>synchronized (awaitResult) {<NEW_LINE>// Now send the request, setup the retry alarm, and wait for a result<NEW_LINE>MP.getMPIO().sendToMe(<MASK><NEW_LINE>ResendRecord retryRecord = new ResendRecord(MP, msg, remoteUuid, retry, tries, requestID);<NEW_LINE>MP.getAlarmManager().create(retry, _alarmHandler, retryRecord);<NEW_LINE>while (true) try {<NEW_LINE>awaitResult.wait();<NEW_LINE>break;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// No FFDC code needed<NEW_LINE>// We shouldn't be interrupted, but if we are loop around and try again<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "issueRequest", awaitResult[0]);<NEW_LINE>return awaitResult[0];<NEW_LINE>} | remoteUuid, SIMPConstants.CONTROL_MESSAGE_PRIORITY, msg); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.