idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
828,320 | final DisassociateCustomerGatewayResult executeDisassociateCustomerGateway(DisassociateCustomerGatewayRequest disassociateCustomerGatewayRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateCustomerGatewayRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateCustomerGatewayRequest> request = null;<NEW_LINE>Response<DisassociateCustomerGatewayResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateCustomerGatewayRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateCustomerGatewayRequest));<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, "NetworkManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateCustomerGateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateCustomerGatewayResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateCustomerGatewayResultJsonUnmarshaller());<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); |
693,659 | private void doCommit(ArtifactModelImpl artifactModel) {<NEW_LINE>boolean hasChanges;<NEW_LINE>LOG.assertTrue(!myInsideCommit, "Recursive commit");<NEW_LINE>myInsideCommit = true;<NEW_LINE>try {<NEW_LINE>final List<ArtifactImpl> allArtifacts = artifactModel.getOriginalArtifacts();<NEW_LINE>final Set<ArtifactImpl> removed = new HashSet<>(myModel.myArtifactsList);<NEW_LINE>final List<ArtifactImpl> added = new ArrayList<>();<NEW_LINE>final List<Pair<ArtifactImpl, String>> changed = new ArrayList<>();<NEW_LINE>for (ArtifactImpl artifact : allArtifacts) {<NEW_LINE>final boolean isAdded = !removed.remove(artifact);<NEW_LINE>final ArtifactImpl modifiableCopy = artifactModel.getModifiableCopy(artifact);<NEW_LINE>if (isAdded) {<NEW_LINE>added.add(artifact);<NEW_LINE>} else if (modifiableCopy != null && !modifiableCopy.equals(artifact)) {<NEW_LINE>final String oldName = artifact.getName();<NEW_LINE>artifact.copyFrom(modifiableCopy);<NEW_LINE>changed.add(Pair.create(artifact, oldName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myModel.setArtifactsList(allArtifacts);<NEW_LINE>myModificationCount++;<NEW_LINE>final ArtifactListener publisher = myProject.getMessageBus().syncPublisher(TOPIC);<NEW_LINE>hasChanges = !removed.isEmpty() || !added.isEmpty() || !changed.isEmpty();<NEW_LINE>ProjectRootManagerEx.getInstanceEx(myProject).mergeRootsChangesDuring(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>for (ArtifactImpl artifact : removed) {<NEW_LINE>publisher.artifactRemoved(artifact);<NEW_LINE>}<NEW_LINE>// it's important to send 'removed' events before 'added'. Otherwise when artifacts are reloaded from xml artifact pointers will be damaged<NEW_LINE>for (ArtifactImpl artifact : added) {<NEW_LINE>publisher.artifactAdded(artifact);<NEW_LINE>}<NEW_LINE>for (Pair<ArtifactImpl, String> pair : changed) {<NEW_LINE>publisher.artifactChanged(pair.getFirst(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} finally {<NEW_LINE>myInsideCommit = false;<NEW_LINE>}<NEW_LINE>updateWatchedRoots();<NEW_LINE>if (hasChanges) {<NEW_LINE>// TODO [VISTALL] compiler BuildManager.getInstance().clearState(myProject);<NEW_LINE>}<NEW_LINE>} | ), pair.getSecond()); |
874,403 | public static String printClass(MemoryLint context, String cls) {<NEW_LINE>if (cls.startsWith("<< ")) {<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>cls = cls.substring("<< ".length());<NEW_LINE>}<NEW_LINE>if ("unknown".equals(cls)) {<NEW_LINE>// NOI18N<NEW_LINE>return NbBundle.getMessage(Utils.class, "LBL_UnknownClass");<NEW_LINE>}<NEW_LINE>String fullName = cls;<NEW_LINE>String dispName = cls;<NEW_LINE>// NOI18N<NEW_LINE>String field = "";<NEW_LINE>// now you can wrap it with a/href to given class<NEW_LINE>int dotIdx = cls.lastIndexOf('.');<NEW_LINE>int <MASK><NEW_LINE>if (colonIdx == -1) {<NEW_LINE>colonIdx = cls.lastIndexOf(';');<NEW_LINE>}<NEW_LINE>if (colonIdx > 0) {<NEW_LINE>fullName = cls.substring(0, colonIdx);<NEW_LINE>field = "." + cls.substring(colonIdx + 1);<NEW_LINE>}<NEW_LINE>dispName = fullName.substring(dotIdx + 1);<NEW_LINE>// NOI18N<NEW_LINE>return "<a href='file://class/" + fullName + "'>" + dispName + "</a>" + field;<NEW_LINE>} | colonIdx = cls.lastIndexOf(':'); |
767,530 | private void latex(File file) throws IOException {<NEW_LINE><MASK><NEW_LINE>BufferedReader in = new BufferedReader(new FileReader(file));<NEW_LINE>//<NEW_LINE>File outFile = new File(fileName + ".txt");<NEW_LINE>BufferedWriter out = new BufferedWriter(new FileWriter(outFile, false));<NEW_LINE>String line = null;<NEW_LINE>int lineNo = 0;<NEW_LINE>while ((line = in.readLine()) != null) {<NEW_LINE>lineNo++;<NEW_LINE>boolean ignore = false;<NEW_LINE>//<NEW_LINE>char[] inLine = line.toCharArray();<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>for (int i = 0; i < inLine.length; i++) {<NEW_LINE>char c = inLine[i];<NEW_LINE>if (c == '\\')<NEW_LINE>ignore = true;<NEW_LINE>else if (c == '{')<NEW_LINE>ignore = false;<NEW_LINE>else if (c == '}')<NEW_LINE>;<NEW_LINE>else if (!ignore)<NEW_LINE>sb.append(c);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>out.write(sb.toString());<NEW_LINE>out.newLine();<NEW_LINE>}<NEW_LINE>// while reading file<NEW_LINE>//<NEW_LINE>in.close();<NEW_LINE>out.close();<NEW_LINE>System.out.println("File " + fileName + " - lines=" + lineNo);<NEW_LINE>} | String fileName = file.getAbsolutePath(); |
1,259,658 | public static <T extends Set<OffsetRange>> NodeVisitor<T> createMarkOccurrencesNodeVisitor(EditorFeatureContext context, T result, NodeType... nodeTypesToMatch) {<NEW_LINE>final Snapshot snapshot = context.getSnapshot();<NEW_LINE>int astCaretOffset = snapshot.getEmbeddedOffset(context.getCaretOffset());<NEW_LINE>if (astCaretOffset == -1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final Node current = NodeUtil.findNonTokenNodeAtOffset(context.getParseTreeRoot(), astCaretOffset);<NEW_LINE>if (current == null) {<NEW_LINE>// this may happen if the offset falls to the area outside the selectors rule node.<NEW_LINE>// (for example when the stylesheet starts or ends with whitespaces or comment and<NEW_LINE>// and the offset falls there).<NEW_LINE>// In such case root node (with null parent) is returned from NodeUtil.findNodeAtOffset()<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Set types = EnumSet.copyOf(Arrays.asList(nodeTypesToMatch));<NEW_LINE>if (!types.contains(current.type())) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final CharSequence selectedNamespacePrefixImage = current.image();<NEW_LINE>return new NodeVisitor<T>(result) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean visit(Node node) {<NEW_LINE>if (node.type() == current.type() && CharSequenceUtilities.textEquals(selectedNamespacePrefixImage, node.image())) {<NEW_LINE>OffsetRange documentNodeRange = <MASK><NEW_LINE>getResult().add(Css3Utils.getValidOrNONEOffsetRange(documentNodeRange));<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | Css3Utils.getDocumentOffsetRange(node, snapshot); |
1,812,815 | public void onBlockDispensing(BlockDispenseEvent e) {<NEW_LINE>Block b = e.getBlock();<NEW_LINE>if (b.getType() == Material.DISPENSER && b.getRelative(BlockFace.DOWN).getType() != Material.HOPPER) {<NEW_LINE>SlimefunItem <MASK><NEW_LINE>if (machine != null) {<NEW_LINE>machine.callItemHandler(BlockDispenseHandler.class, handler -> {<NEW_LINE>BlockState state = PaperLib.getBlockState(b, false).getState();<NEW_LINE>if (state instanceof Dispenser) {<NEW_LINE>Dispenser dispenser = (Dispenser) state;<NEW_LINE>BlockFace face = ((Directional) b.getBlockData()).getFacing();<NEW_LINE>Block block = b.getRelative(face);<NEW_LINE>handler.onBlockDispense(e, dispenser, block, machine);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | machine = BlockStorage.check(b); |
1,303,497 | static final // Used as helper to create byte arrays as well as loading Memory for direct compact sketches<NEW_LINE>Memory loadCompactMemory(final long[] compactHashArr, final short seedHash, final int curCount, final long thetaLong, final WritableMemory dstMem, final byte flags, final int preLongs) {<NEW_LINE>assert (dstMem != null) && (compactHashArr != null);<NEW_LINE>final int outLongs = preLongs + curCount;<NEW_LINE>final int outBytes = outLongs << 3;<NEW_LINE>final int dstBytes = (int) dstMem.getCapacity();<NEW_LINE>if (outBytes > dstBytes) {<NEW_LINE>throw new SketchesArgumentException("Insufficient Memory: " + dstBytes + ", Need: " + outBytes);<NEW_LINE>}<NEW_LINE>final byte famID = (byte) Family.COMPACT.getID();<NEW_LINE>// Caution: The following loads directly into Memory without creating a heap byte[] first,<NEW_LINE>// which would act as a pre-clearing, initialization mechanism. So it is important to make sure<NEW_LINE>// that all fields are initialized, even those that are not used by the CompactSketch.<NEW_LINE>// Otherwise, uninitialized fields could be filled with off-heap garbage, which could cause<NEW_LINE>// other problems downstream if those fields are not filtered out first.<NEW_LINE>// As written below, all fields are initialized avoiding an extra copy.<NEW_LINE>// The first 8 bytes (pre0)<NEW_LINE>// RF not used = 0<NEW_LINE>insertPreLongs(dstMem, preLongs);<NEW_LINE>insertSerVer(dstMem, SER_VER);<NEW_LINE>insertFamilyID(dstMem, famID);<NEW_LINE>// The following initializes the lgNomLongs and lgArrLongs to 0.<NEW_LINE>// They are not used in CompactSketches.<NEW_LINE>dstMem.putShort<MASK><NEW_LINE>insertFlags(dstMem, flags);<NEW_LINE>insertSeedHash(dstMem, seedHash);<NEW_LINE>if ((preLongs == 1) && (curCount == 1)) {<NEW_LINE>// singleItem, theta = 1.0<NEW_LINE>dstMem.putLong(8, compactHashArr[0]);<NEW_LINE>return dstMem;<NEW_LINE>}<NEW_LINE>if (preLongs > 1) {<NEW_LINE>insertCurCount(dstMem, curCount);<NEW_LINE>insertP(dstMem, (float) 1.0);<NEW_LINE>}<NEW_LINE>if (preLongs > 2) {<NEW_LINE>insertThetaLong(dstMem, thetaLong);<NEW_LINE>}<NEW_LINE>if (curCount > 0) {<NEW_LINE>// theta could be < 1.0.<NEW_LINE>dstMem.putLongArray(preLongs << 3, compactHashArr, 0, curCount);<NEW_LINE>}<NEW_LINE>// if prelongs == 3 & curCount == 0, theta could be < 1.0.<NEW_LINE>return dstMem;<NEW_LINE>} | (LG_NOM_LONGS_BYTE, (short) 0); |
1,190,671 | public static QueryNumber400ListResponse unmarshall(QueryNumber400ListResponse queryNumber400ListResponse, UnmarshallerContext context) {<NEW_LINE>queryNumber400ListResponse.setRequestId<MASK><NEW_LINE>queryNumber400ListResponse.setSuccess(context.booleanValue("QueryNumber400ListResponse.Success"));<NEW_LINE>queryNumber400ListResponse.setCode(context.stringValue("QueryNumber400ListResponse.Code"));<NEW_LINE>queryNumber400ListResponse.setMessage(context.stringValue("QueryNumber400ListResponse.Message"));<NEW_LINE>queryNumber400ListResponse.setHttpStatusCode(context.integerValue("QueryNumber400ListResponse.HttpStatusCode"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setMonthlyPrice(context.integerValue("QueryNumber400ListResponse.Data.MonthlyPrice"));<NEW_LINE>List<Number> numbers = new ArrayList<Number>();<NEW_LINE>for (int i = 0; i < context.lengthValue("QueryNumber400ListResponse.Data.Numbers.Length"); i++) {<NEW_LINE>Number number = new Number();<NEW_LINE>number.setNumber(context.stringValue("QueryNumber400ListResponse.Data.Numbers[" + i + "].Number"));<NEW_LINE>number.setSignature(context.stringValue("QueryNumber400ListResponse.Data.Numbers[" + i + "].Signature"));<NEW_LINE>numbers.add(number);<NEW_LINE>}<NEW_LINE>data.setNumbers(numbers);<NEW_LINE>queryNumber400ListResponse.setData(data);<NEW_LINE>return queryNumber400ListResponse;<NEW_LINE>} | (context.stringValue("QueryNumber400ListResponse.RequestId")); |
1,553,217 | protected JPanel instanceablePanel(Instanceable inst) {<NEW_LINE>JPanel panel = new JPanel(new MigLayout("fill"));<NEW_LINE>{<NEW_LINE>// Instance Count<NEW_LINE>panel.add(new JLabel(trans.get("RocketCompCfg.lbl.InstanceCount")));<NEW_LINE>IntegerModel countModel = new IntegerModel(component, "InstanceCount", 1);<NEW_LINE>JSpinner countSpinner = new JSpinner(countModel.getSpinnerModel());<NEW_LINE>countSpinner.setEditor(new SpinnerEditor(countSpinner));<NEW_LINE>panel.add(countSpinner, "w 100lp, wrap rel");<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// Instance separation<NEW_LINE>panel.add(new JLabel(trans.get("RocketCompCfg.lbl.InstanceSeparation")));<NEW_LINE>DoubleModel separationModel = new DoubleModel(component, "InstanceSeparation", UnitGroup.UNITS_LENGTH);<NEW_LINE>JSpinner separationSpinner = new JSpinner(separationModel.getSpinnerModel());<NEW_LINE>separationSpinner.<MASK><NEW_LINE>panel.add(separationSpinner, "growx");<NEW_LINE>panel.add(new UnitSelector(separationModel), "growx");<NEW_LINE>panel.add(new BasicSlider(separationModel.getSliderModel(0, 0.001, 0.02)), "w 100lp, wrap para");<NEW_LINE>}<NEW_LINE>return panel;<NEW_LINE>} | setEditor(new SpinnerEditor(separationSpinner)); |
760,116 | public Response update(@PathParam("id") String id, @FormParam("name") String name, @FormParam("steps") String steps) {<NEW_LINE>if (!authenticate()) {<NEW_LINE>throw new ForbiddenClientException();<NEW_LINE>}<NEW_LINE>checkBaseFunction(BaseFunction.ADMIN);<NEW_LINE>// Validate input<NEW_LINE>name = ValidationUtil.validateLength(name, "name", 1, 50, false);<NEW_LINE>steps = ValidationUtil.validateLength(steps, "steps", 1, 5000, false);<NEW_LINE>validateRouteModelSteps(steps);<NEW_LINE>// Get the route model<NEW_LINE>RouteModelDao routeModelDao = new RouteModelDao();<NEW_LINE>RouteModel <MASK><NEW_LINE>if (routeModel == null) {<NEW_LINE>throw new NotFoundException();<NEW_LINE>}<NEW_LINE>// Update the route model<NEW_LINE>routeModelDao.update(routeModel.setName(name).setSteps(steps), principal.getId());<NEW_LINE>// Always return OK<NEW_LINE>JsonObjectBuilder response = Json.createObjectBuilder().add("status", "ok");<NEW_LINE>return Response.ok().entity(response.build()).build();<NEW_LINE>} | routeModel = routeModelDao.getActiveById(id); |
1,410,997 | public boolean removeAll(ByteIterable source) {<NEW_LINE>if (source.isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int oldSize = this.size();<NEW_LINE>if (source instanceof ByteHashSet) {<NEW_LINE>this.size = 0;<NEW_LINE>ByteHashSet hashSet = (ByteHashSet) source;<NEW_LINE>this.bitGroup3 &= ~hashSet.bitGroup3;<NEW_LINE>this.size += <MASK><NEW_LINE>this.bitGroup4 &= ~hashSet.bitGroup4;<NEW_LINE>this.size += Long.bitCount(this.bitGroup4);<NEW_LINE>this.bitGroup2 &= ~hashSet.bitGroup2;<NEW_LINE>this.size += Long.bitCount(this.bitGroup2);<NEW_LINE>this.bitGroup1 &= ~hashSet.bitGroup1;<NEW_LINE>this.size += Long.bitCount(this.bitGroup1);<NEW_LINE>} else {<NEW_LINE>ByteIterator iterator = source.byteIterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>byte item = iterator.next();<NEW_LINE>this.remove(item);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this.size() != oldSize;<NEW_LINE>} | Long.bitCount(this.bitGroup3); |
966,066 | public void testAuthenticateMethodBA_ProtectedServlet1() throws Exception {<NEW_LINE>String methodName = "testAuthenticateMethodBA_ProtectedServlet1";<NEW_LINE>METHODS = "testMethod=authenticate,logout,login";<NEW_LINE>String url = "http://" + server.getHostname() + ":" + server.getHttpDefaultPort() + "/basicauth/ProgrammaticAPIServlet?" + METHODS + "&user=" + managerUser + "&password=" + managerPassword;<NEW_LINE>String response = authenticateWithValidAuthDataBA(<MASK><NEW_LINE>// Get servlet output to verify each test<NEW_LINE>String test1 = response.substring(response.indexOf("STARTTEST1"), response.indexOf("ENDTEST1"));<NEW_LINE>String test2 = response.substring(response.indexOf("STARTTEST2"), response.indexOf("ENDTEST2"));<NEW_LINE>String test3 = response.substring(response.indexOf("STARTTEST3"), response.indexOf("ENDTEST3"));<NEW_LINE>// TEST1 - check values after authenticate<NEW_LINE>testHelper.verifyProgrammaticAPIValues(authTypeBasic, validUser, test1, NOT_MANAGER_ROLE, IS_EMPLOYEE_ROLE);<NEW_LINE>// TEST2 - check values after logout<NEW_LINE>testHelper.verifyNullValuesAfterLogout(validUser, test2, NOT_MANAGER_ROLE, IS_EMPLOYEE_ROLE);<NEW_LINE>// TEST3 - check values after login<NEW_LINE>testHelper.verifyProgrammaticAPIValues(authTypeBasic, managerUser, test3, IS_MANAGER_ROLE, NOT_EMPLOYEE_ROLE);<NEW_LINE>assertNoPasswordsInServerLogFiles(methodName);<NEW_LINE>} | validUser, validPassword, url, PROGRAMMATIC_API_SERVLET); |
181,527 | public static DescribeLiveStreamRecordIndexFilesResponse unmarshall(DescribeLiveStreamRecordIndexFilesResponse describeLiveStreamRecordIndexFilesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLiveStreamRecordIndexFilesResponse.setRequestId(_ctx.stringValue("DescribeLiveStreamRecordIndexFilesResponse.RequestId"));<NEW_LINE>describeLiveStreamRecordIndexFilesResponse.setPageNum(_ctx.integerValue("DescribeLiveStreamRecordIndexFilesResponse.PageNum"));<NEW_LINE>describeLiveStreamRecordIndexFilesResponse.setOrder(_ctx.stringValue("DescribeLiveStreamRecordIndexFilesResponse.Order"));<NEW_LINE>describeLiveStreamRecordIndexFilesResponse.setTotalPage(_ctx.integerValue("DescribeLiveStreamRecordIndexFilesResponse.TotalPage"));<NEW_LINE>describeLiveStreamRecordIndexFilesResponse.setPageSize(_ctx.integerValue("DescribeLiveStreamRecordIndexFilesResponse.PageSize"));<NEW_LINE>describeLiveStreamRecordIndexFilesResponse.setTotalNum(_ctx.integerValue("DescribeLiveStreamRecordIndexFilesResponse.TotalNum"));<NEW_LINE>List<RecordIndexInfo> recordIndexInfoList = new ArrayList<RecordIndexInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLiveStreamRecordIndexFilesResponse.RecordIndexInfoList.Length"); i++) {<NEW_LINE>RecordIndexInfo recordIndexInfo = new RecordIndexInfo();<NEW_LINE>recordIndexInfo.setRecordUrl(_ctx.stringValue("DescribeLiveStreamRecordIndexFilesResponse.RecordIndexInfoList[" + i + "].RecordUrl"));<NEW_LINE>recordIndexInfo.setStreamName(_ctx.stringValue("DescribeLiveStreamRecordIndexFilesResponse.RecordIndexInfoList[" + i + "].StreamName"));<NEW_LINE>recordIndexInfo.setCreateTime(_ctx.stringValue("DescribeLiveStreamRecordIndexFilesResponse.RecordIndexInfoList[" + i + "].CreateTime"));<NEW_LINE>recordIndexInfo.setRecordId(_ctx.stringValue("DescribeLiveStreamRecordIndexFilesResponse.RecordIndexInfoList[" + i + "].RecordId"));<NEW_LINE>recordIndexInfo.setHeight(_ctx.integerValue("DescribeLiveStreamRecordIndexFilesResponse.RecordIndexInfoList[" + i + "].Height"));<NEW_LINE>recordIndexInfo.setOssBucket(_ctx.stringValue("DescribeLiveStreamRecordIndexFilesResponse.RecordIndexInfoList[" + i + "].OssBucket"));<NEW_LINE>recordIndexInfo.setDomainName(_ctx.stringValue("DescribeLiveStreamRecordIndexFilesResponse.RecordIndexInfoList[" + i + "].DomainName"));<NEW_LINE>recordIndexInfo.setOssObject(_ctx.stringValue("DescribeLiveStreamRecordIndexFilesResponse.RecordIndexInfoList[" + i + "].OssObject"));<NEW_LINE>recordIndexInfo.setEndTime(_ctx.stringValue<MASK><NEW_LINE>recordIndexInfo.setAppName(_ctx.stringValue("DescribeLiveStreamRecordIndexFilesResponse.RecordIndexInfoList[" + i + "].AppName"));<NEW_LINE>recordIndexInfo.setStartTime(_ctx.stringValue("DescribeLiveStreamRecordIndexFilesResponse.RecordIndexInfoList[" + i + "].StartTime"));<NEW_LINE>recordIndexInfo.setWidth(_ctx.integerValue("DescribeLiveStreamRecordIndexFilesResponse.RecordIndexInfoList[" + i + "].Width"));<NEW_LINE>recordIndexInfo.setDuration(_ctx.floatValue("DescribeLiveStreamRecordIndexFilesResponse.RecordIndexInfoList[" + i + "].Duration"));<NEW_LINE>recordIndexInfo.setOssEndpoint(_ctx.stringValue("DescribeLiveStreamRecordIndexFilesResponse.RecordIndexInfoList[" + i + "].OssEndpoint"));<NEW_LINE>recordIndexInfoList.add(recordIndexInfo);<NEW_LINE>}<NEW_LINE>describeLiveStreamRecordIndexFilesResponse.setRecordIndexInfoList(recordIndexInfoList);<NEW_LINE>return describeLiveStreamRecordIndexFilesResponse;<NEW_LINE>} | ("DescribeLiveStreamRecordIndexFilesResponse.RecordIndexInfoList[" + i + "].EndTime")); |
1,563,215 | private static String filter(List<String> dumpList, String[] filters, boolean headerExists) {<NEW_LINE>int i;<NEW_LINE>int size = dumpList.size();<NEW_LINE>int startIndex = 0;<NEW_LINE>String value;<NEW_LINE>String lineSeparator = System.getProperty("line.separator");<NEW_LINE>StringBuilder stackBuffer = new StringBuilder(4096);<NEW_LINE>if (headerExists) {<NEW_LINE>for (i = startIndex; i < size; i++) {<NEW_LINE>value = dumpList.get(i);<NEW_LINE>stackBuffer.append(value).append(lineSeparator);<NEW_LINE>if (value.length() == 0) {<NEW_LINE>startIndex = i + 1;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int ii;<NEW_LINE>boolean bSave = false;<NEW_LINE>boolean bScouter = false;<NEW_LINE>List<String> stack = new ArrayList<String>();<NEW_LINE>for (i = startIndex; i < size; i++) {<NEW_LINE>value = dumpList.get(i);<NEW_LINE>if (value.length() == 0) {<NEW_LINE>if (bSave && stack.size() > 1) {<NEW_LINE>for (ii = 0; ii < stack.size(); ii++) {<NEW_LINE>stackBuffer.append(stack.get(<MASK><NEW_LINE>}<NEW_LINE>stackBuffer.append(lineSeparator);<NEW_LINE>}<NEW_LINE>stack.clear();<NEW_LINE>bSave = false;<NEW_LINE>bScouter = false;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (stack.size() == 0 && !bScouter) {<NEW_LINE>if (value.indexOf("Scouter-") >= 0) {<NEW_LINE>bScouter = true;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (bScouter) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>stack.add(value);<NEW_LINE>if (!bSave) {<NEW_LINE>if (filters == null) {<NEW_LINE>bSave = true;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (ii = 0; ii < filters.length; ii++) {<NEW_LINE>if (value.indexOf(filters[ii]) >= 0) {<NEW_LINE>bSave = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (bSave && stack.size() > 1) {<NEW_LINE>for (ii = 0; ii < stack.size(); ii++) {<NEW_LINE>stackBuffer.append(stack.get(ii)).append(lineSeparator);<NEW_LINE>}<NEW_LINE>stackBuffer.append(lineSeparator);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return stackBuffer.toString();<NEW_LINE>} | ii)).append(lineSeparator); |
713,914 | public MetaView build(DashboardBuilder dashboardBuilder) {<NEW_LINE>log.debug("Processing dashboard: {}", dashboardBuilder.getName());<NEW_LINE>log.debug("Dashlet list: {}", dashboardBuilder.getDashletBuilderList());<NEW_LINE>if (dashboardBuilder.getDashletBuilderList() == null || dashboardBuilder.getDashletBuilderList().isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Dashboard dashboard = new Dashboard();<NEW_LINE><MASK><NEW_LINE>dashboard.setTitle(dashboardBuilder.getTitle());<NEW_LINE>dashboard.setName(dashboardBuilder.getName());<NEW_LINE>List<AbstractWidget> dashlets = new ArrayList<AbstractWidget>();<NEW_LINE>dashboardBuilder.clearGeneratedActions();<NEW_LINE>for (DashletBuilder dashletBuilder : dashboardBuilder.getDashletBuilderList()) {<NEW_LINE>Dashlet dashlet = new Dashlet();<NEW_LINE>String name = null;<NEW_LINE>String model = null;<NEW_LINE>MetaView metaView = dashletBuilder.getMetaView();<NEW_LINE>MetaAction action = dashletBuilder.getAction();<NEW_LINE>String actionName = null;<NEW_LINE>if (metaView != null) {<NEW_LINE>name = metaView.getName();<NEW_LINE>model = metaView.getModel();<NEW_LINE>MetaAction metaAction = getAction(boardName, name, model, dashletBuilder);<NEW_LINE>actionName = metaAction.getName();<NEW_LINE>dashboardBuilder.addGeneratedAction(metaAction);<NEW_LINE>} else if (action != null) {<NEW_LINE>model = action.getModel();<NEW_LINE>actionName = action.getName();<NEW_LINE>}<NEW_LINE>dashlet.setAction(actionName);<NEW_LINE>dashlet.setHeight("350");<NEW_LINE>Integer colSpan = dashletBuilder.getColspan();<NEW_LINE>if (colSpan > 12) {<NEW_LINE>colSpan = 12;<NEW_LINE>} else if (colSpan <= 0) {<NEW_LINE>colSpan = 6;<NEW_LINE>}<NEW_LINE>dashlet.setColSpan(colSpan);<NEW_LINE>dashlets.add(dashlet);<NEW_LINE>}<NEW_LINE>if (dashlets.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>dashboard.setItems(dashlets);<NEW_LINE>MetaStore.clear();<NEW_LINE>return metaService.generateMetaView(dashboard);<NEW_LINE>} | String boardName = dashboardBuilder.getName(); |
1,777,806 | protected CaseElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, ActivityProcessor processor, BaseElement parentElement, Map<String, JsonNode> shapeMap, CmmnModel cmmnModel, CmmnJsonConverterContext converterContext, CmmnModelIdHelper cmmnModelIdHelper) {<NEW_LINE>SendEventServiceTask task = new SendEventServiceTask();<NEW_LINE>String eventKey = getPropertyValueAsString(PROPERTY_EVENT_REGISTRY_EVENT_KEY, elementNode);<NEW_LINE>if (StringUtils.isNotEmpty(eventKey)) {<NEW_LINE>task.setEventType(eventKey);<NEW_LINE>addFlowableExtensionElementWithValue("eventName", getPropertyValueAsString(PROPERTY_EVENT_REGISTRY_EVENT_NAME, elementNode), task);<NEW_LINE>CmmnModelJsonConverterUtil.convertJsonToInParameters(elementNode, task);<NEW_LINE>addFlowableExtensionElementWithValue("channelKey", getPropertyValueAsString(PROPERTY_EVENT_REGISTRY_CHANNEL_KEY, elementNode), task);<NEW_LINE>addFlowableExtensionElementWithValue("channelName", getPropertyValueAsString<MASK><NEW_LINE>addFlowableExtensionElementWithValue("channelType", getPropertyValueAsString(PROPERTY_EVENT_REGISTRY_CHANNEL_TYPE, elementNode), task);<NEW_LINE>addFlowableExtensionElementWithValue("channelDestination", getPropertyValueAsString(PROPERTY_EVENT_REGISTRY_CHANNEL_DESTINATION, elementNode), task);<NEW_LINE>}<NEW_LINE>return task;<NEW_LINE>} | (PROPERTY_EVENT_REGISTRY_CHANNEL_NAME, elementNode), task); |
715,316 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Application application = emc.flag(wi.getApplication(), Application.class);<NEW_LINE>if (null == application) {<NEW_LINE>throw new ExceptionEntityNotExist(wi.getApplication(), Application.class);<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, application)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson.getDistinguishedName());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(wi.getProcess())) {<NEW_LINE>Process process = emc.flag(wi.getProcess(), Process.class);<NEW_LINE>if (null == process) {<NEW_LINE>throw new ExceptionEntityNotExist(wi.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Mapping mapping = emc.flag(flag, Mapping.class);<NEW_LINE>Wi.copier.copy(wi, mapping);<NEW_LINE>this.empty(mapping);<NEW_LINE>this.duplicate(business, mapping);<NEW_LINE>try {<NEW_LINE>Class.forName(DynamicEntity.CLASS_PACKAGE + "." + mapping.getTableName());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ExceptionDynamicClassNotExist(mapping.getTableName());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>gson.fromJson(mapping.getData(), new TypeToken<List<Mapping.Item>>() {<NEW_LINE>}.getType());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ExceptionDataError();<NEW_LINE>}<NEW_LINE>emc.beginTransaction(Mapping.class);<NEW_LINE>emc.check(mapping, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(Mapping.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(mapping.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | getProcess(), Process.class); |
1,674,477 | public ExpressionProtos.Expression visitConCall(ConCallExpression expr, Void params) {<NEW_LINE>ExpressionProtos.Expression.ConCalls.Builder builders = ExpressionProtos.Expression.ConCalls.newBuilder();<NEW_LINE>while (true) {<NEW_LINE>ExpressionProtos.Expression.ConCall.Builder builder = ExpressionProtos.Expression.ConCall.newBuilder();<NEW_LINE>builder.setConstructorRef(myCallTargetIndexProvider.getDefIndex(expr.getDefinition()));<NEW_LINE>builder.setRecursiveParam(expr.<MASK><NEW_LINE>builder.setLevels(writeLevels(expr.getLevels(), expr.getDefinition()));<NEW_LINE>for (Expression arg : expr.getDataTypeArguments()) {<NEW_LINE>builder.addDatatypeArgument(arg.accept(this, null));<NEW_LINE>}<NEW_LINE>int recursiveParam = expr.getDefinition().getRecursiveParameter();<NEW_LINE>List<Expression> defCallArgs = expr.getDefCallArguments();<NEW_LINE>for (int i = 0; i < defCallArgs.size(); i++) {<NEW_LINE>Expression arg = defCallArgs.get(i);<NEW_LINE>if (i == recursiveParam) {<NEW_LINE>if (!(arg instanceof ConCallExpression)) {<NEW_LINE>recursiveParam = -1;<NEW_LINE>} else {<NEW_LINE>expr = (ConCallExpression) arg;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (i != recursiveParam) {<NEW_LINE>builder.addArgument(arg.accept(this, null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builders.addConCall(builder);<NEW_LINE>if (recursiveParam < 0 || defCallArgs.isEmpty()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ExpressionProtos.Expression.newBuilder().setConCalls(builders).build();<NEW_LINE>} | getDefinition().getRecursiveParameter()); |
1,219,364 | public void afterPropertiesSet() throws Exception {<NEW_LINE>providers.clear();<NEW_LINE>addLdapProvider();<NEW_LINE>addSamlProviders();<NEW_LINE>addOauthProviders();<NEW_LINE>addKeystoneProvider();<NEW_LINE>String zoneId = IdentityZone.getUaaZoneId();<NEW_LINE>for (IdentityProviderWrapper wrapper : providers) {<NEW_LINE>IdentityProvider provider = wrapper.getProvider();<NEW_LINE>if (getOriginsToDelete().contains(provider.getOriginKey())) {<NEW_LINE>// dont process origins slated for deletion<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>IdentityProvider existing = getProviderByOriginIgnoreActiveFlag(provider.getOriginKey(), zoneId);<NEW_LINE>provider.setIdentityZoneId(zoneId);<NEW_LINE>if (existing == null) {<NEW_LINE>provisioning.create(provider, zoneId);<NEW_LINE>} else if (wrapper.isOverride()) {<NEW_LINE>provider.setId(existing.getId());<NEW_LINE>provider.setCreated(existing.getCreated());<NEW_LINE>provider.<MASK><NEW_LINE>provider.setLastModified(new Date(System.currentTimeMillis()));<NEW_LINE>provisioning.update(provider, zoneId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updateDefaultZoneUaaIDP();<NEW_LINE>} | setVersion(existing.getVersion()); |
1,578,729 | public void visitThread(ThreadsInfo thread) {<NEW_LINE>Extension frameworkThread = m_statusInfo.findOrCreateExtension("FrameworkThread");<NEW_LINE>ThreadMXBean bean = ManagementFactory.getThreadMXBean();<NEW_LINE>bean.setThreadContentionMonitoringEnabled(true);<NEW_LINE>ThreadInfo[] threads;<NEW_LINE>if (m_dumpLocked) {<NEW_LINE>threads = bean.dumpAllThreads(true, true);<NEW_LINE>} else {<NEW_LINE>threads = bean.dumpAllThreads(false, false);<NEW_LINE>}<NEW_LINE>thread.setCount(bean.getThreadCount());<NEW_LINE>thread.setDaemonCount(bean.getDaemonThreadCount());<NEW_LINE>thread.setPeekCount(bean.getPeakThreadCount());<NEW_LINE>thread.setTotalStartedCount((int) bean.getTotalStartedThreadCount());<NEW_LINE>int jbossThreadsCount = countThreadsByPrefix(threads, "http-", "catalina-exec-");<NEW_LINE>int jettyThreadsCount = countThreadsBySubstring(threads, "@qtp");<NEW_LINE>m_jstackInfo = getThreadDump(threads);<NEW_LINE>frameworkThread.findOrCreateExtensionDetail("HttpThread"<MASK><NEW_LINE>frameworkThread.findOrCreateExtensionDetail("CatThread").setValue(countThreadsByPrefix(threads, "Cat-"));<NEW_LINE>frameworkThread.findOrCreateExtensionDetail("PigeonThread").setValue(countThreadsByPrefix(threads, "Pigeon-", "DPSF-", "Netty-", "Client-ResponseProcessor"));<NEW_LINE>frameworkThread.findOrCreateExtensionDetail("ActiveThread").setValue(bean.getThreadCount());<NEW_LINE>frameworkThread.findOrCreateExtensionDetail("StartedThread").setValue(bean.getTotalStartedThreadCount());<NEW_LINE>m_statusInfo.addExtension(frameworkThread);<NEW_LINE>} | ).setValue(jbossThreadsCount + jettyThreadsCount); |
762,166 | private SessionRepresentation createSessionRepresentation(UserSessionModel s, DeviceRepresentation device) {<NEW_LINE>SessionRepresentation sessionRep = new SessionRepresentation();<NEW_LINE>sessionRep.setId(s.getId());<NEW_LINE>sessionRep.setIpAddress(s.getIpAddress());<NEW_LINE>sessionRep.setStarted(s.getStarted());<NEW_LINE>sessionRep.<MASK><NEW_LINE>sessionRep.setExpires(s.getStarted() + realm.getSsoSessionMaxLifespan());<NEW_LINE>sessionRep.setBrowser(device.getBrowser());<NEW_LINE>if (isCurrentSession(s)) {<NEW_LINE>sessionRep.setCurrent(true);<NEW_LINE>}<NEW_LINE>sessionRep.setClients(new LinkedList());<NEW_LINE>for (String clientUUID : s.getAuthenticatedClientSessions().keySet()) {<NEW_LINE>ClientModel client = realm.getClientById(clientUUID);<NEW_LINE>ClientRepresentation clientRep = new ClientRepresentation();<NEW_LINE>clientRep.setClientId(client.getClientId());<NEW_LINE>clientRep.setClientName(client.getName());<NEW_LINE>sessionRep.getClients().add(clientRep);<NEW_LINE>}<NEW_LINE>return sessionRep;<NEW_LINE>} | setLastAccess(s.getLastSessionRefresh()); |
24,226 | public SpringProcessLiveData retrieveLiveData(JMXConnector jmxConnector, String processID, String processName, String urlScheme, String host, String contextPath, String port, SpringProcessLiveData currentData) {<NEW_LINE>try {<NEW_LINE>MBeanServerConnection connection = jmxConnector.getMBeanServerConnection();<NEW_LINE>String domain = getDomainForActuator(connection);<NEW_LINE>String environment = getEnvironment(connection, domain);<NEW_LINE>String[] activeProfiles = getActiveProfiles(connection, environment);<NEW_LINE>LiveProperties properties = getProperties(connection, environment);<NEW_LINE>if (processID == null) {<NEW_LINE>processID = getProcessID(connection);<NEW_LINE>}<NEW_LINE>if (processName == null) {<NEW_LINE>Properties systemProperties = getSystemProperties(connection);<NEW_LINE>if (systemProperties != null) {<NEW_LINE>String javaCommand = getJavaCommand(systemProperties);<NEW_LINE>processName = getProcessName(javaCommand);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LiveConditional[] conditionals = getConditionals(connection, domain, processID, processName);<NEW_LINE>LiveRequestMapping[] requestMappings = getRequestMappings(connection, domain);<NEW_LINE>LiveBeansModel <MASK><NEW_LINE>LiveMetricsModel metrics = getMetrics(connection, domain);<NEW_LINE>StartupMetricsModel startup = getStartupMetrics(connection, domain, currentData == null ? null : currentData.getStartupMetrics());<NEW_LINE>if (contextPath == null) {<NEW_LINE>contextPath = getContextPath(connection, domain, environment);<NEW_LINE>}<NEW_LINE>if (port == null) {<NEW_LINE>port = getPort(connection, environment);<NEW_LINE>}<NEW_LINE>return new SpringProcessLiveData(processName, processID, contextPath, urlScheme, port, host, beans, activeProfiles, requestMappings, conditionals, properties, metrics, startup);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("error reading live data from: " + processID + " - " + processName, e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | beans = getBeans(connection, domain); |
1,325,262 | private Mono<PagedResponse<FirewallRuleInner>> listByServerSinglePageAsync(String resourceGroupName, String serverName, 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 (serverName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2017-12-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
564,902 | public void add(AsmMemoryOperand dst, int imm) {<NEW_LINE>int code;<NEW_LINE>if (dst.size == MemoryOperandSize.QWORD) {<NEW_LINE>code = imm >= -0x80 && imm <= 0x7F ? Code.ADD_RM64_IMM8 : Code.ADD_RM64_IMM32;<NEW_LINE>} else if (dst.size == MemoryOperandSize.DWORD) {<NEW_LINE>code = imm >= -0x80 && imm <= 0x7F ? Code.ADD_RM32_IMM8 : Code.ADD_RM32_IMM32;<NEW_LINE>} else if (dst.size == MemoryOperandSize.WORD) {<NEW_LINE>code = imm >= -0x80 && imm <= 0x7F <MASK><NEW_LINE>} else if (dst.size == MemoryOperandSize.BYTE) {<NEW_LINE>code = Code.ADD_RM8_IMM8;<NEW_LINE>} else {<NEW_LINE>throw noOpCodeFoundFor(Mnemonic.ADD, dst, imm);<NEW_LINE>}<NEW_LINE>addInstruction(Instruction.create(code, dst.toMemoryOperand(getBitness()), imm));<NEW_LINE>} | ? Code.ADD_RM16_IMM8 : Code.ADD_RM16_IMM16; |
1,565,580 | private static void tryAssertion56(RegressionEnvironment env, String stmtText, String outputLimit, AtomicInteger milestone) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>String[] fields = new String[] { "symbol", "sum(price)" };<NEW_LINE>ResultAssertTestResult expected = new ResultAssertTestResult(CATEGORY, outputLimit, fields);<NEW_LINE>expected.addResultInsert(1200, 0, new Object[][] { { "IBM", 25d }, { "MSFT", 34d } });<NEW_LINE>expected.addResultInsert(2200, 0, new Object[][] { { "IBM", 58d }, { "YAH", 59d }, { "IBM", 85d } });<NEW_LINE>expected.addResultInsRem(<MASK><NEW_LINE>expected.addResultInsert(4200, 0, new Object[][] { { "YAH", 87d } });<NEW_LINE>expected.addResultInsert(5200, 0, new Object[][] { { "IBM", 109d }, { "YAH", 112d } });<NEW_LINE>expected.addResultInsRem(6200, 0, new Object[][] { { "YAH", 88d } }, new Object[][] { { "IBM", 87d } });<NEW_LINE>expected.addResultRemove(7200, 0, new Object[][] { { "MSFT", 79d }, { "IBM", 54d }, { "YAH", 54d } });<NEW_LINE>ResultAssertExecution execution = new ResultAssertExecution(stmtText, env, expected);<NEW_LINE>execution.execute(false, milestone);<NEW_LINE>} | 3200, 0, null, null); |
358,833 | public ScimGroupExternalMember unmapExternalGroup(final String groupId, final String externalGroup, final String origin, final String zoneId) throws ScimResourceNotFoundException {<NEW_LINE>ScimGroup group = scimGroupProvisioning.retrieve(groupId, zoneId);<NEW_LINE>ScimGroupExternalMember result = getExternalGroupMap(<MASK><NEW_LINE>if (null != group && null != result) {<NEW_LINE>int count = jdbcTemplate.update(DELETE_EXTERNAL_GROUP_MAPPING_SQL, ps -> {<NEW_LINE>ps.setString(1, groupId);<NEW_LINE>ps.setString(2, externalGroup);<NEW_LINE>ps.setString(3, origin);<NEW_LINE>ps.setString(4, zoneId);<NEW_LINE>});<NEW_LINE>if (count == 1) {<NEW_LINE>return result;<NEW_LINE>} else if (count == 0) {<NEW_LINE>throw new ScimResourceNotFoundException("No group mappings deleted.");<NEW_LINE>} else {<NEW_LINE>throw new InvalidResultSetAccessException("More than one mapping deleted count=" + count, new SQLException());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | groupId, externalGroup, origin, zoneId); |
867,401 | private JPanel content() {<NEW_LINE>JPanel panel = new JPanel(new BorderLayout());<NEW_LINE>panel.setOpaque(false);<NEW_LINE>panel.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));<NEW_LINE>JPanel header = new JPanel(new FlowLayout(FlowLayout.LEADING, 5, 5));<NEW_LINE>header.setOpaque(false);<NEW_LINE>header.add(new JLabel(MessageUtils.getLocalizedMessage("documents.stored.label.stored_value")));<NEW_LINE>header.add(new JLabel(field));<NEW_LINE>panel.add(header, BorderLayout.PAGE_START);<NEW_LINE>JTextArea valueTA = new JTextArea(value);<NEW_LINE>valueTA.setLineWrap(true);<NEW_LINE>valueTA.setEditable(false);<NEW_LINE>valueTA.setBackground(Color.white);<NEW_LINE>JScrollPane scrollPane = new JScrollPane(valueTA);<NEW_LINE>panel.add(scrollPane, BorderLayout.CENTER);<NEW_LINE>JPanel footer = new JPanel(new FlowLayout(FlowLayout.TRAILING, 5, 5));<NEW_LINE>footer.setOpaque(false);<NEW_LINE>JButton copyBtn = new JButton(FontUtils.elegantIconHtml("", MessageUtils.getLocalizedMessage("button.copy")));<NEW_LINE>copyBtn.setMargin(new Insets(3, 3, 3, 3));<NEW_LINE>copyBtn.addActionListener(e -> {<NEW_LINE>Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();<NEW_LINE>StringSelection selection = new StringSelection(value);<NEW_LINE>clipboard.setContents(selection, null);<NEW_LINE>});<NEW_LINE>footer.add(copyBtn);<NEW_LINE>JButton closeBtn = new JButton(MessageUtils.getLocalizedMessage("button.close"));<NEW_LINE>closeBtn.setMargin(new Insets(3<MASK><NEW_LINE>closeBtn.addActionListener(e -> dialog.dispose());<NEW_LINE>footer.add(closeBtn);<NEW_LINE>panel.add(footer, BorderLayout.PAGE_END);<NEW_LINE>return panel;<NEW_LINE>} | , 3, 3, 3)); |
134,891 | private Flux<?> prepareFluxResult(Message<?> message, Object result) {<NEW_LINE>int sequenceSize = 1;<NEW_LINE>Flux<?> flux = Flux.just(result);<NEW_LINE>if (result instanceof Iterable<?>) {<NEW_LINE>Iterable<Object> iterable = (Iterable<Object>) result;<NEW_LINE>sequenceSize = obtainSizeIfPossible(iterable);<NEW_LINE>flux = Flux.fromIterable(iterable);<NEW_LINE>} else if (result.getClass().isArray()) {<NEW_LINE>Object[] items = ObjectUtils.toObjectArray(result);<NEW_LINE>sequenceSize = items.length;<NEW_LINE>flux = Flux.fromArray(items);<NEW_LINE>} else if (result instanceof Iterator<?>) {<NEW_LINE>Iterator<Object> iter = (Iterator<Object>) result;<NEW_LINE>sequenceSize = obtainSizeIfPossible(iter);<NEW_LINE>flux = Flux.fromIterable(() -> iter);<NEW_LINE>} else if (result instanceof Stream<?>) {<NEW_LINE>Stream<Object> stream = ((Stream<Object>) result);<NEW_LINE>sequenceSize = 0;<NEW_LINE>flux = Flux.fromStream(stream);<NEW_LINE>} else if (result instanceof Publisher<?>) {<NEW_LINE>Publisher<Object> publisher = (Publisher<Object>) result;<NEW_LINE>sequenceSize = 0;<NEW_LINE>flux = Flux.from(publisher);<NEW_LINE>}<NEW_LINE>Function<Object, ?> <MASK><NEW_LINE>return flux.map(messageBuilderFunction).switchIfEmpty(Mono.defer(() -> {<NEW_LINE>MessageChannel discardingChannel = getDiscardChannel();<NEW_LINE>if (discardingChannel != null) {<NEW_LINE>this.messagingTemplate.send(discardingChannel, message);<NEW_LINE>}<NEW_LINE>return Mono.empty();<NEW_LINE>}));<NEW_LINE>} | messageBuilderFunction = prepareMessageBuilderFunction(message, sequenceSize); |
710,660 | private Map<String, ShapeModel> addEmptyOutputShapes(Map<String, OperationModel> currentOperations) {<NEW_LINE>final Map<String, Operation> operations = serviceModel.getOperations();<NEW_LINE>final Map<String, ShapeModel> emptyOutputShapes = new HashMap<>();<NEW_LINE>for (Map.Entry<String, Operation> entry : operations.entrySet()) {<NEW_LINE>String operationName = entry.getKey();<NEW_LINE>Operation operation = entry.getValue();<NEW_LINE>Output output = operation.getOutput();<NEW_LINE>if (output == null) {<NEW_LINE>final String outputShape = namingStrategy.getResponseClassName(operationName);<NEW_LINE>final OperationModel operationModel = currentOperations.get(operationName);<NEW_LINE>operationModel.setReturnType(new ReturnTypeModel(outputShape));<NEW_LINE>ShapeModel shape = new ShapeModel(outputShape).withType(<MASK><NEW_LINE>shape.setShapeName(outputShape);<NEW_LINE>final VariableModel outputVariable = new VariableModel(namingStrategy.getVariableName(outputShape), outputShape);<NEW_LINE>shape.setVariable(outputVariable);<NEW_LINE>shape.setUnmarshaller(new ShapeUnmarshaller());<NEW_LINE>emptyOutputShapes.put(outputShape, shape);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return emptyOutputShapes;<NEW_LINE>} | ShapeType.Response.getValue()); |
1,813,054 | // snippet-start:[sqs.java2.list_tags.main]<NEW_LINE>public static void listTags(SqsClient sqsClient, String queueName) {<NEW_LINE>try {<NEW_LINE>GetQueueUrlRequest urlRequest = GetQueueUrlRequest.builder().queueName(queueName).build();<NEW_LINE>GetQueueUrlResponse <MASK><NEW_LINE>String queueUrl = getQueueUrlResponse.queueUrl();<NEW_LINE>ListQueueTagsRequest listQueueTagsRequest = ListQueueTagsRequest.builder().queueUrl(queueUrl).build();<NEW_LINE>ListQueueTagsResponse listQueueTagsResponse = sqsClient.listQueueTags(listQueueTagsRequest);<NEW_LINE>System.out.println(String.format("ListQueueTags: \tTags for queue %s are %s.\n", queueName, listQueueTagsResponse.tags()));<NEW_LINE>} catch (SqsException e) {<NEW_LINE>System.err.println(e.awsErrorDetails().errorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>} | getQueueUrlResponse = sqsClient.getQueueUrl(urlRequest); |
1,091,685 | public void paintControl(PaintEvent e) {<NEW_LINE>if (!VrapperPlugin.isVrapperEnabled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StyledText text = textViewer.getTextWidget();<NEW_LINE>// Never move caret somewhere else in Insert / Select mode<NEW_LINE>if (text.getSelectionCount() == 0 || (vrapperModeRecorder.getCurrentMode() instanceof InsertMode)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Forces caret visibility for blockwise mode: normally it is disabled all the time.<NEW_LINE>// Regular visual modes should have it visible anyway.<NEW_LINE>text.<MASK><NEW_LINE>Position to = getSelection().getTo();<NEW_LINE>boolean isInclusive = Selection.INCLUSIVE.equals(configuration.get(Options.SELECTION));<NEW_LINE>int offset = to.getViewOffset();<NEW_LINE>int documentLength = textViewer.getDocument().getLength();<NEW_LINE>// Selection is on some character in a fold or file is empty?<NEW_LINE>if (offset < 0) {<NEW_LINE>VrapperLog.debug("In a fold");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Fix caret position for last character in the file - selection.to might not be correct<NEW_LINE>if (documentLength > 0 && documentLength == to.getModelOffset() && isInclusive) {<NEW_LINE>offset--;<NEW_LINE>}<NEW_LINE>Point visualOffset = text.getLocationAtOffset(offset);<NEW_LINE>text.getCaret().setLocation(visualOffset);<NEW_LINE>} | getCaret().setVisible(true); |
1,547,792 | public void initView(int sketchWidth, int sketchHeight, boolean parentSize, LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>// https://www.bignerdranch.com/blog/understanding-androids-layoutinflater-inflate/<NEW_LINE>ViewGroup rootView = (ViewGroup) inflater.inflate(sketch.parentLayout, container, false);<NEW_LINE>View view = getSurfaceView();<NEW_LINE>if (parentSize) {<NEW_LINE>LinearLayout.LayoutParams lp;<NEW_LINE>lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);<NEW_LINE>lp.weight = 1.0f;<NEW_LINE>lp.setMargins(0, 0, 0, 0);<NEW_LINE>view.setPadding(0, 0, 0, 0);<NEW_LINE>rootView.addView(view, lp);<NEW_LINE>} else {<NEW_LINE>RelativeLayout layout = new RelativeLayout(activity);<NEW_LINE>RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>lp.addRule(RelativeLayout.CENTER_IN_PARENT);<NEW_LINE>layout.<MASK><NEW_LINE>rootView.addView(layout, lp);<NEW_LINE>}<NEW_LINE>rootView.setBackgroundColor(sketch.sketchWindowColor());<NEW_LINE>setRootView(rootView);<NEW_LINE>} | addView(view, sketchWidth, sketchHeight); |
1,720,856 | public static double calculateSOR(final int[][] table) {<NEW_LINE>final double t00 = table[0][0] + PSEUDOCOUNT;<NEW_LINE>final double t01 = table[0][1] + PSEUDOCOUNT;<NEW_LINE>final double t11 = table[1][1] + PSEUDOCOUNT;<NEW_LINE>final double t10 = table[1][0] + PSEUDOCOUNT;<NEW_LINE>final double ratio = (t00 / t01) * (t11 / t10) + (t01 / <MASK><NEW_LINE>final double refRatio = min(t00, t01) / max(t00, t01);<NEW_LINE>final double altRatio = min(t10, t11) / max(t10, t11);<NEW_LINE>return Math.log(ratio) + Math.log(refRatio) - Math.log(altRatio);<NEW_LINE>} | t00) * (t10 / t11); |
1,838,906 | public void executeFrameWithDeltaTime(float deltaTime, PhysicsObject physicsObject) {<NEW_LINE>if (!isWithinInfluence()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float dx = this.target.getTranslationX() - this.anchorPoint.x;<NEW_LINE>float dy = this.target.getTranslationY() - this.anchorPoint.y;<NEW_LINE>double dr = Math.sqrt(dx * dx + dy * dy);<NEW_LINE>if (dr == 0.0)<NEW_LINE>return;<NEW_LINE>double a = (-this.strength * dr * Math.exp(-0.5f * (dr * dr) / (this.falloff * this.falloff))) / physicsObject.mass;<NEW_LINE>double ax = dx / dr * a;<NEW_LINE>float vx = (float) (physicsObject.<MASK><NEW_LINE>double ay = dy / dr * a;<NEW_LINE>float vy = (float) (physicsObject.velocity.y + deltaTime * ay);<NEW_LINE>// Log.d("InteractableView"," PhysicsGravityWellBehavior executeFrameWithDeltaTime: " + deltaTime<NEW_LINE>// + " vx = " + vx + " cur vx = " + physicsObject.velocity.x);<NEW_LINE>physicsObject.velocity = new PointF(vx, vy);<NEW_LINE>} | velocity.x + deltaTime * ax); |
551,874 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>beforeApiCall(request, response);<NEW_LINE>String path = request.getPathInfo();<NEW_LINE>if (path == null) {<NEW_LINE>path = request.getServletPath();<NEW_LINE>}<NEW_LINE>boolean develMode = CBApplication.getInstance().isDevelMode();<NEW_LINE>if (path.contentEquals("/schema.json") && develMode) {<NEW_LINE>executeQuery(request, response, <MASK><NEW_LINE>} else if (path.contentEquals("/console") && develMode) {<NEW_LINE>try (InputStream consolePageStream = WebServiceUtils.openStaticResource("static/graphiql/index.html")) {<NEW_LINE>IOUtils.copyStream(consolePageStream, response.getOutputStream());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String query = request.getParameter("query");<NEW_LINE>if (query != null) {<NEW_LINE>executeQuery(request, response, query, null, request.getParameter("operationName"));<NEW_LINE>} else {<NEW_LINE>response.sendError(400, "Bad GET request");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | GraphQLConstants.SCHEMA_READ_QUERY, null, null); |
555,020 | Object doCached(PolyglotLanguageContext languageContext, Object function, Object[] functionArgs, Class<?> resultClass, Type resultType, @CachedLibrary("function") InteropLibrary interop, @Cached PolyglotToHostNode toHost, @Cached ConditionProfile executableCondition, @Cached ConditionProfile instantiableCondition, @Cached BranchProfile unsupportedError, @Cached BranchProfile arityError, @Cached BranchProfile unsupportedArgumentError) {<NEW_LINE>Object result;<NEW_LINE>boolean executable = executableCondition.profile(interop.isExecutable(function));<NEW_LINE>try {<NEW_LINE>if (executable) {<NEW_LINE>result = interop.execute(function, functionArgs);<NEW_LINE>} else if (instantiableCondition.profile(interop.isInstantiable(function))) {<NEW_LINE>result = interop.instantiate(function, functionArgs);<NEW_LINE>} else {<NEW_LINE>throw PolyglotInteropErrors.executeUnsupported(languageContext, function);<NEW_LINE>}<NEW_LINE>} catch (UnsupportedTypeException e) {<NEW_LINE>unsupportedArgumentError.enter();<NEW_LINE>if (executable) {<NEW_LINE>throw PolyglotInteropErrors.invalidExecuteArgumentType(languageContext, function, functionArgs);<NEW_LINE>} else {<NEW_LINE>throw PolyglotInteropErrors.invalidInstantiateArgumentType(languageContext, function, functionArgs);<NEW_LINE>}<NEW_LINE>} catch (ArityException e) {<NEW_LINE>arityError.enter();<NEW_LINE>if (executable) {<NEW_LINE>throw PolyglotInteropErrors.invalidExecuteArity(languageContext, function, functionArgs, e.getExpectedMinArity(), e.getExpectedMaxArity(), e.getActualArity());<NEW_LINE>} else {<NEW_LINE>throw PolyglotInteropErrors.invalidInstantiateArity(languageContext, function, functionArgs, e.getExpectedMinArity(), e.getExpectedMaxArity(), e.getActualArity());<NEW_LINE>}<NEW_LINE>} catch (UnsupportedMessageException e) {<NEW_LINE>unsupportedError.enter();<NEW_LINE>throw <MASK><NEW_LINE>}<NEW_LINE>return toHost.execute(languageContext, result, resultClass, resultType);<NEW_LINE>} | PolyglotInteropErrors.executeUnsupported(languageContext, function); |
317,942 | public String generateContent(AlertEntity alert) {<NEW_LINE>Map<Object, Object> datas = new HashMap<Object, Object>();<NEW_LINE>String[] fields = alert.getMetric().split("-");<NEW_LINE>datas.put("domain", alert.getGroup());<NEW_LINE>datas.put("type", fields[0]);<NEW_LINE>datas.put("name", fields[1]);<NEW_LINE>datas.put("content", alert.getContent());<NEW_LINE>datas.put("date", m_format.format(alert.getDate()));<NEW_LINE>datas.put("linkDate", m_linkFormat.format<MASK><NEW_LINE>StringWriter sw = new StringWriter(5000);<NEW_LINE>try {<NEW_LINE>Template t = m_configuration.getTemplate("transactionAlert.ftl");<NEW_LINE>t.process(datas, sw);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Cat.logError("build front end content error:" + alert.toString(), e);<NEW_LINE>}<NEW_LINE>return sw.toString();<NEW_LINE>} | (alert.getDate())); |
578,315 | protected void startDragging() {<NEW_LINE>beginDragDividerLocation = getDividerLocation(splitPane);<NEW_LINE>if (getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {<NEW_LINE>setLastDragLocation(divider.getBounds().x);<NEW_LINE>dividerSize <MASK><NEW_LINE>if (!isContinuousLayout()) {<NEW_LINE>final Rectangle border = BoundsType.border.bounds(splitPane);<NEW_LINE>getNonContinuousLayoutDivider().setBounds(getLastDragLocation(), border.y, dividerSize, border.height);<NEW_LINE>addHeavyweightDivider();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>setLastDragLocation(divider.getBounds().y);<NEW_LINE>dividerSize = divider.getSize().height;<NEW_LINE>if (!isContinuousLayout()) {<NEW_LINE>final Rectangle border = BoundsType.border.bounds(splitPane);<NEW_LINE>getNonContinuousLayoutDivider().setBounds(border.x, getLastDragLocation(), border.width, dividerSize);<NEW_LINE>addHeavyweightDivider();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = divider.getSize().width; |
168,807 | public static void addProblemToCompilationResult(char[] fileNameArray, CompilationResult result, boolean isWarning, String message, int sourceStart, int sourceEnd) {<NEW_LINE>if (result == null)<NEW_LINE>return;<NEW_LINE>if (fileNameArray == null)<NEW_LINE>fileNameArray = "(unknown).java".toCharArray();<NEW_LINE>int lineNumber = 0;<NEW_LINE>int columnNumber = 1;<NEW_LINE>int[] lineEnds = null;<NEW_LINE>lineNumber = sourceStart >= 0 ? Util.getLineNumber(sourceStart, lineEnds = result.getLineSeparatorPositions(), 0, lineEnds.length - 1) : 0;<NEW_LINE>columnNumber = sourceStart >= 0 ? Util.searchColumnNumber(result.getLineSeparatorPositions(), lineNumber, sourceStart) : 0;<NEW_LINE>CategorizedProblem ecProblem = new LombokProblem(fileNameArray, message, 0, new String[0], isWarning ? ProblemSeverities.Warning : ProblemSeverities.Error, <MASK><NEW_LINE>result.record(ecProblem, null);<NEW_LINE>} | sourceStart, sourceEnd, lineNumber, columnNumber); |
774,549 | public void testSelfCancelingTaskSuspendTransaction(PrintWriter out) throws Exception {<NEW_LINE>// Cancel on the third update<NEW_LINE>SelfCancelingTask task = new SelfCancelingTask("testSelfCancelingTaskSuspendTransaction", 3, false);<NEW_LINE>task.getExecutionProperties().put(ManagedTask.TRANSACTION, ManagedTask.SUSPEND);<NEW_LINE>// Run up to 6 times, but we should cancel at 3<NEW_LINE>Trigger trigger = new FixedRepeatTrigger(6, 33);<NEW_LINE>TaskStatus<Integer> status = scheduler.schedule((Callable<Integer>) task, trigger);<NEW_LINE>for (long start = System.nanoTime(); status.getNextExecutionTime() != null && System.nanoTime() - start < TIMEOUT_NS; Thread.sleep(POLL_INTERVAL)) status = scheduler.getStatus(status.getTaskId());<NEW_LINE>if (!status.isCancelled())<NEW_LINE>throw new Exception("Task was not canceled. " + status);<NEW_LINE>pollForTableEntry("testSelfCancelingTaskSuspendTransaction", 3);<NEW_LINE>try {<NEW_LINE>Integer result = status.get();<NEW_LINE>throw new Exception(<MASK><NEW_LINE>} catch (CancellationException x) {<NEW_LINE>}<NEW_LINE>} | "Should not be able to retrieve a result (" + result + ") from a canceled task. " + status); |
1,577,181 | public DataBuffer extraArgsDataBuff(DataType dtype) {<NEW_LINE>if (extraArgz != null)<NEW_LINE>return extraArgz;<NEW_LINE>if (extraArgs != null) {<NEW_LINE>if (Shape.isZ(dtype) || Shape.isB(dtype)) {<NEW_LINE>long[] extraz = new long[extraArgs.length];<NEW_LINE>for (int i = 0; i < extraArgs.length; i++) {<NEW_LINE>if (extraArgs[i] instanceof Number) {<NEW_LINE>Number arg <MASK><NEW_LINE>long val = arg.longValue();<NEW_LINE>extraz[i] = val;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>extraArgz = Nd4j.getConstantHandler().getConstantBuffer(extraz, dtype);<NEW_LINE>return extraArgz;<NEW_LINE>} else if (Shape.isR(dtype)) {<NEW_LINE>double[] extraz = new double[extraArgs.length];<NEW_LINE>for (int i = 0; i < extraArgs.length; i++) {<NEW_LINE>if (!(extraArgs[i] instanceof Number))<NEW_LINE>continue;<NEW_LINE>Number arg = (Number) extraArgs[i];<NEW_LINE>if (arg == null)<NEW_LINE>arg = 0.0;<NEW_LINE>double val = arg.doubleValue();<NEW_LINE>extraz[i] = val;<NEW_LINE>}<NEW_LINE>extraArgz = Nd4j.getConstantHandler().getConstantBuffer(extraz, dtype);<NEW_LINE>return extraArgz;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | = (Number) extraArgs[i]; |
1,377,571 | private static Resource generate(Set<Triple> paths, Collection<ReportEntry> entries, PrefixMapping prefixes) {<NEW_LINE>if (entries.isEmpty())<NEW_LINE>return reportConformsTrueResource();<NEW_LINE>Model model = ModelFactory.createDefaultModel();<NEW_LINE>model.setNsPrefix("rdf", RDF.getURI());<NEW_LINE>model.setNsPrefix("rdfs", RDFS.getURI());<NEW_LINE>model.setNsPrefix("xsd", XSD.getURI());<NEW_LINE>model.setNsPrefix(<MASK><NEW_LINE>if (prefixes != null)<NEW_LINE>model.setNsPrefixes(prefixes);<NEW_LINE>Resource report = model.createResource(SHACLM.ValidationReport);<NEW_LINE>entries.forEach(e -> e.generate(model, report));<NEW_LINE>paths.forEach(model.getGraph()::add);<NEW_LINE>report.addProperty(SHACLM.conforms, C.mFALSE);<NEW_LINE>return report;<NEW_LINE>} | "sh", SHACLM.getURI()); |
278,997 | public static void vertical(Kernel1D_S32 kernel, InterleavedU8 input, InterleavedI8 output) {<NEW_LINE>final int offset = kernel.getOffset();<NEW_LINE>final int width = input.getWidth();<NEW_LINE>final int height = input.getHeight();<NEW_LINE>final int numBands = input.getNumBands();<NEW_LINE>final int[<MASK><NEW_LINE>final int[] total = new int[numBands];<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>Arrays.fill(total, 0);<NEW_LINE>int weight = 0;<NEW_LINE>int startY = y - offset;<NEW_LINE>int endY = startY + kernel.getWidth();<NEW_LINE>if (startY < 0)<NEW_LINE>startY = 0;<NEW_LINE>if (endY > height)<NEW_LINE>endY = height;<NEW_LINE>for (int i = startY; i < endY; i++) {<NEW_LINE>int v = kernel.get(i - y + offset);<NEW_LINE>input.get(x, i, pixel);<NEW_LINE>for (int band = 0; band < numBands; band++) {<NEW_LINE>total[band] += pixel[band] * v;<NEW_LINE>}<NEW_LINE>weight += v;<NEW_LINE>}<NEW_LINE>for (int band = 0; band < numBands; band++) {<NEW_LINE>total[band] = (total[band] + weight / 2) / weight;<NEW_LINE>}<NEW_LINE>output.set(x, y, total);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ] pixel = new int[numBands]; |
1,019,249 | public String delete(@RequestAttribute SysSite site, Long id, @SessionAttribute SysUser user, String returnUrl, HttpServletRequest request, ModelMap model) {<NEW_LINE>Map<String, String> config = configComponent.getConfigData(site.getId(), Config.CONFIG_CODE_SITE);<NEW_LINE>String safeReturnUrl = config.get(LoginConfigComponent.CONFIG_RETURN_URL);<NEW_LINE>if (ControllerUtils.isUnSafeUrl(returnUrl, site, safeReturnUrl, request)) {<NEW_LINE>returnUrl = site.isUseStatic() ? site.getSitePath() : site.getDynamicPath();<NEW_LINE>}<NEW_LINE>CmsPlace entity = service.getEntity(id);<NEW_LINE>if (null != entity) {<NEW_LINE>String filePath = siteComponent.getWebTemplateFilePath(site, TemplateComponent.INCLUDE_DIRECTORY + entity.getPath());<NEW_LINE>CmsPlaceMetadata <MASK><NEW_LINE>if (ControllerUtils.verifyCustom("manage", CommonUtils.empty(metadata.getAdminIds()) || !ArrayUtils.contains(metadata.getAdminIds(), user.getId()), model) || ControllerUtils.verifyNotEquals("siteId", site.getId(), entity.getSiteId(), model)) {<NEW_LINE>} else {<NEW_LINE>service.delete(id);<NEW_LINE>logOperateService.save(new LogOperate(site.getId(), user.getId(), LogLoginService.CHANNEL_WEB, "delete.place", RequestUtils.getIpAddress(request), CommonUtils.getDate(), id.toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return UrlBasedViewResolver.REDIRECT_URL_PREFIX + returnUrl;<NEW_LINE>} | metadata = metadataComponent.getPlaceMetadata(filePath); |
616,463 | private static StatsResults stats$(DatasetGraphTDB dsg, Node gn) {<NEW_LINE>NodeTable nt = dsg.getTripleTable().getNodeTupleTable().getNodeTable();<NEW_LINE>StatsCollectorNodeId stats = new StatsCollectorNodeId(nt);<NEW_LINE>if (gn == null) {<NEW_LINE>Iterator<Tuple<NodeId>> iter = dsg.getTripleTable()<MASK><NEW_LINE>for (; iter.hasNext(); ) {<NEW_LINE>Tuple<NodeId> t = iter.next();<NEW_LINE>stats.record(null, t.get(0), t.get(1), t.get(2));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// If the union graph, then we need to scan all quads but with uniqueness.<NEW_LINE>boolean unionGraph = Quad.isUnionGraph(gn);<NEW_LINE>NodeId gnid = null;<NEW_LINE>if (!unionGraph) {<NEW_LINE>gnid = nt.getNodeIdForNode(gn);<NEW_LINE>if (NodeId.isDoesNotExist(gnid))<NEW_LINE>Log.warn(tdbstats.class, "No such graph: " + gn);<NEW_LINE>}<NEW_LINE>NodeTupleTable ntt = dsg.getQuadTable().getNodeTupleTable();<NEW_LINE>Iterator<Tuple<NodeId>> iter = unionGraph ? SolverLibTDB.unionGraph(ntt) : ntt.find(gnid, null, null, null);<NEW_LINE>for (; iter.hasNext(); ) {<NEW_LINE>Tuple<NodeId> t = iter.next();<NEW_LINE>stats.record(t.get(0), t.get(1), t.get(2), t.get(3));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return stats.results();<NEW_LINE>} | .getNodeTupleTable().findAll(); |
38,770 | private void logFindBeanSummary(CQuery<?> q) {<NEW_LINE>SpiQuery<?> query = q.getQueryRequest().query();<NEW_LINE>String loadMode = query.getLoadMode();<NEW_LINE>String loadDesc = query.getLoadDescription();<NEW_LINE>String lazyLoadProp = query.getLazyLoadProperty();<NEW_LINE>ObjectGraphNode node = query.getParentNode();<NEW_LINE>String originKey;<NEW_LINE>if (node == null || node.getOriginQueryPoint() == null) {<NEW_LINE>originKey = null;<NEW_LINE>} else {<NEW_LINE>originKey = node.getOriginQueryPoint().getKey();<NEW_LINE>}<NEW_LINE>StringBuilder msg = new StringBuilder(200);<NEW_LINE>msg.append("FindBean ");<NEW_LINE>if (loadMode != null) {<NEW_LINE>msg.append("mode[").append(loadMode).append("] ");<NEW_LINE>}<NEW_LINE>msg.append("type[").append(q.getBeanName()).append("] ");<NEW_LINE>if (query.isAutoTuned()) {<NEW_LINE>msg.append("tuned[true] ");<NEW_LINE>}<NEW_LINE>if (query.isAsDraft()) {<NEW_LINE>msg.append(" draft[true] ");<NEW_LINE>}<NEW_LINE>if (originKey != null) {<NEW_LINE>msg.append("origin[").append(originKey).append("] ");<NEW_LINE>}<NEW_LINE>if (lazyLoadProp != null) {<NEW_LINE>msg.append("lazyLoadProp[").append<MASK><NEW_LINE>}<NEW_LINE>if (loadDesc != null) {<NEW_LINE>msg.append("load[").append(loadDesc).append("] ");<NEW_LINE>}<NEW_LINE>msg.append("exeMicros[").append(q.getQueryExecutionTimeMicros());<NEW_LINE>msg.append("] rows[").append(q.getLoadedRowDetail());<NEW_LINE>msg.append("] bind[").append(q.getBindLog()).append("]");<NEW_LINE>q.getTransaction().logSummary(msg.toString());<NEW_LINE>} | (lazyLoadProp).append("] "); |
1,762,577 | public String backup(long batchId) {<NEW_LINE>try {<NEW_LINE>String hdfsCpDir = getRemoteCheckpointPath(batchId);<NEW_LINE>String batchCpPath = getLocalCheckpointPath(batchId);<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>// upload sst data files to hdfs<NEW_LINE>Collection<File> sstFiles = FileUtils.listFiles(new File(batchCpPath), new String[] { ROCKSDB_DATA_FILE_EXT }, false);<NEW_LINE>for (File sstFile : sstFiles) {<NEW_LINE>if (!lastCheckpointFiles.contains(sstFile.getName())) {<NEW_LINE>hdfsCache.copyToDfs(batchCpPath + "/" + sstFile.getName(), hdfsDbDir, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// upload sstFile.list, CURRENT, MANIFEST to hdfs<NEW_LINE>Collection<<MASK><NEW_LINE>File cpFileList = new File(batchCpPath + "/" + SST_FILE_LIST);<NEW_LINE>FileUtils.writeLines(cpFileList, sstFileList);<NEW_LINE>if (hdfsCache.exist(hdfsCpDir))<NEW_LINE>hdfsCache.remove(hdfsCpDir, true);<NEW_LINE>hdfsCache.mkdir(hdfsCpDir);<NEW_LINE>Collection<File> allFiles = FileUtils.listFiles(new File(batchCpPath), null, false);<NEW_LINE>allFiles.removeAll(sstFiles);<NEW_LINE>Collection<File> nonSstFiles = allFiles;<NEW_LINE>for (File nonSstFile : nonSstFiles) {<NEW_LINE>hdfsCache.copyToDfs(batchCpPath + "/" + nonSstFile.getName(), hdfsCpDir, true);<NEW_LINE>}<NEW_LINE>if (JStormMetrics.enabled)<NEW_LINE>hdfsWriteLatency.update(System.currentTimeMillis() - startTime);<NEW_LINE>lastCheckpointFiles = sstFileList;<NEW_LINE>return hdfsCpDir;<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error("Failed to upload checkpoint", e);<NEW_LINE>throw new RuntimeException(e.getMessage());<NEW_LINE>}<NEW_LINE>} | String> sstFileList = getFileList(sstFiles); |
330,842 | public void handleMessage(BrowserMessage message) {<NEW_LINE>String opid = message.getOperationId();<NEW_LINE>if (OP_COPY_TO_CLIPBOARD.equals(opid)) {<NEW_LINE><MASK><NEW_LINE>ClipboardCopy.copyToClipBoard(MapUtils.getMapString(decodedMap, "text", ""));<NEW_LINE>} else if (OP_BRING_TO_FRONT.equals(opid)) {<NEW_LINE>bringToFront();<NEW_LINE>} else if (OP_SHOW_DONATION_WINDOW.equals(opid)) {<NEW_LINE>Map decodedMap = message.getDecodedMap();<NEW_LINE>DonationWindow.open(true, MapUtils.getMapString(decodedMap, "source-ref", "RPC"));<NEW_LINE>} else if (OP_OPEN_SEARCH.equals(opid)) {<NEW_LINE>Map decodedMap = message.getDecodedMap();<NEW_LINE>UIFunctions uif = UIFunctionsManager.getUIFunctions();<NEW_LINE>if (uif != null) {<NEW_LINE>uif.doSearch(MapUtils.getMapString(decodedMap, "search-text", ""));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown operation: " + opid);<NEW_LINE>}<NEW_LINE>} | Map decodedMap = message.getDecodedMap(); |
759,122 | public String toXmlPartial(Object domainObject) {<NEW_LINE>bombIf(!isAnnotationPresent(domainObject.getClass(), ConfigTag.class), "Object " + domainObject + " does not have a ConfigTag");<NEW_LINE>Element element = elementFor(domainObject.getClass(), configCache);<NEW_LINE>write(<MASK><NEW_LINE>if (isAnnotationPresent(domainObject.getClass(), ConfigCollection.class) && domainObject instanceof Collection) {<NEW_LINE>for (Object item : (Collection) domainObject) {<NEW_LINE>if (isAnnotationPresent(item.getClass(), ConfigCollection.class) && item instanceof Collection) {<NEW_LINE>new ExplicitCollectionXmlFieldWithValue(domainObject.getClass(), null, (Collection) item, configCache, registry).populate(element);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Element childElement = elementFor(item.getClass(), configCache);<NEW_LINE>element.addContent(childElement);<NEW_LINE>write(item, childElement, configCache, registry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try (ByteArrayOutputStream output = new ByteArrayOutputStream(32 * 1024)) {<NEW_LINE>XmlUtils.writeXml(element, output);<NEW_LINE>return output.toString();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw bomb("Unable to write xml to String");<NEW_LINE>}<NEW_LINE>} | domainObject, element, configCache, registry); |
261,149 | public void establishCsAccessSourceSet() {<NEW_LINE>final SourceSetContainer sourceSets = (SourceSetContainer) project.getProperties().get("sourceSets");<NEW_LINE>final SourceSet mainSourceSet = sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME);<NEW_LINE>// Create the 'csaccess' source set<NEW_LINE>final SourceSet csaccessSourceSet = sourceSets.create(CSACCESS_SOURCESET_NAME);<NEW_LINE>csaccessSourceSet.setCompileClasspath(csaccessSourceSet.getCompileClasspath().plus(mainSourceSet.getOutput()));<NEW_LINE>csaccessSourceSet.setRuntimeClasspath(csaccessSourceSet.getRuntimeClasspath().plus(mainSourceSet.getOutput()));<NEW_LINE>// Derive all its configurations from 'main', so 'csaccess' code can see 'main' code<NEW_LINE>final ConfigurationContainer configurations = project.getConfigurations();<NEW_LINE>configurations.getByName(csaccessSourceSet.getImplementationConfigurationName()).extendsFrom(configurations.getByName(mainSourceSet.getImplementationConfigurationName()));<NEW_LINE>configurations.getByName(csaccessSourceSet.getCompileOnlyConfigurationName()).extendsFrom(configurations.getByName(mainSourceSet.getCompileOnlyConfigurationName()));<NEW_LINE>configurations.getByName(csaccessSourceSet.getCompileClasspathConfigurationName()).extendsFrom(configurations.getByName(mainSourceSet.getCompileClasspathConfigurationName()));<NEW_LINE>configurations.getByName(csaccessSourceSet.getRuntimeOnlyConfigurationName()).extendsFrom(configurations.getByName(mainSourceSet.getRuntimeOnlyConfigurationName()));<NEW_LINE>// Wire task dependencies to match the classpath dependencies (arrow means "depends on"):<NEW_LINE>// - compileTestJava -> compileCsaccessJava<NEW_LINE>// - testClasses -> csaccessClasses<NEW_LINE>// - jar -> csaccessClasses<NEW_LINE>final TaskContainer tasks = project.getTasks();<NEW_LINE>tasks.getByName(JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME).dependsOn(tasks.getByName(csaccessSourceSet.getCompileJavaTaskName()));<NEW_LINE>tasks.getByName(JavaPlugin.TEST_CLASSES_TASK_NAME).dependsOn(tasks.getByName<MASK><NEW_LINE>tasks.getByName(JavaPlugin.JAR_TASK_NAME).dependsOn(tasks.getByName(csaccessSourceSet.getClassesTaskName()));<NEW_LINE>} | (csaccessSourceSet.getClassesTaskName())); |
237,002 | private void createLockFile() throws IllegalStateException {<NEW_LINE>try {<NEW_LINE>int currentPid = android.os.Process.myPid();<NEW_LINE>if (lockFile.exists()) {<NEW_LINE>int lastPid = -1;<NEW_LINE>// read pid<NEW_LINE>byte[] bytes = new byte[64];<NEW_LINE>FileInputStream fis = new FileInputStream(lockFile);<NEW_LINE>int read = fis.read(bytes);<NEW_LINE>fis.close();<NEW_LINE>if (read > 0) {<NEW_LINE>String pidStr = new String(bytes, 0, read);<NEW_LINE>try {<NEW_LINE>lastPid = Integer.parseInt(pidStr);<NEW_LINE>} catch (NumberFormatException ignored) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (lastPid > 0) {<NEW_LINE>// check if last pid is alive<NEW_LINE>if (new File("/proc/" + lastPid).exists()) {<NEW_LINE>throw new IllegalStateException("BackupConfigSession is already running at pid: " + lastPid);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!lockFile.exists()) {<NEW_LINE>if (!lockFile.createNewFile()) {<NEW_LINE>throw new IllegalStateException("Failed to create lock file: " + lockFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FileOutputStream fos = new FileOutputStream(lockFile);<NEW_LINE>fos.write(String.valueOf<MASK><NEW_LINE>fos.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalStateException("Failed to create lock file: " + lockFile.getAbsolutePath(), e);<NEW_LINE>}<NEW_LINE>} | (currentPid).getBytes()); |
1,476,432 | public <T> T submitRequest(String pluginId, String requestName, PluginInteractionCallback<T> pluginInteractionCallback) {<NEW_LINE>if (!pluginManager.isPluginOfType(extensionName, pluginId)) {<NEW_LINE>throw new RecordNotFoundException(format("Did not find '%s' plugin with id '%s'. Looks like plugin is missing", extensionName, pluginId));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String resolvedExtensionVersion = pluginManager.resolveExtensionVersion(pluginId, extensionName, goSupportedVersions);<NEW_LINE>DefaultGoPluginApiRequest apiRequest = new DefaultGoPluginApiRequest(extensionName, resolvedExtensionVersion, requestName);<NEW_LINE>apiRequest.setRequestBody(pluginInteractionCallback.requestBody(resolvedExtensionVersion));<NEW_LINE>apiRequest.setRequestParams<MASK><NEW_LINE>apiRequest.setRequestHeaders(pluginInteractionCallback.requestHeaders(resolvedExtensionVersion));<NEW_LINE>GoPluginApiResponse response = pluginManager.submitTo(pluginId, extensionName, apiRequest);<NEW_LINE>if (response == null) {<NEW_LINE>throw new RuntimeException("The plugin sent a null response");<NEW_LINE>}<NEW_LINE>if (DefaultGoApiResponse.SUCCESS_RESPONSE_CODE == response.responseCode()) {<NEW_LINE>return pluginInteractionCallback.onSuccess(response.responseBody(), response.responseHeaders(), resolvedExtensionVersion);<NEW_LINE>}<NEW_LINE>pluginInteractionCallback.onFailure(response.responseCode(), response.responseBody(), resolvedExtensionVersion);<NEW_LINE>throw new RuntimeException(format("The plugin sent a response that could not be understood by Go. Plugin returned with code '%s' and the following response: '%s'", response.responseCode(), response.responseBody()));<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(format("Interaction with plugin with id '%s' implementing '%s' extension failed while requesting for '%s'. Reason: [%s]", pluginId, extensionName, requestName, e.getMessage()), e);<NEW_LINE>}<NEW_LINE>} | (pluginInteractionCallback.requestParams(resolvedExtensionVersion)); |
91,509 | protected void processActions() throws IncorrectOperationException {<NEW_LINE><MASK><NEW_LINE>app.runWriteAction(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>Document doc = FileDocumentManager.getInstance().getDocument(myPsiFile.getVirtualFile());<NEW_LINE>PsiDocumentManager.getInstance(myPsiFile.getProject()).doPostponedOperationsAndUnblockDocument(doc);<NEW_LINE>for (CommentAction action : myActions) {<NEW_LINE>int start = action.getStart();<NEW_LINE>int end = action.getEnd();<NEW_LINE>switch(action.getType()) {<NEW_LINE>case CommentAction.ACTION_INSERT:<NEW_LINE>String comment = getCommentText(action.getPrefix(), action.getSuffix());<NEW_LINE>if (!comment.isEmpty()) {<NEW_LINE>doc.insertString(start, comment);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case CommentAction.ACTION_REPLACE:<NEW_LINE>doc.replaceString(start, end, getCommentText("", ""));<NEW_LINE>break;<NEW_LINE>case CommentAction.ACTION_DELETE:<NEW_LINE>doc.deleteString(start, end);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | Application app = ApplicationManager.getApplication(); |
174,719 | public int fetchIndex() {<NEW_LINE>if (!this.repoData.isEnabled()) {<NEW_LINE>this.indexRaw = null;<NEW_LINE>this.toUpdate = Collections.emptyList();<NEW_LINE>this.toApply = Collections.emptySet();<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!this.repoData.prepare()) {<NEW_LINE>this.indexRaw = null;<NEW_LINE>this.toUpdate = Collections.emptyList();<NEW_LINE>this.toApply = Collections.emptySet();<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>this.indexRaw = Http.doHttpGet(<MASK><NEW_LINE>this.toUpdate = this.repoData.populate(new JSONObject(new String(this.indexRaw, StandardCharsets.UTF_8)));<NEW_LINE>// Since we reuse instances this should work<NEW_LINE>this.toApply = new HashSet<>(this.repoData.moduleHashMap.values());<NEW_LINE>this.toApply.removeAll(this.toUpdate);<NEW_LINE>// Return repo to update<NEW_LINE>return this.toUpdate.size();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(TAG, "Failed to get manifest", e);<NEW_LINE>this.indexRaw = null;<NEW_LINE>this.toUpdate = Collections.emptyList();<NEW_LINE>this.toApply = Collections.emptySet();<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>} | this.repoData.url, false); |
507,067 | public static void main(String[] args) throws Exception {<NEW_LINE>FabricConfig fabricConfig = new FabricConfig();<NEW_LINE>fabricConfig.load("");<NEW_LINE>HFClient <MASK><NEW_LINE>Channel channel = FabricSDKWrapper.initializeChannel(client, fabricConfig.getChannelName(), fabricConfig);<NEW_LINE>ChaincodeID chaincodeID = ChaincodeID.newBuilder().setName(fabricConfig.getTopicControllerName()).setVersion(fabricConfig.getTopicControllerVersion()).build();<NEW_LINE>switch(args[0]) {<NEW_LINE>case "add":<NEW_LINE>FabricSDKWrapper.executeTransaction(client, channel, chaincodeID, true, "addTopicContractName", fabricConfig.getTransactionTimeout(), fabricConfig.getTopicName(), fabricConfig.getTopicVerison());<NEW_LINE>String topicContractNameAdd = FabricSDKWrapper.executeTransaction(client, channel, chaincodeID, false, "getTopicContractName", fabricConfig.getTransactionTimeout()).getPayLoad();<NEW_LINE>String topicContractVersionAdd = FabricSDKWrapper.executeTransaction(client, channel, chaincodeID, false, "getTopicContractVersion", fabricConfig.getTransactionTimeout()).getPayLoad();<NEW_LINE>if (fabricConfig.getTopicName().equals(topicContractNameAdd) && fabricConfig.getTopicVerison().equals(topicContractVersionAdd)) {<NEW_LINE>log.debug("add TopicContract success");<NEW_LINE>} else {<NEW_LINE>log.error("add TopicContrct error");<NEW_LINE>systemExit(1);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "update":<NEW_LINE>FabricSDKWrapper.executeTransaction(client, channel, chaincodeID, true, "updateTopicContractName", fabricConfig.getTransactionTimeout(), fabricConfig.getTopicName(), fabricConfig.getTopicVerison());<NEW_LINE>String topicContractNameUpdate = FabricSDKWrapper.executeTransaction(client, channel, chaincodeID, false, "getTopicContractName", fabricConfig.getTransactionTimeout()).getPayLoad();<NEW_LINE>String topicContractVersionUpdate = FabricSDKWrapper.executeTransaction(client, channel, chaincodeID, false, "getTopicContractVersion", fabricConfig.getTransactionTimeout()).getPayLoad();<NEW_LINE>if (fabricConfig.getTopicName().equals(topicContractNameUpdate) && fabricConfig.getTopicVerison().equals(topicContractVersionUpdate)) {<NEW_LINE>log.debug("update TopicContract success");<NEW_LINE>} else {<NEW_LINE>log.error("update TopicContrct error");<NEW_LINE>systemExit(1);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>log.error("update TopicContract, error command action");<NEW_LINE>systemExit(1);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | client = FabricSDKWrapper.initializeClient(fabricConfig); |
753,317 | final DescribeBudgetActionHistoriesResult executeDescribeBudgetActionHistories(DescribeBudgetActionHistoriesRequest describeBudgetActionHistoriesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeBudgetActionHistoriesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeBudgetActionHistoriesRequest> request = null;<NEW_LINE>Response<DescribeBudgetActionHistoriesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeBudgetActionHistoriesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeBudgetActionHistoriesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Budgets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeBudgetActionHistories");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeBudgetActionHistoriesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeBudgetActionHistoriesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,010,650 | String censorMessage(final String username, final String message) {<NEW_LINE>String strippedMessage = jagexPrintableCharMatcher.retainFrom(message<MASK><NEW_LINE>String strippedAccents = StringUtils.stripAccents(strippedMessage);<NEW_LINE>assert strippedMessage.length() == strippedAccents.length();<NEW_LINE>if (username != null && shouldFilterByName(username)) {<NEW_LINE>switch(config.filterType()) {<NEW_LINE>case CENSOR_WORDS:<NEW_LINE>return StringUtils.repeat('*', strippedMessage.length());<NEW_LINE>case CENSOR_MESSAGE:<NEW_LINE>return CENSOR_MESSAGE;<NEW_LINE>case REMOVE_MESSAGE:<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean filtered = false;<NEW_LINE>for (Pattern pattern : filteredPatterns) {<NEW_LINE>Matcher m = pattern.matcher(strippedAccents);<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>int idx = 0;<NEW_LINE>while (m.find()) {<NEW_LINE>switch(config.filterType()) {<NEW_LINE>case CENSOR_WORDS:<NEW_LINE>MatchResult matchResult = m.toMatchResult();<NEW_LINE>sb.append(strippedMessage, idx, matchResult.start()).append(StringUtils.repeat('*', matchResult.group().length()));<NEW_LINE>idx = m.end();<NEW_LINE>filtered = true;<NEW_LINE>break;<NEW_LINE>case CENSOR_MESSAGE:<NEW_LINE>return CENSOR_MESSAGE;<NEW_LINE>case REMOVE_MESSAGE:<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(strippedMessage.substring(idx));<NEW_LINE>strippedMessage = sb.toString();<NEW_LINE>assert strippedMessage.length() == strippedAccents.length();<NEW_LINE>}<NEW_LINE>return filtered ? strippedMessage : message;<NEW_LINE>} | ).replace('\u00A0', ' '); |
48,238 | final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Cloud9");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
817,283 | public void visit(RecordFieldWithDefaultValueNode recordFieldWithDefaultValueNode) {<NEW_LINE>Token token = recordFieldWithDefaultValueNode.fieldName();<NEW_LINE>LinePosition startLine = token.lineRange().startLine();<NEW_LINE>SemanticToken semanticToken = new SemanticToken(startLine.line(), startLine.offset());<NEW_LINE>if (!semanticTokens.contains(semanticToken)) {<NEW_LINE>int length = token.text().trim().length();<NEW_LINE>int modifiers;<NEW_LINE>int refModifiers;<NEW_LINE>if (recordFieldWithDefaultValueNode.readonlyKeyword().isPresent()) {<NEW_LINE>modifiers = TokenTypeModifiers.DECLARATION.getId() | TokenTypeModifiers.READONLY.getId();<NEW_LINE>refModifiers = TokenTypeModifiers.READONLY.getId();<NEW_LINE>} else {<NEW_LINE>modifiers = TokenTypeModifiers.DECLARATION.getId();<NEW_LINE>refModifiers = 0;<NEW_LINE>}<NEW_LINE>semanticToken.setProperties(length, TokenTypes.PROPERTY.getId(), modifiers);<NEW_LINE>semanticTokens.add(semanticToken);<NEW_LINE>handleReferences(startLine, length, TokenTypes.<MASK><NEW_LINE>}<NEW_LINE>visitSyntaxNode(recordFieldWithDefaultValueNode);<NEW_LINE>} | PROPERTY.getId(), refModifiers); |
1,106,654 | private Object decodePer(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>Parser parser = new Parser(PATTERN_PER, (String) msg);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>// seq<NEW_LINE>parser.next();<NEW_LINE>position.setLatitude(parser.nextDouble());<NEW_LINE>position.setLongitude(parser.nextDouble());<NEW_LINE>position.setTime(parser.nextDateTime(Parser.DateTimeFormat.HMS_DMY));<NEW_LINE>position.setSpeed(parser.nextDouble());<NEW_LINE>position.setCourse(parser.nextDouble());<NEW_LINE>position.set(Position.KEY_SATELLITES, parser.nextInt());<NEW_LINE>position.set(Position.KEY_IGNITION, <MASK><NEW_LINE>if (parser.hasNext(4)) {<NEW_LINE>position.set("dop1", parser.nextInt());<NEW_LINE>position.set("dop2", parser.nextInt());<NEW_LINE>position.set(Position.PREFIX_ADC + 1, parser.nextDouble());<NEW_LINE>position.set(Position.KEY_BATTERY, parser.nextDouble());<NEW_LINE>}<NEW_LINE>if (parser.hasNext()) {<NEW_LINE>position.set(Position.KEY_MOTION, parser.nextInt(0) > 0);<NEW_LINE>}<NEW_LINE>position.set(Position.KEY_POWER, parser.nextDouble());<NEW_LINE>position.set(Position.KEY_ODOMETER, parser.nextDouble());<NEW_LINE>position.set("pulseOdometer", parser.nextDouble());<NEW_LINE>position.set(Position.KEY_STATUS, parser.nextInt());<NEW_LINE>position.setValid(parser.nextInt() > 0);<NEW_LINE>position.set(Position.KEY_ARCHIVE, parser.nextInt() > 0);<NEW_LINE>return position;<NEW_LINE>} | parser.nextInt() > 0); |
1,209,656 | public void onProjectsLinked(@Nonnull final Collection linked) {<NEW_LINE>List<VcsDirectoryMapping> newMappings = ContainerUtilRt.newArrayList();<NEW_LINE>final LocalFileSystem fileSystem = LocalFileSystem.getInstance();<NEW_LINE>ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);<NEW_LINE>for (Object o : linked) {<NEW_LINE>final ExternalProjectSettings settings = (ExternalProjectSettings) o;<NEW_LINE>VirtualFile dir = fileSystem.refreshAndFindFileByPath(settings.getExternalProjectPath());<NEW_LINE>if (dir == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!dir.isDirectory()) {<NEW_LINE>dir = dir.getParent();<NEW_LINE>}<NEW_LINE>newMappings.addAll(VcsUtil<MASK><NEW_LINE>}<NEW_LINE>// There is a possible case that no VCS mappings are configured for the current project. There is a single<NEW_LINE>// mapping like <Project> - <No VCS> then. We want to replace it if only one mapping to the project root dir<NEW_LINE>// has been detected then.<NEW_LINE>List<VcsDirectoryMapping> oldMappings = vcsManager.getDirectoryMappings();<NEW_LINE>if (oldMappings.size() == 1 && newMappings.size() == 1 && StringUtil.isEmpty(oldMappings.get(0).getVcs())) {<NEW_LINE>VcsDirectoryMapping newMapping = newMappings.iterator().next();<NEW_LINE>String detectedDirPath = newMapping.getDirectory();<NEW_LINE>VirtualFile detectedDir = fileSystem.findFileByPath(detectedDirPath);<NEW_LINE>if (detectedDir != null && detectedDir.equals(project.getBaseDir())) {<NEW_LINE>newMappings.clear();<NEW_LINE>newMappings.add(new VcsDirectoryMapping("", newMapping.getVcs()));<NEW_LINE>vcsManager.setDirectoryMappings(newMappings);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newMappings.addAll(oldMappings);<NEW_LINE>vcsManager.setDirectoryMappings(newMappings);<NEW_LINE>} | .findRoots(dir, project)); |
1,635,308 | public Future<ArrayList<Long>> innermostFARMethod() {<NEW_LINE>String methID = "innermostFARMethod()";<NEW_LINE>svLogger.info("--> Entering " + methID);<NEW_LINE>boolean gateOpen;<NEW_LINE>try {<NEW_LINE>gateOpen = ivAsync2Latch.await(MAX_WAIT, TimeUnit.SECONDS);<NEW_LINE>if (!gateOpen) {<NEW_LINE>svLogger.info("--> " + methID + <MASK><NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>svLogger.info("--> " + methID + ":Unexpected InterruptedException: " + e);<NEW_LINE>}<NEW_LINE>long innermostFARMethodID = Thread.currentThread().getId();<NEW_LINE>threadIDList.add(innermostFARMethodID);<NEW_LINE>svLogger.info("--> " + methID + ":Current threadIDList = " + threadIDList);<NEW_LINE>svLogger.info("<-- " + methID + ":Returning results...");<NEW_LINE>return new AsyncResult<ArrayList<Long>>(threadIDList);<NEW_LINE>} | ":**** The innerFARMethod did not execute " + "ivAsync2Latch.countDown() in a timely manner. " + "This may cause the test to fail as the returned " + "ArrayList may not have the expected results."); |
982,674 | public Request<DescribeTextTranslationJobRequest> marshall(DescribeTextTranslationJobRequest describeTextTranslationJobRequest) {<NEW_LINE>if (describeTextTranslationJobRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DescribeTextTranslationJobRequest)");<NEW_LINE>}<NEW_LINE>Request<DescribeTextTranslationJobRequest> request = new DefaultRequest<DescribeTextTranslationJobRequest>(describeTextTranslationJobRequest, "AmazonTranslate");<NEW_LINE>String target = "AWSShineFrontendService_20170701.DescribeTextTranslationJob";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter <MASK><NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (describeTextTranslationJobRequest.getJobId() != null) {<NEW_LINE>String jobId = describeTextTranslationJobRequest.getJobId();<NEW_LINE>jsonWriter.name("JobId");<NEW_LINE>jsonWriter.value(jobId);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | jsonWriter = JsonUtils.getJsonWriter(stringWriter); |
88,468 | Map<String, ?> toSerializable() {<NEW_LINE>Map<String, Object> map = new LinkedHashMap<>();<NEW_LINE>map.put("displayName", displayName);<NEW_LINE>map.put("id", id);<NEW_LINE>if (parentId != null) {<NEW_LINE>map.put("parentId", parentId);<NEW_LINE>}<NEW_LINE>map.put("startTime", startTime);<NEW_LINE>map.put("endTime", endTime);<NEW_LINE>map.put("duration", endTime - startTime);<NEW_LINE>if (details != null) {<NEW_LINE>map.put("details", details);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (result != null) {<NEW_LINE>map.put("result", result);<NEW_LINE>map.put("resultClassName", resultClassName);<NEW_LINE>}<NEW_LINE>if (failure != null) {<NEW_LINE>map.put("failure", failure);<NEW_LINE>}<NEW_LINE>if (!progress.isEmpty()) {<NEW_LINE>map.put("progress", transform(progress, Progress::toSerializable));<NEW_LINE>}<NEW_LINE>if (!children.isEmpty()) {<NEW_LINE>map.put("children", transform(children, BuildOperationRecord::toSerializable));<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>} | map.put("detailsClassName", detailsClassName); |
72,424 | private int calculateLength() {<NEW_LINE>int len;<NEW_LINE>byte second = ((beg + 1 < end) && data[beg] == '0') ? data[beg <MASK><NEW_LINE>switch(base) {<NEW_LINE>case 2:<NEW_LINE>len = 1;<NEW_LINE>if (second == 'b' || second == 'B') {<NEW_LINE>beg += 2;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>len = 2;<NEW_LINE>break;<NEW_LINE>case 8:<NEW_LINE>if (second == 'o' || second == 'O') {<NEW_LINE>beg += 2;<NEW_LINE>}<NEW_LINE>case 4:<NEW_LINE>case 5:<NEW_LINE>case 6:<NEW_LINE>case 7:<NEW_LINE>len = 3;<NEW_LINE>break;<NEW_LINE>case 10:<NEW_LINE>if (second == 'd' || second == 'D') {<NEW_LINE>beg += 2;<NEW_LINE>}<NEW_LINE>case 9:<NEW_LINE>case 11:<NEW_LINE>case 12:<NEW_LINE>case 13:<NEW_LINE>case 14:<NEW_LINE>case 15:<NEW_LINE>len = 4;<NEW_LINE>break;<NEW_LINE>case 16:<NEW_LINE>len = 4;<NEW_LINE>if (second == 'x' || second == 'X') {<NEW_LINE>beg += 2;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>if (base < 2 || 36 < base) {<NEW_LINE>throw runtime.newArgumentError("illegal radix " + base);<NEW_LINE>}<NEW_LINE>if (base <= 32) {<NEW_LINE>len = 5;<NEW_LINE>} else {<NEW_LINE>len = 6;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return len;<NEW_LINE>} | + 1] : (byte) 0; |
621,907 | public synchronized void truncateUnpartitionedTable(ConnectorSession session, String databaseName, String tableName) {<NEW_LINE>checkReadable();<NEW_LINE>Optional<Table> table = getTable(new MetastoreContext(session.getIdentity(), session.getQueryId(), session.getClientInfo(), session.getSource(), getMetastoreHeaders(session), isUserDefinedTypeEncodingEnabled(session), columnConverterProvider), databaseName, tableName);<NEW_LINE>SchemaTableName schemaTableName = new SchemaTableName(databaseName, tableName);<NEW_LINE>if (!table.isPresent()) {<NEW_LINE>throw new TableNotFoundException(schemaTableName);<NEW_LINE>}<NEW_LINE>if (!table.get().getTableType().equals(MANAGED_TABLE) && !table.get().getTableType().equals(MATERIALIZED_VIEW)) {<NEW_LINE>throw new PrestoException(NOT_SUPPORTED, "Cannot delete from non-managed Hive table");<NEW_LINE>}<NEW_LINE>if (!table.get().getPartitionColumns().isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Table is partitioned");<NEW_LINE>}<NEW_LINE>Path path = new Path(table.get().getStorage().getLocation());<NEW_LINE>HdfsContext context = new HdfsContext(session, databaseName, tableName, table.get().getStorage().getLocation(), false);<NEW_LINE>setExclusive((delegate, hdfsEnvironment) -> {<NEW_LINE>RecursiveDeleteResult recursiveDeleteResult = recursiveDeleteFiles(hdfsEnvironment, context, path, ImmutableSet<MASK><NEW_LINE>if (!recursiveDeleteResult.getNotDeletedEligibleItems().isEmpty()) {<NEW_LINE>throw new PrestoException(HIVE_FILESYSTEM_ERROR, format("Error deleting from unpartitioned table %s. These items can not be deleted: %s", schemaTableName, recursiveDeleteResult.getNotDeletedEligibleItems()));<NEW_LINE>}<NEW_LINE>return EMPTY_HIVE_COMMIT_HANDLE;<NEW_LINE>});<NEW_LINE>} | .of(""), false); |
628,129 | public static EnableApplicationScalingRuleResponse unmarshall(EnableApplicationScalingRuleResponse enableApplicationScalingRuleResponse, UnmarshallerContext _ctx) {<NEW_LINE>enableApplicationScalingRuleResponse.setRequestId(_ctx.stringValue("EnableApplicationScalingRuleResponse.RequestId"));<NEW_LINE>enableApplicationScalingRuleResponse.setCode(_ctx.integerValue("EnableApplicationScalingRuleResponse.Code"));<NEW_LINE>enableApplicationScalingRuleResponse.setMessage(_ctx.stringValue("EnableApplicationScalingRuleResponse.Message"));<NEW_LINE>AppScalingRule appScalingRule = new AppScalingRule();<NEW_LINE>appScalingRule.setAppId(_ctx.stringValue("EnableApplicationScalingRuleResponse.AppScalingRule.AppId"));<NEW_LINE>appScalingRule.setScaleRuleName(_ctx.stringValue("EnableApplicationScalingRuleResponse.AppScalingRule.ScaleRuleName"));<NEW_LINE>appScalingRule.setScaleRuleType(_ctx.stringValue("EnableApplicationScalingRuleResponse.AppScalingRule.ScaleRuleType"));<NEW_LINE>appScalingRule.setScaleRuleEnabled(_ctx.booleanValue("EnableApplicationScalingRuleResponse.AppScalingRule.ScaleRuleEnabled"));<NEW_LINE>appScalingRule.setMinReplicas(_ctx.integerValue("EnableApplicationScalingRuleResponse.AppScalingRule.MinReplicas"));<NEW_LINE>appScalingRule.setMaxReplicas(_ctx.integerValue("EnableApplicationScalingRuleResponse.AppScalingRule.MaxReplicas"));<NEW_LINE>appScalingRule.setCreateTime(_ctx.longValue("EnableApplicationScalingRuleResponse.AppScalingRule.CreateTime"));<NEW_LINE>appScalingRule.setUpdateTime(_ctx.longValue("EnableApplicationScalingRuleResponse.AppScalingRule.UpdateTime"));<NEW_LINE>appScalingRule.setLastDisableTime(_ctx.longValue("EnableApplicationScalingRuleResponse.AppScalingRule.LastDisableTime"));<NEW_LINE>Metric metric = new Metric();<NEW_LINE>metric.setMaxReplicas(_ctx.integerValue("EnableApplicationScalingRuleResponse.AppScalingRule.Metric.MaxReplicas"));<NEW_LINE>metric.setMinReplicas(_ctx.integerValue("EnableApplicationScalingRuleResponse.AppScalingRule.Metric.MinReplicas"));<NEW_LINE>List<Metric1> metrics = new ArrayList<Metric1>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("EnableApplicationScalingRuleResponse.AppScalingRule.Metric.Metrics.Length"); i++) {<NEW_LINE>Metric1 metric1 = new Metric1();<NEW_LINE>metric1.setMetricType(_ctx.stringValue("EnableApplicationScalingRuleResponse.AppScalingRule.Metric.Metrics[" + i + "].MetricType"));<NEW_LINE>metric1.setMetricTargetAverageUtilization(_ctx.integerValue<MASK><NEW_LINE>metrics.add(metric1);<NEW_LINE>}<NEW_LINE>metric.setMetrics(metrics);<NEW_LINE>appScalingRule.setMetric(metric);<NEW_LINE>Trigger trigger = new Trigger();<NEW_LINE>trigger.setMaxReplicas(_ctx.integerValue("EnableApplicationScalingRuleResponse.AppScalingRule.Trigger.MaxReplicas"));<NEW_LINE>trigger.setMinReplicas(_ctx.integerValue("EnableApplicationScalingRuleResponse.AppScalingRule.Trigger.MinReplicas"));<NEW_LINE>List<Trigger2> triggers = new ArrayList<Trigger2>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("EnableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers.Length"); i++) {<NEW_LINE>Trigger2 trigger2 = new Trigger2();<NEW_LINE>trigger2.setType(_ctx.stringValue("EnableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers[" + i + "].Type"));<NEW_LINE>trigger2.setName(_ctx.stringValue("EnableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers[" + i + "].Name"));<NEW_LINE>trigger2.setMetaData(_ctx.stringValue("EnableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers[" + i + "].MetaData"));<NEW_LINE>triggers.add(trigger2);<NEW_LINE>}<NEW_LINE>trigger.setTriggers(triggers);<NEW_LINE>appScalingRule.setTrigger(trigger);<NEW_LINE>enableApplicationScalingRuleResponse.setAppScalingRule(appScalingRule);<NEW_LINE>return enableApplicationScalingRuleResponse;<NEW_LINE>} | ("EnableApplicationScalingRuleResponse.AppScalingRule.Metric.Metrics[" + i + "].MetricTargetAverageUtilization")); |
810,941 | final boolean sre_category(int category, int ch) {<NEW_LINE>switch(category) {<NEW_LINE>case SRE_CATEGORY_DIGIT:<NEW_LINE>return SRE_IS_DIGIT(ch);<NEW_LINE>case SRE_CATEGORY_NOT_DIGIT:<NEW_LINE>return !SRE_IS_DIGIT(ch);<NEW_LINE>case SRE_CATEGORY_SPACE:<NEW_LINE>return SRE_IS_SPACE(ch);<NEW_LINE>case SRE_CATEGORY_NOT_SPACE:<NEW_LINE>return !SRE_IS_SPACE(ch);<NEW_LINE>case SRE_CATEGORY_WORD:<NEW_LINE>return SRE_IS_WORD(ch);<NEW_LINE>case SRE_CATEGORY_NOT_WORD:<NEW_LINE>return !SRE_IS_WORD(ch);<NEW_LINE>case SRE_CATEGORY_LINEBREAK:<NEW_LINE>return SRE_IS_LINEBREAK(ch);<NEW_LINE>case SRE_CATEGORY_NOT_LINEBREAK:<NEW_LINE>return !SRE_IS_LINEBREAK(ch);<NEW_LINE>case SRE_CATEGORY_LOC_WORD:<NEW_LINE>return SRE_LOC_IS_WORD(ch);<NEW_LINE>case SRE_CATEGORY_LOC_NOT_WORD:<NEW_LINE>return !SRE_LOC_IS_WORD(ch);<NEW_LINE>case SRE_CATEGORY_UNI_DIGIT:<NEW_LINE>return Character.isDigit(ch);<NEW_LINE>case SRE_CATEGORY_UNI_NOT_DIGIT:<NEW_LINE>return !Character.isDigit(ch);<NEW_LINE>case SRE_CATEGORY_UNI_SPACE:<NEW_LINE>return Character.isSpaceChar(ch) || Character.isWhitespace(ch) <MASK><NEW_LINE>case SRE_CATEGORY_UNI_NOT_SPACE:<NEW_LINE>return !(Character.isSpaceChar(ch) || Character.isWhitespace(ch) || ch == 0x0085 || ch == 0x180e);<NEW_LINE>case SRE_CATEGORY_UNI_WORD:<NEW_LINE>return Character.isLetterOrDigit(ch) || ch == '_';<NEW_LINE>case SRE_CATEGORY_UNI_NOT_WORD:<NEW_LINE>return !(Character.isLetterOrDigit(ch) || ch == '_');<NEW_LINE>case SRE_CATEGORY_UNI_LINEBREAK:<NEW_LINE>return SRE_UNI_IS_LINEBREAK(ch);<NEW_LINE>case SRE_CATEGORY_UNI_NOT_LINEBREAK:<NEW_LINE>return !SRE_UNI_IS_LINEBREAK(ch);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | || ch == 0x0085 || ch == 0x180e; |
145,709 | public void computeSelection(CombiningBuilder builder, Area area, TimeSpan ts) {<NEW_LINE>int startDepth = (int) ((area.y - SLICE_Y) / SLICE_HEIGHT);<NEW_LINE>int endDepth = (int) ((area.y + area<MASK><NEW_LINE>if (startDepth == endDepth && area.h / SLICE_HEIGHT < SELECTION_THRESHOLD) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (((startDepth + 1) * SLICE_HEIGHT - area.y + SLICE_Y) / SLICE_HEIGHT < SELECTION_THRESHOLD) {<NEW_LINE>startDepth++;<NEW_LINE>}<NEW_LINE>if ((area.y + area.h - endDepth * SLICE_HEIGHT - SLICE_Y) / SLICE_HEIGHT < SELECTION_THRESHOLD) {<NEW_LINE>endDepth--;<NEW_LINE>}<NEW_LINE>if (startDepth > endDepth) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (endDepth >= 0) {<NEW_LINE>builder.add(Selection.Kind.VulkanEvent, transform(track.getSlices(ts, startDepth, endDepth), VulkanEventTrack.SlicesBuilder::new));<NEW_LINE>}<NEW_LINE>} | .h - SLICE_Y) / SLICE_HEIGHT); |
47,675 | // Run the preprocessing job and set up the common env variables for worker jobs.<NEW_LINE>private int doPreprocessingJob() throws Exception {<NEW_LINE>Utils.extractResources(appIdString);<NEW_LINE>HashMap<String, String> extraEnv = new HashMap<>(shellEnv);<NEW_LINE>if (singleNode) {<NEW_LINE>ServerSocket tbSocket = new ServerSocket(0);<NEW_LINE>int tbPort = tbSocket.getLocalPort();<NEW_LINE>extraEnv.put(Constants.TB_PORT, String.valueOf(tbPort));<NEW_LINE>String tbUrl = Utils.getCurrentHostName() + ":" + tbPort;<NEW_LINE>proxyUrl = Utils.constructUrl(tbUrl);<NEW_LINE>LOG.info("Registering TensorBoard url for single node training: " + tbUrl);<NEW_LINE>registerTensorBoardUrlToRM(tbUrl);<NEW_LINE>tbSocket.close();<NEW_LINE>}<NEW_LINE>LOG.info("Start python preprocessing");<NEW_LINE>extraEnv.put(Constants.PREPROCESSING_JOB, "true");<NEW_LINE>extraEnv.put("HOME", System.getProperty("user.dir"));<NEW_LINE>String taskCommand = tonyConf.get(TonyConfigurationKeys.getExecuteCommandKey(Constants.AM_NAME), tonyConf.get(TonyConfigurationKeys.getContainerExecuteCommandKey()));<NEW_LINE>LOG.info("Executing command: " + taskCommand);<NEW_LINE>int exitCode = Utils.executeShell(taskCommand, executionTimeout, extraEnv);<NEW_LINE>preprocessExitCode = exitCode;<NEW_LINE>preprocessFinished = true;<NEW_LINE>// Short circuit if preprocessing job fails.<NEW_LINE>if (exitCode != 0) {<NEW_LINE>LOG.error("Preprocess job exits with " + exitCode + ", exiting.");<NEW_LINE>session.setFinalStatus(FinalApplicationStatus.FAILED, "Preprocessing job failed.");<NEW_LINE>return exitCode;<NEW_LINE>}<NEW_LINE>try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(System.getProperty(YarnConfiguration.YARN_APP_CONTAINER_LOG_DIR) + File.separatorChar + Constants.AM_STDOUT_FILENAME), StandardCharsets.UTF_8))) {<NEW_LINE>String line;<NEW_LINE>while ((line = reader.readLine()) != null) {<NEW_LINE>if (line.contains("Model parameters: ")) {<NEW_LINE>String params = line.substring(line.indexOf("Model parameters: "<MASK><NEW_LINE>// Add serialized params to env<NEW_LINE>containerEnv.put(Constants.TASK_PARAM_KEY, params);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return exitCode;<NEW_LINE>} | ) + "Model parameters: ".length()); |
193,692 | void postProcess(QuerySearchResult result) throws IOException {<NEW_LINE>super.postProcess(result);<NEW_LINE>final TopDocs topDocs = result.topDocs();<NEW_LINE>if (scrollContext.totalHits == -1) {<NEW_LINE>// first round<NEW_LINE>scrollContext.totalHits = topDocs.totalHits;<NEW_LINE>scrollContext.maxScore = topDocs.getMaxScore();<NEW_LINE>} else {<NEW_LINE>// subsequent round: the total number of hits and<NEW_LINE>// the maximum score were computed on the first round<NEW_LINE>topDocs.totalHits = scrollContext.totalHits;<NEW_LINE>topDocs.setMaxScore(scrollContext.maxScore);<NEW_LINE>}<NEW_LINE>if (numberOfShards == 1) {<NEW_LINE>// if we fetch the document in the same roundtrip, we already know the last emitted doc<NEW_LINE>if (topDocs.scoreDocs.length > 0) {<NEW_LINE>// set the last emitted doc<NEW_LINE>scrollContext.lastEmittedDoc = topDocs.scoreDocs[topDocs.scoreDocs.length - 1];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.topDocs(<MASK><NEW_LINE>} | topDocs, result.sortValueFormats()); |
1,626,331 | public AnnotationMirrorMap<AnnotationMirror> visitDeclared_Declared(AnnotatedDeclaredType type1, AnnotatedDeclaredType type2, Void aVoid) {<NEW_LINE>// Don't call super because asSuper has to be called on each type argument.<NEW_LINE>if (visited(type2)) {<NEW_LINE>return new AnnotationMirrorMap<>();<NEW_LINE>}<NEW_LINE>AnnotationMirrorMap<AnnotationMirror> <MASK><NEW_LINE>Iterator<AnnotatedTypeMirror> type2Args = type2.getTypeArguments().iterator();<NEW_LINE>for (AnnotatedTypeMirror type1Arg : type1.getTypeArguments()) {<NEW_LINE>AnnotatedTypeMirror type2Arg = type2Args.next();<NEW_LINE>if (TypesUtils.isErasedSubtype(type1Arg.getUnderlyingType(), type2Arg.getUnderlyingType(), atypeFactory.getChecker().getTypeUtils())) {<NEW_LINE>result = reduce(result, visit(type1Arg, type2Arg));<NEW_LINE>}<NEW_LINE>// else an unchecked warning was issued by Java, ignore this part of the type.<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | result = mapQualifierToPoly(type1, type2); |
413,728 | private String resolveImplementationVersion() throws IOException {<NEW_LINE>String[] metroLibs = getDetectedMetroLibs();<NEW_LINE>File wsToolsJar = new File(catalinaHome, metroLibs[TOOLS_JAR_INDEX]);<NEW_LINE>if (wsToolsJar.exists()) {<NEW_LINE>JarFile jarFile = new JarFile(wsToolsJar);<NEW_LINE>// NOI18N<NEW_LINE>JarEntry entry = jarFile.getJarEntry("com/sun/tools/ws/version.properties");<NEW_LINE>if (entry != null) {<NEW_LINE>InputStream is = jarFile.getInputStream(entry);<NEW_LINE>BufferedReader r = new BufferedReader(new InputStreamReader(is));<NEW_LINE>String ln = null;<NEW_LINE>String ver = null;<NEW_LINE>while ((ln = r.readLine()) != null) {<NEW_LINE><MASK><NEW_LINE>if (line.startsWith("major-version=")) {<NEW_LINE>// NOI18N<NEW_LINE>ver = line.substring(14);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>r.close();<NEW_LINE>return ver;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | String line = ln.trim(); |
1,673,529 | public static ListCalcEnginesResponse unmarshall(ListCalcEnginesResponse listCalcEnginesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listCalcEnginesResponse.setRequestId(_ctx.stringValue("ListCalcEnginesResponse.RequestId"));<NEW_LINE>listCalcEnginesResponse.setHttpStatusCode(_ctx.integerValue("ListCalcEnginesResponse.HttpStatusCode"));<NEW_LINE>listCalcEnginesResponse.setSuccess(_ctx.booleanValue("ListCalcEnginesResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListCalcEnginesResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListCalcEnginesResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListCalcEnginesResponse.Data.TotalCount"));<NEW_LINE>List<CalcEnginesItem> calcEngines = new ArrayList<CalcEnginesItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListCalcEnginesResponse.Data.CalcEngines.Length"); i++) {<NEW_LINE>CalcEnginesItem calcEnginesItem = new CalcEnginesItem();<NEW_LINE>calcEnginesItem.setBindingProjectName(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].BindingProjectName"));<NEW_LINE>calcEnginesItem.setIsDefault(_ctx.booleanValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].IsDefault"));<NEW_LINE>calcEnginesItem.setEngineId(_ctx.integerValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].EngineId"));<NEW_LINE>calcEnginesItem.setDwRegion(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].DwRegion"));<NEW_LINE>calcEnginesItem.setTaskAuthType(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].TaskAuthType"));<NEW_LINE>calcEnginesItem.setCalcEngineType(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].CalcEngineType"));<NEW_LINE>calcEnginesItem.setEngineInfo(_ctx.mapValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].EngineInfo"));<NEW_LINE>calcEnginesItem.setEnvType(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].EnvType"));<NEW_LINE>calcEnginesItem.setRegion(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].Region"));<NEW_LINE>calcEnginesItem.setGmtCreate(_ctx.stringValue<MASK><NEW_LINE>calcEnginesItem.setBindingProjectId(_ctx.integerValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].BindingProjectId"));<NEW_LINE>calcEnginesItem.setName(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].Name"));<NEW_LINE>calcEnginesItem.setTenantId(_ctx.longValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].TenantId"));<NEW_LINE>calcEngines.add(calcEnginesItem);<NEW_LINE>}<NEW_LINE>data.setCalcEngines(calcEngines);<NEW_LINE>listCalcEnginesResponse.setData(data);<NEW_LINE>return listCalcEnginesResponse;<NEW_LINE>} | ("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].GmtCreate")); |
1,653,914 | private void parseSize(VDTree apath, Attributes attributes) {<NEW_LINE>Pattern pattern = Pattern.compile("^\\s*(\\d+(\\.\\d+)*)\\s*([a-zA-Z]+)\\s*$");<NEW_LINE>HashMap<String, Integer> m = new HashMap<String, Integer>();<NEW_LINE>m.put("px", 1);<NEW_LINE>m.put("dip", 1);<NEW_LINE>m.put("dp", 1);<NEW_LINE>m.put("sp", 1);<NEW_LINE>m.put("pt", 1);<NEW_LINE>m.put("in", 1);<NEW_LINE>m.put("mm", 1);<NEW_LINE>int len = attributes.getLength();<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>String <MASK><NEW_LINE>String value = attributes.getValue(i);<NEW_LINE>Matcher matcher = pattern.matcher(value);<NEW_LINE>float size = 0;<NEW_LINE>if (matcher.matches()) {<NEW_LINE>float v = Float.parseFloat(matcher.group(1));<NEW_LINE>String unit = matcher.group(3).toLowerCase();<NEW_LINE>size = v;<NEW_LINE>}<NEW_LINE>// -- Extract dimension units.<NEW_LINE>if ("android:width".equals(name)) {<NEW_LINE>apath.mBaseWidth = size;<NEW_LINE>} else if ("android:height".equals(name)) {<NEW_LINE>apath.mBaseHeight = size;<NEW_LINE>} else if ("android:viewportWidth".equals(name)) {<NEW_LINE>apath.mPortWidth = Float.parseFloat(value);<NEW_LINE>;<NEW_LINE>} else if ("android:viewportHeight".equals(name)) {<NEW_LINE>apath.mPortHeight = Float.parseFloat(value);<NEW_LINE>;<NEW_LINE>} else {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | name = attributes.getQName(i); |
1,082,819 | private void filterPaeth(byte[] uncompressed, int rowSize, byte[] lastRow, int bpp) {<NEW_LINE>for (int i = 0; i < bpp; i++) {<NEW_LINE>ca[i] = lastRow[i];<NEW_LINE>lastRow[i] = (byte) ((uncompressed[i + 1] & 0xff) + (lastRow[i] & 0xff));<NEW_LINE>}<NEW_LINE>for (int i = bpp; i < rowSize; i++) {<NEW_LINE>int a = lastRow[i - bpp] & 0xff;<NEW_LINE>int b = lastRow[i] & 0xff;<NEW_LINE>int c = ca[i % bpp] & 0xff;<NEW_LINE>int p = b - c;<NEW_LINE>int pc = a - c;<NEW_LINE>int pa = abs(p);<NEW_LINE>int pb = abs(pc);<NEW_LINE><MASK><NEW_LINE>if (pa <= pb && pa <= pc)<NEW_LINE>p = a;<NEW_LINE>else if (pb <= pc)<NEW_LINE>p = b;<NEW_LINE>else<NEW_LINE>p = c;<NEW_LINE>ca[i % bpp] = lastRow[i];<NEW_LINE>lastRow[i] = (byte) (p + (uncompressed[i + 1] & 0xff));<NEW_LINE>}<NEW_LINE>} | pc = abs(p + pc); |
983,570 | public Expr visitPrimary_expression(JSLParser.Primary_expressionContext ctx) {<NEW_LINE>if (ctx.IDENTIFIER() != null) {<NEW_LINE>return tm.variable(ctx.<MASK><NEW_LINE>} else if (ctx.INTCONSTANT() != null) {<NEW_LINE>return tm.literal(Type.INT, Integer.valueOf(ctx.INTCONSTANT().getText()));<NEW_LINE>} else if (ctx.FLOATCONSTANT() != null) {<NEW_LINE>return tm.literal(Type.FLOAT, Float.valueOf(ctx.FLOATCONSTANT().getText()));<NEW_LINE>} else if (ctx.BOOLCONSTANT() != null) {<NEW_LINE>return tm.literal(Type.BOOL, Boolean.valueOf(ctx.BOOLCONSTANT().getText()));<NEW_LINE>} else if (ctx.e != null) {<NEW_LINE>return tm.parenExpr(visitExpression(ctx.e));<NEW_LINE>}<NEW_LINE>throw new RuntimeException("invalid primary expression");<NEW_LINE>} | IDENTIFIER().getText()); |
1,711,936 | public Node leaveVarNode(VarNode varNode) {<NEW_LINE>Expression init = varNode.getInit();<NEW_LINE>// assignment is right associative, so we end up visiting the value before the name. We have to invert the<NEW_LINE>// children<NEW_LINE>if (!isDefaultNamedFunctionExport(varNode) && !varNode.isFunctionDeclaration() && !(init instanceof ClassNode)) {<NEW_LINE>// Invert the two children of the declaration!<NEW_LINE>IParseNode node = getCurrentNode();<NEW_LINE>if (node.getChildCount() > 1) {<NEW_LINE>IParseNode value = node.getChild(0);<NEW_LINE>IParseNode name = node.getChild(1);<NEW_LINE>((JSNode) node).setChildren(new IParseNode[] { name, value });<NEW_LINE>} else {<NEW_LINE>// If we only have name, add an empty node for value<NEW_LINE>node.addChild(new JSEmptyNode(node.getEndingOffset()));<NEW_LINE>}<NEW_LINE>// decl node<NEW_LINE>JSDeclarationNode declNode = (JSDeclarationNode) popNode();<NEW_LINE>// var node<NEW_LINE>popNode();<NEW_LINE>IdentNode nameNode = varNode.getName();<NEW_LINE>ExportedStatus exportStatus = getExportStatus(nameNode);<NEW_LINE>if (exportStatus.isExported) {<NEW_LINE>// export node<NEW_LINE>JSExportNode exportNode = (JSExportNode) popNode();<NEW_LINE>// Handle when we're exporting default function!<NEW_LINE>if (init instanceof FunctionNode && Module.DEFAULT_EXPORT_BINDING_NAME.equals(nameNode.getName())) {<NEW_LINE>// hoist the function up to be child of export itself<NEW_LINE>JSFunctionNode funcNode = (JSFunctionNode) declNode.getValue();<NEW_LINE>exportNode.setChildren(new IParseNode[] { funcNode });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (init instanceof ClassNode) {<NEW_LINE>// Swap order of body and name<NEW_LINE>// FIXME What if no name?!<NEW_LINE>IParseNode node = getCurrentNode();<NEW_LINE>// optional first child is superclass/heritage<NEW_LINE><MASK><NEW_LINE>// second-last child should be class body<NEW_LINE>IParseNode body = node.getChild(childCount - 2);<NEW_LINE>// last child should be the class name<NEW_LINE>IParseNode name = node.getChild(childCount - 1);<NEW_LINE>if (childCount == 2) {<NEW_LINE>((JSNode) node).setChildren(new IParseNode[] { name, body });<NEW_LINE>} else {<NEW_LINE>IParseNode heritage = node.getFirstChild();<NEW_LINE>((JSNode) node).setChildren(new IParseNode[] { name, heritage, body });<NEW_LINE>}<NEW_LINE>// class node<NEW_LINE>popNode();<NEW_LINE>}<NEW_LINE>return super.leaveVarNode(varNode);<NEW_LINE>} | int childCount = node.getChildCount(); |
290,846 | public void commit(boolean onSave) {<NEW_LINE>final Model model = getModel();<NEW_LINE>final String comments = FormHelper.trimTrailingSpaces(commentsSource.getDocument().get());<NEW_LINE>model.setAttribute(MODEL_COMMENTS, comments);<NEW_LINE>// TLCUIActivator.getDefault().logDebug("Main page commit");<NEW_LINE>// closed formula<NEW_LINE>String closedFormula = FormHelper.trimTrailingSpaces(this.specSource.getDocument().get());<NEW_LINE>model.setAttribute(MODEL_BEHAVIOR_CLOSED_SPECIFICATION, closedFormula);<NEW_LINE>// init formula<NEW_LINE>String initFormula = FormHelper.trimTrailingSpaces(this.initFormulaSource.getDocument().get());<NEW_LINE>model.setAttribute(MODEL_BEHAVIOR_SEPARATE_SPECIFICATION_INIT, initFormula);<NEW_LINE>// next formula<NEW_LINE>String nextFormula = FormHelper.trimTrailingSpaces(this.nextFormulaSource.getDocument().get());<NEW_LINE>model.setAttribute(MODEL_BEHAVIOR_SEPARATE_SPECIFICATION_NEXT, nextFormula);<NEW_LINE>// fairness formula<NEW_LINE>// String fairnessFormula =<NEW_LINE>// FormHelper.trimTrailingSpaces(this.fairnessFormulaSource.getDocument().get());<NEW_LINE>// model.setAttribute(MODEL_BEHAVIOR_SEPARATE_SPECIFICATION_FAIRNESS,<NEW_LINE>// fairnessFormula);<NEW_LINE>// mode<NEW_LINE>model.setAttribute(MODEL_BEHAVIOR_SPEC_TYPE, getModelConstantForSpecSelection());<NEW_LINE>// check deadlock<NEW_LINE>boolean checkDeadlock = this.checkDeadlockButton.getSelection();<NEW_LINE>model.setAttribute(MODEL_CORRECTNESS_CHECK_DEADLOCK, checkDeadlock);<NEW_LINE>final TLCConsumptionProfile profile = getSelectedTLCProfile();<NEW_LINE>final String profileValue = (profile != null) ? profile.getPreferenceValue() : CUSTOM_TLC_PROFILE_PREFERENCE_VALUE;<NEW_LINE>model.setAttribute(TLC_RESOURCES_PROFILE, profileValue);<NEW_LINE>model.setAttribute(LAUNCH_NUMBER_OF_WORKERS, workerThreadCount.get());<NEW_LINE>model.setAttribute(LAUNCH_MAX_HEAP_SIZE, heapPercentage.get());<NEW_LINE>// run in distributed mode<NEW_LINE>if ((profile != null) && profile.profileIsForRemoteWorkers()) {<NEW_LINE>model.setAttribute(LAUNCH_DISTRIBUTED, profile.getPreferenceValue());<NEW_LINE>} else {<NEW_LINE>model.setAttribute(LAUNCH_DISTRIBUTED, LAUNCH_DISTRIBUTED_NO);<NEW_LINE>}<NEW_LINE>String resultMailAddress = this.resultMailAddressText.getText();<NEW_LINE>model.setAttribute(LAUNCH_DISTRIBUTED_RESULT_MAIL_ADDRESS, resultMailAddress);<NEW_LINE>// distributed FPSet count<NEW_LINE>model.setAttribute(LAUNCH_DISTRIBUTED_FPSET_COUNT, distributedFPSetCountSpinner.getSelection());<NEW_LINE>// distributed FPSet count<NEW_LINE>model.setAttribute(LAUNCH_DISTRIBUTED_NODES_COUNT, distributedNodesCountSpinner.getSelection());<NEW_LINE>// network interface<NEW_LINE>String iface = "";<NEW_LINE>final int index = this.networkInterfaceCombo.getSelectionIndex();<NEW_LINE>if (index == -1) {<NEW_LINE>// Normally, the user selects an address from the provided list.<NEW_LINE>// This branch handles the case where the user manually entered an<NEW_LINE>// address. We don't verify it though.<NEW_LINE>iface = this.networkInterfaceCombo.getText();<NEW_LINE>} else {<NEW_LINE>iface = this.networkInterfaceCombo.getItem(index);<NEW_LINE>}<NEW_LINE>model.setAttribute(LAUNCH_DISTRIBUTED_INTERFACE, iface);<NEW_LINE>// invariants<NEW_LINE>List<String> serializedList = FormHelper.getSerializedInput(invariantsTable);<NEW_LINE>model.setAttribute(MODEL_CORRECTNESS_INVARIANTS, serializedList);<NEW_LINE>// properties<NEW_LINE>serializedList = FormHelper.getSerializedInput(propertiesTable);<NEW_LINE>model.setAttribute(MODEL_CORRECTNESS_PROPERTIES, serializedList);<NEW_LINE>// constants<NEW_LINE>List<String> constants = FormHelper.getSerializedInput(constantTable);<NEW_LINE><MASK><NEW_LINE>// variables<NEW_LINE>String variables = ModelHelper.createVariableList(SemanticHelper.getRootModuleNode());<NEW_LINE>model.setAttribute(MODEL_BEHAVIOR_VARS, variables);<NEW_LINE>super.commit(onSave);<NEW_LINE>} | model.setAttribute(MODEL_PARAMETER_CONSTANTS, constants); |
177,932 | private Mono<Response<Void>> syncFunctionsWithResponseAsync(String resourceGroupName, String name, 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 (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name 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>context = <MASK><NEW_LINE>return service.syncFunctions(this.client.getEndpoint(), resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), context);<NEW_LINE>} | this.client.mergeContext(context); |
1,335,758 | public static Result<Object> exceptionToResultWithSpecialValue(Map<String, Object> optionMap, Throwable e, Object specialValue) {<NEW_LINE>if (!isResultStructure(optionMap) && specialValue != null) {<NEW_LINE>return Result.of(specialValue);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>Map<String, Object> resultData = new LinkedHashMap<>();<NEW_LINE>resultData.put("success", false);<NEW_LINE>resultData.put("message", e.getLocalizedMessage());<NEW_LINE>resultData.put("value", specialValue);<NEW_LINE>resultData.put("lifeCycleTime", currentLostTime());<NEW_LINE>if (e instanceof ThrowRuntimeException) {<NEW_LINE>resultData.put("location", ((ThrowRuntimeException) e).getLocation().toString());<NEW_LINE>resultData.put("code", ((ThrowRuntimeException) e).getThrowCode());<NEW_LINE>resultData.put("executionTime", ((ThrowRuntimeException) e).getExecutionTime());<NEW_LINE>} else if (e instanceof DataQueryException) {<NEW_LINE>resultData.put("location", ((DataQueryException) e).getLocation().toString());<NEW_LINE>resultData.put("code", 500);<NEW_LINE>resultData.put("executionTime", -1);<NEW_LINE>} else {<NEW_LINE>resultData.put("location", "Unknown");<NEW_LINE>resultData.put("code", 500);<NEW_LINE>resultData<MASK><NEW_LINE>}<NEW_LINE>return Result.of(doResponseFormat(optionMap, resultData));<NEW_LINE>} | .put("executionTime", -1); |
1,725,236 | public synchronized void clear() {<NEW_LINE>logger.debug("Clearing all items from auto refresh scheduler");<NEW_LINE>ivUpdateQueue.clear();<NEW_LINE>// Restarting schedule executor<NEW_LINE>if (ivScheduledExecutorService != null) {<NEW_LINE>logger.debug("Schedule executor restart.");<NEW_LINE>ivScheduledExecutorService.shutdown();<NEW_LINE>try {<NEW_LINE>if (ivScheduledExecutorService.awaitTermination(cvScheduledExecutorServiceShutdownTimeout, TimeUnit.SECONDS)) {<NEW_LINE>logger.debug("Schedule executor restart: successfully terminated old instance");<NEW_LINE>} else {<NEW_LINE>logger.debug("Schedule executor restart failed: termination timed out.");<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.debug("Schedule executor restart failed: interrupted while waiting for termination.");<NEW_LINE>}<NEW_LINE>ivScheduledExecutorService = Executors.newScheduledThreadPool(cvNumberOfThreads);<NEW_LINE>logger.debug("Schedule executor restart: started.");<NEW_LINE>}<NEW_LINE>for (Iterator<Integer> lvIterator = cvScheduleMap.keySet().iterator(); lvIterator.hasNext(); ) {<NEW_LINE>int autoRefreshTimeInSecs = lvIterator.next();<NEW_LINE>List<String> lvItemListe = cvScheduleMap.get(autoRefreshTimeInSecs);<NEW_LINE>synchronized (lvItemListe) {<NEW_LINE>logger.debug("Clearing list {}", autoRefreshTimeInSecs);<NEW_LINE>lvItemListe.clear();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>lvIterator.remove();<NEW_LINE>}<NEW_LINE>} | logger.debug("Removing list {} from scheduler", autoRefreshTimeInSecs); |
1,221,581 | public OutlierResult run(Relation<O> relation) {<NEW_LINE>KNNSearcher<DBIDRef> knnQuery = new QueryBuilder<>(relation, distance).kNNByDBID(kplus);<NEW_LINE>FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("kNN distance for objects", relation.size(), LOG) : null;<NEW_LINE>DoubleMinMax minmax = new DoubleMinMax();<NEW_LINE>WritableDoubleDataStore knno_score = DataStoreUtil.makeDoubleStorage(relation.getDBIDs(), DataStoreFactory.HINT_STATIC);<NEW_LINE>// compute distance to the k nearest neighbor.<NEW_LINE>for (DBIDIter it = relation.iterDBIDs(); it.valid(); it.advance()) {<NEW_LINE>// distance to the kth nearest neighbor<NEW_LINE>// (assuming the query point is always included, with distance 0)<NEW_LINE>final double dkn = knnQuery.getKNN(it, kplus).getKNNDistance();<NEW_LINE>knno_score.putDouble(it, dkn);<NEW_LINE>minmax.put(dkn);<NEW_LINE>LOG.incrementProcessed(prog);<NEW_LINE>}<NEW_LINE>LOG.ensureCompleted(prog);<NEW_LINE>DoubleRelation scoreres = new MaterializedDoubleRelation("kNN Outlier Score", relation.getDBIDs(), knno_score);<NEW_LINE>OutlierScoreMeta meta = new BasicOutlierScoreMeta(minmax.getMin(), minmax.getMax(), <MASK><NEW_LINE>return new OutlierResult(meta, scoreres);<NEW_LINE>} | 0., Double.POSITIVE_INFINITY, 0.); |
63,615 | final Cluster executeModifyClusterIamRoles(ModifyClusterIamRolesRequest modifyClusterIamRolesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyClusterIamRolesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyClusterIamRolesRequest> request = null;<NEW_LINE>Response<Cluster> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyClusterIamRolesRequestMarshaller().marshall(super.beforeMarshalling(modifyClusterIamRolesRequest));<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, "Redshift");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<Cluster> responseHandler = new StaxResponseHandler<Cluster>(new ClusterStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyClusterIamRoles"); |
633,861 | public static DisableApplicationScalingRuleResponse unmarshall(DisableApplicationScalingRuleResponse disableApplicationScalingRuleResponse, UnmarshallerContext _ctx) {<NEW_LINE>disableApplicationScalingRuleResponse.setRequestId(_ctx.stringValue("DisableApplicationScalingRuleResponse.RequestId"));<NEW_LINE>disableApplicationScalingRuleResponse.setCode(_ctx.integerValue("DisableApplicationScalingRuleResponse.Code"));<NEW_LINE>disableApplicationScalingRuleResponse.setMessage<MASK><NEW_LINE>AppScalingRule appScalingRule = new AppScalingRule();<NEW_LINE>appScalingRule.setAppId(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.AppId"));<NEW_LINE>appScalingRule.setScaleRuleName(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.ScaleRuleName"));<NEW_LINE>appScalingRule.setScaleRuleType(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.ScaleRuleType"));<NEW_LINE>appScalingRule.setScaleRuleEnabled(_ctx.booleanValue("DisableApplicationScalingRuleResponse.AppScalingRule.ScaleRuleEnabled"));<NEW_LINE>appScalingRule.setMinReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.MinReplicas"));<NEW_LINE>appScalingRule.setMaxReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.MaxReplicas"));<NEW_LINE>appScalingRule.setCreateTime(_ctx.longValue("DisableApplicationScalingRuleResponse.AppScalingRule.CreateTime"));<NEW_LINE>appScalingRule.setUpdateTime(_ctx.longValue("DisableApplicationScalingRuleResponse.AppScalingRule.UpdateTime"));<NEW_LINE>appScalingRule.setLastDisableTime(_ctx.longValue("DisableApplicationScalingRuleResponse.AppScalingRule.LastDisableTime"));<NEW_LINE>Metric metric = new Metric();<NEW_LINE>metric.setMaxReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.Metric.MaxReplicas"));<NEW_LINE>metric.setMinReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.Metric.MinReplicas"));<NEW_LINE>List<Metric1> metrics = new ArrayList<Metric1>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DisableApplicationScalingRuleResponse.AppScalingRule.Metric.Metrics.Length"); i++) {<NEW_LINE>Metric1 metric1 = new Metric1();<NEW_LINE>metric1.setMetricType(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.Metric.Metrics[" + i + "].MetricType"));<NEW_LINE>metric1.setMetricTargetAverageUtilization(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.Metric.Metrics[" + i + "].MetricTargetAverageUtilization"));<NEW_LINE>metrics.add(metric1);<NEW_LINE>}<NEW_LINE>metric.setMetrics(metrics);<NEW_LINE>appScalingRule.setMetric(metric);<NEW_LINE>Trigger trigger = new Trigger();<NEW_LINE>trigger.setMaxReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.MaxReplicas"));<NEW_LINE>trigger.setMinReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.MinReplicas"));<NEW_LINE>List<Trigger2> triggers = new ArrayList<Trigger2>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers.Length"); i++) {<NEW_LINE>Trigger2 trigger2 = new Trigger2();<NEW_LINE>trigger2.setType(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers[" + i + "].Type"));<NEW_LINE>trigger2.setName(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers[" + i + "].Name"));<NEW_LINE>trigger2.setMetaData(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers[" + i + "].MetaData"));<NEW_LINE>triggers.add(trigger2);<NEW_LINE>}<NEW_LINE>trigger.setTriggers(triggers);<NEW_LINE>appScalingRule.setTrigger(trigger);<NEW_LINE>disableApplicationScalingRuleResponse.setAppScalingRule(appScalingRule);<NEW_LINE>return disableApplicationScalingRuleResponse;<NEW_LINE>} | (_ctx.stringValue("DisableApplicationScalingRuleResponse.Message")); |
658,892 | public int compare(Object o1, Object o2) {<NEW_LINE>String s1;<NEW_LINE>String s2;<NEW_LINE>if (o1 == FiltersExplorer.QUERIES || o2 == FiltersExplorer.QUERIES) {<NEW_LINE>return o1 == FiltersExplorer.QUERIES ? 1 : -1;<NEW_LINE>} else if (o1 instanceof Category && o2 instanceof Category) {<NEW_LINE>s1 = ((Category) o1).getName();<NEW_LINE>s2 = ((Category) o2).getName();<NEW_LINE>return s1.compareTo(s2);<NEW_LINE>} else if (o1 instanceof FilterBuilder && o2 instanceof FilterBuilder) {<NEW_LINE>s1 = ((FilterBuilder) o1).getName();<NEW_LINE>s2 = ((FilterBuilder) o2).getName();<NEW_LINE>return s1.compareTo(s2);<NEW_LINE>} else if (o1 instanceof Query && o2 instanceof Query) {<NEW_LINE>s1 = ((<MASK><NEW_LINE>s2 = ((Query) o2).getName();<NEW_LINE>return s1.compareTo(s2);<NEW_LINE>} else if (o1 instanceof Category) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>} | Query) o1).getName(); |
1,608,519 | final SetTimeBasedAutoScalingResult executeSetTimeBasedAutoScaling(SetTimeBasedAutoScalingRequest setTimeBasedAutoScalingRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(setTimeBasedAutoScalingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SetTimeBasedAutoScalingRequest> request = null;<NEW_LINE>Response<SetTimeBasedAutoScalingResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SetTimeBasedAutoScalingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(setTimeBasedAutoScalingRequest));<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, "OpsWorks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetTimeBasedAutoScaling");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SetTimeBasedAutoScalingResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SetTimeBasedAutoScalingResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
727,948 | private void maybeRecordExportDeclaration(NodeTraversal t, Node n) {<NEW_LINE>if (!currentScript.isModule || !n.getString().equals("exports") || !isAssignTarget(n)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// ClosureCheckModule reports an error for duplicate 'exports = ' assignments, but that error<NEW_LINE>// may be suppressed. If so then use the final assignment as the canonical one.<NEW_LINE>if (currentScript.defaultExport != null) {<NEW_LINE>ExportDefinition previousExport = currentScript.defaultExport;<NEW_LINE>String localName = previousExport.getLocalName();<NEW_LINE>if (localName != null && currentScript.namesToInlineByAlias.containsKey(localName)) {<NEW_LINE>currentScript.namesToInlineByAlias.remove(localName);<NEW_LINE>}<NEW_LINE>currentScript.defaultExportLocalName = null;<NEW_LINE>}<NEW_LINE>Node exportRhs = n.getNext();<NEW_LINE>// Exports object should have already been converted in ScriptPreprocess step.<NEW_LINE>checkState(!NodeUtil.isNamedExportsLiteral(exportRhs), "Exports object should have been converted already");<NEW_LINE>currentScript.willCreateExportsObject = true;<NEW_LINE>ExportDefinition defaultExport = <MASK><NEW_LINE>currentScript.defaultExport = defaultExport;<NEW_LINE>if (!currentScript.declareLegacyNamespace && defaultExport.hasInlinableName(currentScript.exportsToInline.keySet())) {<NEW_LINE>String localName = defaultExport.getLocalName();<NEW_LINE>currentScript.defaultExportLocalName = localName;<NEW_LINE>recordExportToInline(defaultExport);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} | ExportDefinition.newDefaultExport(t, exportRhs); |
461,789 | public void run() {<NEW_LINE>Ref<PsiElement> targetElementRef = new Ref<>();<NEW_LINE>QuickDocUtil.runInReadActionWithWriteActionPriorityWithRetries(() -> {<NEW_LINE>if (originalElement.isValid()) {<NEW_LINE>targetElementRef.set(docManager.findTargetElement(editor, offset, originalElement.getContainingFile(), originalElement));<NEW_LINE>}<NEW_LINE>}, 5000, 100, myProgressIndicator);<NEW_LINE>Ref<String> documentationRef = new Ref<>();<NEW_LINE>if (!targetElementRef.isNull()) {<NEW_LINE>try {<NEW_LINE>documentationRef.set(docManager.generateDocumentation(targetElementRef.get(), originalElement, true));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.info(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ApplicationManager.getApplication().invokeLater(() -> {<NEW_LINE>myCurrentRequest = null;<NEW_LINE>if (editor.isDisposed() || (IdeTooltipManager.getInstance().hasCurrent() || IdeTooltipManager.getInstance().hasScheduled()) && !docManager.hasActiveDockedDocWindow()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>String documentation = documentationRef.get();<NEW_LINE>if (targetElement == null || StringUtil.isEmpty(documentation)) {<NEW_LINE>closeQuickDocIfPossible();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>myAlarm.cancelAllRequests();<NEW_LINE>if (!originalElement.equals(SoftReference.dereference(myActiveElements.get(editor)))) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Skip the request if there is a control shown as a result of explicit 'show quick doc' (Ctrl + Q) invocation.<NEW_LINE>if (docManager.getDocInfoHint() != null && !docManager.isCloseOnSneeze()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>editor.putUserData(PopupFactoryImpl.ANCHOR_POPUP_POSITION, editor.offsetToVisualPosition(originalElement.getTextRange().getStartOffset()));<NEW_LINE>docManager.showJavaDocInfo(editor, targetElement, originalElement, new MyCloseDocCallback(editor), documentation, true, false);<NEW_LINE>myDocumentationManager = new WeakReference<>(docManager);<NEW_LINE>}, ApplicationManager.getApplication().getNoneModalityState());<NEW_LINE>} | PsiElement targetElement = targetElementRef.get(); |
1,575,124 | Node tryFoldFor(Node n) {<NEW_LINE><MASK><NEW_LINE>Node init = n.getFirstChild();<NEW_LINE>Node cond = init.getNext();<NEW_LINE>Node increment = cond.getNext();<NEW_LINE>if (!init.isEmpty() && !NodeUtil.isNameDeclaration(init)) {<NEW_LINE>init = trySimplifyUnusedResult(init);<NEW_LINE>if (init == null) {<NEW_LINE>init = IR.empty().srcref(n);<NEW_LINE>n.addChildToFront(init);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!increment.isEmpty()) {<NEW_LINE>increment = trySimplifyUnusedResult(increment);<NEW_LINE>if (increment == null) {<NEW_LINE>increment = IR.empty().srcref(n);<NEW_LINE>increment.insertAfter(cond);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// There is an initializer skip it<NEW_LINE>if (!n.getFirstChild().isEmpty()) {<NEW_LINE>return n;<NEW_LINE>}<NEW_LINE>if (NodeUtil.getBooleanValue(cond) != Tri.FALSE) {<NEW_LINE>return n;<NEW_LINE>}<NEW_LINE>Node parent = n.getParent();<NEW_LINE>NodeUtil.redeclareVarsInsideBranch(n);<NEW_LINE>if (!mayHaveSideEffects(cond)) {<NEW_LINE>NodeUtil.removeChild(parent, n);<NEW_LINE>} else {<NEW_LINE>Node statement = IR.exprResult(cond.detach()).srcrefIfMissing(cond);<NEW_LINE>if (parent.isLabel()) {<NEW_LINE>Node block = IR.block();<NEW_LINE>block.srcrefIfMissing(statement);<NEW_LINE>block.addChildToFront(statement);<NEW_LINE>statement = block;<NEW_LINE>}<NEW_LINE>n.replaceWith(statement);<NEW_LINE>}<NEW_LINE>reportChangeToEnclosingScope(parent);<NEW_LINE>return null;<NEW_LINE>} | checkArgument(n.isVanillaFor()); |
1,076,956 | private void init() throws NullPointerException {<NEW_LINE>try {<NEW_LINE>configuration = new HdfsConfiguration();<NEW_LINE>if (CommonUtils.loadKerberosConf(configuration)) {<NEW_LINE>hdfsUser = "";<NEW_LINE>}<NEW_LINE>String defaultFS = configuration.get(Constants.FS_DEFAULT_FS);<NEW_LINE>// first get key from core-site.xml hdfs-site.xml ,if null ,then try to get from properties file<NEW_LINE>// the default is the local file system<NEW_LINE>if (defaultFS.startsWith("file")) {<NEW_LINE>String defaultFSProp = PropertyUtils.getString(Constants.FS_DEFAULT_FS);<NEW_LINE>if (StringUtils.isNotBlank(defaultFSProp)) {<NEW_LINE>Map<String, String> fsRelatedProps = PropertyUtils.getPrefixedProperties("fs.");<NEW_LINE>configuration.<MASK><NEW_LINE>fsRelatedProps.forEach((key, value) -> configuration.set(key, value));<NEW_LINE>} else {<NEW_LINE>logger.error("property:{} can not to be empty, please set!", Constants.FS_DEFAULT_FS);<NEW_LINE>throw new NullPointerException(String.format("property: %s can not to be empty, please set!", Constants.FS_DEFAULT_FS));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.info("get property:{} -> {}, from core-site.xml hdfs-site.xml ", Constants.FS_DEFAULT_FS, defaultFS);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(hdfsUser)) {<NEW_LINE>UserGroupInformation ugi = UserGroupInformation.createRemoteUser(hdfsUser);<NEW_LINE>ugi.doAs((PrivilegedExceptionAction<Boolean>) () -> {<NEW_LINE>fs = FileSystem.get(configuration);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>logger.warn("hdfs.root.user is not set value!");<NEW_LINE>fs = FileSystem.get(configuration);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | set(Constants.FS_DEFAULT_FS, defaultFSProp); |
518,647 | public static void showHtmlDescriptionDialog(Context ctx, OsmandApplication app, String html, String title) {<NEW_LINE>final <MASK><NEW_LINE>LinearLayout.LayoutParams llTextParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>webView.setLayoutParams(llTextParams);<NEW_LINE>int margin = dpToPx(app, 10f);<NEW_LINE>webView.setPadding(margin, margin, margin, margin);<NEW_LINE>webView.setScrollbarFadingEnabled(true);<NEW_LINE>webView.setVerticalScrollBarEnabled(false);<NEW_LINE>webView.setBackgroundColor(Color.TRANSPARENT);<NEW_LINE>webView.getSettings().setTextZoom((int) (app.getResources().getConfiguration().fontScale * 100f));<NEW_LINE>boolean light = app.getSettings().isLightContent();<NEW_LINE>int textColor = ColorUtilities.getPrimaryTextColor(app, !light);<NEW_LINE>String rgbHex = Algorithms.colorToString(textColor);<NEW_LINE>html = "<body style=\"color:" + rgbHex + ";\">" + html + "</body>";<NEW_LINE>String encoded = Base64.encodeToString(html.getBytes(), Base64.NO_PADDING);<NEW_LINE>webView.loadData(encoded, "text/html", "base64");<NEW_LINE>showText(ctx, app, webView, title);<NEW_LINE>} | WebViewEx webView = new WebViewEx(ctx); |
820,772 | public void launchPhotoProcess(String... photoLabels) {<NEW_LINE>List<Photo> photos = new ArrayList<>();<NEW_LINE>for (String l : photoLabels) {<NEW_LINE>Photo x = this.photoRepository.save(new Photo(l));<NEW_LINE>photos.add(x);<NEW_LINE>}<NEW_LINE>Map<String, Object> procVars = new HashMap<>();<NEW_LINE>procVars.put("photos", photos);<NEW_LINE>ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("dogeProcess", procVars);<NEW_LINE>List<Execution> waitingExecutions = runtimeService.createExecutionQuery().activityId("wait").list();<NEW_LINE>System.out.println("--> # executions = " + waitingExecutions.size());<NEW_LINE>for (Execution execution : waitingExecutions) {<NEW_LINE>runtimeService.trigger(execution.getId());<NEW_LINE>}<NEW_LINE>Task reviewTask = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();<NEW_LINE>taskService.complete(reviewTask.getId(), Collections.singletonMap("approved", (Object) true));<NEW_LINE>long count = runtimeService<MASK><NEW_LINE>System.out.println("Proc count " + count);<NEW_LINE>} | .createProcessInstanceQuery().count(); |
1,583,894 | protected void calculateSymbol() {<NEW_LINE>// Eye diagram listener<NEW_LINE>if (mSymbolDecisionDataListener != null) {<NEW_LINE>mSymbolDecisionDataListener.receive(((InterpolatingSampleBufferInstrumented) getInterpolatingSampleBuffer()).getSymbolDecisionData());<NEW_LINE>}<NEW_LINE>super.calculateSymbol();<NEW_LINE>if (mSamplesPerSymbolListener != null) {<NEW_LINE>mSamplesPerSymbolListener.receive((double) getInterpolatingSampleBuffer().getSamplingPoint());<NEW_LINE>}<NEW_LINE>// Send to an external constellation symbol listener when registered<NEW_LINE>if (mComplexSymbolListener != null) {<NEW_LINE>mComplexSymbolListener.receive(mCurrentSymbol);<NEW_LINE>}<NEW_LINE>if (mPLLErrorListener != null) {<NEW_LINE>mPLLErrorListener.receive((<MASK><NEW_LINE>}<NEW_LINE>if (mPLLFrequencyListener != null) {<NEW_LINE>double loopFrequency = ((CostasLoop) getPLL()).getLoopFrequency();<NEW_LINE>loopFrequency *= mSampleRate / (2.0 * FastMath.PI);<NEW_LINE>mPLLFrequencyListener.receive(loopFrequency);<NEW_LINE>}<NEW_LINE>} | double) mSymbolEvaluator.getPhaseError()); |
1,256,463 | void exportAuthFile(ServicePrincipalImpl servicePrincipal) {<NEW_LINE>if (authFile == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AzureEnvironment environment = AzureEnvironment.AZURE;<NEW_LINE>StringBuilder builder = new StringBuilder("{\n");<NEW_LINE>builder.append(" ").append(String.format("\"clientId\": \"%s\",", servicePrincipal.applicationId())).append("\n");<NEW_LINE>builder.append(" ").append(String.format("\"clientSecret\": \"%s\",", value())).append("\n");<NEW_LINE>builder.append(" ").append(String.format("\"tenantId\": \"%s\",", servicePrincipal.manager().tenantId())).append("\n");<NEW_LINE>builder.append(" ").append(String.format("\"subscriptionId\": \"%s\",", servicePrincipal.assignedSubscription)).append("\n");<NEW_LINE>builder.append(" ").append(String.format("\"activeDirectoryEndpointUrl\": \"%s\",", environment.getActiveDirectoryEndpoint())).append("\n");<NEW_LINE>builder.append(" ").append(String.format("\"resourceManagerEndpointUrl\": \"%s\",", environment.getResourceManagerEndpoint())).append("\n");<NEW_LINE>builder.append(" ").append(String.format("\"activeDirectoryGraphResourceId\": \"%s\",", environment.getGraphEndpoint())).append("\n");<NEW_LINE>builder.append(" ").append(String.format("\"managementEndpointUrl\": \"%s\"", environment.getManagementEndpoint())).append("\n");<NEW_LINE>builder.append("}");<NEW_LINE>try {<NEW_LINE>authFile.write(builder.toString()<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>throw logger.logExceptionAsError(new RuntimeException(e));<NEW_LINE>}<NEW_LINE>} | .getBytes(StandardCharsets.UTF_8)); |
655,701 | private <T> T doWithMatchingMapping(HttpServletRequest request, boolean ignoreException, BiFunction<HandlerMapping, HandlerExecutionChain, T> matchHandler) throws Exception {<NEW_LINE>Assert.notNull(this.handlerMappings, "Handler mappings not initialized");<NEW_LINE>boolean parseRequestPath = !this.pathPatternHandlerMappings.isEmpty();<NEW_LINE>RequestPath previousPath = null;<NEW_LINE>if (parseRequestPath) {<NEW_LINE>previousPath = (RequestPath) request.getAttribute(ServletRequestPathUtils.PATH_ATTRIBUTE);<NEW_LINE>ServletRequestPathUtils.parseAndCache(request);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>for (HandlerMapping handlerMapping : this.handlerMappings) {<NEW_LINE>HandlerExecutionChain chain = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (Exception ex) {<NEW_LINE>if (!ignoreException) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (chain == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>return matchHandler.apply(handlerMapping, chain);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (parseRequestPath) {<NEW_LINE>ServletRequestPathUtils.setParsedRequestPath(previousPath, request);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | chain = handlerMapping.getHandler(request); |
1,443,428 | protected RpcInvocation buildInvocation(MethodDescriptor methodDescriptor) {<NEW_LINE>final URL url = invoker.getUrl();<NEW_LINE>RpcInvocation inv = new RpcInvocation(url.getServiceModel(), methodDescriptor.getMethodName(), serviceDescriptor.getInterfaceName(), url.getProtocolServiceKey(), methodDescriptor.getParameterClasses(), new Object[0]);<NEW_LINE>inv.setTargetServiceUniqueName(url.getServiceKey());<NEW_LINE>inv.setReturnTypes(methodDescriptor.getReturnTypes());<NEW_LINE>inv.setObjectAttachments(StreamUtils.toAttachments(requestMetadata));<NEW_LINE>inv.put(REMOTE_ADDRESS_KEY, stream.remoteAddress());<NEW_LINE>// handle timeout<NEW_LINE>String timeout = (String) requestMetadata.get(TripleHeaderEnum.TIMEOUT.getHeader());<NEW_LINE>try {<NEW_LINE>if (Objects.nonNull(timeout)) {<NEW_LINE>this.timeout = parseTimeoutToMills(timeout);<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>LOGGER.warn(String.format("Failed to parse request timeout set from:%s, service=%s " + "method=%s", timeout, serviceDescriptor.getInterfaceName(), methodName));<NEW_LINE>}<NEW_LINE>if (null != requestMetadata.get(TripleHeaderEnum.CONSUMER_APP_NAME_KEY.getHeader())) {<NEW_LINE>inv.put(TripleHeaderEnum.CONSUMER_APP_NAME_KEY, requestMetadata.get(TripleHeaderEnum<MASK><NEW_LINE>}<NEW_LINE>return inv;<NEW_LINE>} | .CONSUMER_APP_NAME_KEY.getHeader())); |
1,775,215 | public Set<Integer> filter(@Nonnull List<VcsLogDetailsFilter> detailsFilters) {<NEW_LINE>VcsLogTextFilter textFilter = ContainerUtil.findInstance(detailsFilters, VcsLogTextFilter.class);<NEW_LINE>VcsLogUserFilter userFilter = ContainerUtil.findInstance(detailsFilters, VcsLogUserFilter.class);<NEW_LINE>VcsLogStructureFilter pathFilter = ContainerUtil.findInstance(detailsFilters, VcsLogStructureFilter.class);<NEW_LINE>IntSet filteredByMessage = null;<NEW_LINE>if (textFilter != null) {<NEW_LINE>filteredByMessage = filterMessages(textFilter);<NEW_LINE>}<NEW_LINE>IntSet filteredByUser = null;<NEW_LINE>if (userFilter != null) {<NEW_LINE>Set<VcsUser> users = ContainerUtil.newHashSet();<NEW_LINE>for (VirtualFile root : myRoots) {<NEW_LINE>users.addAll(userFilter.getUsers(root));<NEW_LINE>}<NEW_LINE>filteredByUser = filterUsers(users);<NEW_LINE>}<NEW_LINE>IntSet filteredByPath = null;<NEW_LINE>if (pathFilter != null) {<NEW_LINE>filteredByPath = filterPaths(pathFilter.getFiles());<NEW_LINE>}<NEW_LINE>return TroveUtil.<MASK><NEW_LINE>} | intersect(filteredByMessage, filteredByPath, filteredByUser); |
1,426,532 | public static byte[] rotate90(byte[] data, int imageWidth, int imageHeight) {<NEW_LINE>// Rotate the Y luma<NEW_LINE>int i = 0;<NEW_LINE>for (int x = 0; x < imageWidth; x++) {<NEW_LINE>for (int y = imageHeight - 1; y >= 0; y--) {<NEW_LINE>preAllocatedBufferRotate[i++] = <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int size = imageWidth * imageHeight;<NEW_LINE>final int colorSize = size / 4;<NEW_LINE>final int colorHeight = colorSize / imageWidth;<NEW_LINE>// Rotate the U and V color components<NEW_LINE>for (int x = 0; x < imageWidth / 2; x++) {<NEW_LINE>for (int y = colorHeight - 1; y >= 0; y--) {<NEW_LINE>// V<NEW_LINE>preAllocatedBufferRotate[i + colorSize] = data[colorSize + size + (imageWidth * y) + x + (imageWidth / 2)];<NEW_LINE>preAllocatedBufferRotate[i + colorSize + 1] = data[colorSize + size + (imageWidth * y) + x];<NEW_LINE>// U<NEW_LINE>preAllocatedBufferRotate[i++] = data[size + (imageWidth * y) + x + (imageWidth / 2)];<NEW_LINE>preAllocatedBufferRotate[i++] = data[size + (imageWidth * y) + x];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return preAllocatedBufferRotate;<NEW_LINE>} | data[y * imageWidth + x]; |
1,023,684 | public MergeBranchesByFastForwardResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>MergeBranchesByFastForwardResult mergeBranchesByFastForwardResult = new MergeBranchesByFastForwardResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return mergeBranchesByFastForwardResult;<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("commitId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>mergeBranchesByFastForwardResult.setCommitId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("treeId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>mergeBranchesByFastForwardResult.setTreeId(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return mergeBranchesByFastForwardResult;<NEW_LINE>} | class).unmarshall(context)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.