idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,668,053 | public static ListOrdersResponse unmarshall(ListOrdersResponse listOrdersResponse, UnmarshallerContext _ctx) {<NEW_LINE>listOrdersResponse.setRequestId(_ctx.stringValue("ListOrdersResponse.RequestId"));<NEW_LINE>listOrdersResponse.setTotalCount(_ctx.longValue("ListOrdersResponse.TotalCount"));<NEW_LINE>listOrdersResponse.setErrorCode(_ctx.stringValue("ListOrdersResponse.ErrorCode"));<NEW_LINE>listOrdersResponse.setErrorMessage(_ctx.stringValue("ListOrdersResponse.ErrorMessage"));<NEW_LINE>listOrdersResponse.setSuccess(_ctx.booleanValue("ListOrdersResponse.Success"));<NEW_LINE>List<Order> orders = new ArrayList<Order>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListOrdersResponse.Orders.Length"); i++) {<NEW_LINE>Order order = new Order();<NEW_LINE>order.setComment(_ctx.stringValue("ListOrdersResponse.Orders[" + i + "].Comment"));<NEW_LINE>order.setLastModifyTime(_ctx.stringValue<MASK><NEW_LINE>order.setStatusCode(_ctx.stringValue("ListOrdersResponse.Orders[" + i + "].StatusCode"));<NEW_LINE>order.setCreateTime(_ctx.stringValue("ListOrdersResponse.Orders[" + i + "].CreateTime"));<NEW_LINE>order.setCommitter(_ctx.stringValue("ListOrdersResponse.Orders[" + i + "].Committer"));<NEW_LINE>order.setCommitterId(_ctx.longValue("ListOrdersResponse.Orders[" + i + "].CommitterId"));<NEW_LINE>order.setStatusDesc(_ctx.stringValue("ListOrdersResponse.Orders[" + i + "].StatusDesc"));<NEW_LINE>order.setPluginType(_ctx.stringValue("ListOrdersResponse.Orders[" + i + "].PluginType"));<NEW_LINE>order.setOrderId(_ctx.longValue("ListOrdersResponse.Orders[" + i + "].OrderId"));<NEW_LINE>orders.add(order);<NEW_LINE>}<NEW_LINE>listOrdersResponse.setOrders(orders);<NEW_LINE>return listOrdersResponse;<NEW_LINE>} | ("ListOrdersResponse.Orders[" + i + "].LastModifyTime")); |
519,132 | public boolean execute(Object result) throws ContractExeException {<NEW_LINE>TransactionResultCapsule ret = (TransactionResultCapsule) result;<NEW_LINE>if (Objects.isNull(ret)) {<NEW_LINE>throw new RuntimeException(ActuatorConstant.TX_RESULT_NULL);<NEW_LINE>}<NEW_LINE>final SetAccountIdContract setAccountIdContract;<NEW_LINE>final long fee = calcFee();<NEW_LINE>AccountStore accountStore = chainBaseManager.getAccountStore();<NEW_LINE>AccountIdIndexStore accountIdIndexStore = chainBaseManager.getAccountIdIndexStore();<NEW_LINE>try {<NEW_LINE>setAccountIdContract = any.unpack(SetAccountIdContract.class);<NEW_LINE>} catch (InvalidProtocolBufferException e) {<NEW_LINE>logger.debug(e.getMessage(), e);<NEW_LINE>ret.setStatus(fee, code.FAILED);<NEW_LINE>throw new ContractExeException(e.getMessage());<NEW_LINE>}<NEW_LINE>byte[] ownerAddress = setAccountIdContract.getOwnerAddress().toByteArray();<NEW_LINE>AccountCapsule account = accountStore.get(ownerAddress);<NEW_LINE>account.setAccountId(setAccountIdContract.getAccountId().toByteArray());<NEW_LINE><MASK><NEW_LINE>accountIdIndexStore.put(account);<NEW_LINE>ret.setStatus(fee, code.SUCESS);<NEW_LINE>return true;<NEW_LINE>} | accountStore.put(ownerAddress, account); |
1,530,483 | @Timed<NEW_LINE>@ExceptionMetered<NEW_LINE>public CreateJobResponse post(@Valid final Job job, @RequestUser final String username) {<NEW_LINE>final Job.Builder clone = // If the job had a hash coming in, preserve it<NEW_LINE>job.toBuilder().setCreatingUser(username).setCreated(clock.now().getMillis()).setHash(job.getId().getHash());<NEW_LINE>final Job actualJob = clone.build();<NEW_LINE>final Collection<String> <MASK><NEW_LINE>final String jobIdString = actualJob.getId().toString();<NEW_LINE>if (!errors.isEmpty()) {<NEW_LINE>throw badRequest(new CreateJobResponse(INVALID_JOB_DEFINITION, ImmutableList.copyOf(errors), jobIdString));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>model.addJob(actualJob);<NEW_LINE>} catch (JobExistsException e) {<NEW_LINE>throw badRequest(new CreateJobResponse(JOB_ALREADY_EXISTS, ImmutableList.<String>of(), jobIdString));<NEW_LINE>}<NEW_LINE>log.info("created job: {}", actualJob);<NEW_LINE>return new CreateJobResponse(CreateJobResponse.Status.OK, ImmutableList.<String>of(), jobIdString);<NEW_LINE>} | errors = jobValidator.validate(actualJob); |
1,667,886 | final EnableAddOnResult executeEnableAddOn(EnableAddOnRequest enableAddOnRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(enableAddOnRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<EnableAddOnRequest> request = null;<NEW_LINE>Response<EnableAddOnResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new EnableAddOnRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(enableAddOnRequest));<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, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "EnableAddOn");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<EnableAddOnResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new EnableAddOnResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,178,817 | final EnableVgwRoutePropagationResult executeEnableVgwRoutePropagation(EnableVgwRoutePropagationRequest enableVgwRoutePropagationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(enableVgwRoutePropagationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<EnableVgwRoutePropagationRequest> request = null;<NEW_LINE>Response<EnableVgwRoutePropagationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new EnableVgwRoutePropagationRequestMarshaller().marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "EnableVgwRoutePropagation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<EnableVgwRoutePropagationResult> responseHandler = new StaxResponseHandler<EnableVgwRoutePropagationResult>(new EnableVgwRoutePropagationResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(enableVgwRoutePropagationRequest)); |
1,459,491 | public ResponseEntity<String> receivePaymentConfirmation(HttpServletRequest request, @PathVariable("reservationId") String reservationId) {<NEW_LINE>return Optional.ofNullable(StringUtils.trimToNull(request.getParameter("id"))).flatMap(id -> purchaseContextManager.findByReservationId(reservationId).map(purchaseContext -> {<NEW_LINE>var content = "id=" + id;<NEW_LINE>var result = ticketReservationManager.processTransactionWebhook(content, null, PaymentProxy.MOLLIE, Map.of(ADDITIONAL_INFO_PURCHASE_CONTEXT_TYPE, purchaseContext.getType().getUrlComponent(), ADDITIONAL_INFO_PURCHASE_IDENTIFIER, purchaseContext.getPublicIdentifier(), ADDITIONAL_INFO_RESERVATION_ID, reservationId), <MASK><NEW_LINE>if (result.isSuccessful()) {<NEW_LINE>return ResponseEntity.ok("OK");<NEW_LINE>} else if (result.isError()) {<NEW_LINE>return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(result.getReason());<NEW_LINE>}<NEW_LINE>return ResponseEntity.ok(result.getReason());<NEW_LINE>})).orElseGet(() -> ResponseEntity.badRequest().body("NOK"));<NEW_LINE>} | new PaymentContext(purchaseContext, reservationId)); |
1,330,481 | public void compute(double[][] seasonMatrix, int sP, int sQ, int season) {<NEW_LINE>int dataLength = TsMethod.seasonMatrix2Array(seasonMatrix).length;<NEW_LINE>// step 1: set residual[i]=0, if i<initPoint; set data[i]=0, if i<initPoint<NEW_LINE>double[] cResidual = new double[seasonMatrix[0].length];<NEW_LINE>// step 2: find initial parameters for fitting CSS<NEW_LINE>double[] newARCoef = new double[sP];<NEW_LINE>double[] newMACoef = new double[sQ];<NEW_LINE>double[] newIntercept = new double[1];<NEW_LINE>ArrayList<double[]> initCoef = new ArrayList<>();<NEW_LINE>initCoef.add(newARCoef);<NEW_LINE>initCoef.add(newMACoef);<NEW_LINE>initCoef.add(newIntercept);<NEW_LINE>// step 3: gradient descent<NEW_LINE>SCSSGradientTarget sarmaGT = new SCSSGradientTarget();<NEW_LINE>sarmaGT.fit(seasonMatrix, cResidual, initCoef, season);<NEW_LINE>AbstractGradientTarget problem = BFGS.solve(sarmaGT, 1000, 0.001, 0.000001, new int[] { 1, 2, 3 }, -1);<NEW_LINE>this.sResidual = problem.getResidual();<NEW_LINE>this.variance = problem.getMinValue() / (dataLength - sP - sQ);<NEW_LINE>DenseMatrix result = problem.getFinalCoef();<NEW_LINE>this.warn = problem.getWarn();<NEW_LINE>this.sARCoef = new double[sP];<NEW_LINE>this.sMACoef = new double[sQ];<NEW_LINE>for (int i = 0; i < sP; i++) {<NEW_LINE>this.sARCoef[i] = result.get(i, 0);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < sQ; i++) {<NEW_LINE>this.sMACoef[i] = result.get(i + sP, 0);<NEW_LINE>}<NEW_LINE>this.css = problem.getMinValue();<NEW_LINE>this.logLikelihood = -((double) (dataLength - sP) / 2) * Math.log(2 * Math.PI) - ((double) (dataLength - sP) / 2) * Math.log(variance) - css / (2 * variance);<NEW_LINE>DenseMatrix information = problem.getH();<NEW_LINE>this.sArStdError = new double[sP];<NEW_LINE>this.sMaStdError = new double[sQ];<NEW_LINE>for (int i = 0; i < sP; i++) {<NEW_LINE>this.sArStdError[i] = Math.sqrt(information.get(i, i));<NEW_LINE>if (Double.isNaN(this.sArStdError[i])) {<NEW_LINE>this.sArStdError[i] = -99;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < sQ; i++) {<NEW_LINE>this.sMaStdError[i] = Math.sqrt(information.get(i <MASK><NEW_LINE>if (Double.isNaN(this.sMaStdError[i])) {<NEW_LINE>this.sMaStdError[i] = -99;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | + sP, i + sP)); |
226,542 | // Looks up various UUIDs for a user.<NEW_LINE>private void runUUIDTest(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception {<NEW_LINE>if (args.length < 2) {<NEW_LINE>throw new Exception("/<command> uuidtest <name>");<NEW_LINE>}<NEW_LINE>final String name = args[1];<NEW_LINE><MASK><NEW_LINE>UUID onlineUUID = null;<NEW_LINE>for (final Player player : ess.getOnlinePlayers()) {<NEW_LINE>if (player.getName().equalsIgnoreCase(name)) {<NEW_LINE>onlineUUID = player.getUniqueId();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final UUID essUUID = ess.getUserMap().getUser(name).getConfigUUID();<NEW_LINE>final org.bukkit.OfflinePlayer player = ess.getServer().getOfflinePlayer(name);<NEW_LINE>final UUID bukkituuid = player.getUniqueId();<NEW_LINE>sender.sendMessage("Bukkit Lookup: " + bukkituuid.toString());<NEW_LINE>if (onlineUUID != null && onlineUUID != bukkituuid) {<NEW_LINE>sender.sendMessage("Online player: " + onlineUUID.toString());<NEW_LINE>}<NEW_LINE>if (essUUID != null && essUUID != bukkituuid) {<NEW_LINE>sender.sendMessage("Essentials config: " + essUUID.toString());<NEW_LINE>}<NEW_LINE>final UUID npcuuid = UUID.nameUUIDFromBytes(("NPC:" + name).getBytes(Charsets.UTF_8));<NEW_LINE>sender.sendMessage("NPC UUID: " + npcuuid.toString());<NEW_LINE>final UUID offlineuuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8));<NEW_LINE>sender.sendMessage("Offline Mode UUID: " + offlineuuid.toString());<NEW_LINE>} | sender.sendMessage("Looking up UUID for " + name); |
257,224 | public void onActivityResult(int requestCode, int resultCode, Intent data) {<NEW_LINE>android.util.Log.i(TAG, "onActivityResult");<NEW_LINE>super.onActivityResult(requestCode, resultCode, data);<NEW_LINE>switch(requestCode) {<NEW_LINE>case IMPORT_KEY_REQUEST:<NEW_LINE>if (resultCode == Activity.RESULT_OK) {<NEW_LINE>if (data != null && data.getData() != null) {<NEW_LINE>ContentResolver resolver = getContentResolver();<NEW_LINE>InputStream in = getInputStreamFromUri(resolver, data.getData());<NEW_LINE>String keyData = readFile(in);<NEW_LINE>try {<NEW_LINE>passphrase = password1.getText().toString();<NEW_LINE>KeyPair pair = PubkeyUtils.tryImportingPemAndPkcs8(GeneratePubkeyActivity.this, keyData, passphrase);<NEW_LINE>converToBase64AndSendIntent(pair);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE><MASK><NEW_LINE>Toast.makeText(getBaseContext(), e.getLocalizedMessage(), Toast.LENGTH_LONG).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Toast.makeText(getBaseContext(), getString(R.string.success_importing), Toast.LENGTH_LONG).show();<NEW_LINE>} else {<NEW_LINE>android.util.Log.e(TAG, "File uri not found, not importing key");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>android.util.Log.e(TAG, "Error while selecting file to import key from");<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case SAVE_KEY_REQUEST:<NEW_LINE>if (resultCode == Activity.RESULT_OK) {<NEW_LINE>if (data != null && data.getData() != null) {<NEW_LINE>ContentResolver resolver = getContentResolver();<NEW_LINE>OutputStream out = getOutputStreamFromUri(resolver, data.getData());<NEW_LINE>outputToStream(publicKeySSHFormat, out);<NEW_LINE>} else {<NEW_LINE>android.util.Log.e(TAG, "File uri not found, not exporting pubkey");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>android.util.Log.e(TAG, "Error while selecting file to export pubkey to");<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | Log.e(TAG, "Failed to decode key."); |
986,171 | private void generateRealGetMethod(String name) {<NEW_LINE>String <MASK><NEW_LINE>Label elseLabel = new Label();<NEW_LINE>MethodVisitor mv = getMethodVisitor(name);<NEW_LINE>mv.visitCode();<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, 1);<NEW_LINE>mv.visitTypeInsn(Opcodes.INSTANCEOF, accessorInterfaceInternalName);<NEW_LINE>mv.visitJumpInsn(Opcodes.IFEQ, elseLabel);<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, 1);<NEW_LINE>mv.visitTypeInsn(Opcodes.CHECKCAST, accessorInterfaceInternalName);<NEW_LINE>mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, accessorInterfaceInternalName, getterName, Utils.getMethodDefinition(accessorInterface, getterName).getDescriptor(), /* isInterface= */<NEW_LINE>true);<NEW_LINE>mv.visitInsn(Opcodes.ARETURN);<NEW_LINE>mv.visitLabel(elseLabel);<NEW_LINE>if (frames) {<NEW_LINE>mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);<NEW_LINE>}<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, 0);<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, 1);<NEW_LINE>mv.visitMethodInsn(Opcodes.INVOKESPECIAL, instrumentedTypeInternalName, "mapGet", Utils.getMethodDefinition(instrumentedType, "mapGet").getDescriptor(), /* isInterface= */<NEW_LINE>false);<NEW_LINE>mv.visitInsn(Opcodes.ARETURN);<NEW_LINE>mv.visitMaxs(0, 0);<NEW_LINE>mv.visitEnd();<NEW_LINE>} | getterName = getRealGetterName(typeName, fieldTypeName); |
1,382,050 | private void addRelation(InternalRelationship layoutRelationship) {<NEW_LINE>if (layoutRelationship == null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>throw new IllegalArgumentException("The arguments can not be null!");<NEW_LINE>} else {<NEW_LINE>double weight = layoutRelationship.getWeight();<NEW_LINE>weight = (weight <= 0 ? 0.1 : weight);<NEW_LINE>String key1 = layoutRelationship.getSource().toString() + layoutRelationship.getDestination().toString();<NEW_LINE>String key2 = layoutRelationship.getDestination().toString() + layoutRelationship<MASK><NEW_LINE>String[] keys = { key1, key2 };<NEW_LINE>for (int i = 0; i < keys.length; i++) {<NEW_LINE>String key = keys[i];<NEW_LINE>Integer count = (Integer) srcDestToNumRelsMap.get(key);<NEW_LINE>Double avgWeight = (Double) srcDestToRelsAvgWeightMap.get(key);<NEW_LINE>if (count == null) {<NEW_LINE>count = new Integer(1);<NEW_LINE>avgWeight = new Double(weight);<NEW_LINE>} else {<NEW_LINE>int newCount = count.intValue() + 1;<NEW_LINE>double newAverage = (avgWeight.doubleValue() * count.doubleValue() + weight) / newCount;<NEW_LINE>avgWeight = new Double(newAverage);<NEW_LINE>count = new Integer(newCount);<NEW_LINE>}<NEW_LINE>srcDestToNumRelsMap.put(key, count);<NEW_LINE>srcDestToRelsAvgWeightMap.put(key, avgWeight);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getSource().toString(); |
464,003 | @RequiresPermissions(SidecarRestPermissions.COLLECTORS_READ)<NEW_LINE>@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>@ApiOperation(value = "List all collectors")<NEW_LINE>public Response listCollectors(@Context HttpHeaders httpHeaders) {<NEW_LINE>String ifNoneMatch = httpHeaders.getHeaderString("If-None-Match");<NEW_LINE>Boolean etagCached = false;<NEW_LINE>Response.<MASK><NEW_LINE>// check if client is up to date with a known valid etag<NEW_LINE>if (ifNoneMatch != null) {<NEW_LINE>EntityTag etag = new EntityTag(ifNoneMatch.replaceAll("\"", ""));<NEW_LINE>if (etagService.isPresent(etag.toString())) {<NEW_LINE>etagCached = true;<NEW_LINE>builder = Response.notModified();<NEW_LINE>builder.tag(etag);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// fetch collector list from database if client is outdated<NEW_LINE>if (!etagCached) {<NEW_LINE>final List<Collector> result = this.collectorService.all();<NEW_LINE>CollectorListResponse collectorListResponse = CollectorListResponse.create(result.size(), result);<NEW_LINE>// add new etag to cache<NEW_LINE>String etagString = collectorsToEtag(collectorListResponse);<NEW_LINE>EntityTag collectorsEtag = new EntityTag(etagString);<NEW_LINE>builder = Response.ok(collectorListResponse);<NEW_LINE>builder.tag(collectorsEtag);<NEW_LINE>etagService.put(collectorsEtag.toString());<NEW_LINE>}<NEW_LINE>// set cache control<NEW_LINE>CacheControl cacheControl = new CacheControl();<NEW_LINE>cacheControl.setNoTransform(true);<NEW_LINE>cacheControl.setPrivate(true);<NEW_LINE>builder.cacheControl(cacheControl);<NEW_LINE>return builder.build();<NEW_LINE>} | ResponseBuilder builder = Response.noContent(); |
317,087 | final DescribeActivitiesResult executeDescribeActivities(DescribeActivitiesRequest describeActivitiesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeActivitiesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeActivitiesRequest> request = null;<NEW_LINE>Response<DescribeActivitiesResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeActivitiesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeActivitiesRequest));<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, "WorkDocs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeActivities");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeActivitiesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeActivitiesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
327,394 | private static void testCRUDOperations() {<NEW_LINE>CatalogItem item = new CatalogItem();<NEW_LINE>item.setId(601);<NEW_LINE>item.setTitle("Book 601");<NEW_LINE>item.setISBN("611-1111111111");<NEW_LINE>item.setBookAuthors(new HashSet<String>(Arrays.asList("Author1", "Author2")));<NEW_LINE>// Save the item (book).<NEW_LINE>DynamoDBMapper mapper = new DynamoDBMapper(client);<NEW_LINE>mapper.save(item);<NEW_LINE>// Retrieve the item.<NEW_LINE>CatalogItem itemRetrieved = mapper.load(CatalogItem.class, 601);<NEW_LINE>System.out.println("Item retrieved:");<NEW_LINE>System.out.println(itemRetrieved);<NEW_LINE>// Update the item.<NEW_LINE>itemRetrieved.setISBN("622-2222222222");<NEW_LINE>itemRetrieved.setBookAuthors(new HashSet<String>(Arrays.asList("Author1", "Author3")));<NEW_LINE>mapper.save(itemRetrieved);<NEW_LINE>System.out.println("Item updated:");<NEW_LINE>System.out.println(itemRetrieved);<NEW_LINE>// Retrieve the updated item.<NEW_LINE>DynamoDBMapperConfig config = DynamoDBMapperConfig.builder().withConsistentReads(DynamoDBMapperConfig.ConsistentReads.CONSISTENT).build();<NEW_LINE>CatalogItem updatedItem = mapper.load(CatalogItem.class, 601, config);<NEW_LINE>System.out.println("Retrieved the previously updated item:");<NEW_LINE><MASK><NEW_LINE>// Delete the item.<NEW_LINE>mapper.delete(updatedItem);<NEW_LINE>// Try to retrieve deleted item.<NEW_LINE>CatalogItem deletedItem = mapper.load(CatalogItem.class, updatedItem.getId(), config);<NEW_LINE>if (deletedItem == null) {<NEW_LINE>System.out.println("Done - Sample item is deleted.");<NEW_LINE>}<NEW_LINE>} | System.out.println(updatedItem); |
859,075 | public void checkGiteeUpdate(final int appVersionCode) {<NEW_LINE>mCompositeSubscription.add(Update.checkGitee().observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void call(String json) {<NEW_LINE>try {<NEW_LINE>String versionName = new JSONObject<MASK><NEW_LINE>String versionCodeString = new JSONObject(json).getString(APP_VERSIONCODE);<NEW_LINE>int ServerAppVersionCode = Integer.parseInt(versionCodeString);<NEW_LINE>String content = new JSONObject(json).getString(APP_CONTENT);<NEW_LINE>String md5 = new JSONObject(json).getString(APP_MD5);<NEW_LINE>String url = new JSONObject(json).getString(APP_URL);<NEW_LINE>if (appVersionCode < ServerAppVersionCode) {<NEW_LINE>mBaseView.onUpdateReady(versionName, content, url, ServerAppVersionCode, md5);<NEW_LINE>}<NEW_LINE>} catch (JSONException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, new Action1<Throwable>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void call(Throwable throwable) {<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>} | (json).getString(APP_VERSIONNAME); |
1,518,355 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see com.aptana.editor.common.CommonDocumentProvider#connect(java.lang.Object)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void connect(Object element) throws CoreException {<NEW_LINE>super.connect(element);<NEW_LINE>IDocument document = getDocument(element);<NEW_LINE>if (document != null) {<NEW_LINE>CompositePartitionScanner partitionScanner = new //<NEW_LINE>//<NEW_LINE>CompositePartitionScanner(//<NEW_LINE>SVGSourceConfiguration.getDefault().createSubPartitionScanner(), //<NEW_LINE>new NullSubPartitionScanner(), new NullPartitionerSwitchStrategy());<NEW_LINE>IDocumentPartitioner partitioner = new //<NEW_LINE>//<NEW_LINE>ExtendedFastPartitioner(//<NEW_LINE>partitionScanner, SVGSourceConfiguration.getDefault().getContentTypes());<NEW_LINE>partitionScanner.setPartitioner((IExtendedPartitioner) partitioner);<NEW_LINE>partitioner.connect(document);<NEW_LINE>document.setDocumentPartitioner(partitioner);<NEW_LINE>//<NEW_LINE>//<NEW_LINE>CommonEditorPlugin.getDefault().getDocumentScopeManager().//<NEW_LINE>registerConfiguration(//<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | document, SVGSourceConfiguration.getDefault()); |
1,236,397 | void decode(Decoder decoder, Instruction instruction) {<NEW_LINE>int operandSize = decoder.state_operandSize;<NEW_LINE>instruction.setCode(codes[operandSize]);<NEW_LINE>if (decoder.state_mod < 3) {<NEW_LINE>decoder.state_zs_flags |= (flags & HandlerFlags.LOCK) << (13 - 3);<NEW_LINE>instruction.setOp0Kind(OpKind.MEMORY);<NEW_LINE>decoder.readOpMem(instruction);<NEW_LINE>} else {<NEW_LINE>instruction.setOp0Register((operandSize << 4) + decoder.state_rm + decoder.state_zs_extraBaseRegisterBase + Register.AX);<NEW_LINE>}<NEW_LINE>if (operandSize == OpSize.SIZE32) {<NEW_LINE>instruction.setOp1Kind(OpKind.IMMEDIATE32);<NEW_LINE>instruction.setImmediate32(decoder.readUInt32());<NEW_LINE>} else if (operandSize == OpSize.SIZE64) {<NEW_LINE>instruction.setOp1Kind(OpKind.IMMEDIATE32TO64);<NEW_LINE>instruction.setImmediate32(decoder.readUInt32());<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>instruction.setImmediate16((short) decoder.readUInt16());<NEW_LINE>}<NEW_LINE>} | instruction.setOp1Kind(OpKind.IMMEDIATE16); |
397,720 | protected void buttonPressed(int buttonId) {<NEW_LINE>if (buttonId == 0) {<NEW_LINE>response = JsonNodeFactory.instance.objectNode();<NEW_LINE>Iterator<String> iterator = userInput.fieldNames();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE><MASK><NEW_LINE>JsonNode value = userInput.path(fieldName);<NEW_LINE>if (!(value instanceof POJONode)) {<NEW_LINE>// something bad. FIXME we should recover from here.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object controls = ((POJONode) value).getPojo();<NEW_LINE>if (!(controls instanceof List<?>)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Object> input = (List<Object>) controls;<NEW_LINE>Object firstElement = CollectionsUtil.getFirstElement(input);<NEW_LINE>if (firstElement instanceof Boolean) {<NEW_LINE>response.put(fieldName, (Boolean) firstElement);<NEW_LINE>} else if (firstElement instanceof Text) {<NEW_LINE>response.put(fieldName, ((Text) firstElement).getText());<NEW_LINE>} else if (firstElement instanceof Button) {<NEW_LINE>for (Object b : input) {<NEW_LINE>if (((Button) b).getSelection()) {<NEW_LINE>response.put(fieldName, ((Button) b).getText());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (firstElement instanceof ComboViewer) {<NEW_LINE>ISelection selection = ((ComboViewer) firstElement).getSelection();<NEW_LINE>if (!selection.isEmpty() && selection instanceof IStructuredSelection) {<NEW_LINE>Object selectedElement = ((IStructuredSelection) selection).getFirstElement();<NEW_LINE>if (selectedElement instanceof JsonNode) {<NEW_LINE>response.put(fieldName, ((JsonNode) selectedElement).path(VALUE).asText());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (firstElement instanceof Boolean) {<NEW_LINE>response.put(fieldName, Boolean.TRUE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.buttonPressed(buttonId);<NEW_LINE>} | String fieldName = iterator.next(); |
1,701,556 | private void initializeSemaphoreTaskFactories() {<NEW_LINE>factories.put(SemaphoreAcquireCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AcquirePermitsMessageTask(cm, node, con));<NEW_LINE>factories.put(SemaphoreAvailablePermitsCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new AvailablePermitsMessageTask(cm, node, con));<NEW_LINE>factories.put(SemaphoreChangeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ChangePermitsMessageTask<MASK><NEW_LINE>factories.put(SemaphoreDrainCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new DrainPermitsMessageTask(cm, node, con));<NEW_LINE>factories.put(SemaphoreGetSemaphoreTypeCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new GetSemaphoreTypeMessageTask(cm, node, con));<NEW_LINE>factories.put(SemaphoreInitCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new InitSemaphoreMessageTask(cm, node, con));<NEW_LINE>factories.put(SemaphoreReleaseCodec.REQUEST_MESSAGE_TYPE, (cm, con) -> new ReleasePermitsMessageTask(cm, node, con));<NEW_LINE>} | (cm, node, con)); |
1,610,561 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>final ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.person_detail_fragment, container, false);<NEW_LINE>Toolbar toolbar = rootView.findViewById(R.id.toolbar_main);<NEW_LINE>((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);<NEW_LINE>ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();<NEW_LINE>if (actionBar != null) {<NEW_LINE>actionBar.setHomeButtonEnabled(true);<NEW_LINE>actionBar.setDisplayHomeAsUpEnabled(true);<NEW_LINE>actionBar.setTitle(null);<NEW_LINE>}<NEW_LINE>mAvatarImageView = rootView.findViewById(R.id.person_avatar);<NEW_LINE>mDisplayNameTextView = rootView.findViewById(R.id.person_display_name);<NEW_LINE>mUsernameTextView = rootView.findViewById(R.id.person_username);<NEW_LINE>mRoleContainer = rootView.findViewById(R.id.person_role_container);<NEW_LINE>mRoleTextView = rootView.<MASK><NEW_LINE>mSubscribedDateContainer = rootView.findViewById(R.id.subscribed_date_container);<NEW_LINE>mSubscribedDateTitleView = rootView.findViewById(R.id.subscribed_date_title);<NEW_LINE>mSubscribedDateTextView = rootView.findViewById(R.id.subscribed_date_text);<NEW_LINE>boolean isCurrentUser = mCurrentUserId == mPersonId;<NEW_LINE>SiteModel site = mSiteStore.getSiteByLocalId(mLocalTableBlogId);<NEW_LINE>if (!isCurrentUser && site != null && site.getHasCapabilityRemoveUsers()) {<NEW_LINE>setHasOptionsMenu(true);<NEW_LINE>}<NEW_LINE>return rootView;<NEW_LINE>} | findViewById(R.id.person_role); |
906,361 | void ensureChildHelper() {<NEW_LINE>try {<NEW_LINE>if (mInnerChildHelper == null) {<NEW_LINE>mInnerChildHelper = mChildHelperField.get(mLayoutManager);<NEW_LINE>if (mInnerChildHelper == null)<NEW_LINE>return;<NEW_LINE>Class<?> helperClz = mInnerChildHelper.getClass();<NEW_LINE>mHideMethod = helperClz.getDeclaredMethod("hide", View.class);<NEW_LINE>mHideMethod.setAccessible(true);<NEW_LINE>try {<NEW_LINE>mFindHiddenNonRemovedViewMethod = helperClz.getDeclaredMethod("findHiddenNonRemovedView", int.class, int.class);<NEW_LINE>mFindHiddenNonRemovedViewMethod.setAccessible(true);<NEW_LINE>} catch (NoSuchMethodException nsme) {<NEW_LINE>mFindHiddenNonRemovedViewMethod25 = helperClz.getDeclaredMethod("findHiddenNonRemovedView", int.class);<NEW_LINE>mFindHiddenNonRemovedViewMethod25.setAccessible(true);<NEW_LINE>}<NEW_LINE>mIsHideMethod = helperClz.getDeclaredMethod("isHidden", View.class);<NEW_LINE>mIsHideMethod.setAccessible(true);<NEW_LINE>Field <MASK><NEW_LINE>bucketField.setAccessible(true);<NEW_LINE>mInnerBucket = bucketField.get(mInnerChildHelper);<NEW_LINE>mClearMethod = mInnerBucket.getClass().getDeclaredMethod("clear", int.class);<NEW_LINE>mClearMethod.setAccessible(true);<NEW_LINE>mHiddenViewField = helperClz.getDeclaredField("mHiddenViews");<NEW_LINE>mHiddenViewField.setAccessible(true);<NEW_LINE>mInnerHiddenView = (List) mHiddenViewField.get(mInnerChildHelper);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | bucketField = helperClz.getDeclaredField("mBucket"); |
673,453 | public void addRemovalTimeById(String processInstanceId, Date removalTime) {<NEW_LINE>CommandContext commandContext = Context.getCommandContext();<NEW_LINE>commandContext.getHistoricActivityInstanceManager().addRemovalTimeToActivityInstancesByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getHistoricTaskInstanceManager().addRemovalTimeToTaskInstancesByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getHistoricVariableInstanceManager().addRemovalTimeToVariableInstancesByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getHistoricDetailManager().addRemovalTimeToDetailsByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getHistoricIncidentManager().addRemovalTimeToIncidentsByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getHistoricExternalTaskLogManager().addRemovalTimeToExternalTaskLogByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getHistoricJobLogManager().addRemovalTimeToJobLogByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getOperationLogManager(<MASK><NEW_LINE>commandContext.getHistoricIdentityLinkManager().addRemovalTimeToIdentityLinkLogByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getCommentManager().addRemovalTimeToCommentsByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getAttachmentManager().addRemovalTimeToAttachmentsByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getByteArrayManager().addRemovalTimeToByteArraysByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>if (isEnableHistoricInstancePermissions()) {<NEW_LINE>commandContext.getAuthorizationManager().addRemovalTimeToAuthorizationsByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>}<NEW_LINE>Map<String, Object> parameters = new HashMap<>();<NEW_LINE>parameters.put("processInstanceId", processInstanceId);<NEW_LINE>parameters.put("removalTime", removalTime);<NEW_LINE>getDbEntityManager().updatePreserveOrder(HistoricProcessInstanceEventEntity.class, "updateHistoricProcessInstanceByProcessInstanceId", parameters);<NEW_LINE>} | ).addRemovalTimeToUserOperationLogByProcessInstanceId(processInstanceId, removalTime); |
1,241,728 | public final static void YUVJtoRGB(byte y, byte cb, byte cr, byte[] data, int off) {<NEW_LINE>int y_ <MASK><NEW_LINE>int add_r = FIX_1_402 * cr + ONE_HALF;<NEW_LINE>int add_g = _FIX_0_34414 * cb - FIX_0_71414 * cr + ONE_HALF;<NEW_LINE>int add_b = FIX_1_772 * cb + ONE_HALF;<NEW_LINE>int r = (y_ + add_r) >> SCALEBITS;<NEW_LINE>int g = (y_ + add_g) >> SCALEBITS;<NEW_LINE>int b = (y_ + add_b) >> SCALEBITS;<NEW_LINE>data[off] = (byte) clip(r - 128, -128, 127);<NEW_LINE>data[off + 1] = (byte) clip(g - 128, -128, 127);<NEW_LINE>data[off + 2] = (byte) clip(b - 128, -128, 127);<NEW_LINE>} | = (y + 128) << SCALEBITS; |
1,706,384 | public void start(BundleContext context) throws Exception {<NEW_LINE>FileProtocolService service = new FileProtocolService() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getSchema() {<NEW_LINE>return "nfs";<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ProtocolProvider getProtocolProvider() {<NEW_LINE>return new NFSProtocolProvider();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public SchemeHandler getSchemeHandler() {<NEW_LINE>return new DefaultSchemeHandler(new DefaultSchemeParser(), 2049, "/", AuthenticationType.NO_AUTHENTICATION, null);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ProtocolPanelProvider panelProvider = new ProtocolPanelProvider() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getSchema() {<NEW_LINE>return "nfs";<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ServerPanel get(ServerPanelListener listener, JFrame mainFrame) {<NEW_LINE>return new NFSPanel(listener, mainFrame);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int priority() {<NEW_LINE>return 2000;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Class<? extends ServerPanel> getPanelClass() {<NEW_LINE>return NFSPanel.class;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>serviceRegistration = context.registerService(<MASK><NEW_LINE>uiServiceRegistration = context.registerService(ProtocolPanelProvider.class, panelProvider, null);<NEW_LINE>} | FileProtocolService.class, service, null); |
1,753,143 | public static void init(Context context) throws Exception {<NEW_LINE>mContext = context;<NEW_LINE>try {<NEW_LINE>Logger.debug("initializing System...");<NEW_LINE>mStoragePath = getSettings().getString("PREF_SAVE_PATH", Environment.getExternalStorageDirectory().toString());<NEW_LINE>mSessionName = "csploit-session-" + java.lang.System.currentTimeMillis();<NEW_LINE>mKnownIssues = new KnownIssues();<NEW_LINE>mPlugins = new ArrayList<>();<NEW_LINE>mOpenPorts = new SparseIntArray(3);<NEW_LINE>mServices = new HashMap<>();<NEW_LINE>mPorts = new HashMap<>();<NEW_LINE>// if we are here, network initialization didn't throw any error, lock wifi<NEW_LINE>WifiManager wifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);<NEW_LINE>if (mWifiLock == null)<NEW_LINE>mWifiLock = wifiManager.createWifiLock(WifiManager.WIFI_MODE_FULL, "wifiLock");<NEW_LINE>if (!mWifiLock.isHeld())<NEW_LINE>mWifiLock.acquire();<NEW_LINE>// wake lock if enabled<NEW_LINE>if (getSettings().getBoolean("PREF_WAKE_LOCK", true)) {<NEW_LINE>PowerManager powerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);<NEW_LINE>if (mWakeLock == null)<NEW_LINE>mWakeLock = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, "wakeLock");<NEW_LINE>if (!mWakeLock.isHeld())<NEW_LINE>mWakeLock.acquire();<NEW_LINE>}<NEW_LINE>// set ports<NEW_LINE>try {<NEW_LINE>HTTP_PROXY_PORT = Integer.parseInt(getSettings().getString("PREF_HTTP_PROXY_PORT", "8080"));<NEW_LINE>HTTP_SERVER_PORT = Integer.parseInt(getSettings().getString("PREF_HTTP_SERVER_PORT", "8081"));<NEW_LINE>HTTPS_REDIR_PORT = Integer.parseInt(getSettings()<MASK><NEW_LINE>MSF_RPC_PORT = Integer.parseInt(getSettings().getString("MSF_RPC_PORT", "55553"));<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>HTTP_PROXY_PORT = 8080;<NEW_LINE>HTTP_SERVER_PORT = 8081;<NEW_LINE>HTTPS_REDIR_PORT = 8082;<NEW_LINE>MSF_RPC_PORT = 55553;<NEW_LINE>}<NEW_LINE>// initialize network data at the end<NEW_LINE>uncaughtReloadNetworkMapping();<NEW_LINE>if (isCoreInstalled())<NEW_LINE>beginLoadServicesAndVendors();<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (!(e instanceof NoRouteToHostException))<NEW_LINE>errorLogging(e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | .getString("PREF_HTTPS_REDIRECTOR_PORT", "8082")); |
920,426 | private UaDataTypeNode newDataTypeNode(NodeId nodeId, List<DataValue> attributeValues) throws UaException {<NEW_LINE>DataValue nodeIdDataValue = attributeValues.get(0);<NEW_LINE><MASK><NEW_LINE>if (nodeIdStatusCode != null && nodeIdStatusCode.isBad()) {<NEW_LINE>throw new UaException(nodeIdStatusCode);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>NodeClass nodeClass = NodeClass.from((Integer) attributeValues.get(1).getValue().getValue());<NEW_LINE>Preconditions.checkArgument(nodeClass == NodeClass.DataType, "expected NodeClass.DataType, got NodeClass." + nodeClass);<NEW_LINE>QualifiedName browseName = (QualifiedName) attributeValues.get(2).getValue().getValue();<NEW_LINE>LocalizedText displayName = (LocalizedText) attributeValues.get(3).getValue().getValue();<NEW_LINE>LocalizedText description = getAttributeOrNull(attributeValues.get(4), LocalizedText.class);<NEW_LINE>UInteger writeMask = getAttributeOrNull(attributeValues.get(5), UInteger.class);<NEW_LINE>UInteger userWriteMask = getAttributeOrNull(attributeValues.get(6), UInteger.class);<NEW_LINE>Boolean isAbstract = (Boolean) attributeValues.get(7).getValue().getValue();<NEW_LINE>return new UaDataTypeNode(client, nodeId, nodeClass, browseName, displayName, description, writeMask, userWriteMask, isAbstract);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw UaException.extract(t).orElse(new UaException(StatusCodes.Bad_UnexpectedError, t));<NEW_LINE>}<NEW_LINE>} | StatusCode nodeIdStatusCode = nodeIdDataValue.getStatusCode(); |
1,681,130 | public void validate(Object obj, Errors errors) {<NEW_LINE>CheckoutForm checkoutForm = (CheckoutForm) obj;<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(errors, "billingAddress.addressLine1", "addressLine1.required");<NEW_LINE>ValidationUtils.<MASK><NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(errors, "billingAddress.city", "city.required");<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(errors, "billingAddress.postalCode", "postalCode.required");<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(errors, "billingAddress.firstName", "firstName.required");<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(errors, "billingAddress.lastName", "lastName.required");<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(errors, "shippingAddress.addressLine1", "addressLine1.required");<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(errors, "shippingAddress.city", "city.required");<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(errors, "shippingAddress.postalCode", "postalCode.required");<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(errors, "shippingAddress.firstName", "firstName.required");<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(errors, "shippingAddress.lastName", "lastName.required");<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(errors, "emailAddress", "emailAddress.required");<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(errors, "creditCardNumber", "creditCardNumber.required");<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(errors, "creditCardCvvCode", "creditCardCvvCode.required");<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(errors, "creditCardExpMonth", "creditCardExpMonth.required");<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(errors, "creditCardExpYear", "creditCardExpYear.required");<NEW_LINE>if (!errors.hasErrors()) {<NEW_LINE>if (!GenericValidator.isEmail(checkoutForm.getEmailAddress())) {<NEW_LINE>errors.rejectValue("emailAddress", "emailAddress.invalid", null, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | rejectIfEmptyOrWhitespace(errors, "billingAddress.phonePrimary", "phone.required"); |
1,168,273 | public byte[] decrypt(byte[] tagData) throws Exception {<NEW_LINE>if (!hasFixedKey() || !hasUnFixedKey())<NEW_LINE>throw new Exception(context.getString(R.string.key_not_present));<NEW_LINE>AmiiTool tool = new AmiiTool();<NEW_LINE>if (tool.setKeysFixed(fixedKey, fixedKey.length) == 0)<NEW_LINE>throw new Exception(context.getString(R.string.error_amiitool_init));<NEW_LINE>if (tool.setKeysUnfixed(unfixedKey, unfixedKey.length) == 0)<NEW_LINE>throw new Exception(context.getString(R.string.error_amiitool_init));<NEW_LINE>byte[] decrypted = new byte[NfcByte.TAG_FILE_SIZE];<NEW_LINE>if (tool.unpack(tagData, tagData.length, decrypted, decrypted.length) == 0)<NEW_LINE>throw new Exception(context.getString<MASK><NEW_LINE>return decrypted;<NEW_LINE>} | (R.string.fail_decrypt)); |
389,258 | /* Build call for throttlingPoliciesSubscriptionPolicyIdDelete */<NEW_LINE>private com.squareup.okhttp.Call throttlingPoliciesSubscriptionPolicyIdDeleteCall(String policyId, String ifMatch, String ifUnmodifiedSince, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/throttling/policies/subscription/{policyId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "policyId" + "\\}", apiClient.escapeString(policyId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (ifMatch != null)<NEW_LINE>localVarHeaderParams.put("If-Match", apiClient.parameterToString(ifMatch));<NEW_LINE>if (ifUnmodifiedSince != null)<NEW_LINE>localVarHeaderParams.put("If-Unmodified-Since", apiClient.parameterToString(ifUnmodifiedSince));<NEW_LINE>Map<String, Object> localVarFormParams = new <MASK><NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>} | HashMap<String, Object>(); |
645,991 | public boolean visit(MySqlJSONTableExpr.Column x) {<NEW_LINE>x.getName().accept(this);<NEW_LINE>if (x.isOrdinality()) {<NEW_LINE>print0(ucase ? " FOR ORDINALITY" : " for ordinality");<NEW_LINE>}<NEW_LINE>SQLDataType dataType = x.getDataType();<NEW_LINE>if (dataType != null) {<NEW_LINE>print(' ');<NEW_LINE>dataType.accept(this);<NEW_LINE>}<NEW_LINE>if (x.isExists()) {<NEW_LINE>print0(ucase ? " EXISTS" : " exists");<NEW_LINE>}<NEW_LINE>SQLExpr path = x.getPath();<NEW_LINE>if (path != null) {<NEW_LINE>print0(ucase ? " PATH " : " path ");<NEW_LINE>path.accept(this);<NEW_LINE>}<NEW_LINE>List<MySqlJSONTableExpr.Column> nestedColumns = x.getNestedColumns();<NEW_LINE>if (nestedColumns.size() > 0) {<NEW_LINE>print0(ucase ? " COLUMNS (" : " columns (");<NEW_LINE>printAndAccept(nestedColumns, ", ");<NEW_LINE>print(')');<NEW_LINE>}<NEW_LINE>SQLExpr onEmpty = x.getOnEmpty();<NEW_LINE>if (onEmpty != null) {<NEW_LINE>print(' ');<NEW_LINE>if (!(onEmpty instanceof SQLNullExpr || onEmpty instanceof SQLIdentifierExpr)) {<NEW_LINE>print0(ucase ? "DEFAULT " : "default ");<NEW_LINE>}<NEW_LINE>onEmpty.accept(this);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>SQLExpr onError = x.getOnError();<NEW_LINE>if (onError != null) {<NEW_LINE>print(' ');<NEW_LINE>if (!(onEmpty instanceof SQLNullExpr || onEmpty instanceof SQLIdentifierExpr)) {<NEW_LINE>print0(ucase ? "DEFAULT " : "default ");<NEW_LINE>}<NEW_LINE>onError.accept(this);<NEW_LINE>print0(ucase ? " ON ERROR" : " on error");<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | print0(ucase ? " ON EMPTY" : " on empty"); |
1,323,767 | private static void correctSubjPass(SemanticGraph sg) {<NEW_LINE>if (sg.getRoots().isEmpty())<NEW_LINE>return;<NEW_LINE>SemanticGraph sgCopy = sg.makeSoftCopy();<NEW_LINE>SemgrexMatcher matcher = CORRECT_SUBJPASS_PATTERN.matcher(sgCopy);<NEW_LINE>while (matcher.find()) {<NEW_LINE>IndexedWord <MASK><NEW_LINE>IndexedWord subj = matcher.getNode("subj");<NEW_LINE>SemanticGraphEdge edge = sg.getEdge(gov, subj);<NEW_LINE>GrammaticalRelation reln = null;<NEW_LINE>if (edge.getRelation() == NOMINAL_SUBJECT) {<NEW_LINE>reln = NOMINAL_PASSIVE_SUBJECT;<NEW_LINE>} else if (edge.getRelation() == CLAUSAL_SUBJECT) {<NEW_LINE>reln = CLAUSAL_PASSIVE_SUBJECT;<NEW_LINE>} else if (edge.getRelation() == CONTROLLING_NOMINAL_SUBJECT) {<NEW_LINE>reln = CONTROLLING_NOMINAL_PASSIVE_SUBJECT;<NEW_LINE>} else if (edge.getRelation() == CONTROLLING_CLAUSAL_SUBJECT) {<NEW_LINE>reln = CONTROLLING_CLAUSAL_PASSIVE_SUBJECT;<NEW_LINE>}<NEW_LINE>if (reln != null) {<NEW_LINE>sg.removeEdge(edge);<NEW_LINE>sg.addEdge(gov, subj, reln, Double.NEGATIVE_INFINITY, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | gov = matcher.getNode("gov"); |
1,790,843 | private static void applyAnnotationToMethodDecl(EclipseNode typeNode, MethodDeclaration mth, String annType, boolean typeUse) {<NEW_LINE>if (annType == null)<NEW_LINE>return;<NEW_LINE>int partCount = 1;<NEW_LINE>for (int i = 0; i < annType.length(); i++) if (annType.charAt(i) == '.')<NEW_LINE>partCount++;<NEW_LINE>long[] ps = new long[partCount];<NEW_LINE>Arrays.fill(ps, 0L);<NEW_LINE>Annotation ann = new MarkerAnnotation(new QualifiedTypeReference(Eclipse.fromQualifiedName(annType), ps), 0);<NEW_LINE>if (!typeUse || mth.returnType == null || mth.returnType.getTypeName().length < 2) {<NEW_LINE>Annotation[] a = mth.annotations;<NEW_LINE>if (a == null)<NEW_LINE>a = new Annotation[1];<NEW_LINE>else {<NEW_LINE>Annotation[] b = new <MASK><NEW_LINE>System.arraycopy(a, 0, b, 0, a.length);<NEW_LINE>a = b;<NEW_LINE>}<NEW_LINE>a[a.length - 1] = ann;<NEW_LINE>mth.annotations = a;<NEW_LINE>} else {<NEW_LINE>int len = mth.returnType.getTypeName().length;<NEW_LINE>if (mth.returnType.annotations == null)<NEW_LINE>mth.returnType.annotations = new Annotation[len][];<NEW_LINE>Annotation[] a = mth.returnType.annotations[len - 1];<NEW_LINE>if (a == null)<NEW_LINE>a = new Annotation[1];<NEW_LINE>else {<NEW_LINE>Annotation[] b = new Annotation[a.length + 1];<NEW_LINE>System.arraycopy(a, 0, b, 1, a.length);<NEW_LINE>a = b;<NEW_LINE>}<NEW_LINE>a[0] = ann;<NEW_LINE>mth.returnType.annotations[len - 1] = a;<NEW_LINE>mth.bits |= Eclipse.HasTypeAnnotations;<NEW_LINE>}<NEW_LINE>} | Annotation[a.length + 1]; |
320,923 | ReferenceBinding resolve(LookupEnvironment environment, boolean convertGenericToRawType) {<NEW_LINE>ReferenceBinding targetType;<NEW_LINE>if (this != this.prototype) {<NEW_LINE>// $IDENTITY-COMPARISON$<NEW_LINE>targetType = this.prototype.resolve(environment, convertGenericToRawType);<NEW_LINE>if (convertGenericToRawType && targetType != null && targetType.isRawType()) {<NEW_LINE>targetType = (ReferenceBinding) environment.createAnnotatedType(targetType, this.typeAnnotations);<NEW_LINE>} else {<NEW_LINE>targetType = this.resolvedType;<NEW_LINE>}<NEW_LINE>return targetType;<NEW_LINE>}<NEW_LINE>targetType = this.resolvedType;<NEW_LINE>if (targetType == null) {<NEW_LINE>char[] typeName = this.compoundName[<MASK><NEW_LINE>targetType = this.fPackage.getType0(typeName);<NEW_LINE>if (targetType == this || targetType == null) {<NEW_LINE>// $IDENTITY-COMPARISON$<NEW_LINE>if (// leverage SplitPackageBinding to avoid duplicate creation of BinaryTypeBinding<NEW_LINE>this.fPackage instanceof SplitPackageBinding)<NEW_LINE>targetType = environment.askForType(this.fPackage, typeName, this.fPackage.enclosingModule);<NEW_LINE>else if (// $IDENTITY-COMPARISON$<NEW_LINE>targetType == this)<NEW_LINE>targetType = environment.askForType(this.compoundName, this.fPackage.enclosingModule);<NEW_LINE>}<NEW_LINE>if ((targetType == null || targetType == this) && CharOperation.contains('.', typeName)) {<NEW_LINE>// $IDENTITY-COMPARISON$<NEW_LINE>// bug 491354: this complements the NameLookup#seekTypes(..), which performs the same adaptation<NEW_LINE>targetType = environment.askForType(this.fPackage, CharOperation.replaceOnCopy(typeName, '.', '$'), this.fPackage.enclosingModule);<NEW_LINE>}<NEW_LINE>if (targetType == null || targetType == this) {<NEW_LINE>// could not resolve any better, error was already reported against it //$IDENTITY-COMPARISON$<NEW_LINE>// report the missing class file first - only if not resolving a previously missing type<NEW_LINE>if ((this.tagBits & TagBits.HasMissingType) == 0 && !environment.mayTolerateMissingType) {<NEW_LINE>environment.problemReporter.isClassPathCorrect(this.compoundName, environment.root.unitBeingCompleted, environment.missingClassFileLocation);<NEW_LINE>}<NEW_LINE>// create a proxy for the missing BinaryType<NEW_LINE>targetType = environment.createMissingType(null, this.compoundName);<NEW_LINE>}<NEW_LINE>setResolvedType(targetType, environment);<NEW_LINE>}<NEW_LINE>if (convertGenericToRawType) {<NEW_LINE>targetType = (ReferenceBinding) environment.convertUnresolvedBinaryToRawType(targetType);<NEW_LINE>}<NEW_LINE>return targetType;<NEW_LINE>} | this.compoundName.length - 1]; |
558,719 | private IModuleFile loadModuleFile(LibraryDataSource source, String objectName) throws IOException {<NEW_LINE>XCOFFReader xcoff = null;<NEW_LINE>try {<NEW_LINE>switch(source.getType()) {<NEW_LINE>case FILE:<NEW_LINE>xcoff = new XCOFFReader(source.getFile());<NEW_LINE>break;<NEW_LINE>case STREAM:<NEW_LINE>xcoff = new XCOFFReader(source.getName(), source.getStream(), 0, source.getStream().length());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>String msg = String.format("The library %s could not be read from a source type of %s", source.getName(), source.<MASK><NEW_LINE>throw new IllegalArgumentException(msg);<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>ARReader reader = null;<NEW_LINE>switch(source.getType()) {<NEW_LINE>case FILE:<NEW_LINE>reader = new ARReader(source.getFile());<NEW_LINE>break;<NEW_LINE>case STREAM:<NEW_LINE>reader = new ARReader(source.getStream());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>String msg = String.format("The library %s could not be read from a source type of %s", source.getName(), source.getType().name());<NEW_LINE>throw new IllegalArgumentException(msg);<NEW_LINE>}<NEW_LINE>long offset = reader.offsetOfModule(objectName);<NEW_LINE>long size = reader.offsetOfModule(objectName);<NEW_LINE>if (offset < 0 || size < 0) {<NEW_LINE>throw new IOException("Can't find object " + objectName + " in module " + source.getName() + ". offset = " + offset + ", size = " + size);<NEW_LINE>}<NEW_LINE>switch(source.getType()) {<NEW_LINE>case FILE:<NEW_LINE>xcoff = new XCOFFReader(source.getFile(), offset, size);<NEW_LINE>break;<NEW_LINE>case STREAM:<NEW_LINE>xcoff = new XCOFFReader(source.getName(), source.getStream(), offset, size);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>String msg = String.format("The library %s could not be read from a source type of %s", source.getName(), source.getType().name());<NEW_LINE>throw new IllegalArgumentException(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// track the file to close when this dump reader is closed<NEW_LINE>openFileTracker.add(xcoff);<NEW_LINE>return xcoff;<NEW_LINE>} | getType().name()); |
1,013,780 | ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String workId, JsonElement jsonElement) throws Exception {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>List<Wo> wos = new ArrayList<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Work work = null;<NEW_LINE>Req req = new Req();<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>work = emc.find(workId, Work.class);<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(workId, Work.class);<NEW_LINE>}<NEW_LINE>if (effectivePerson.isNotManager()) {<NEW_LINE>WoWorkControl workControl = business.getControl(effectivePerson, work, WoWorkControl.class);<NEW_LINE>if (!workControl.getAllowProcessing()) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, work);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(wi.getAttachmentList())) {<NEW_LINE>for (WiAttachment w : wi.getAttachmentList()) {<NEW_LINE>Attachment o = emc.find(w.<MASK><NEW_LINE>if (null == o) {<NEW_LINE>throw new ExceptionEntityNotExist(w.getId(), Attachment.class);<NEW_LINE>}<NEW_LINE>if (!business.readableWithJob(effectivePerson, o.getJob())) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, o.getJob());<NEW_LINE>}<NEW_LINE>ReqAttachment q = new ReqAttachment();<NEW_LINE>q.setId(o.getId());<NEW_LINE>q.setName(w.getName());<NEW_LINE>q.setSite(w.getSite());<NEW_LINE>q.setSoftCopy(true);<NEW_LINE>req.getAttachmentList().add(q);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(req.getAttachmentList())) {<NEW_LINE>wos = ThisApplication.context().applications().postQuery(effectivePerson.getDebugger(), x_processplatform_service_processing.class, Applications.joinQueryUri("attachment", "copy", "work", work.getId()), req, work.getJob()).getDataAsList(Wo.class);<NEW_LINE>}<NEW_LINE>result.setData(wos);<NEW_LINE>return result;<NEW_LINE>} | getId(), Attachment.class); |
1,766,895 | static String[] matchPrefixedField(String prefix, String rawText, char endChar, boolean trim) {<NEW_LINE>Vector matches = null;<NEW_LINE>int i = 0;<NEW_LINE>int max = rawText.length();<NEW_LINE>while (i < max) {<NEW_LINE>i = rawText.indexOf(prefix, i);<NEW_LINE>if (i < 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Skip past this prefix we found to start<NEW_LINE>i += prefix.length();<NEW_LINE>// Found the start of a match here<NEW_LINE>int start = i;<NEW_LINE>boolean done = false;<NEW_LINE>while (!done) {<NEW_LINE>i = rawText.indexOf((int) endChar, i);<NEW_LINE>if (i < 0) {<NEW_LINE>// No terminating end character? uh, done. Set i such that loop terminates and break<NEW_LINE>i = rawText.length();<NEW_LINE>done = true;<NEW_LINE>} else if (rawText.charAt(i - 1) == '\\') {<NEW_LINE>// semicolon was escaped so continue<NEW_LINE>i++;<NEW_LINE>} else {<NEW_LINE>// found a match<NEW_LINE>if (matches == null) {<NEW_LINE>// lazy init<NEW_LINE>matches = new Vector(3);<NEW_LINE>}<NEW_LINE>String element = unescapeBackslash(rawText<MASK><NEW_LINE>if (trim) {<NEW_LINE>element = element.trim();<NEW_LINE>}<NEW_LINE>matches.addElement(element);<NEW_LINE>i++;<NEW_LINE>done = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (matches == null || matches.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return toStringArray(matches);<NEW_LINE>} | .substring(start, i)); |
292,920 | public void putStorageMetaData(Collection<? extends StorageMetaData> collection) {<NEW_LINE>List<StatsStorageEvent> sses = null;<NEW_LINE>try {<NEW_LINE>PreparedStatement ps = connection.prepareStatement(INSERT_META_SQL);<NEW_LINE>for (StorageMetaData storageMetaData : collection) {<NEW_LINE>List<StatsStorageEvent> ssesTemp = checkStorageEvents(storageMetaData);<NEW_LINE>if (ssesTemp != null) {<NEW_LINE>if (sses == null)<NEW_LINE>sses = ssesTemp;<NEW_LINE>else<NEW_LINE>sses.addAll(ssesTemp);<NEW_LINE>}<NEW_LINE>if (!listeners.isEmpty()) {<NEW_LINE>StatsStorageEvent sse = new StatsStorageEvent(this, StatsStorageListener.EventType.PostMetaData, storageMetaData.getSessionID(), storageMetaData.getTypeID(), storageMetaData.getWorkerID(), storageMetaData.getTimeStamp());<NEW_LINE>if (sses == null)<NEW_LINE><MASK><NEW_LINE>sses.add(sse);<NEW_LINE>}<NEW_LINE>// Normally we'd batch these... sqlite has an autocommit feature that messes up batching with .addBatch() and .executeUpdate()<NEW_LINE>Pair<String, byte[]> p = serializeForDB(storageMetaData);<NEW_LINE>ps.setString(1, storageMetaData.getSessionID());<NEW_LINE>ps.setString(2, storageMetaData.getTypeID());<NEW_LINE>ps.setString(3, p.getFirst());<NEW_LINE>ps.setObject(4, p.getSecond());<NEW_LINE>ps.executeUpdate();<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>notifyListeners(sses);<NEW_LINE>} | sses = new ArrayList<>(); |
1,632,035 | public boolean visit(SQLAlterTableAddPartition x) {<NEW_LINE>boolean printAdd = true;<NEW_LINE>if (x.getParent() instanceof SQLAlterTableStatement) {<NEW_LINE>SQLAlterTableStatement stmt = (SQLAlterTableStatement) x.getParent();<NEW_LINE>int p = stmt.getChildren().indexOf(x);<NEW_LINE>if (p > 0 && stmt.getChildren().get(p - 1) instanceof SQLAlterTableAddPartition) {<NEW_LINE>printAdd = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (printAdd) {<NEW_LINE>print0(ucase ? "ADD " : "add ");<NEW_LINE>if (x.isIfNotExists()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>print('\t');<NEW_LINE>indentCount++;<NEW_LINE>}<NEW_LINE>if (x.getPartitionCount() != null) {<NEW_LINE>print0(ucase ? "PARTITION PARTITIONS " : "partition partitions ");<NEW_LINE>x.getPartitionCount().accept(this);<NEW_LINE>}<NEW_LINE>if (x.getPartitions().size() > 0) {<NEW_LINE>print0(ucase ? "PARTITION (" : "partition (");<NEW_LINE>printAndAccept(x.getPartitions(), ", ");<NEW_LINE>print(')');<NEW_LINE>}<NEW_LINE>SQLExpr location = x.getLocation();<NEW_LINE>if (location != null) {<NEW_LINE>print0(ucase ? " LOCATION " : " locationn ");<NEW_LINE>location.accept(this);<NEW_LINE>}<NEW_LINE>if (!printAdd) {<NEW_LINE>indentCount--;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | print0(ucase ? "IF NOT EXISTS " : "if not exists "); |
818,840 | private List<MethodNode> findOverriddenMethods(MethodNode methodNode) {<NEW_LINE>List<MethodNode> overriddenMethods = new ArrayList<>();<NEW_LINE>ClassNode classNode = methodNode.getDeclaringClass();<NEW_LINE>String methodName = methodNode.getName();<NEW_LINE>Map<String, Map<String, ClassNode>> genericsInfo = AstGenericUtils.<MASK><NEW_LINE>classLoop: while (classNode != null && !classNode.getName().equals(Object.class.getName())) {<NEW_LINE>for (ClassNode i : classNode.getAllInterfaces()) {<NEW_LINE>for (MethodNode parent : i.getMethods(methodName)) {<NEW_LINE>if (methodOverrides(methodNode, parent, genericsInfo.get(i.getName()))) {<NEW_LINE>overriddenMethods.add(parent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>classNode = classNode.getSuperClass();<NEW_LINE>if (classNode != null && !classNode.getName().equals(Object.class.getName())) {<NEW_LINE>for (MethodNode parent : classNode.getMethods(methodName)) {<NEW_LINE>if (methodOverrides(methodNode, parent, genericsInfo.get(classNode.getName()))) {<NEW_LINE>if (!parent.isPrivate()) {<NEW_LINE>overriddenMethods.add(parent);<NEW_LINE>}<NEW_LINE>if (parent.getAnnotations(ANN_OVERRIDE).isEmpty()) {<NEW_LINE>break classLoop;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return overriddenMethods;<NEW_LINE>} | buildAllGenericElementInfo(classNode, createVisitorContext()); |
604,449 | private CompositeFuture reconcileCredentialsQuotasAndAcls(Reconciliation reconciliation, KafkaUserModel user, KafkaUserStatus userStatus) {<NEW_LINE>Set<SimpleAclRule> tlsAcls = null;<NEW_LINE>Set<SimpleAclRule> scramOrNoneAcls = null;<NEW_LINE>KafkaUserQuotas tlsQuotas = null;<NEW_LINE>KafkaUserQuotas scramOrNoneQuotas = null;<NEW_LINE>if (user.isTlsUser() || user.isTlsExternalUser()) {<NEW_LINE>tlsAcls = user.getSimpleAclRules();<NEW_LINE>tlsQuotas = user.getQuotas();<NEW_LINE>} else if (user.isScramUser() || user.isNoneUser()) {<NEW_LINE>scramOrNoneAcls = user.getSimpleAclRules();<NEW_LINE>scramOrNoneQuotas = user.getQuotas();<NEW_LINE>}<NEW_LINE>// Reconcile the user SCRAM-SHA-512 credentials<NEW_LINE>Future<ReconcileResult<String>> scramCredentialsFuture = scramCredentialsOperator.reconcile(reconciliation, user.getName(), user.getScramSha512Password());<NEW_LINE>// Quotas need to reconciled for both regular and TLS username. It will be (possibly) set for one user and deleted for the other<NEW_LINE>Future<ReconcileResult<KafkaUserQuotas>> tlsQuotasFuture = quotasOperator.reconcile(reconciliation, KafkaUserModel.getTlsUserName(reconciliation.name()), tlsQuotas);<NEW_LINE>Future<ReconcileResult<KafkaUserQuotas>> quotasFuture = quotasOperator.reconcile(reconciliation, KafkaUserModel.getScramUserName(reconciliation.name()), scramOrNoneQuotas);<NEW_LINE>// Reconcile the user secret generated by the user operator with the credentials<NEW_LINE>Future<ReconcileResult<Secret>> userSecretFuture = reconcileUserSecret(reconciliation, user, userStatus);<NEW_LINE>// ACLs need to reconciled for both regular and TLS username. It will be (possibly) set for one user and deleted for the other<NEW_LINE>Future<ReconcileResult<Set<SimpleAclRule>>> aclsTlsUserFuture;<NEW_LINE>Future<ReconcileResult<Set<SimpleAclRule>>> aclsScramUserFuture;<NEW_LINE>if (config.isAclsAdminApiSupported()) {<NEW_LINE>aclsTlsUserFuture = aclOperations.reconcile(reconciliation, KafkaUserModel.getTlsUserName(reconciliation.name()), tlsAcls);<NEW_LINE>aclsScramUserFuture = aclOperations.reconcile(reconciliation, KafkaUserModel.getScramUserName(reconciliation.name()), scramOrNoneAcls);<NEW_LINE>} else {<NEW_LINE>aclsTlsUserFuture = Future.succeededFuture(ReconcileResult.noop(null));<NEW_LINE>aclsScramUserFuture = Future.succeededFuture<MASK><NEW_LINE>}<NEW_LINE>return CompositeFuture.join(scramCredentialsFuture, tlsQuotasFuture, quotasFuture, aclsTlsUserFuture, aclsScramUserFuture, userSecretFuture);<NEW_LINE>} | (ReconcileResult.noop(null)); |
346,450 | public static void main(String[] args) {<NEW_LINE>Exercise29_SymbolTableWithRandomAccess exercise29_symbolTableWithRandomAccess = new Exercise29_SymbolTableWithRandomAccess();<NEW_LINE>SymbolTableWithRandomAccess<Integer, Integer> symbolTableWithRandomAccess = exercise29_symbolTableWithRandomAccess.new SymbolTableWithRandomAccess();<NEW_LINE>symbolTableWithRandomAccess.insert(2, 2);<NEW_LINE>symbolTableWithRandomAccess.insert(3, 3);<NEW_LINE>symbolTableWithRandomAccess.insert(5, 5);<NEW_LINE>symbolTableWithRandomAccess.insert(7, 7);<NEW_LINE>symbolTableWithRandomAccess.insert(11, 11);<NEW_LINE><MASK><NEW_LINE>symbolTableWithRandomAccess.insert(17, 17);<NEW_LINE>StdOut.println("Get 7: " + symbolTableWithRandomAccess.get(7) + " Expected: 7");<NEW_LINE>StdOut.println("Get 2: " + symbolTableWithRandomAccess.get(2) + " Expected: 2");<NEW_LINE>StdOut.println("Get 17: " + symbolTableWithRandomAccess.get(17) + " Expected: 17");<NEW_LINE>StdOut.println("Get 20: " + symbolTableWithRandomAccess.get(20) + " Expected: null");<NEW_LINE>StdOut.println("\nRandom key deletes");<NEW_LINE>for (int i = 0; i < 7; i++) {<NEW_LINE>StdOut.println("Random key deleted: " + symbolTableWithRandomAccess.deleteRandomKey());<NEW_LINE>}<NEW_LINE>StdOut.println("Expected deleted values: 2 3 5 7 11 13 17 - Not necessarily in this order");<NEW_LINE>} | symbolTableWithRandomAccess.insert(13, 13); |
157,323 | private int findPathSum(TreeNode node, int rootToNodeSum, int target, Map<Integer, Integer> prefixSumToTotalPrefixes) {<NEW_LINE>if (node == null) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>rootToNodeSum += node.val;<NEW_LINE>int amountToCompensateFor = rootToNodeSum - target;<NEW_LINE>int totalPathsEndingAtThisNode = prefixSumToTotalPrefixes.getOrDefault(amountToCompensateFor, 0);<NEW_LINE>int totalPathsWithThisPathsSum = prefixSumToTotalPrefixes.getOrDefault(rootToNodeSum, 0);<NEW_LINE>prefixSumToTotalPrefixes.put(rootToNodeSum, totalPathsWithThisPathsSum + 1);<NEW_LINE>int totalCompletedPathsInThisSubtree = totalPathsEndingAtThisNode + findPathSum(node.left, rootToNodeSum, target, prefixSumToTotalPrefixes) + findPathSum(node.right, rootToNodeSum, target, prefixSumToTotalPrefixes);<NEW_LINE>prefixSumToTotalPrefixes.put(rootToNodeSum, prefixSumToTotalPrefixes.getOrDefault<MASK><NEW_LINE>return totalCompletedPathsInThisSubtree;<NEW_LINE>} | (rootToNodeSum, 0) - 1); |
476,678 | // Reviewed vs. Native Jan 11, 2011<NEW_LINE>protected void _beforeNewSegment(int resizeBy) {<NEW_LINE>// Called for each new segment being added.<NEW_LINE>if (m_bPathStarted) {<NEW_LINE>// make sure the m_movetoPoint exists and has<NEW_LINE>_initPathStartPoint();<NEW_LINE>// right vertex description<NEW_LINE>// The new path is started. Need to grow m_parts and m_pathFlags.<NEW_LINE>if (m_paths == null) {<NEW_LINE>m_paths = (AttributeStreamOfInt32) AttributeStreamBase.createIndexStream(2);<NEW_LINE><MASK><NEW_LINE>m_pathFlags = (AttributeStreamOfInt8) AttributeStreamBase.createByteStream(2, (byte) 0);<NEW_LINE>} else {<NEW_LINE>// _ASSERT(m_parts.size() >= 2);<NEW_LINE>m_paths.resize(m_paths.size() + 1, 0);<NEW_LINE>m_pathFlags.resize(m_pathFlags.size() + 1, 0);<NEW_LINE>}<NEW_LINE>if (m_bPolygon) {<NEW_LINE>// Mark the path as closed<NEW_LINE>m_pathFlags.write(m_pathFlags.size() - 2, (byte) PathFlags.enumClosed);<NEW_LINE>}<NEW_LINE>// +1 for the StartPath point.<NEW_LINE>resizeBy++;<NEW_LINE>}<NEW_LINE>int oldcount = m_pointCount;<NEW_LINE>// The<NEW_LINE>m_paths.write(m_paths.size() - 1, m_pointCount + resizeBy);<NEW_LINE>// NotifyModified<NEW_LINE>// will<NEW_LINE>// update<NEW_LINE>// the<NEW_LINE>// m_pointCount<NEW_LINE>// with this<NEW_LINE>// value.<NEW_LINE>_resizeImpl(oldcount + resizeBy);<NEW_LINE>m_pathFlags.write(m_paths.size() - 1, (byte) 0);<NEW_LINE>if (m_bPathStarted) {<NEW_LINE>// setPoint(oldcount,<NEW_LINE>setPointByVal(oldcount, m_moveToPoint);<NEW_LINE>// m_moveToPoint); //finally<NEW_LINE>// set the start point to<NEW_LINE>// the geometry<NEW_LINE>m_bPathStarted = false;<NEW_LINE>}<NEW_LINE>} | m_paths.write(0, 0); |
1,094,989 | private void buildSets(List<int[]> foldContents) {<NEW_LINE>this.folds.clear();<NEW_LINE>for (int i = 0; i < this.k; i++) {<NEW_LINE>// first calculate the size<NEW_LINE>int trainingSize = 0;<NEW_LINE>int validationSize = 0;<NEW_LINE>for (int j = 0; j < foldContents.size(); j++) {<NEW_LINE>int foldSize = foldContents.get(j).length;<NEW_LINE>if (j == i) {<NEW_LINE>validationSize += foldSize;<NEW_LINE>} else {<NEW_LINE>trainingSize += foldSize;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// create the masks<NEW_LINE>int[] trainingMask = new int[trainingSize];<NEW_LINE>int[] validationMask = new int[validationSize];<NEW_LINE>int trainingIndex = 0;<NEW_LINE>for (int j = 0; j < foldContents.size(); j++) {<NEW_LINE>int[] source = foldContents.get(j);<NEW_LINE>if (j == i) {<NEW_LINE>EngineArray.arrayCopy(source, 0, validationMask, 0, source.length);<NEW_LINE>} else {<NEW_LINE>EngineArray.arrayCopy(source, 0, trainingMask, trainingIndex, source.length);<NEW_LINE>trainingIndex += source.length;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Build the set<NEW_LINE>MatrixMLDataSet training = new MatrixMLDataSet(this.baseDataset, trainingMask);<NEW_LINE>MatrixMLDataSet validation = new <MASK><NEW_LINE>this.folds.add(new DataFold(training, validation));<NEW_LINE>}<NEW_LINE>} | MatrixMLDataSet(this.baseDataset, validationMask); |
538,990 | public static void print(PacketCapture resource) {<NEW_LINE>StringBuilder sb = new StringBuilder().append("Packet Capture: ").append(resource.id()).append("\n\tName: ").append(resource.name()).append("\n\tTarget id: ").append(resource.targetId()).append("\n\tTime limit in seconds: ").append(resource.timeLimitInSeconds()).append("\n\tBytes to capture per packet: ").append(resource.bytesToCapturePerPacket()).append("\n\tProvisioning state: ").append(resource.provisioningState()).append("\n\tStorage location:").append("\n\tStorage account id: ").append(resource.storageLocation().storageId()).append("\n\tStorage account path: ").append(resource.storageLocation().storagePath()).append("\n\tFile path: ").append(resource.storageLocation().filePath()).append("\n\t Packet capture filters: ").append(resource.filters().size());<NEW_LINE>for (PacketCaptureFilter filter : resource.filters()) {<NEW_LINE>sb.append("\n\t\tProtocol: ").<MASK><NEW_LINE>sb.append("\n\t\tLocal IP address: ").append(filter.localIpAddress());<NEW_LINE>sb.append("\n\t\tRemote IP address: ").append(filter.remoteIpAddress());<NEW_LINE>sb.append("\n\t\tLocal port: ").append(filter.localPort());<NEW_LINE>sb.append("\n\t\tRemote port: ").append(filter.remotePort());<NEW_LINE>}<NEW_LINE>System.out.println(sb.toString());<NEW_LINE>} | append(filter.protocol()); |
201,449 | public SftpConfigurationValidator validate(String host, String port, String user, String identityFile, String knownHostsFile, String initialDirectory, String timeout, String keepAliveInterval) {<NEW_LINE>String <MASK><NEW_LINE>if (err != null) {<NEW_LINE>// NOI18N<NEW_LINE>result.addError(new ValidationResult.Message("host", err));<NEW_LINE>}<NEW_LINE>err = RemoteValidator.validatePort(port);<NEW_LINE>if (err != null) {<NEW_LINE>// NOI18N<NEW_LINE>result.addError(new ValidationResult.Message("port", err));<NEW_LINE>}<NEW_LINE>err = RemoteValidator.validateUser(user);<NEW_LINE>if (err != null) {<NEW_LINE>// NOI18N<NEW_LINE>result.addError(new ValidationResult.Message("user", err));<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(identityFile)) {<NEW_LINE>err = FileUtils.validateFile(Bundle.SftpConfigurationValidator_identityFile(), identityFile, false);<NEW_LINE>if (err != null) {<NEW_LINE>// NOI18N<NEW_LINE>result.addError(new ValidationResult.Message("identityFile", err));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(knownHostsFile)) {<NEW_LINE>err = FileUtils.validateFile(Bundle.SftpConfigurationValidator_knownHosts(), knownHostsFile, false);<NEW_LINE>if (err != null) {<NEW_LINE>// NOI18N<NEW_LINE>result.addError(new ValidationResult.Message("knownHostsFile", err));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>err = RemoteValidator.validateUploadDirectory(initialDirectory);<NEW_LINE>if (err != null) {<NEW_LINE>// NOI18N<NEW_LINE>result.addError(new ValidationResult.Message("initialDirectory", err));<NEW_LINE>}<NEW_LINE>err = RemoteValidator.validateTimeout(timeout);<NEW_LINE>if (err != null) {<NEW_LINE>// NOI18N<NEW_LINE>result.addError(new ValidationResult.Message("timeout", err));<NEW_LINE>}<NEW_LINE>err = RemoteValidator.validateKeepAliveInterval(keepAliveInterval);<NEW_LINE>if (err != null) {<NEW_LINE>// NOI18N<NEW_LINE>result.addError(new ValidationResult.Message("keepAliveInterval", err));<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | err = RemoteValidator.validateHost(host); |
1,000,918 | protected void onActivityResult(final int requestCode, final int resultCode, @Nullable final Intent data) {<NEW_LINE>super.<MASK><NEW_LINE>if (requestCode == REQUEST_CODE_WIZARD_GC) {<NEW_LINE>if (!hasValidGCCredentials()) {<NEW_LINE>Toast.makeText(this, R.string.err_auth_process, Toast.LENGTH_SHORT).show();<NEW_LINE>} else {<NEW_LINE>SimpleDialog.of(this).setTitle(R.string.settings_title_gc).setMessage(R.string.settings_gc_legal_note).confirm((dialog, which) -> {<NEW_LINE>Settings.setGCConnectorActive(true);<NEW_LINE>gotoNext();<NEW_LINE>}, (dialog, i) -> {<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((contentStorageActivityHelper == null || !contentStorageActivityHelper.onActivityResult(requestCode, resultCode, data))) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>backupUtils.onActivityResult(requestCode, resultCode, data);<NEW_LINE>} | onActivityResult(requestCode, resultCode, data); |
1,216,469 | private Serde<GenericKey> createInner(final FormatInfo format, final PersistenceSchema schema, final KsqlConfig ksqlConfig, final Supplier<SchemaRegistryClient> schemaRegistryClientFactory, final String loggerNamePrefix, final ProcessingLogContext processingLogContext, final Optional<TrackedCallback> tracker) {<NEW_LINE>checkUnsupportedSchema(schema.columns(), ksqlConfig);<NEW_LINE>final Serde<List<?>> formatSerde = innerFactory.createFormatSerde("Key", format, schema, ksqlConfig, schemaRegistryClientFactory, true);<NEW_LINE>final Serde<GenericKey> genericKeySerde = toGenericKeySerde(formatSerde, schema);<NEW_LINE>final Serde<GenericKey> loggingSerde = innerFactory.<MASK><NEW_LINE>final Serde<GenericKey> serde = tracker.map(callback -> innerFactory.wrapInTrackingSerde(loggingSerde, callback)).orElse(loggingSerde);<NEW_LINE>serde.configure(Collections.emptyMap(), true);<NEW_LINE>return serde;<NEW_LINE>} | wrapInLoggingSerde(genericKeySerde, loggerNamePrefix, processingLogContext); |
797,683 | protected void doImportSelectionAction(Program program, ProgramSelection selection) {<NEW_LINE>if (selection == null || selection.getNumAddressRanges() != 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// should only be 1<NEW_LINE>AddressRange range = selection.getFirstRange();<NEW_LINE>if (range.getLength() >= Integer.MAX_VALUE) {<NEW_LINE>Msg.showInfo(getClass(), tool.getActiveWindow(), "Selection Too Large", "The selection is too large to extract.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Memory memory = program.getMemory();<NEW_LINE>FileSystemService fsService = FileSystemService.getInstance();<NEW_LINE>// create a tmp ByteProvider that contains the bytes from the selected region<NEW_LINE>FileCacheEntry tmpFile;<NEW_LINE>try (FileCacheEntryBuilder tmpFileBuilder = fsService.createTempFile(range.getLength())) {<NEW_LINE>byte[] bytes = new byte[(int) range.getLength()];<NEW_LINE>memory.getBytes(range.getMinAddress(), bytes);<NEW_LINE>tmpFileBuilder.write(bytes);<NEW_LINE>tmpFile = tmpFileBuilder.finish();<NEW_LINE>}<NEW_LINE>MemoryBlock block = memory.getBlock(range.getMinAddress());<NEW_LINE>String rangeName = block.getName() + "[" + range.getMinAddress() + "," + range.getMaxAddress() + "]";<NEW_LINE>ByteProvider bp = fsService.getNamedTempFile(tmpFile, program.getName() + " " + rangeName);<NEW_LINE>LoaderMap <MASK><NEW_LINE>ImporterDialog importerDialog = new ImporterDialog(tool, tool.getService(ProgramManager.class), loaderMap, bp, null);<NEW_LINE>tool.showDialog(importerDialog);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Msg.showError(this, null, "I/O Error Occurred", e.getMessage(), e);<NEW_LINE>} catch (MemoryAccessException e) {<NEW_LINE>Msg.showError(this, null, "Memory Access Error Occurred", e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | loaderMap = LoaderService.getAllSupportedLoadSpecs(bp); |
84,595 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>try {<NEW_LINE>response.setContentType("application/json");<NEW_LINE>response.setStatus(HttpServletResponse.SC_OK);<NEW_LINE>response.setCharacterEncoding("UTF-8");<NEW_LINE>response.setHeader("Access-Control-Allow-Origin", "*");<NEW_LINE>// get user id via url parameter<NEW_LINE>String userId = request.getParameter("id");<NEW_LINE>// number of returned movies<NEW_LINE>String size = request.getParameter("size");<NEW_LINE>// ranking algorithm<NEW_LINE>String model = request.getParameter("model");<NEW_LINE>if (Config.IS_ENABLE_AB_TEST) {<NEW_LINE>model = ABTest.getConfigByUserId(userId);<NEW_LINE>}<NEW_LINE>// a simple method, just fetch all the movie in the genre<NEW_LINE>List<Movie> movies = RecForYouProcess.getRecList(Integer.parseInt(userId), Integer.parseInt(size), model);<NEW_LINE>// convert movie list to json format and return<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>String jsonMovies = mapper.writeValueAsString(movies);<NEW_LINE>response.getWriter().println(jsonMovies);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>response.<MASK><NEW_LINE>}<NEW_LINE>} | getWriter().println(""); |
1,642,190 | public List<Product> readProductsByIds(List<Long> productIds) {<NEW_LINE>if (productIds == null || productIds.size() == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (productIds.size() > 100) {<NEW_LINE>logger.warn("Not recommended to use the readProductsByIds method for long lists of productIds, since " + "Hibernate is required to transform the distinct results. The list of requested" + "product ids was (" + productIds.size() + ") in length.");<NEW_LINE>}<NEW_LINE>// Set up the criteria query that specifies we want to return Products<NEW_LINE>CriteriaBuilder builder = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Product> criteria = builder.createQuery(Product.class);<NEW_LINE>Root<ProductImpl> product = criteria.from(ProductImpl.class);<NEW_LINE>product.fetch("defaultSku", JoinType.LEFT);<NEW_LINE>criteria.select(product);<NEW_LINE>// We only want results that match the product IDs<NEW_LINE>criteria.where(product.get("id").as(Long.class).in(sandBoxHelper.mergeCloneIds(ProductImpl.class, productIds.toArray(new Long[productIds.<MASK><NEW_LINE>TypedQuery<Product> query = em.createQuery(criteria);<NEW_LINE>query.setHint(QueryHints.HINT_CACHEABLE, true);<NEW_LINE>query.setHint(QueryHints.HINT_CACHE_REGION, "query.Catalog");<NEW_LINE>return query.getResultList();<NEW_LINE>} | size()])))); |
888,442 | public void reload(CommandContext args, Actor sender) throws CommandException {<NEW_LINE>// TODO: This is subject to a race condition, but at least other commands are not being processed concurrently<NEW_LINE>List<Task<?>> tasks = WorldGuard.getInstance()<MASK><NEW_LINE>if (!tasks.isEmpty()) {<NEW_LINE>throw new CommandException("There are currently pending tasks. Use /wg running to monitor these tasks first.");<NEW_LINE>}<NEW_LINE>LoggerToChatHandler handler = null;<NEW_LINE>Logger minecraftLogger = null;<NEW_LINE>if (sender instanceof LocalPlayer) {<NEW_LINE>handler = new LoggerToChatHandler(sender);<NEW_LINE>handler.setLevel(Level.ALL);<NEW_LINE>minecraftLogger = Logger.getLogger("com.sk89q.worldguard");<NEW_LINE>minecraftLogger.addHandler(handler);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ConfigurationManager config = WorldGuard.getInstance().getPlatform().getGlobalStateManager();<NEW_LINE>config.unload();<NEW_LINE>config.load();<NEW_LINE>for (World world : WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getWorlds()) {<NEW_LINE>config.get(world);<NEW_LINE>}<NEW_LINE>WorldGuard.getInstance().getPlatform().getRegionContainer().reload();<NEW_LINE>// WGBukkit.cleanCache();<NEW_LINE>sender.print("WorldGuard configuration reloaded.");<NEW_LINE>} catch (Throwable t) {<NEW_LINE>sender.printError("Error while reloading: " + t.getMessage());<NEW_LINE>} finally {<NEW_LINE>if (minecraftLogger != null) {<NEW_LINE>minecraftLogger.removeHandler(handler);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getSupervisor().getTasks(); |
748,404 | public int maximumGeeks(int[] input) {<NEW_LINE>int[] lhs = new int[input.length];<NEW_LINE>int[] rhs = new int[input.length];<NEW_LINE>lhs[0] = 0;<NEW_LINE>for (int i = 1; i < lhs.length; i++) {<NEW_LINE>if (input[lhs[i - 1]] < input[i]) {<NEW_LINE>lhs[i<MASK><NEW_LINE>} else {<NEW_LINE>lhs[i] = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rhs[input.length - 1] = input.length - 1;<NEW_LINE>for (int i = input.length - 2; i >= 0; i--) {<NEW_LINE>if (input[rhs[i + 1]] > input[i]) {<NEW_LINE>rhs[i] = rhs[i + 1];<NEW_LINE>} else {<NEW_LINE>rhs[i] = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int i = 0;<NEW_LINE>int j = 0;<NEW_LINE>int max = 0;<NEW_LINE>for (; j < input.length; ) {<NEW_LINE>if (input[lhs[i]] < input[rhs[j]]) {<NEW_LINE>max = Math.max(max, j - i);<NEW_LINE>j++;<NEW_LINE>} else {<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return max;<NEW_LINE>} | ] = lhs[i - 1]; |
442,357 | private void findLabels(char[] label, char[][] choices) {<NEW_LINE>if (choices == null || choices.length == 0)<NEW_LINE>return;<NEW_LINE>int length = label.length;<NEW_LINE>for (int i = 0; i < choices.length; i++) {<NEW_LINE>if (length <= choices[i].length && CharOperation.prefixEquals(label, choices[i], false)) {<NEW_LINE>int relevance = computeBaseRelevance();<NEW_LINE>relevance += computeRelevanceForResolution();<NEW_LINE>relevance += computeRelevanceForInterestingProposal();<NEW_LINE>relevance += computeRelevanceForCaseMatching(label, choices[i]);<NEW_LINE>// no access restriction for keywors<NEW_LINE><MASK><NEW_LINE>this.noProposal = false;<NEW_LINE>if (!this.requestor.isIgnored(CompletionProposal.LABEL_REF)) {<NEW_LINE>InternalCompletionProposal proposal = createProposal(CompletionProposal.LABEL_REF, this.actualCompletionPosition);<NEW_LINE>proposal.setName(choices[i]);<NEW_LINE>proposal.setCompletion(choices[i]);<NEW_LINE>proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset);<NEW_LINE>proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset);<NEW_LINE>proposal.setRelevance(relevance);<NEW_LINE>this.requestor.accept(proposal);<NEW_LINE>if (DEBUG) {<NEW_LINE>this.printDebug(proposal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE); |
1,747,111 | public JCExpression staticReference(Inliner inliner, CharSequence topLevelClazz, CharSequence fullyQualifiedClazz, CharSequence member) {<NEW_LINE>if (Refaster.class.getName().contentEquals(topLevelClazz)) {<NEW_LINE>// Special handling to ensure that the pretty-printer always recognizes Refaster references<NEW_LINE>return inliner.maker().Select(inliner.maker().Ident(inliner.asName("Refaster")), inliner.asName(member));<NEW_LINE>}<NEW_LINE>// Foo.class tokens are considered static members :(.<NEW_LINE>if (member.toString().equals("class")) {<NEW_LINE>return IMPORT_TOP_LEVEL.staticReference(inliner, topLevelClazz, fullyQualifiedClazz, member);<NEW_LINE>}<NEW_LINE>// Check to see if the reference is already static-imported.<NEW_LINE><MASK><NEW_LINE>if (!getAllImports(inliner, WhichImports.STATIC).contains(importableName)) {<NEW_LINE>inliner.addStaticImport(importableName);<NEW_LINE>}<NEW_LINE>return inliner.maker().Ident(inliner.asName(member));<NEW_LINE>} | String importableName = fullyQualifiedClazz + "." + member; |
170,494 | private void logXmlTask(CategorizedProblem problem, char[] unitSource) {<NEW_LINE>HashMap<String, Object> parameters = new HashMap<>();<NEW_LINE>parameters.put(Logger.PROBLEM_LINE, Integer.valueOf(problem.getSourceLineNumber()));<NEW_LINE>parameters.put(Logger.PROBLEM_SOURCE_START, Integer.valueOf(problem.getSourceStart()));<NEW_LINE>parameters.put(Logger.PROBLEM_SOURCE_END, Integer.valueOf(problem.getSourceEnd()));<NEW_LINE>String problemOptionKey = <MASK><NEW_LINE>if (problemOptionKey != null) {<NEW_LINE>parameters.put(Logger.PROBLEM_OPTION_KEY, problemOptionKey);<NEW_LINE>}<NEW_LINE>printTag(Logger.TASK, parameters, true, false);<NEW_LINE>parameters.put(Logger.VALUE, problem.getMessage());<NEW_LINE>printTag(Logger.PROBLEM_MESSAGE, parameters, true, true);<NEW_LINE>extractContext(problem, unitSource);<NEW_LINE>endTag(Logger.TASK);<NEW_LINE>} | getProblemOptionKey(problem.getID()); |
1,453,575 | public static DescribeBackupPoliciesResponse unmarshall(DescribeBackupPoliciesResponse describeBackupPoliciesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeBackupPoliciesResponse.setRequestId(_ctx.stringValue("DescribeBackupPoliciesResponse.RequestId"));<NEW_LINE>PageInfo pageInfo = new PageInfo();<NEW_LINE>pageInfo.setCount<MASK><NEW_LINE>pageInfo.setPageSize(_ctx.integerValue("DescribeBackupPoliciesResponse.PageInfo.PageSize"));<NEW_LINE>pageInfo.setTotalCount(_ctx.integerValue("DescribeBackupPoliciesResponse.PageInfo.TotalCount"));<NEW_LINE>pageInfo.setCurrentPage(_ctx.integerValue("DescribeBackupPoliciesResponse.PageInfo.CurrentPage"));<NEW_LINE>describeBackupPoliciesResponse.setPageInfo(pageInfo);<NEW_LINE>List<BackupPolicy> policies = new ArrayList<BackupPolicy>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeBackupPoliciesResponse.Policies.Length"); i++) {<NEW_LINE>BackupPolicy backupPolicy = new BackupPolicy();<NEW_LINE>backupPolicy.setId(_ctx.longValue("DescribeBackupPoliciesResponse.Policies[" + i + "].Id"));<NEW_LINE>backupPolicy.setName(_ctx.stringValue("DescribeBackupPoliciesResponse.Policies[" + i + "].Name"));<NEW_LINE>backupPolicy.setStatus(_ctx.stringValue("DescribeBackupPoliciesResponse.Policies[" + i + "].Status"));<NEW_LINE>backupPolicy.setPolicy(_ctx.stringValue("DescribeBackupPoliciesResponse.Policies[" + i + "].Policy"));<NEW_LINE>backupPolicy.setPolicyVersion(_ctx.stringValue("DescribeBackupPoliciesResponse.Policies[" + i + "].PolicyVersion"));<NEW_LINE>backupPolicy.setPolicyRegionId(_ctx.stringValue("DescribeBackupPoliciesResponse.Policies[" + i + "].PolicyRegionId"));<NEW_LINE>backupPolicy.setClientStatus(_ctx.stringValue("DescribeBackupPoliciesResponse.Policies[" + i + "].ClientStatus"));<NEW_LINE>backupPolicy.setClientErrorCount(_ctx.integerValue("DescribeBackupPoliciesResponse.Policies[" + i + "].ClientErrorCount"));<NEW_LINE>backupPolicy.setServiceErrorCount(_ctx.integerValue("DescribeBackupPoliciesResponse.Policies[" + i + "].ServiceErrorCount"));<NEW_LINE>backupPolicy.setHealthClientCount(_ctx.integerValue("DescribeBackupPoliciesResponse.Policies[" + i + "].HealthClientCount"));<NEW_LINE>List<String> uuidList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeBackupPoliciesResponse.Policies[" + i + "].UuidList.Length"); j++) {<NEW_LINE>uuidList.add(_ctx.stringValue("DescribeBackupPoliciesResponse.Policies[" + i + "].UuidList[" + j + "]"));<NEW_LINE>}<NEW_LINE>backupPolicy.setUuidList(uuidList);<NEW_LINE>List<String> remarkedUuidList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeBackupPoliciesResponse.Policies[" + i + "].RemarkedUuidList.Length"); j++) {<NEW_LINE>remarkedUuidList.add(_ctx.stringValue("DescribeBackupPoliciesResponse.Policies[" + i + "].RemarkedUuidList[" + j + "]"));<NEW_LINE>}<NEW_LINE>backupPolicy.setRemarkedUuidList(remarkedUuidList);<NEW_LINE>List<String> clientErrorUuidList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeBackupPoliciesResponse.Policies[" + i + "].ClientErrorUuidList.Length"); j++) {<NEW_LINE>clientErrorUuidList.add(_ctx.stringValue("DescribeBackupPoliciesResponse.Policies[" + i + "].ClientErrorUuidList[" + j + "]"));<NEW_LINE>}<NEW_LINE>backupPolicy.setClientErrorUuidList(clientErrorUuidList);<NEW_LINE>List<String> serviceErrorUuidList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeBackupPoliciesResponse.Policies[" + i + "].ServiceErrorUuidList.Length"); j++) {<NEW_LINE>serviceErrorUuidList.add(_ctx.stringValue("DescribeBackupPoliciesResponse.Policies[" + i + "].ServiceErrorUuidList[" + j + "]"));<NEW_LINE>}<NEW_LINE>backupPolicy.setServiceErrorUuidList(serviceErrorUuidList);<NEW_LINE>List<String> healthClientUuidList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeBackupPoliciesResponse.Policies[" + i + "].HealthClientUuidList.Length"); j++) {<NEW_LINE>healthClientUuidList.add(_ctx.stringValue("DescribeBackupPoliciesResponse.Policies[" + i + "].HealthClientUuidList[" + j + "]"));<NEW_LINE>}<NEW_LINE>backupPolicy.setHealthClientUuidList(healthClientUuidList);<NEW_LINE>policies.add(backupPolicy);<NEW_LINE>}<NEW_LINE>describeBackupPoliciesResponse.setPolicies(policies);<NEW_LINE>return describeBackupPoliciesResponse;<NEW_LINE>} | (_ctx.integerValue("DescribeBackupPoliciesResponse.PageInfo.Count")); |
684,056 | public ExecuteTransactionResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ExecuteTransactionResult executeTransactionResult = new ExecuteTransactionResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return executeTransactionResult;<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("Responses", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>executeTransactionResult.setResponses(new ListUnmarshaller<ItemResponse>(ItemResponseJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ConsumedCapacity", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>executeTransactionResult.setConsumedCapacity(new ListUnmarshaller<ConsumedCapacity>(ConsumedCapacityJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return executeTransactionResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
737,452 | public static GetPatentTimeStatisticsInfoResponse unmarshall(GetPatentTimeStatisticsInfoResponse getPatentTimeStatisticsInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>getPatentTimeStatisticsInfoResponse.setRequestId(_ctx.stringValue("GetPatentTimeStatisticsInfoResponse.RequestId"));<NEW_LINE>getPatentTimeStatisticsInfoResponse.setPageNum(_ctx.integerValue("GetPatentTimeStatisticsInfoResponse.PageNum"));<NEW_LINE>getPatentTimeStatisticsInfoResponse.setSuccess(_ctx.booleanValue("GetPatentTimeStatisticsInfoResponse.Success"));<NEW_LINE>getPatentTimeStatisticsInfoResponse.setTotalItemNum(_ctx.integerValue("GetPatentTimeStatisticsInfoResponse.TotalItemNum"));<NEW_LINE>getPatentTimeStatisticsInfoResponse.setPageSize(_ctx.integerValue("GetPatentTimeStatisticsInfoResponse.PageSize"));<NEW_LINE>getPatentTimeStatisticsInfoResponse.setTotalPageNum(_ctx.integerValue("GetPatentTimeStatisticsInfoResponse.TotalPageNum"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetPatentTimeStatisticsInfoResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setType(_ctx.stringValue("GetPatentTimeStatisticsInfoResponse.Data[" + i + "].Type"));<NEW_LINE>dataItem.setHalfMonthCount(_ctx.longValue("GetPatentTimeStatisticsInfoResponse.Data[" + i + "].HalfMonthCount"));<NEW_LINE>dataItem.setMonthCount(_ctx.longValue("GetPatentTimeStatisticsInfoResponse.Data[" + i + "].MonthCount"));<NEW_LINE>dataItem.setTwoMonthCount(_ctx.longValue("GetPatentTimeStatisticsInfoResponse.Data[" + i + "].TwoMonthCount"));<NEW_LINE>dataItem.setThreeMonthCount(_ctx.longValue<MASK><NEW_LINE>dataItem.setExpiredCount(_ctx.longValue("GetPatentTimeStatisticsInfoResponse.Data[" + i + "].ExpiredCount"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>getPatentTimeStatisticsInfoResponse.setData(data);<NEW_LINE>return getPatentTimeStatisticsInfoResponse;<NEW_LINE>} | ("GetPatentTimeStatisticsInfoResponse.Data[" + i + "].ThreeMonthCount")); |
368,524 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>String test = request.getParameter("test");<NEW_LINE>String idString = request.getParameter("taskid");<NEW_LINE>PrintWriter out = response.getWriter();<NEW_LINE>try {<NEW_LINE>out.println(getClass().getSimpleName() + " is starting " + test + "<br>");<NEW_LINE>System.out.println("-----> " + test + " starting");<NEW_LINE>if (idString == null) {<NEW_LINE>getClass().getMethod(test, PrintWriter.class).invoke(this, out);<NEW_LINE>} else {<NEW_LINE>long id = Long.parseLong(idString);<NEW_LINE>getClass().getMethod(test, PrintWriter.class, Long.class).invoke(this, out, id);<NEW_LINE>}<NEW_LINE>System.out.println("<----- " + test + " successful");<NEW_LINE>out.<MASK><NEW_LINE>} catch (Throwable x) {<NEW_LINE>if (x instanceof InvocationTargetException)<NEW_LINE>x = x.getCause();<NEW_LINE>System.out.println("<----- " + test + " failed:");<NEW_LINE>x.printStackTrace(System.out);<NEW_LINE>out.println("<pre>ERROR in " + test + ":");<NEW_LINE>x.printStackTrace(out);<NEW_LINE>out.println("</pre>");<NEW_LINE>} finally {<NEW_LINE>out.flush();<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>} | println(test + " " + SUCCESS_MESSAGE); |
1,774,503 | public void run(RegressionEnvironment env) {<NEW_LINE>String eplOne = "@name('s0') select * " + "from SupportBean_S0#keepall as s0, SupportBean_S1#keepall as s1 " + "where s0.p00 = s1.p10 and s0.p01 = s1.p11 and s0.p02 > s1.p12";<NEW_LINE>env.compileDeploy(eplOne).addListener("s0");<NEW_LINE>sendS0(env, 10, "a0", "b0", "X");<NEW_LINE>sendS1(env, 20, "a0", "b0", "F");<NEW_LINE>assertReceived(env, new Object[][] <MASK><NEW_LINE>env.milestone(0);<NEW_LINE>sendS0(env, 11, "a1", "b0", "X");<NEW_LINE>sendS1(env, 22, "a0", "b1", "F");<NEW_LINE>sendS0(env, 12, "a0", "b1", "A");<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendS0(env, 13, "a0", "b1", "Z");<NEW_LINE>assertReceived(env, new Object[][] { { 13, 22 } });<NEW_LINE>sendS1(env, 23, "a1", "b0", "A");<NEW_LINE>assertReceived(env, new Object[][] { { 11, 23 } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | { { 10, 20 } }); |
1,555,233 | protected void addNewHistoryCommit(Directory indexDirectory, Terminal terminal, boolean updateLocalCheckpoint) throws IOException {<NEW_LINE>final String historyUUID = UUIDs.randomBase64UUID();<NEW_LINE>terminal.println("Marking index with the new history uuid : " + historyUUID);<NEW_LINE>// commit the new history id<NEW_LINE>final IndexWriterConfig iwc = // we don't want merges to happen here - we call maybe merge on the engine<NEW_LINE>new IndexWriterConfig(null).// later once we stared it up otherwise we would need to wait for it here<NEW_LINE>// we also don't specify a codec here and merges should use the engines for this index<NEW_LINE>setCommitOnClose(false).setSoftDeletesField(Lucene.SOFT_DELETES_FIELD).setMergePolicy(NoMergePolicy.INSTANCE).setOpenMode(IndexWriterConfig.OpenMode.APPEND);<NEW_LINE>// IndexWriter acquires directory lock by its own<NEW_LINE>try (IndexWriter indexWriter = new IndexWriter(indexDirectory, iwc)) {<NEW_LINE>final Map<String, String> userData = new HashMap<>();<NEW_LINE>indexWriter.getLiveCommitData().forEach(e -> userData.put(e.getKey(), e.getValue()));<NEW_LINE>if (updateLocalCheckpoint) {<NEW_LINE>// In order to have a safe commit invariant, we have to assign the global checkpoint to the max_seqno of the last commit.<NEW_LINE>// We can only safely do it because we will generate a new history uuid this shard.<NEW_LINE>final SequenceNumbers.CommitInfo commitInfo = SequenceNumbers.loadSeqNoInfoFromLuceneCommit(userData.entrySet());<NEW_LINE>// Also advances the local checkpoint of the last commit to its max_seqno.<NEW_LINE>userData.put(SequenceNumbers.LOCAL_CHECKPOINT_KEY, Long.toString(commitInfo.maxSeqNo));<NEW_LINE>}<NEW_LINE>// commit the new history id<NEW_LINE>userData.<MASK><NEW_LINE>indexWriter.setLiveCommitData(userData.entrySet());<NEW_LINE>indexWriter.commit();<NEW_LINE>}<NEW_LINE>} | put(Engine.HISTORY_UUID_KEY, historyUUID); |
747,052 | public ListRecipesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListRecipesResult listRecipesResult = new ListRecipesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listRecipesResult;<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("recipes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listRecipesResult.setRecipes(new ListUnmarshaller<RecipeSummary>(RecipeSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listRecipesResult.setNextToken(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 listRecipesResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
680,590 | protected Round createRoundSwiss() {<NEW_LINE>List<TournamentPlayer> roundPlayers = getActivePlayers();<NEW_LINE>boolean isLastRound = (rounds.size() + 1 == getNumberRounds());<NEW_LINE>Round round = null;<NEW_LINE>if (options.matchOptions.getNumSeats() == 2) {<NEW_LINE>RoundPairings roundPairings;<NEW_LINE>if (roundPlayers.size() <= 16) {<NEW_LINE>SwissPairingMinimalWeightMatching swissPairing = new SwissPairingMinimalWeightMatching(roundPlayers, rounds, isLastRound);<NEW_LINE>roundPairings = swissPairing.getRoundPairings();<NEW_LINE>} else {<NEW_LINE>SwissPairingSimple swissPairing = new SwissPairingSimple(roundPlayers, rounds);<NEW_LINE>roundPairings = swissPairing.getRoundPairings();<NEW_LINE>}<NEW_LINE>round = new Round(rounds.size() + 1, this);<NEW_LINE>rounds.add(round);<NEW_LINE>for (TournamentPairing pairing : roundPairings.getPairings()) {<NEW_LINE>round.addPairing(pairing);<NEW_LINE>}<NEW_LINE>for (TournamentPlayer playerBye : roundPairings.getPlayerByes()) {<NEW_LINE>// player free round - add to bye players of this round<NEW_LINE>round.getPlayerByes().add(playerBye);<NEW_LINE>if (isLastRound) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>playerBye.setState(TournamentPlayerState.WAITING);<NEW_LINE>}<NEW_LINE>playerBye.setStateInfo("Round Bye");<NEW_LINE>updateResults();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return round;<NEW_LINE>} | playerBye.setState(TournamentPlayerState.FINISHED); |
883,286 | public void fixSize(int left, int top, int width, int height) {<NEW_LINE>if (mVideoWidth == 0 || mVideoHeight == 0) {<NEW_LINE>mVisibleLeft = left;<NEW_LINE>mVisibleTop = top;<NEW_LINE>mVisibleWidth = width;<NEW_LINE>mVisibleHeight = height;<NEW_LINE>} else if (width != 0 && height != 0) {<NEW_LINE>if (mKeepRatio && !mFullScreenEnabled) {<NEW_LINE>if (mVideoWidth * height > width * mVideoHeight) {<NEW_LINE>mVisibleWidth = width;<NEW_LINE>mVisibleHeight = width * mVideoHeight / mVideoWidth;<NEW_LINE>} else if (mVideoWidth * height < width * mVideoHeight) {<NEW_LINE>mVisibleWidth = height * mVideoWidth / mVideoHeight;<NEW_LINE>mVisibleHeight = height;<NEW_LINE>}<NEW_LINE>mVisibleLeft = left + (width - mVisibleWidth) / 2;<NEW_LINE>mVisibleTop = top + (height - mVisibleHeight) / 2;<NEW_LINE>} else {<NEW_LINE>mVisibleLeft = left;<NEW_LINE>mVisibleTop = top;<NEW_LINE>mVisibleWidth = width;<NEW_LINE>mVisibleHeight = height;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>mVisibleLeft = left;<NEW_LINE>mVisibleTop = top;<NEW_LINE>mVisibleWidth = mVideoWidth;<NEW_LINE>mVisibleHeight = mVideoHeight;<NEW_LINE>}<NEW_LINE>getHolder().setFixedSize(mVisibleWidth, mVisibleHeight);<NEW_LINE>FrameLayout.LayoutParams lParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.<MASK><NEW_LINE>lParams.leftMargin = mVisibleLeft;<NEW_LINE>lParams.topMargin = mVisibleTop;<NEW_LINE>setLayoutParams(lParams);<NEW_LINE>} | MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT); |
1,821,823 | public List<Node> querySelectorAll(Node node, String selector) {<NEW_LINE>List<Node> list = Collections.emptyList();<NEW_LINE>JSONObject params = new JSONObject();<NEW_LINE>// NOI18N<NEW_LINE>params.put("nodeId", node.getNodeId());<NEW_LINE>// NOI18N<NEW_LINE>params.put("selector", selector);<NEW_LINE>// NOI18N<NEW_LINE>Response response = transport.sendBlockingCommand(new Command("DOM.querySelectorAll", params));<NEW_LINE>if (response != null) {<NEW_LINE>JSONObject result = response.getResult();<NEW_LINE>if (result != null) {<NEW_LINE>list = new ArrayList<Node>();<NEW_LINE>// NOI18N<NEW_LINE>JSONArray array = (JSONArray) result.get("nodeIds");<NEW_LINE>synchronized (this) {<NEW_LINE>for (Object id : array) {<NEW_LINE>int nodeId = ((Number) id).intValue();<NEW_LINE>Node <MASK><NEW_LINE>if (n != null) {<NEW_LINE>list.add(n);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} | n = nodes.get(nodeId); |
1,109,119 | private static SQLResponse executeAndConvertResult(PreparedStatement preparedStatement) throws SQLException {<NEW_LINE>if (preparedStatement.execute()) {<NEW_LINE>ResultSetMetaData metadata = preparedStatement.getMetaData();<NEW_LINE>ResultSet resultSet = preparedStatement.getResultSet();<NEW_LINE>List<Object[]> rows = new ArrayList<>();<NEW_LINE>List<String> columnNames = new ArrayList<>(metadata.getColumnCount());<NEW_LINE>DataType[] dataTypes = new DataType[metadata.getColumnCount()];<NEW_LINE>for (int i = 0; i < metadata.getColumnCount(); i++) {<NEW_LINE>columnNames.add(metadata.getColumnName(i + 1));<NEW_LINE>}<NEW_LINE>while (resultSet.next()) {<NEW_LINE>Object[] row = new Object[metadata.getColumnCount()];<NEW_LINE>for (int i = 0; i < row.length; i++) {<NEW_LINE>Object value;<NEW_LINE>String typeName = metadata.getColumnTypeName(i + 1);<NEW_LINE>value = getObject(resultSet, i, typeName);<NEW_LINE>row[i] = value;<NEW_LINE>}<NEW_LINE>rows.add(row);<NEW_LINE>}<NEW_LINE>return new SQLResponse(columnNames.toArray(new String[0]), rows.toArray(new Object[0][]), dataTypes, rows.size());<NEW_LINE>} else {<NEW_LINE>int updateCount = preparedStatement.getUpdateCount();<NEW_LINE>if (updateCount < 0) {<NEW_LINE>updateCount += 1;<NEW_LINE>}<NEW_LINE>return new SQLResponse(new String[0], new Object[0][], <MASK><NEW_LINE>}<NEW_LINE>} | new DataType[0], updateCount); |
1,243,985 | public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {<NEW_LINE>writer.startList(SqlWriter.FrameTypeEnum.SELECT);<NEW_LINE>writer.sep(isUpsert() ? "UPSERT" : "INSERT");<NEW_LINE>for (SqlNode keyword : keywords) {<NEW_LINE>keyword.unparse(writer, 0, 0);<NEW_LINE>}<NEW_LINE>writer.sep("INTO");<NEW_LINE>final int opLeft = getOperator().getLeftPrec();<NEW_LINE>final int opRight = getOperator().getRightPrec();<NEW_LINE>targetTable.<MASK><NEW_LINE>if (columnList != null) {<NEW_LINE>columnList.unparse(writer, opLeft, opRight);<NEW_LINE>}<NEW_LINE>writer.newlineAndIndent();<NEW_LINE>if (source.getKind() == SqlKind.UNION) {<NEW_LINE>// if it's a union, don't add brackets.<NEW_LINE>writer.getDialect().unparseCall(writer, (SqlCall) source, 0, 0);<NEW_LINE>} else {<NEW_LINE>source.unparse(writer, 0, 0);<NEW_LINE>}<NEW_LINE>if (updateList.size() > 0) {<NEW_LINE>writer.sep("ON DUPLICATE KEY UPDATE");<NEW_LINE>final SqlWriter.Frame frame = writer.startList("", "");<NEW_LINE>final SqlDialect dialect = writer.getDialect();<NEW_LINE>for (SqlNode node : updateList) {<NEW_LINE>writer.sep(",");<NEW_LINE>dialect.unparseCall(writer, (SqlCall) node, 0, 0);<NEW_LINE>}<NEW_LINE>writer.endList(frame);<NEW_LINE>}<NEW_LINE>} | unparse(writer, opLeft, opRight); |
1,764,496 | public // the existing shared durable subscription.<NEW_LINE>void testCreateSharedDurableConsumer_Sel_2Subscribers(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>JMSContext jmsContext = tcfBindings.createContext();<NEW_LINE>JMSConsumer jmsConsumer1 = jmsContext.createDurableConsumer(topic1, "DURATEST13", "Company = 'IBM'", true);<NEW_LINE>JMSProducer jmsProducer = jmsContext.createProducer();<NEW_LINE>TextMessage msgOut = jmsContext.createTextMessage("This is a test message");<NEW_LINE>msgOut.setStringProperty("Company", "IBM");<NEW_LINE>jmsProducer.send(topic1, msgOut);<NEW_LINE>TextMessage msgIn = (<MASK><NEW_LINE>jmsConsumer1.close();<NEW_LINE>boolean testFailed = false;<NEW_LINE>try {<NEW_LINE>JMSConsumer jmsConsumer2 = jmsContext.createDurableConsumer(topic1, "DURATEST13", "Company = 'IBM'", true);<NEW_LINE>testFailed = true;<NEW_LINE>} catch (Exception mfe) {<NEW_LINE>mfe.printStackTrace();<NEW_LINE>}<NEW_LINE>jmsContext.unsubscribe("DURATEST13");<NEW_LINE>jmsContext.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testCreateSharedDurableConsumer_Sel_2Subscribers failed");<NEW_LINE>}<NEW_LINE>} | TextMessage) jmsConsumer1.receive(DEFAULT_TIMEOUT); |
769,939 | private boolean extraDataIsValid(final Collection<Address> expectedValidators, final BlockHeader header) {<NEW_LINE>final CliqueExtraData cliqueExtraData = CliqueExtraData.decode(header);<NEW_LINE>final Address proposer = cliqueExtraData.getProposerAddress();<NEW_LINE>if (!expectedValidators.contains(proposer)) {<NEW_LINE>LOG.info("Invalid block header: Proposer sealing block is not a member of the signers.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (epochManager.isEpochBlock(header.getNumber())) {<NEW_LINE>if (!Iterables.elementsEqual(cliqueExtraData.getValidators(), expectedValidators)) {<NEW_LINE>LOG.info("Invalid block header: Incorrect signers. Expected {} but got {}.", <MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!cliqueExtraData.getValidators().isEmpty()) {<NEW_LINE>LOG.info("Invalid block header: Signer list on non-epoch blocks must be empty.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | expectedValidators, cliqueExtraData.getValidators()); |
573,780 | public BatchCreateVariableError unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BatchCreateVariableError batchCreateVariableError = new BatchCreateVariableError();<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("name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchCreateVariableError.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("code", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchCreateVariableError.setCode(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("message", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchCreateVariableError.setMessage(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 batchCreateVariableError;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,075,379 | public static final SchemaLocation parseURI(String uri) {<NEW_LINE>try {<NEW_LINE>int hashmarkIdx = uri.indexOf("#");<NEW_LINE>if (hashmarkIdx > -1) {<NEW_LINE>String rootDocumentURI;<NEW_LINE>String rawPointer;<NEW_LINE>if (hashmarkIdx == uri.length() - 1) {<NEW_LINE>rootDocumentURI = uri;<NEW_LINE>rawPointer = "";<NEW_LINE>} else {<NEW_LINE>rootDocumentURI = <MASK><NEW_LINE>rawPointer = uri.substring(hashmarkIdx + 1);<NEW_LINE>}<NEW_LINE>URI documentURI = "".equals(rootDocumentURI) ? null : new URI(rootDocumentURI);<NEW_LINE>return new SchemaLocation(documentURI, new JSONPointer(rawPointer).getRefTokens());<NEW_LINE>} else {<NEW_LINE>return new SchemaLocation(new URI(uri), emptyList());<NEW_LINE>}<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | uri.substring(0, hashmarkIdx); |
1,533,220 | private CompletionStage<KeyEntry> prepareFindKey(SRRset rrset) {<NEW_LINE>FindKeyState state = new FindKeyState();<NEW_LINE>state<MASK><NEW_LINE>state.qclass = rrset.getDClass();<NEW_LINE>if (state.signerName == null) {<NEW_LINE>state.signerName = rrset.getName();<NEW_LINE>}<NEW_LINE>SRRset trustAnchorRRset = this.trustAnchors.find(state.signerName, rrset.getDClass());<NEW_LINE>if (trustAnchorRRset == null) {<NEW_LINE>// response isn't under a trust anchor, so we cannot validate.<NEW_LINE>KeyEntry ke = KeyEntry.newNullKeyEntry(state.signerName, rrset.getDClass(), DEFAULT_TA_BAD_KEY_TTL);<NEW_LINE>return completedFuture(ke);<NEW_LINE>}<NEW_LINE>state.keyEntry = this.keyCache.find(state.signerName, rrset.getDClass());<NEW_LINE>if (state.keyEntry == null || (!state.keyEntry.getName().equals(state.signerName) && state.keyEntry.isGood())) {<NEW_LINE>// start the FINDKEY phase with the trust anchor<NEW_LINE>state.dsRRset = trustAnchorRRset;<NEW_LINE>state.keyEntry = null;<NEW_LINE>state.currentDSKeyName = new Name(trustAnchorRRset.getName(), 1);<NEW_LINE>// and otherwise, don't continue processing this event.<NEW_LINE>// (it will be reactivated when the priming query returns).<NEW_LINE>return this.processFindKey(state).thenApply(v -> state.keyEntry);<NEW_LINE>}<NEW_LINE>return completedFuture(state.keyEntry);<NEW_LINE>} | .signerName = rrset.getSignerName(); |
1,713,507 | public Document retriveDocument(XMLEventReader xmlEventReader) throws ParserConfigurationException {<NEW_LINE>DocumentBuilderFactory dbfInstance = DocumentBuilderFactory.newInstance();<NEW_LINE>DocumentBuilder documentBuilder = dbfInstance.newDocumentBuilder();<NEW_LINE>Document document = documentBuilder.newDocument();<NEW_LINE>Element currentElement = document.getDocumentElement();<NEW_LINE>while (xmlEventReader.hasNext()) {<NEW_LINE>XMLEvent xmleve = (XMLEvent) xmlEventReader.next();<NEW_LINE>if (xmleve.getEventType() == XmlNodeType.END_ELEMENT) {<NEW_LINE>Node node = currentElement.getParentNode();<NEW_LINE>if (node instanceof Document) {<NEW_LINE>currentElement = ((Document) node).getDocumentElement();<NEW_LINE>} else {<NEW_LINE>currentElement = (Element) currentElement.getParentNode();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (xmleve.getEventType() == XmlNodeType.START_ELEMENT) {<NEW_LINE>// startElement((StartElement) xmleve,doc);<NEW_LINE>StartElement ele = (StartElement) xmleve;<NEW_LINE>Element element = null;<NEW_LINE>element = document.createElementNS(ele.getName().getNamespaceURI(), ele.getName().getLocalPart());<NEW_LINE>Iterator<Attribute> ite = ele.getAttributes();<NEW_LINE>while (ite.hasNext()) {<NEW_LINE>Attribute attr = ite.next();<NEW_LINE>element.setAttribute(attr.getName().getLocalPart(), attr.getValue());<NEW_LINE>}<NEW_LINE>// "http://schemas.xmlsoap.org/wsdl/";<NEW_LINE>String xmlns = EwsUtilities.WSTrustFebruary2005Namespace;<NEW_LINE>ite = ele.getNamespaces();<NEW_LINE>while (ite.hasNext()) {<NEW_LINE>Namespace ns = (Namespace) ite.next();<NEW_LINE>String name = ns.getPrefix();<NEW_LINE>if (!name.isEmpty()) {<NEW_LINE>element.setAttributeNS(xmlns, name, ns.getNamespaceURI());<NEW_LINE>} else {<NEW_LINE>xmlns = ns.getNamespaceURI();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (currentElement == null) {<NEW_LINE>document.appendChild(element);<NEW_LINE>} else {<NEW_LINE>currentElement.appendChild(element);<NEW_LINE>}<NEW_LINE>currentElement = element;<NEW_LINE>element.setUserData("location", <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return document;<NEW_LINE>} | ele.getLocation(), null); |
999,367 | public boolean pullImage(InstallationParam installationParam) {<NEW_LINE>List<Machine> machineList = installationParam.getMachineList();<NEW_LINE><MASK><NEW_LINE>String clusterName = cluster.getClusterName();<NEW_LINE>String image = cluster.getImage();<NEW_LINE>List<Future<Boolean>> resultFutureList = new ArrayList<>(machineList.size());<NEW_LINE>for (Machine machine : machineList) {<NEW_LINE>resultFutureList.add(threadPool.submit(() -> {<NEW_LINE>String host = machine.getHost();<NEW_LINE>try {<NEW_LINE>dockerClientOperation.pullImage(host, image);<NEW_LINE>return true;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>String message = "Pull docker image failed, host: " + host;<NEW_LINE>InstallationLogContainer.appendLog(clusterName, message);<NEW_LINE>InstallationLogContainer.appendLog(clusterName, e.getMessage());<NEW_LINE>logger.error(message, e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>for (Future<Boolean> resultFuture : resultFutureList) {<NEW_LINE>try {<NEW_LINE>if (!resultFuture.get(TIMEOUT, TimeUnit.MINUTES)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>InstallationLogContainer.appendLog(clusterName, e.getMessage());<NEW_LINE>logger.error("", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | Cluster cluster = installationParam.getCluster(); |
1,822,980 | private Environment createOrUpdateEnvironment(EnvironmentSpec spec, String operation) {<NEW_LINE>EnvironmentEntity entity = new EnvironmentEntity();<NEW_LINE>String environmentId = generateEnvironmentId().toString();<NEW_LINE>entity.setId(environmentId);<NEW_LINE>entity.<MASK><NEW_LINE>entity.setEnvironmentSpec(new GsonBuilder().disableHtmlEscaping().create().toJson(spec));<NEW_LINE>try (SqlSession sqlSession = MyBatisUtil.getSqlSession()) {<NEW_LINE>EnvironmentMapper environmentMapper = sqlSession.getMapper(EnvironmentMapper.class);<NEW_LINE>if (operation.equals("c")) {<NEW_LINE>environmentMapper.insert(entity);<NEW_LINE>} else {<NEW_LINE>environmentMapper.update(entity);<NEW_LINE>}<NEW_LINE>sqlSession.commit();<NEW_LINE>Environment environment = new Environment();<NEW_LINE>environment.setEnvironmentId(EnvironmentId.fromString(environmentId));<NEW_LINE>environment.setEnvironmentSpec(spec);<NEW_LINE>// Update cache<NEW_LINE>cachedEnvironments.putIfAbsent(spec.getName(), environment);<NEW_LINE>return environment;<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(e.getMessage(), e);<NEW_LINE>throw new SubmarineRuntimeException(Status.BAD_REQUEST.getStatusCode(), "Unable to process the environment spec.");<NEW_LINE>}<NEW_LINE>} | setEnvironmentName(spec.getName()); |
408,446 | private Map<String, TestClassResult> toResultsMap(Map<String, Map<UniqueId, TestResult>> resultsByClass) {<NEW_LINE>Map<String, TestClassResult> resultMap = new HashMap<>();<NEW_LINE>Set<String> classes = new HashSet<>(resultsByClass.keySet());<NEW_LINE>for (String clazz : classes) {<NEW_LINE>List<TestResult> <MASK><NEW_LINE>List<TestResult> failing = new ArrayList<>();<NEW_LINE>List<TestResult> skipped = new ArrayList<>();<NEW_LINE>long time = 0;<NEW_LINE>for (TestResult i : Optional.ofNullable(resultsByClass.get(clazz)).orElse(Collections.emptyMap()).values()) {<NEW_LINE>if (i.getTestExecutionResult().getStatus() == TestExecutionResult.Status.FAILED) {<NEW_LINE>failing.add(i);<NEW_LINE>} else if (i.getTestExecutionResult().getStatus() == TestExecutionResult.Status.ABORTED) {<NEW_LINE>skipped.add(i);<NEW_LINE>} else {<NEW_LINE>passing.add(i);<NEW_LINE>}<NEW_LINE>if (i.getUniqueId().getLastSegment().getType().equals("class")) {<NEW_LINE>time = i.time;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>resultMap.put(clazz, new TestClassResult(clazz, passing, failing, skipped, time));<NEW_LINE>}<NEW_LINE>return resultMap;<NEW_LINE>} | passing = new ArrayList<>(); |
1,647,932 | public static ListPublishVersionsResponse unmarshall(ListPublishVersionsResponse listPublishVersionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listPublishVersionsResponse.setRequestId(_ctx.stringValue("ListPublishVersionsResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListPublishVersionsResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListPublishVersionsResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListPublishVersionsResponse.Data.TotalCount"));<NEW_LINE>List<PublishItem> items = new ArrayList<PublishItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListPublishVersionsResponse.Data.Items.Length"); i++) {<NEW_LINE>PublishItem publishItem = new PublishItem();<NEW_LINE>publishItem.setAppId(_ctx.stringValue("ListPublishVersionsResponse.Data.Items[" + i + "].AppId"));<NEW_LINE>publishItem.setCommitId(_ctx.stringValue("ListPublishVersionsResponse.Data.Items[" + i + "].CommitId"));<NEW_LINE>publishItem.setCompletionTime(_ctx.stringValue("ListPublishVersionsResponse.Data.Items[" + i + "].CompletionTime"));<NEW_LINE>publishItem.setDescription(_ctx.stringValue("ListPublishVersionsResponse.Data.Items[" + i + "].Description"));<NEW_LINE>publishItem.setEnvId(_ctx.stringValue("ListPublishVersionsResponse.Data.Items[" + i + "].EnvId"));<NEW_LINE>publishItem.setCreateTime(_ctx.stringValue("ListPublishVersionsResponse.Data.Items[" + i + "].CreateTime"));<NEW_LINE>publishItem.setModifiedTime(_ctx.stringValue<MASK><NEW_LINE>publishItem.setPublishId(_ctx.stringValue("ListPublishVersionsResponse.Data.Items[" + i + "].PublishId"));<NEW_LINE>publishItem.setReason(_ctx.stringValue("ListPublishVersionsResponse.Data.Items[" + i + "].Reason"));<NEW_LINE>publishItem.setStartTime(_ctx.stringValue("ListPublishVersionsResponse.Data.Items[" + i + "].StartTime"));<NEW_LINE>publishItem.setPublishStatus(_ctx.stringValue("ListPublishVersionsResponse.Data.Items[" + i + "].PublishStatus"));<NEW_LINE>publishItem.setPublishType(_ctx.stringValue("ListPublishVersionsResponse.Data.Items[" + i + "].PublishType"));<NEW_LINE>publishItem.setVersionNumber(_ctx.stringValue("ListPublishVersionsResponse.Data.Items[" + i + "].VersionNumber"));<NEW_LINE>List<Map<Object, Object>> subTasks = _ctx.listMapValue("ListPublishVersionsResponse.Data.Items[" + i + "].SubTasks");<NEW_LINE>publishItem.setSubTasks(subTasks);<NEW_LINE>items.add(publishItem);<NEW_LINE>}<NEW_LINE>data.setItems(items);<NEW_LINE>listPublishVersionsResponse.setData(data);<NEW_LINE>return listPublishVersionsResponse;<NEW_LINE>} | ("ListPublishVersionsResponse.Data.Items[" + i + "].ModifiedTime")); |
109,579 | private void initPlugins() {<NEW_LINE>List<OsmandPlugin> notFunctionalPlugins = OsmandPlugin.getNotActivePlugins();<NEW_LINE>notFunctionalPlugins.remove(OsmandPlugin.getPlugin(SkiMapsPlugin.class));<NEW_LINE>notFunctionalPlugins.remove(OsmandPlugin.getPlugin(NauticalMapsPlugin.class));<NEW_LINE>Collections.shuffle(notFunctionalPlugins);<NEW_LINE>List<OsmandPlugin> enabledPlugins = OsmandPlugin.getActivePlugins();<NEW_LINE>enabledPlugins.remove(OsmandPlugin.getPlugin(SkiMapsPlugin.class));<NEW_LINE>enabledPlugins.remove(OsmandPlugin.getPlugin(NauticalMapsPlugin.class));<NEW_LINE>plugins = new ArrayList<OsmandPlugin>();<NEW_LINE>Iterator<OsmandPlugin> nit = notFunctionalPlugins.iterator();<NEW_LINE>Iterator<OsmandPlugin<MASK><NEW_LINE>addPluginsToLimit(nit, 1);<NEW_LINE>addPluginsToLimit(it, 5);<NEW_LINE>addPluginsToLimit(nit, 5);<NEW_LINE>} | > it = enabledPlugins.iterator(); |
366,899 | public static void finish_time_warp() {<NEW_LINE>long completed_ticks = time_warp_scheduled_ticks - time_bias;<NEW_LINE>double milis_to_complete <MASK><NEW_LINE>if (milis_to_complete == 0.0) {<NEW_LINE>milis_to_complete = 1.0;<NEW_LINE>}<NEW_LINE>milis_to_complete /= 1000000.0;<NEW_LINE>int tps = (int) (1000.0D * completed_ticks / milis_to_complete);<NEW_LINE>double mspt = (1.0 * milis_to_complete) / completed_ticks;<NEW_LINE>time_warp_scheduled_ticks = 0;<NEW_LINE>time_warp_start_time = 0;<NEW_LINE>if (tick_warp_callback != null) {<NEW_LINE>Commands icommandmanager = tick_warp_sender.getServer().getCommands();<NEW_LINE>try {<NEW_LINE>icommandmanager.performCommand(tick_warp_sender, tick_warp_callback);<NEW_LINE>} catch (Throwable var23) {<NEW_LINE>if (time_advancerer != null) {<NEW_LINE>Messenger.m(time_advancerer, "r Command Callback failed - unknown error: ", "rb /" + tick_warp_callback, "/" + tick_warp_callback);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tick_warp_callback = null;<NEW_LINE>tick_warp_sender = null;<NEW_LINE>}<NEW_LINE>if (time_advancerer != null) {<NEW_LINE>Messenger.m(time_advancerer, String.format("gi ... Time warp completed with %d tps, or %.2f mspt", tps, mspt));<NEW_LINE>time_advancerer = null;<NEW_LINE>} else {<NEW_LINE>Messenger.print_server_message(CarpetServer.minecraft_server, String.format("... Time warp completed with %d tps, or %.2f mspt", tps, mspt));<NEW_LINE>}<NEW_LINE>time_bias = 0;<NEW_LINE>} | = System.nanoTime() - time_warp_start_time; |
1,403,059 | public void formAst(String fullPath, List<String> locations, String className) {<NEW_LINE>Program program = SootResolver.v().getProgram();<NEW_LINE>CompilationUnit u = program.getCachedOrLoadCompilationUnit(fullPath);<NEW_LINE>if (u != null && !u.isResolved) {<NEW_LINE>u.isResolved = true;<NEW_LINE>java.util.ArrayList<soot.JastAddJ.Problem> errors = new java.util.ArrayList<soot.JastAddJ.Problem>();<NEW_LINE>u.errorCheck(errors);<NEW_LINE>if (!errors.isEmpty()) {<NEW_LINE>for (soot.JastAddJ.Problem p : errors) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// die<NEW_LINE>throw new CompilationDeathException(CompilationDeathException.COMPILATION_ABORTED, "there were errors during parsing and/or type checking (JastAdd frontend)");<NEW_LINE>}<NEW_LINE>u.transformation();<NEW_LINE>u.jimplify1phase1();<NEW_LINE>u.jimplify1phase2();<NEW_LINE>HashSet<SootClass> types = new HashSet<SootClass>();<NEW_LINE>for (TypeDecl typeDecl : u.getTypeDecls()) {<NEW_LINE>collectTypeDecl(typeDecl, types);<NEW_LINE>}<NEW_LINE>if (types.isEmpty()) {<NEW_LINE>classNameToCU.put(className, u);<NEW_LINE>} else {<NEW_LINE>for (SootClass sc : types) {<NEW_LINE>classNameToCU.put(sc.getName(), u);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | logger.debug("" + p); |
1,782,543 | private String formatJVMArgs(String jvmargs) {<NEW_LINE>// NOI18N<NEW_LINE>if (jvmargs == null || jvmargs.isEmpty())<NEW_LINE>return NbBundle.getMessage(JFRSnapshotOverviewView.class, "LBL_none");<NEW_LINE>// NOI18N<NEW_LINE>String mangledString = " ".concat(jvmargs).replace(" -", "\n");<NEW_LINE>// NOI18N<NEW_LINE>StringTokenizer tok = new StringTokenizer(mangledString, "\n");<NEW_LINE>StringBuilder text = new StringBuilder(100);<NEW_LINE>while (tok.hasMoreTokens()) {<NEW_LINE>// NOI18N<NEW_LINE>String arg = tok.nextToken().replace(" ", " ");<NEW_LINE>int <MASK><NEW_LINE>// NOI18N<NEW_LINE>text.append("<b>");<NEW_LINE>// NOI18N<NEW_LINE>text.append("-");<NEW_LINE>if (equalsSign != -1) {<NEW_LINE>text.append(arg.substring(0, equalsSign));<NEW_LINE>// NOI18N<NEW_LINE>text.append("</b>");<NEW_LINE>text.append(arg.substring(equalsSign));<NEW_LINE>} else {<NEW_LINE>text.append(arg);<NEW_LINE>// NOI18N<NEW_LINE>text.append("</b>");<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>text.append("<br>");<NEW_LINE>}<NEW_LINE>return text.toString();<NEW_LINE>} | equalsSign = arg.indexOf('='); |
135,982 | private void draw(Coordinate[] points, Canvas canvas, RotatedTileBox tileBox, int tileX, int tileY, int tileZoom) {<NEW_LINE>if (points.length > 1) {<NEW_LINE>int zoomDiff = tileBox.getZoom() - tileZoom;<NEW_LINE>int mult = (int) Math.pow(2.0, zoomDiff);<NEW_LINE>QuadRect tileBounds = tileBox.getTileBounds();<NEW_LINE>Coordinate lastPt = points[0];<NEW_LINE>float x;<NEW_LINE>float y;<NEW_LINE>float lastX = 0;<NEW_LINE>float lastY = 0;<NEW_LINE>double px, py, tpx, tpy, tlx, tly;<NEW_LINE>double lx = lastPt.x / EXTENT;<NEW_LINE>double ly = lastPt.y / EXTENT;<NEW_LINE>boolean recalculateLastXY = true;<NEW_LINE>int size = points.length;<NEW_LINE>for (int i = 1; i < size; i++) {<NEW_LINE>Coordinate pt = points[i];<NEW_LINE>px = pt.x / EXTENT;<NEW_LINE>py = pt.y / EXTENT;<NEW_LINE>tpx = (tileX + px) * mult;<NEW_LINE>tpy <MASK><NEW_LINE>tlx = (tileX + lx) * mult;<NEW_LINE>tly = (tileY + ly) * mult;<NEW_LINE>if (Math.min(tpx, tlx) < tileBounds.right && Math.max(tpx, tlx) > tileBounds.left && Math.max(tpy, tly) > tileBounds.top && Math.min(tpy, tly) < tileBounds.bottom) {<NEW_LINE>if (recalculateLastXY) {<NEW_LINE>lastX = tileBox.getPixXFromTile(tileX + lx, tileY + ly, tileZoom);<NEW_LINE>lastY = tileBox.getPixYFromTile(tileX + lx, tileY + ly, tileZoom);<NEW_LINE>recalculateLastXY = false;<NEW_LINE>}<NEW_LINE>x = tileBox.getPixXFromTile(tileX + px, tileY + py, tileZoom);<NEW_LINE>y = tileBox.getPixYFromTile(tileX + px, tileY + py, tileZoom);<NEW_LINE>if (lastX != x || lastY != y) {<NEW_LINE>canvas.drawLine(lastX, lastY, x, y, paintLine);<NEW_LINE>}<NEW_LINE>lastX = x;<NEW_LINE>lastY = y;<NEW_LINE>} else {<NEW_LINE>recalculateLastXY = true;<NEW_LINE>}<NEW_LINE>lx = px;<NEW_LINE>ly = py;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = (tileY + py) * mult; |
1,462,118 | public void writeProperty(DataType dataType, Object value) {<NEW_LINE>switch(dataType) {<NEW_LINE>case BOOLEAN:<NEW_LINE>this.writeVInt(((Boolean) value) ? 1 : 0);<NEW_LINE>break;<NEW_LINE>case BYTE:<NEW_LINE>this.writeVInt((Byte) value);<NEW_LINE>break;<NEW_LINE>case INT:<NEW_LINE>this.writeVInt((Integer) value);<NEW_LINE>break;<NEW_LINE>case FLOAT:<NEW_LINE>this.writeFloat((Float) value);<NEW_LINE>break;<NEW_LINE>case LONG:<NEW_LINE>this.writeVLong((Long) value);<NEW_LINE>break;<NEW_LINE>case DATE:<NEW_LINE>this.writeVLong(((Date) value).getTime());<NEW_LINE>break;<NEW_LINE>case DOUBLE:<NEW_LINE>this.writeDouble((Double) value);<NEW_LINE>break;<NEW_LINE>case TEXT:<NEW_LINE>this.writeString((String) value);<NEW_LINE>break;<NEW_LINE>case BLOB:<NEW_LINE>byte[] bytes = value instanceof byte[] ? (byte[]) value : ((Blob) value).bytes();<NEW_LINE>this.writeBigBytes(bytes);<NEW_LINE>break;<NEW_LINE>case UUID:<NEW_LINE>UUID uuid = (UUID) value;<NEW_LINE>// Generally writeVLong(uuid) can't save space<NEW_LINE>this.<MASK><NEW_LINE>this.writeLong(uuid.getLeastSignificantBits());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>this.writeBytes(KryoUtil.toKryoWithType(value));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | writeLong(uuid.getMostSignificantBits()); |
259,877 | // This test case will test the AutoCloseable feature for QueueSender<NEW_LINE>public void testQueueSenderClose(HttpServletRequest request, HttpServletResponse response) throws Throwable {<NEW_LINE>expectedExceptionFlag = false;<NEW_LINE>unexpectedExceptionFlag = false;<NEW_LINE>QueueSender sender1 = null;<NEW_LINE>TextMessage msg = null;<NEW_LINE>try (<MASK><NEW_LINE>QueueSession sessionSender = con.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);<NEW_LINE>QueueSender send = sessionSender.createSender(queue)) {<NEW_LINE>con.start();<NEW_LINE>sender1 = send;<NEW_LINE>msg = sessionSender.createTextMessage("You got a new Message ");<NEW_LINE>System.out.println("Connection Started : ");<NEW_LINE>} catch (JMSException ex3) {<NEW_LINE>ex3.printStackTrace();<NEW_LINE>unexpectedExceptionFlag = true;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>sender1.send(msg);<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.out.println("Exception occurred while sending message when QueueSender is closed.");<NEW_LINE>expectedExceptionFlag = true;<NEW_LINE>}<NEW_LINE>if (!expectedExceptionFlag || unexpectedExceptionFlag == true)<NEW_LINE>throw new WrongException("testQueueSenderClose failed");<NEW_LINE>} | QueueConnection con = QCFBindings.createQueueConnection(); |
1,751,930 | private void initializeTerminal() {<NEW_LINE>terminalTabPane.getTabs().addListener(new ListChangeListener<Tab>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onChanged(Change<? extends Tab> c) {<NEW_LINE>while (c.next()) {<NEW_LINE>recordTerminalButton.setDisable(c.getList().isEmpty());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>recordTerminalButton.setOnAction(e -> {<NEW_LINE>if (isNull(scheduledFuture)) {<NEW_LINE>Tooltip.install(recordTerminalButton, new Tooltip("Stop"));<NEW_LINE>recordTerminalButton.setGraphic(new FontIcon(FontAwesome.STOP_CIRCLE_O));<NEW_LINE>scheduledFuture = this.recordTerminal(e);<NEW_LINE>} else {<NEW_LINE>Tooltip.install(recordTerminalButton, new Tooltip("Record"));<NEW_LINE>recordTerminalButton.setGraphic(new FontIcon(FontAwesome.PLAY_CIRCLE));<NEW_LINE>scheduledFuture.cancel(false);<NEW_LINE>scheduledFuture = null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>newTerminalButton.setOnAction(this::newTerminal);<NEW_LINE><MASK><NEW_LINE>} | closeTerminalButton.setOnAction(this::closeTerminal); |
1,209,438 | public static List<List<Poker>> distributePoker() {<NEW_LINE>Collections.shuffle(basePokers);<NEW_LINE>List<List<Poker>> pokersList = new ArrayList<MASK><NEW_LINE>List<Poker> pokers1 = new ArrayList<>(17);<NEW_LINE>pokers1.addAll(basePokers.subList(0, 17));<NEW_LINE>List<Poker> pokers2 = new ArrayList<>(17);<NEW_LINE>pokers2.addAll(basePokers.subList(17, 34));<NEW_LINE>List<Poker> pokers3 = new ArrayList<>(17);<NEW_LINE>pokers3.addAll(basePokers.subList(34, 51));<NEW_LINE>List<Poker> pokers4 = new ArrayList<>(3);<NEW_LINE>pokers4.addAll(basePokers.subList(51, 54));<NEW_LINE>pokersList.add(pokers1);<NEW_LINE>pokersList.add(pokers2);<NEW_LINE>pokersList.add(pokers3);<NEW_LINE>pokersList.add(pokers4);<NEW_LINE>for (List<Poker> pokers : pokersList) {<NEW_LINE>sortPoker(pokers);<NEW_LINE>}<NEW_LINE>return pokersList;<NEW_LINE>} | <List<Poker>>(); |
1,285,044 | public boolean isChanged() {<NEW_LINE>ListModel formattersModel = formattersList.getModel();<NEW_LINE>VariablesFormatter[] formatters = new VariablesFormatter[formattersModel.getSize()];<NEW_LINE>for (int i = 0; i < formatters.length; i++) {<NEW_LINE>formatters[i] = (<MASK><NEW_LINE>}<NEW_LINE>VariablesFormatter[] saved = VariablesFormatter.loadFormatters();<NEW_LINE>if (saved == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (saved.length != formatters.length) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < saved.length; i++) {<NEW_LINE>VariablesFormatter savedFormatter = saved[i];<NEW_LINE>VariablesFormatter currentFormatter = (VariablesFormatter) formattersModel.getElementAt(i);<NEW_LINE>if (!areVariablesFormattersEqual(savedFormatter, currentFormatter)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | VariablesFormatter) formattersModel.getElementAt(i); |
1,638,560 | public void swapInspectionEnableState() {<NEW_LINE>LOG.assertTrue(myTreeTable != null);<NEW_LINE>Boolean state = null;<NEW_LINE>final HashSet<HighlightDisplayKey> tools = new HashSet<HighlightDisplayKey>();<NEW_LINE>final List<InspectionConfigTreeNode> nodes = new ArrayList<InspectionConfigTreeNode>();<NEW_LINE>for (TreePath selectionPath : myTreeTable.getTree().getSelectionPaths()) {<NEW_LINE>final InspectionConfigTreeNode node = (InspectionConfigTreeNode) selectionPath.getLastPathComponent();<NEW_LINE>collectInspectionFromNodes(node, tools, nodes);<NEW_LINE>}<NEW_LINE>final int[] selectedRows = myTreeTable.getSelectedRows();<NEW_LINE>for (int selectedRow : selectedRows) {<NEW_LINE>final Boolean value = (Boolean) myTreeTable.getValueAt(selectedRow, IS_ENABLED_COLUMN);<NEW_LINE>if (state == null) {<NEW_LINE>state = value;<NEW_LINE>} else if (!state.equals(value)) {<NEW_LINE>state = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final boolean newState = !Boolean.TRUE.equals(state);<NEW_LINE>final InspectionProfileImpl profile = mySettings.getInspectionProfile();<NEW_LINE>for (HighlightDisplayKey tool : tools) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>for (InspectionConfigTreeNode node : nodes) {<NEW_LINE>node.dropCache();<NEW_LINE>mySettings.onChanged(node);<NEW_LINE>}<NEW_LINE>updateRightPanel();<NEW_LINE>} | setToolEnabled(newState, profile, tool); |
1,803,601 | private Object js_getInt(int bytes, boolean signed, Object[] args) {<NEW_LINE>int pos = determinePos(args);<NEW_LINE>rangeCheck(pos, bytes);<NEW_LINE>boolean littleEndian = isArg(args, 1) && (bytes > 1) && ScriptRuntime.toBoolean(args[1]);<NEW_LINE>switch(bytes) {<NEW_LINE>case 1:<NEW_LINE>if (signed) {<NEW_LINE>return ByteIo.readInt8(arrayBuffer.buffer, offset + pos);<NEW_LINE>} else {<NEW_LINE>return ByteIo.readUint8(arrayBuffer.buffer, offset + pos);<NEW_LINE>}<NEW_LINE>case 2:<NEW_LINE>if (signed) {<NEW_LINE>return ByteIo.readInt16(arrayBuffer.<MASK><NEW_LINE>} else {<NEW_LINE>return ByteIo.readUint16(arrayBuffer.buffer, offset + pos, littleEndian);<NEW_LINE>}<NEW_LINE>case 4:<NEW_LINE>return signed ? ByteIo.readInt32(arrayBuffer.buffer, offset + pos, littleEndian) : ByteIo.readUint32(arrayBuffer.buffer, offset + pos, littleEndian);<NEW_LINE>default:<NEW_LINE>throw new AssertionError();<NEW_LINE>}<NEW_LINE>} | buffer, offset + pos, littleEndian); |
778,396 | private Mono<Response<Flux<ByteBuffer>>> activateWithResponseAsync(String resourceGroupName, String accountName, String livePipelineName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (accountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (livePipelineName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter livePipelineName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.activate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, livePipelineName, this.client.getApiVersion(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
1,629,296 | private void lookup(Name current) {<NEW_LINE>SetResponse sr = cache.lookupRecords(current, type, credibility);<NEW_LINE>// extended logging<NEW_LINE>LogManager.i(this, "cache: " + sr.toString());<NEW_LINE>if (sr.isSuccessful()) {<NEW_LINE>LogManager.i(this, "cache: " + Arrays.toString(sr.answers()));<NEW_LINE>}<NEW_LINE>if (verbose) {<NEW_LINE>System.err.println("lookup " + current + " " + Type.string(type));<NEW_LINE>System.err.println(sr);<NEW_LINE>}<NEW_LINE>processResponse(current, sr);<NEW_LINE>if (done || doneCurrent)<NEW_LINE>return;<NEW_LINE>Record question = Record.newRecord(current, type, dclass);<NEW_LINE>Message query = Message.newQuery(question);<NEW_LINE>Message response = null;<NEW_LINE>try {<NEW_LINE>// extended logging<NEW_LINE>if (query != null)<NEW_LINE>LogManager.i(this, "try query: " + query.toString());<NEW_LINE>response = resolver.send(query);<NEW_LINE>// extended logging<NEW_LINE>if (response != null)<NEW_LINE>LogManager.i(this, "try response: " + response.toString());<NEW_LINE>} catch (IOException e) {<NEW_LINE>// extended logging<NEW_LINE>LogManager.i(this, <MASK><NEW_LINE>// A network error occurred. Press on.<NEW_LINE>if (e instanceof InterruptedIOException)<NEW_LINE>timedout = true;<NEW_LINE>else<NEW_LINE>networkerror = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int rcode = response.getHeader().getRcode();<NEW_LINE>if (rcode != Rcode.NOERROR && rcode != Rcode.NXDOMAIN) {<NEW_LINE>// The server we contacted is broken or otherwise unhelpful.<NEW_LINE>// Press on.<NEW_LINE>badresponse = true;<NEW_LINE>badresponse_error = Rcode.string(rcode);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!query.getQuestion().equals(response.getQuestion())) {<NEW_LINE>// The answer doesn't match the question. That's not good.<NEW_LINE>badresponse = true;<NEW_LINE>badresponse_error = "response does not match query";<NEW_LINE>// !! add logging !!<NEW_LINE>LogManager.i(this, "exception: " + badresponse_error);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>sr = cache.addMessage(response);<NEW_LINE>if (sr == null)<NEW_LINE>sr = cache.lookupRecords(current, type, credibility);<NEW_LINE>if (verbose) {<NEW_LINE>System.err.println("queried " + current + " " + Type.string(type));<NEW_LINE>System.err.println(sr);<NEW_LINE>}<NEW_LINE>processResponse(current, sr);<NEW_LINE>} | "catch exception: " + e.toString()); |
1,134,826 | private void updateDocPanel(ContentMimePair content, JEditorPane textEditor, final JScrollPane scroller) {<NEW_LINE><MASK><NEW_LINE>textEditor.setText(content.content);<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>scroller.getViewport().setViewPosition(new Point(0, 0));<NEW_LINE>Document document = readmePane.getDocument();<NEW_LINE>if (document instanceof HTMLDocument) {<NEW_LINE>HTMLDocument htmlDocument = (HTMLDocument) document;<NEW_LINE>StyleSheet styleSheet = htmlDocument.getStyleSheet();<NEW_LINE>styleSheet.addRule("body {" + "font-family: Helvetica Neue, Helvetica, Arial, Sans-Serif; " + "font-weight: 300; " + "font-size: 10px; " + "color: #808080; " + "padding-left: 10px; " + "padding-right: 10px; " + "padding-top: 2px; " + "}");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | textEditor.setContentType(content.mimeType); |
917,007 | public com.amazonaws.services.kms.model.InvalidGrantIdException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.kms.model.InvalidGrantIdException invalidGrantIdException = new com.amazonaws.services.kms.model.InvalidGrantIdException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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>} 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 invalidGrantIdException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
780,315 | private boolean hasNestedNulls(Type type, Object value) {<NEW_LINE>if (type instanceof RowType) {<NEW_LINE>Block container = (Block) value;<NEW_LINE>RowType rowType = (RowType) type;<NEW_LINE>for (int i = 0; i < rowType.getFields().size(); i++) {<NEW_LINE>Type elementType = rowType.getFields().get(i).getType();<NEW_LINE>if (container.isNull(i) || elementHasNulls(elementType, container, i)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (type instanceof ArrayType) {<NEW_LINE>Block container = (Block) value;<NEW_LINE>ArrayType arrayType = (ArrayType) type;<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < container.getPositionCount(); i++) {<NEW_LINE>if (container.isNull(i) || elementHasNulls(elementType, container, i)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | Type elementType = arrayType.getElementType(); |
922,545 | public void doIndelRefConfCalc(final int ploidy, final byte[] ref, final ReadPileup pileup, final int refOffset, final ReferenceConfidenceResult refResult) {<NEW_LINE>final RefVsAnyResult homRefCalc = (RefVsAnyResult) refResult;<NEW_LINE>// genotype likelihood calculation<NEW_LINE>final GenotypeLikelihoods snpGLs = GenotypeLikelihoods.fromLog10Likelihoods(homRefCalc.getGenotypeLikelihoodsCappedByHomRefLikelihood());<NEW_LINE>final int nIndelInformativeReads = calcNReadsWithNoPlausibleIndelsReads(pileup, refOffset, ref, indelInformativeDepthIndelSize);<NEW_LINE>final GenotypeLikelihoods <MASK><NEW_LINE>// now that we have the SNP and indel GLs, we take the one with the least confidence,<NEW_LINE>// as this is the most conservative estimate of our certainty that we are hom-ref.<NEW_LINE>// For example, if the SNP PLs are 0,10,100 and the indel PLs are 0,100,1000<NEW_LINE>// we are very certain that there's no indel here, but the SNP confidence imply that we are<NEW_LINE>// far less confident that the ref base is actually the only thing here. So we take 0,10,100<NEW_LINE>// as our GLs for the site.<NEW_LINE>final GenotypeLikelihoods leastConfidenceGLs = getGLwithWorstGQ(indelGLs, snpGLs);<NEW_LINE>homRefCalc.finalPhredScaledGenotypeLikelihoods = leastConfidenceGLs.getAsPLs();<NEW_LINE>} | indelGLs = getIndelPLs(ploidy, nIndelInformativeReads); |
1,167,059 | public static int romanToArabic(String input) {<NEW_LINE><MASK><NEW_LINE>int result = 0;<NEW_LINE>List<RomanNumeral> romanNumerals = RomanNumeral.getReverseSortedValues();<NEW_LINE>int i = 0;<NEW_LINE>while ((romanNumeral.length() > 0) && (i < romanNumerals.size())) {<NEW_LINE>RomanNumeral symbol = romanNumerals.get(i);<NEW_LINE>if (romanNumeral.startsWith(symbol.name())) {<NEW_LINE>result += symbol.getValue();<NEW_LINE>romanNumeral = romanNumeral.substring(symbol.name().length());<NEW_LINE>} else {<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (romanNumeral.length() > 0) {<NEW_LINE>throw new IllegalArgumentException(input + " cannot be converted to a Roman Numeral");<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | String romanNumeral = input.toUpperCase(); |
1,578,426 | public void remoteFlush(RemoteFlushRequest request, StreamObserver<RemoteFlushResponse> responseObserver) {<NEW_LINE>long flushSnapshotId = request.getSnapshotId();<NEW_LINE>long waitTimeMs = request.getWaitTimeMs();<NEW_LINE>logger.info("flush snapshot id [" + flushSnapshotId + "] with timeout [" + waitTimeMs + "]ms");<NEW_LINE>try {<NEW_LINE>boolean suc;<NEW_LINE>if (flushSnapshotId == 0L) {<NEW_LINE>suc = graphWriter.flushLastSnapshot(waitTimeMs);<NEW_LINE>} else {<NEW_LINE>suc = <MASK><NEW_LINE>}<NEW_LINE>responseObserver.onNext(RemoteFlushResponse.newBuilder().setSuccess(suc).build());<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.error("remoteFlush failed. flushSnapshotId [" + flushSnapshotId + "] waitTimeMs [" + waitTimeMs + "]");<NEW_LINE>responseObserver.onError(Status.INTERNAL.withDescription(e.getMessage()).asRuntimeException());<NEW_LINE>}<NEW_LINE>} | graphWriter.flushSnapshot(flushSnapshotId, waitTimeMs); |
1,361,910 | private void generateJavaComment(@NonNull final StringBuilder result, @NonNull final ColumnInfo columnInfo, @NonNull final String startOfComment, @Nullable final String deprecated) {<NEW_LINE>final String propertyName = columnInfo.getName();<NEW_LINE>result.append("\n").append("\t/**").append("\n\t * ").append(startOfComment).append(" ").append(propertyName).append(".");<NEW_LINE>//<NEW_LINE>// Description<NEW_LINE>final String description = columnInfo.getDescription();<NEW_LINE>if (description != null && description.length() > 0) {<NEW_LINE>result.append("\n\t * ").<MASK><NEW_LINE>}<NEW_LINE>result.append("\n\t *");<NEW_LINE>//<NEW_LINE>// Type<NEW_LINE>result.append("\n\t * <br>Type: ").append(DisplayType.getDescription(columnInfo.getDisplayType()));<NEW_LINE>//<NEW_LINE>// Mandatory:<NEW_LINE>result.append("\n\t * <br>Mandatory: ").append(columnInfo.isMandatory());<NEW_LINE>//<NEW_LINE>// Virtual Column:<NEW_LINE>result.append("\n\t * <br>Virtual Column: ").append(columnInfo.isVirtualColumn());<NEW_LINE>if (columnInfo.isLazyLoading()) {<NEW_LINE>result.append(" (lazy loading)");<NEW_LINE>}<NEW_LINE>if (deprecated != null) {<NEW_LINE>result.append("\n\t * @deprecated ").append(deprecated);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>result.append("\n\t */\n");<NEW_LINE>} | append(description.trim()); |
1,204,614 | public void decode(ByteBuf buf, ProtocolUtils.Direction direction, ProtocolVersion version) {<NEW_LINE>this.locale = <MASK><NEW_LINE>this.viewDistance = buf.readByte();<NEW_LINE>this.chatVisibility = ProtocolUtils.readVarInt(buf);<NEW_LINE>this.chatColors = buf.readBoolean();<NEW_LINE>if (version.compareTo(ProtocolVersion.MINECRAFT_1_7_6) <= 0) {<NEW_LINE>this.difficulty = buf.readByte();<NEW_LINE>}<NEW_LINE>this.skinParts = buf.readUnsignedByte();<NEW_LINE>if (version.compareTo(ProtocolVersion.MINECRAFT_1_9) >= 0) {<NEW_LINE>this.mainHand = ProtocolUtils.readVarInt(buf);<NEW_LINE>if (version.compareTo(ProtocolVersion.MINECRAFT_1_17) >= 0) {<NEW_LINE>this.chatFilteringEnabled = buf.readBoolean();<NEW_LINE>if (version.compareTo(ProtocolVersion.MINECRAFT_1_18) >= 0) {<NEW_LINE>this.clientListingAllowed = buf.readBoolean();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ProtocolUtils.readString(buf, 16); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.