idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,429,438 | private Map<String, Object> countStateByProject(User loginUser, long projectCode, String startDate, String endDate, TriFunction<Date, Date, Long[], List<ExecuteStatusCount>> instanceStateCounter) {<NEW_LINE>Map<String, Object> result = new HashMap<>();<NEW_LINE>if (projectCode != 0) {<NEW_LINE>Project project = projectMapper.queryByCode(projectCode);<NEW_LINE>result = projectService.checkProjectAndAuth(loginUser, project, projectCode);<NEW_LINE>if (result.get(Constants.STATUS) != Status.SUCCESS) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Date start = null;<NEW_LINE>Date end = null;<NEW_LINE>if (!StringUtils.isEmpty(startDate) && !StringUtils.isEmpty(endDate)) {<NEW_LINE><MASK><NEW_LINE>end = DateUtils.getScheduleDate(endDate);<NEW_LINE>if (Objects.isNull(start) || Objects.isNull(end)) {<NEW_LINE>putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, Constants.START_END_DATE);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<ExecuteStatusCount> processInstanceStateCounts = new ArrayList<>();<NEW_LINE>Long[] projectCodeArray = projectCode == 0 ? getProjectCodesArrays(loginUser) : new Long[] { projectCode };<NEW_LINE>if (projectCodeArray.length != 0 || loginUser.getUserType() == UserType.ADMIN_USER) {<NEW_LINE>processInstanceStateCounts = instanceStateCounter.apply(start, end, projectCodeArray);<NEW_LINE>}<NEW_LINE>if (processInstanceStateCounts != null) {<NEW_LINE>TaskCountDto taskCountResult = new TaskCountDto(processInstanceStateCounts);<NEW_LINE>result.put(Constants.DATA_LIST, taskCountResult);<NEW_LINE>putMsg(result, Status.SUCCESS);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | start = DateUtils.getScheduleDate(startDate); |
705,554 | public void createBindings() {<NEW_LINE>DoubleConverter doubleConverter = new DoubleConverter(Configuration.get().getLengthDisplayFormat());<NEW_LINE>IntegerConverter integerConverter = new IntegerConverter();<NEW_LINE>addWrappedBinding(nozzleTip, "methodPartOn", methodPartOn, "selectedItem");<NEW_LINE>addWrappedBinding(nozzleTip, "establishPartOnLevel", establishPartOnLevel, "selected");<NEW_LINE>addWrappedBinding(nozzleTip, "partOnCheckAfterPick", partOnCheckAfterPick, "selected");<NEW_LINE>addWrappedBinding(nozzleTip, "partOnCheckAlign", partOnCheckAlign, "selected");<NEW_LINE>addWrappedBinding(nozzleTip, "partOnCheckBeforePlace", partOnCheckBeforePlace, "selected");<NEW_LINE>addWrappedBinding(nozzleTip, "vacuumLevelPartOnLow", vacuumLevelPartOnLow, "text", doubleConverter);<NEW_LINE>addWrappedBinding(nozzleTip, "vacuumLevelPartOnHigh", vacuumLevelPartOnHigh, "text", doubleConverter);<NEW_LINE>addWrappedBinding(nozzleTip, <MASK><NEW_LINE>addWrappedBinding(nozzleTip, "vacuumDifferencePartOnLow", vacuumDifferencePartOnLow, "text", doubleConverter);<NEW_LINE>addWrappedBinding(nozzleTip, "vacuumDifferencePartOnHigh", vacuumDifferencePartOnHigh, "text", doubleConverter);<NEW_LINE>addWrappedBinding(nozzleTip, "vacuumDifferencePartOnReading", vacuumDifferencePartOnReading, "text", doubleConverter);<NEW_LINE>addWrappedBinding(nozzleTip, "methodPartOff", methodPartOff, "selectedItem");<NEW_LINE>addWrappedBinding(nozzleTip, "establishPartOffLevel", establishPartOffLevel, "selected");<NEW_LINE>addWrappedBinding(nozzleTip, "partOffCheckAfterPlace", partOffCheckAfterPlace, "selected");<NEW_LINE>addWrappedBinding(nozzleTip, "partOffCheckBeforePick", partOffCheckBeforePick, "selected");<NEW_LINE>addWrappedBinding(nozzleTip, "vacuumLevelPartOffLow", vacuumLevelPartOffLow, "text", doubleConverter);<NEW_LINE>addWrappedBinding(nozzleTip, "vacuumLevelPartOffHigh", vacuumLevelPartOffHigh, "text", doubleConverter);<NEW_LINE>addWrappedBinding(nozzleTip, "vacuumLevelPartOffReading", vacuumLevelPartOffReading, "text", doubleConverter);<NEW_LINE>addWrappedBinding(nozzleTip, "partOffProbingMilliseconds", partOffProbingMilliseconds, "text", integerConverter);<NEW_LINE>addWrappedBinding(nozzleTip, "partOffDwellMilliseconds", partOffDwellMilliseconds, "text", integerConverter);<NEW_LINE>addWrappedBinding(nozzleTip, "vacuumDifferencePartOffLow", vacuumDifferencePartOffLow, "text", doubleConverter);<NEW_LINE>addWrappedBinding(nozzleTip, "vacuumDifferencePartOffHigh", vacuumDifferencePartOffHigh, "text", doubleConverter);<NEW_LINE>addWrappedBinding(nozzleTip, "vacuumDifferencePartOffReading", vacuumDifferencePartOffReading, "text", doubleConverter);<NEW_LINE>addWrappedBinding(nozzleTip, "vacuumPartOnGraph", vacuumPartOnGraph, "graph");<NEW_LINE>addWrappedBinding(nozzleTip, "vacuumPartOffGraph", vacuumPartOffGraph, "graph");<NEW_LINE>ComponentDecorators.decorateWithAutoSelect(partOffProbingMilliseconds);<NEW_LINE>ComponentDecorators.decorateWithAutoSelect(partOffDwellMilliseconds);<NEW_LINE>ComponentDecorators.decorateWithAutoSelect(vacuumLevelPartOnLow);<NEW_LINE>ComponentDecorators.decorateWithAutoSelect(vacuumLevelPartOnHigh);<NEW_LINE>ComponentDecorators.decorateWithAutoSelect(vacuumDifferencePartOnLow);<NEW_LINE>ComponentDecorators.decorateWithAutoSelect(vacuumDifferencePartOnHigh);<NEW_LINE>ComponentDecorators.decorateWithAutoSelect(vacuumLevelPartOffLow);<NEW_LINE>ComponentDecorators.decorateWithAutoSelect(vacuumLevelPartOffHigh);<NEW_LINE>ComponentDecorators.decorateWithAutoSelect(vacuumDifferencePartOffLow);<NEW_LINE>ComponentDecorators.decorateWithAutoSelect(vacuumDifferencePartOffHigh);<NEW_LINE>adaptDialog();<NEW_LINE>} | "vacuumLevelPartOnReading", vacuumLevelPartOnReading, "text", doubleConverter); |
45,734 | private void manageToolbarSizes(int width) {<NEW_LINE>// At startup, we get a resize event with 0 width; ignore this.<NEW_LINE>if (width == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// The View button has text by default<NEW_LINE>viewButton_.setText(true, viewButton_.getText());<NEW_LINE>if (width > 400) {<NEW_LINE>// Full width: show full label for data import<NEW_LINE>dataImportButton_.setText(constants_.importDataset());<NEW_LINE>} else if (width > 350) {<NEW_LINE>// Reduced width: shorten label<NEW_LINE>dataImportButton_.<MASK><NEW_LINE>} else if (width > 325) {<NEW_LINE>// Even more reduced width: shorten label more<NEW_LINE>dataImportButton_.setText("");<NEW_LINE>} else {<NEW_LINE>// Extremely narrow: no labels at all, just buttons<NEW_LINE>dataImportButton_.setText("");<NEW_LINE>viewButton_.setText(false, viewButton_.getText());<NEW_LINE>}<NEW_LINE>} | setText(constants_.importCapitalized()); |
969,869 | public org.python.Object __imul__(org.python.Object other) {<NEW_LINE>if (other instanceof org.python.types.Int) {<NEW_LINE>long count = ((org.python.<MASK><NEW_LINE>org.python.types.Tuple result = new org.python.types.Tuple();<NEW_LINE>for (long i = 0; i < count; i++) {<NEW_LINE>result.value.addAll(this.value);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} else if (other instanceof org.python.types.Bool) {<NEW_LINE>boolean bool = ((org.python.types.Bool) other).value;<NEW_LINE>if (bool) {<NEW_LINE>return this;<NEW_LINE>} else {<NEW_LINE>return new org.python.types.Tuple();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new org.python.exceptions.TypeError("can't multiply sequence by non-int of type '" + other.typeName() + "'");<NEW_LINE>}<NEW_LINE>} | types.Int) other).value; |
1,573,362 | public MultiPhraseQuery build(QueryNode queryNode) throws QueryNodeException {<NEW_LINE>MultiPhraseQueryNode phraseNode = (MultiPhraseQueryNode) queryNode;<NEW_LINE>MultiPhraseQuery.Builder phraseQueryBuilder = new MultiPhraseQuery.Builder();<NEW_LINE>List<QueryNode> children = phraseNode.getChildren();<NEW_LINE>if (children != null) {<NEW_LINE>TreeMap<Integer, List<Term>> <MASK><NEW_LINE>for (QueryNode child : children) {<NEW_LINE>FieldQueryNode termNode = (FieldQueryNode) child;<NEW_LINE>TermQuery termQuery = (TermQuery) termNode.getTag(QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);<NEW_LINE>List<Term> termList = positionTermMap.get(termNode.getPositionIncrement());<NEW_LINE>if (termList == null) {<NEW_LINE>termList = new LinkedList<>();<NEW_LINE>positionTermMap.put(termNode.getPositionIncrement(), termList);<NEW_LINE>}<NEW_LINE>termList.add(termQuery.getTerm());<NEW_LINE>}<NEW_LINE>for (Map.Entry<Integer, List<Term>> entry : positionTermMap.entrySet()) {<NEW_LINE>List<Term> termList = entry.getValue();<NEW_LINE>phraseQueryBuilder.add(termList.toArray(new Term[termList.size()]), entry.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return phraseQueryBuilder.build();<NEW_LINE>} | positionTermMap = new TreeMap<>(); |
1,705,844 | public void marshall(LaunchProfileInitialization launchProfileInitialization, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (launchProfileInitialization == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(launchProfileInitialization.getEc2SecurityGroupIds(), EC2SECURITYGROUPIDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(launchProfileInitialization.getLaunchProfileId(), LAUNCHPROFILEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(launchProfileInitialization.getLaunchProfileProtocolVersion(), LAUNCHPROFILEPROTOCOLVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(launchProfileInitialization.getLaunchPurpose(), LAUNCHPURPOSE_BINDING);<NEW_LINE>protocolMarshaller.marshall(launchProfileInitialization.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(launchProfileInitialization.getPlatform(), PLATFORM_BINDING);<NEW_LINE>protocolMarshaller.marshall(launchProfileInitialization.getSystemInitializationScripts(), SYSTEMINITIALIZATIONSCRIPTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(launchProfileInitialization.getUserInitializationScripts(), USERINITIALIZATIONSCRIPTS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | launchProfileInitialization.getActiveDirectory(), ACTIVEDIRECTORY_BINDING); |
1,309,975 | final AcceptInvitationResult executeAcceptInvitation(AcceptInvitationRequest acceptInvitationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(acceptInvitationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AcceptInvitationRequest> request = null;<NEW_LINE>Response<AcceptInvitationResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new AcceptInvitationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(acceptInvitationRequest));<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, "Detective");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptInvitation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AcceptInvitationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AcceptInvitationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
616,096 | /*<NEW_LINE>* Function to tranfrom the given input matrix into sparse matrix and to display<NEW_LINE>* the resulting sparse matrix<NEW_LINE>*/<NEW_LINE>public static void displaySparseMatrix() {<NEW_LINE>// First row's first column denotes the number of rows of a matrix in sparse<NEW_LINE>// matrix<NEW_LINE>sparseMatrix[0][0] = rows;<NEW_LINE>// First row's second column denotes the number of columns of a matrix in sparse<NEW_LINE>// matrix<NEW_LINE>sparseMatrix[0][1] = columns;<NEW_LINE>k = 1;<NEW_LINE>for (i = 0; i < rows; i++) {<NEW_LINE>for (j = 0; j < columns; j++) {<NEW_LINE>// If a particular input of matrix is non-zero<NEW_LINE>if (inputMatrix[i][j] != 0) {<NEW_LINE>// Storing the row index of that particular non zero number<NEW_LINE>sparseMatrix[k][0] = i;<NEW_LINE>// Storing the column index of that particular non zero number<NEW_LINE>sparseMatrix[k][1] = j;<NEW_LINE>sparseMatrix[k][2] <MASK><NEW_LINE>k++;<NEW_LINE>// count variable keeps a track on non-zero entries in the given matri<NEW_LINE>count += 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sparseMatrix[0][2] = count;<NEW_LINE>}<NEW_LINE>// Loop to represent the sparse Matrix<NEW_LINE>System.out.println("Displaying the effecient representation of sparse matrix\n");<NEW_LINE>for (i = 0; i < count + 1; i++) {<NEW_LINE>for (j = 0; j < 3; j++) {<NEW_LINE>System.out.print(sparseMatrix[i][j] + " ");<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>} | = inputMatrix[i][j]; |
973,639 | public static void vertical9(Kernel1D_S32 kernel, GrayU16 src, GrayI16 dst, int divisor, @Nullable GrowArray<DogArray_I32> workspaces) {<NEW_LINE>final short[] dataSrc = src.data;<NEW_LINE>final short[] dataDst = dst.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int k5 = kernel.data[4];<NEW_LINE>final int k6 = kernel.data[5];<NEW_LINE>final int k7 = kernel.data[6];<NEW_LINE>final int k8 = kernel.data[7];<NEW_LINE>final int k9 = kernel.data[8];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int imgWidth = dst.getWidth();<NEW_LINE>final int imgHeight = dst.getHeight();<NEW_LINE>final int halfDivisor = divisor / 2;<NEW_LINE>final int yEnd = imgHeight - radius;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(radius, yEnd, y -> {<NEW_LINE>for (int y = radius; y < yEnd; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>int i = src.startIndex + (y - radius) * src.stride;<NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>int total = (dataSrc[indexSrc] & 0xFFFF) * k1;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFFFF) * k2;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc<MASK><NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFFFF) * k4;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFFFF) * k5;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFFFF) * k6;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFFFF) * k7;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFFFF) * k8;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFFFF) * k9;<NEW_LINE>dataDst[indexDst++] = (short) ((total + halfDivisor) / divisor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | [indexSrc] & 0xFFFF) * k3; |
1,061,383 | public static void gemm(double alpha, DenseMatrix matA, boolean transA, DenseMatrix matB, boolean transB, double beta, DenseMatrix matC) {<NEW_LINE>int ma = transA ? matA.n : matA.m;<NEW_LINE>int na = transA ? matA.m : matA.n;<NEW_LINE>int mb = transB ? matB.n : matB.m;<NEW_LINE>int nb = transB ? matB.m : matB.n;<NEW_LINE>Preconditions.checkArgument(na == mb && ma == matC.m && nb == matC.n, "matrix size mismatched.");<NEW_LINE>final int m = matC.numRows();<NEW_LINE>final <MASK><NEW_LINE>final int k = transA ? matA.numRows() : matA.numCols();<NEW_LINE>final int lda = matA.numRows();<NEW_LINE>final int ldb = matB.numRows();<NEW_LINE>final int ldc = matC.numRows();<NEW_LINE>final String ta = transA ? "T" : "N";<NEW_LINE>final String tb = transB ? "T" : "N";<NEW_LINE>NATIVE_BLAS.dgemm(ta, tb, m, n, k, alpha, matA.getData(), lda, matB.getData(), ldb, beta, matC.getData(), ldc);<NEW_LINE>} | int n = matC.numCols(); |
1,000,609 | public void onHit(HitResult mop) {<NEW_LINE>if (!this.level.isClientSide && !getAmmo().isEmpty()) {<NEW_LINE>IRailgunProjectile projectileProperties = getProjectileProperties();<NEW_LINE>if (projectileProperties != null) {<NEW_LINE>Entity shooter = this.getOwner();<NEW_LINE>UUID shooterUuid = this.getShooterUUID();<NEW_LINE>if (mop instanceof EntityHitResult) {<NEW_LINE>Entity hit = ((EntityHitResult) mop).getEntity();<NEW_LINE>double damage = projectileProperties.getDamage(this.level, hit, shooterUuid, this);<NEW_LINE>hit.hurt(IEDamageSources.causeRailgunDamage(this, shooter), (float) (damage * IEServerConfig.TOOLS.railgun_damage.get()));<NEW_LINE>} else if (mop instanceof BlockHitResult) {<NEW_LINE>double breakRoll = this.random.nextDouble();<NEW_LINE>if (breakRoll <= getProjectileProperties().getBreakChance(shooterUuid, ammo))<NEW_LINE>this.remove();<NEW_LINE>}<NEW_LINE>projectileProperties.onHitTarget(this.<MASK><NEW_LINE>}<NEW_LINE>if (mop instanceof BlockHitResult)<NEW_LINE>this.onHitBlock((BlockHitResult) mop);<NEW_LINE>}<NEW_LINE>} | level, mop, shooterUuid, this); |
1,020,204 | public void createPartControl(Composite parent) {<NEW_LINE>Server server = ServerManager.getInstance().getServer(serverId);<NEW_LINE>this.setPartName("ResponseTime[" + server.getName() + "]");<NEW_LINE>GridLayout layout = new GridLayout(1, true);<NEW_LINE>layout.marginHeight = 5;<NEW_LINE>layout.marginWidth = 5;<NEW_LINE>parent.setLayout(layout);<NEW_LINE>parent.setBackground(ColorUtil.getInstance().getColor(SWT.COLOR_WHITE));<NEW_LINE>parent.setBackgroundMode(SWT.INHERIT_FORCE);<NEW_LINE>canvas = new FigureCanvas(parent);<NEW_LINE>canvas.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>canvas.setScrollBarVisibility(FigureCanvas.NEVER);<NEW_LINE>canvas.addControlListener(new ControlListener() {<NEW_LINE><NEW_LINE>public void controlMoved(ControlEvent arg0) {<NEW_LINE>}<NEW_LINE><NEW_LINE>public void controlResized(ControlEvent arg0) {<NEW_LINE>Rectangle r = canvas.getClientArea();<NEW_LINE>xyGraph.setSize(r.width, r.height);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>xyGraph = new XYGraph();<NEW_LINE>xyGraph.setShowLegend(true);<NEW_LINE>xyGraph.setShowTitle(false);<NEW_LINE>canvas.setContents(xyGraph);<NEW_LINE>xyGraph.primaryXAxis.setDateEnabled(true);<NEW_LINE>xyGraph.primaryXAxis.setShowMajorGrid(true);<NEW_LINE>xyGraph.primaryYAxis.setAutoScale(true);<NEW_LINE>xyGraph.primaryYAxis.setShowMajorGrid(true);<NEW_LINE>xyGraph.primaryXAxis.setFormatPattern("HH:mm:ss");<NEW_LINE>xyGraph.primaryYAxis.setFormatPattern("#,##0");<NEW_LINE><MASK><NEW_LINE>xyGraph.primaryYAxis.setTitle("");<NEW_LINE>xyGraph.primaryYAxis.addMouseListener(new RangeMouseListener(getViewSite().getShell(), xyGraph.primaryYAxis));<NEW_LINE>CircularBufferDataProvider avgProvider = new CircularBufferDataProvider(true);<NEW_LINE>avgProvider.setBufferSize(((int) (TIME_RANGE / REFRESH_INTERVAL) + 1));<NEW_LINE>avgProvider.setCurrentXDataArray(new double[] {});<NEW_LINE>avgProvider.setCurrentYDataArray(new double[] {});<NEW_LINE>avgTrace = new Trace("Response Time(ms)", xyGraph.primaryXAxis, xyGraph.primaryYAxis, avgProvider);<NEW_LINE>avgTrace.setPointStyle(PointStyle.NONE);<NEW_LINE>avgTrace.setTraceType(TraceType.AREA);<NEW_LINE>avgTrace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));<NEW_LINE>avgTrace.setTraceColor(ColorUtil.getInstance().getColor(SWT.COLOR_DARK_GREEN));<NEW_LINE>xyGraph.addTrace(avgTrace);<NEW_LINE>ScouterUtil.addHorizontalRangeListener(xyGraph.getPlotArea(), new OpenDigestTableAction(serverId), false);<NEW_LINE>thread = new RefreshThread(this, REFRESH_INTERVAL);<NEW_LINE>thread.start();<NEW_LINE>} | xyGraph.primaryXAxis.setTitle(""); |
658,418 | public void grant(Cube cube, Access access) {<NEW_LINE>Util.assertPrecondition(cube != null, "cube != null");<NEW_LINE>assert access == Access.ALL || access == Access.NONE || access == Access.CUSTOM;<NEW_LINE>Util.assertPrecondition(isMutable(), "isMutable()");<NEW_LINE>LOGGER.trace("Grant " + access + " on cube " + cube.getName());<NEW_LINE>cubeGrants.put(cube, access);<NEW_LINE>// Set the schema's access to 'custom' if no rules already exist.<NEW_LINE>final Access schemaAccess = <MASK><NEW_LINE>if (schemaAccess == Access.NONE) {<NEW_LINE>LOGGER.trace("Cascading grant " + Access.CUSTOM + " on schema " + cube.getSchema().getName());<NEW_LINE>grant(cube.getSchema(), Access.CUSTOM);<NEW_LINE>}<NEW_LINE>hashCache.add(new Object[] { cube.getClass().getName(), cube.getName(), access.name() });<NEW_LINE>hash = 0;<NEW_LINE>} | getAccess(cube.getSchema()); |
1,263,266 | public void addRecipe(String recipePath, IIngredient seed, IIngredient soil, int time, IItemStack[] outputs, Block renderBlock, @ZenCodeType.Optional("\"generic\"") String renderType) {<NEW_LINE>final ResourceLocation resourceLocation <MASK><NEW_LINE>final List<ItemStack> outputList = CrTIngredientUtil.getNonNullList(outputs);<NEW_LINE>final Ingredient seedIngredient = seed.asVanillaIngredient();<NEW_LINE>final Ingredient soilIngredient = soil.asVanillaIngredient();<NEW_LINE>if (!ClocheRenderFunction.RENDER_FUNCTION_FACTORIES.containsKey(renderType))<NEW_LINE>throw new IllegalArgumentException("Unknown Render Type: " + renderType);<NEW_LINE>final ClocheRenderFunction.ClocheRenderReference renderReference = new ClocheRenderFunction.ClocheRenderReference(renderType, renderBlock);<NEW_LINE>try {<NEW_LINE>final ClocheRecipe recipe = new ClocheRecipe(resourceLocation, outputList, seedIngredient, soilIngredient, time, renderReference);<NEW_LINE>CraftTweakerAPI.apply(new ActionAddRecipe(this, recipe, null));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>CraftTweakerAPI.logThrowing("Could not create Cloche recipe '%s' with renderType '%s': ", ex, recipePath, renderType);<NEW_LINE>}<NEW_LINE>} | = new ResourceLocation("crafttweaker", recipePath); |
1,306,220 | /* Creates an album with albumName provided. */<NEW_LINE>SmugMugAlbumResponse createAlbum(String albumName) throws IOException {<NEW_LINE>// Set up album<NEW_LINE>Map<String, String> json = new HashMap<>();<NEW_LINE>json.put("NiceName", cleanName(albumName));<NEW_LINE>// Allow conflicting names to be changed<NEW_LINE><MASK><NEW_LINE>json.put("Title", albumName);<NEW_LINE>// All imported content is private by default.<NEW_LINE>json.put("Privacy", "Private");<NEW_LINE>// Upload album<NEW_LINE>String folder = user.getUris().get(FOLDER_KEY).getUri();<NEW_LINE>SmugMugResponse<SmugMugAlbumResponse> response = // No HttpContent for album creation<NEW_LINE>postRequest(// No HttpContent for album creation<NEW_LINE>folder + "!albums", // No HttpContent for album creation<NEW_LINE>json, // No special Smugmug headers are required<NEW_LINE>null, ImmutableMap.of(), new TypeReference<SmugMugResponse<SmugMugAlbumResponse>>() {<NEW_LINE>});<NEW_LINE>Preconditions.checkState(response.getResponse() != null, "Response is null");<NEW_LINE>Preconditions.checkState(response.getResponse().getAlbum() != null, "Album is null");<NEW_LINE>return response.getResponse();<NEW_LINE>} | json.put("AutoRename", "true"); |
1,301,542 | protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {<NEW_LINE>super.onActivityResult(requestCode, resultCode, data);<NEW_LINE>Log.d(TAG, "onActivityResult(" + requestCode + "," + resultCode + "," + data + ")");<NEW_LINE>switch(requestCode) {<NEW_LINE>case REQUEST_CHANGE_DEFAULT_SMS_PACKAGE:<NEW_LINE>{<NEW_LINE>if (resultCode == RESULT_CANCELED)<NEW_LINE>break;<NEW_LINE>preferences.setSeenSmsDefaultPackageChangeDialog();<NEW_LINE>if (preferences.getSmsDefaultPackage() != null) {<NEW_LINE>startRestore();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case REQUEST_WEB_AUTH:<NEW_LINE>{<NEW_LINE>if (resultCode == RESULT_CANCELED) {<NEW_LINE>Toast.makeText(this, R.string.ui_dialog_access_token_error_msg, LENGTH_LONG).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String code = data == null ? null : data.getStringExtra(OAuth2WebAuthActivity.EXTRA_CODE);<NEW_LINE>if (!TextUtils.isEmpty(code)) {<NEW_LINE>showDialog(OAUTH2_ACCESS_TOKEN_PROGRESS);<NEW_LINE>new OAuth2CallbackTask(oauth2Client).execute(code);<NEW_LINE>} else {<NEW_LINE>showDialog(OAUTH2_ACCESS_TOKEN_ERROR);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case REQUEST_PICK_ACCOUNT:<NEW_LINE>{<NEW_LINE>if (resultCode == RESULT_OK && data != null) {<NEW_LINE>if (ACTION_ADD_ACCOUNT.equals(data.getAction())) {<NEW_LINE>handleAccountManagerAuth(data);<NEW_LINE>} else if (ACTION_FALLBACK_AUTH.equals(data.getAction())) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else if (LOCAL_LOGV) {<NEW_LINE>Log.v(TAG, "request canceled, result=" + resultCode);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | handleFallbackAuth(new FallbackAuthEvent(true)); |
1,704,757 | private void initBorders(Settings settingsObj) {<NEW_LINE>jScrollPane1.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, ColorUtil.getBorderGray(settingsObj)));<NEW_LINE>jScrollPane4.setBorder(null);<NEW_LINE>if (settingsObj.getUseMacBackgroundColor() || settingsObj.isMacAqua()) {<NEW_LINE>jListKeywords.setBackground((settingsObj.isMacAqua()) ? ColorUtil.colorJTreeBackground : ColorUtil.colorJTreeLighterBackground);<NEW_LINE>jListKeywords.setForeground(ColorUtil.colorJTreeDarkText);<NEW_LINE>}<NEW_LINE>if (settingsObj.isSeaGlass()) {<NEW_LINE>jPanel3.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, ColorUtil.getBorderGray(settingsObj)));<NEW_LINE>jPanel4.setBorder(BorderFactory.createMatteBorder(0, 1, 0, 0, ColorUtil.getBorderGray(settingsObj)));<NEW_LINE>jListKeywords.setBorder(ZknMacWidgetFactory.getTitledBorder(resourceMap.<MASK><NEW_LINE>if (settingsObj.getSearchFrameSplitLayout() == JSplitPane.HORIZONTAL_SPLIT) {<NEW_LINE>jPanel1.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, ColorUtil.getBorderGray(settingsObj)));<NEW_LINE>jPanel2.setBorder(BorderFactory.createMatteBorder(0, 1, 0, 0, ColorUtil.getBorderGray(settingsObj)));<NEW_LINE>} else {<NEW_LINE>jPanel1.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, ColorUtil.getBorderGray(settingsObj)));<NEW_LINE>jPanel2.setBorder(BorderFactory.createMatteBorder(1, 1, 0, 0, ColorUtil.getBorderGray(settingsObj)));<NEW_LINE>}<NEW_LINE>// jPanel3.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, ColorUtil.getBorderGray(settingsObj)));<NEW_LINE>}<NEW_LINE>if (settingsObj.isMacAqua()) {<NEW_LINE>ZknMacWidgetFactory.updateSplitPane(jSplitPaneSearch1);<NEW_LINE>ZknMacWidgetFactory.updateSplitPane(jSplitPaneSearch2);<NEW_LINE>jListKeywords.setBorder(ZknMacWidgetFactory.getTitledBorder(resourceMap.getString("jListKeywords.border.title"), ColorUtil.colorJTreeText, settingsObj));<NEW_LINE>}<NEW_LINE>} | getString("jListKeywords.border.title"), settingsObj)); |
1,242,065 | public void patchServer() {<NEW_LINE>String message = _serverDescriptor.applicationDistrib ? "You are about to install or refresh your" + " server distribution and your application distribution onto this node.\n" + "Do you want shut down all servers affected by this update?" : "You are about to install or refresh the distribution for this server.\n" + "Do you want to shut down the server for this update?";<NEW_LINE>int shutdown = JOptionPane.showConfirmDialog(getCoordinator().getMainFrame(), message, "Patch Confirmation", JOptionPane.YES_NO_CANCEL_OPTION);<NEW_LINE>if (shutdown == JOptionPane.CANCEL_OPTION) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String prefix = "Patching server '" + _id + "'...";<NEW_LINE>final String errorTitle = "Failed to patch " + _id;<NEW_LINE>getCoordinator().<MASK><NEW_LINE>try {<NEW_LINE>final AdminPrx admin = getCoordinator().getAdmin();<NEW_LINE>admin.patchServerAsync(_id, shutdown == JOptionPane.YES_OPTION).whenComplete((result, ex) -> {<NEW_LINE>amiComplete(prefix, errorTitle, ex);<NEW_LINE>});<NEW_LINE>} catch (com.zeroc.Ice.LocalException ex) {<NEW_LINE>failure(prefix, errorTitle, ex.toString());<NEW_LINE>}<NEW_LINE>} | getStatusBar().setText(prefix); |
1,625,982 | private void deleteTiTempFiles() {<NEW_LINE>// Create the "trash" directory if it doesn't already exist.<NEW_LINE>File trashDir = tryCreateDir(getTiInternalCacheDir(), "trash");<NEW_LINE>// Set up an array of all temp directories to be trashed.<NEW_LINE>File[] dirArray = { // The "Ti.Filesystem.tempDirectory" folder.<NEW_LINE>// The legacy temp folder used before Titanium 9.3.0. Won't exist for new app installations.<NEW_LINE>getTiTempDir(), new File<MASK><NEW_LINE>// Trash the above directories.<NEW_LINE>String renameSuffix = "_" + System.currentTimeMillis();<NEW_LINE>for (File nextDir : dirArray) {<NEW_LINE>boolean wasTrashed = true;<NEW_LINE>try {<NEW_LINE>// Move folder under the "trash" folder to be deleted asynchronously.<NEW_LINE>if (nextDir.exists()) {<NEW_LINE>wasTrashed = false;<NEW_LINE>wasTrashed = nextDir.renameTo(new File(trashDir, nextDir.getName() + renameSuffix));<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Log.e(TAG, "Failed to trash directory: " + nextDir, ex);<NEW_LINE>} finally {<NEW_LINE>// If failed to move existing folder to "trash", then do a blocking delete. (Should never happen.)<NEW_LINE>if (!wasTrashed) {<NEW_LINE>TiFileHelper.getInstance().tryDeleteTree(nextDir);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Async delete the "trash" directory tree.<NEW_LINE>Thread thread = new Thread(() -> {<NEW_LINE>TiFileHelper.getInstance().tryDeleteTree(trashDir);<NEW_LINE>});<NEW_LINE>thread.start();<NEW_LINE>} | (getCacheDir(), "_tmp") }; |
1,249,001 | public void draw(Graphics2D graphics) {<NEW_LINE>graphics.setColor(color);<NEW_LINE>int ovalWidth = Math.round(LayerUtilities.pixelsToUnits(graphics, 4, true));<NEW_LINE>int ovalHeight = Math.round(LayerUtilities.pixelsToUnits<MASK><NEW_LINE>// every second<NEW_LINE>if (features != null) {<NEW_LINE>Map<Double, float[]> submap = features.subMap(cs.getMin(Axis.X) / 1000.0, cs.getMax(Axis.X) / 1000.0);<NEW_LINE>for (Map.Entry<Double, float[]> entry : submap.entrySet()) {<NEW_LINE>// in seconds<NEW_LINE>double time = entry.getKey();<NEW_LINE>// in cents<NEW_LINE>double pitch = entry.getValue()[0];<NEW_LINE>if (pitch > cs.getMin(Axis.Y) && pitch < cs.getMax(Axis.Y)) {<NEW_LINE>graphics.drawOval((int) (time * 1000), (int) pitch, ovalWidth, ovalHeight);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (graphics, 4, false)); |
15,857 | public void saxStartElement(SAXReader reader, String namespaceURI, String localName, Attributes atts) throws XMLException {<NEW_LINE>if (localName.equals(RegistryConstants.TAG_TYPE)) {<NEW_LINE>String typeId = atts.getValue(RegistryConstants.ATTR_ID);<NEW_LINE>DBPConnectionType origType = null;<NEW_LINE>for (DBPConnectionType ct : DBPConnectionType.SYSTEM_TYPES) {<NEW_LINE>if (ct.getId().equals(typeId)) {<NEW_LINE>origType = ct;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DBPConnectionType connectionType = new DBPConnectionType(typeId, atts.getValue(RegistryConstants.ATTR_NAME), atts.getValue(RegistryConstants.ATTR_COLOR), atts.getValue(RegistryConstants.ATTR_DESCRIPTION), CommonUtils.getBoolean(atts.getValue(RegistryConstants.ATTR_AUTOCOMMIT), origType != null && origType.isAutocommit()), CommonUtils.getBoolean(atts.getValue(RegistryConstants.ATTR_CONFIRM_EXECUTE), origType != null && origType.isConfirmExecute()), CommonUtils.getBoolean(atts.getValue(RegistryConstants.ATTR_CONFIRM_DATA_CHANGE), origType != null && origType.isConfirmDataChange()), CommonUtils.getBoolean(atts.getValue(RegistryConstants.ATTR_AUTO_CLOSE_TRANSACTIONS), origType != null && origType.isAutoCloseTransactions()));<NEW_LINE>String modifyPermissionList = atts.getValue("modifyPermission");<NEW_LINE>if (!CommonUtils.isEmpty(modifyPermissionList)) {<NEW_LINE>List<DBPDataSourcePermission> <MASK><NEW_LINE>for (String permItem : modifyPermissionList.split(",")) {<NEW_LINE>permList.add(CommonUtils.valueOf(DBPDataSourcePermission.class, permItem, DBPDataSourcePermission.PERMISSION_EDIT_DATA));<NEW_LINE>}<NEW_LINE>connectionType.setModifyPermissions(permList);<NEW_LINE>}<NEW_LINE>connectionTypes.put(connectionType.getId(), connectionType);<NEW_LINE>}<NEW_LINE>} | permList = new ArrayList<>(); |
1,008,287 | public boolean cancel(boolean mayInterruptIfRunning) {<NEW_LINE>Future<Future<R>> resultFuture = getResultFuture();<NEW_LINE>// Sets the result to be a CancellationException<NEW_LINE>boolean cancellationResult = resultFuture.cancel(false);<NEW_LINE>// If cancellationResult is true, then either we've just cancelled the task, or it was already cancelled<NEW_LINE>if (cancellationResult) {<NEW_LINE>// Attempt to cancel the queued/running task<NEW_LINE>getTaskFuture().cancel(mayInterruptIfRunning);<NEW_LINE>} else if (resultFuture.isDone() && !resultFuture.isCancelled()) {<NEW_LINE>try {<NEW_LINE>Future<R<MASK><NEW_LINE>cancellationResult = innerFuture.cancel(mayInterruptIfRunning);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// outerFuture was done so we should never get an interrupted exception<NEW_LINE>throw new FaultToleranceException(e);<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>// this is most likely to be caused if an exception is thrown from the business method ... or a TimeoutException<NEW_LINE>// either way, the future cannot be cancelled<NEW_LINE>cancellationResult = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return cancellationResult;<NEW_LINE>} | > innerFuture = resultFuture.get(); |
1,487,669 | public void processDelta(IJavaElementDelta delta, int eventType) {<NEW_LINE>switch(delta.getKind()) {<NEW_LINE>case IJavaElementDelta.CHANGED:<NEW_LINE>IJavaElementDelta[] children = delta.getAffectedChildren();<NEW_LINE>for (int i = 0, length = children.length; i < length; i++) {<NEW_LINE>IJavaElementDelta child = children[i];<NEW_LINE>processDelta(child, eventType);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case IJavaElementDelta.REMOVED:<NEW_LINE>IJavaElement element = delta.getElement();<NEW_LINE>if (this.encloses(element)) {<NEW_LINE>if (this.elements != null) {<NEW_LINE>this.elements.remove(element);<NEW_LINE>}<NEW_LINE>String path = null;<NEW_LINE>switch(element.getElementType()) {<NEW_LINE>case IJavaElement.JAVA_PROJECT:<NEW_LINE>path = ((IJavaProject) element).getProject()<MASK><NEW_LINE>break;<NEW_LINE>case IJavaElement.PACKAGE_FRAGMENT_ROOT:<NEW_LINE>path = ((IPackageFragmentRoot) element).getPath().toString();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < this.pathsCount; i++) {<NEW_LINE>if (this.relativePaths[i].equals(path)) {<NEW_LINE>this.relativePaths[i] = null;<NEW_LINE>rehash();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | .getFullPath().toString(); |
1,635,765 | public void createPartControl(Composite parent) {<NEW_LINE>parent.setLayout(UIUtil.formLayout(0, 0));<NEW_LINE>parent.setBackground(ColorUtil.getInstance().getColor(SWT.COLOR_WHITE));<NEW_LINE>canvas = new FigureCanvas(parent);<NEW_LINE>canvas.setScrollBarVisibility(FigureCanvas.NEVER);<NEW_LINE>canvas.setBackground(ColorUtil.getInstance().getColor(SWT.COLOR_WHITE));<NEW_LINE>canvas.setLayoutData(UIUtil.formData(0, leftMargin, 0, 0, 100<MASK><NEW_LINE>canvas.addControlListener(new ControlListener() {<NEW_LINE><NEW_LINE>boolean lock = false;<NEW_LINE><NEW_LINE>public void controlResized(ControlEvent e) {<NEW_LINE>org.eclipse.swt.graphics.Rectangle r = canvas.getClientArea();<NEW_LINE>if (!lock) {<NEW_LINE>lock = true;<NEW_LINE>if (ChartUtil.isShowDescriptionAllowSize(r.height)) {<NEW_LINE>CounterRealCountView.this.setContentDescription(desc);<NEW_LINE>} else {<NEW_LINE>CounterRealCountView.this.setContentDescription("");<NEW_LINE>}<NEW_LINE>r = canvas.getClientArea();<NEW_LINE>lock = false;<NEW_LINE>}<NEW_LINE>if (xyGraph == null)<NEW_LINE>return;<NEW_LINE>xyGraph.setSize(r.width, r.height);<NEW_LINE>trace.setLineWidth(r.width / 30);<NEW_LINE>}<NEW_LINE><NEW_LINE>public void controlMoved(ControlEvent e) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>xyGraph = new XYGraph();<NEW_LINE>xyGraph.setShowLegend(false);<NEW_LINE>canvas.setContents(xyGraph);<NEW_LINE>xyGraph.primaryXAxis.setDateEnabled(false);<NEW_LINE>xyGraph.primaryXAxis.setShowMajorGrid(false);<NEW_LINE>xyGraph.primaryYAxis.setAutoScale(true);<NEW_LINE>xyGraph.primaryYAxis.setShowMajorGrid(true);<NEW_LINE>xyGraph.primaryXAxis.setTitle("");<NEW_LINE>xyGraph.primaryYAxis.setTitle("");<NEW_LINE>traceDataProvider = new CircularBufferDataProvider(true);<NEW_LINE>traceDataProvider.setBufferSize(24);<NEW_LINE>traceDataProvider.setCurrentXDataArray(new double[] {});<NEW_LINE>traceDataProvider.setCurrentYDataArray(new double[] {});<NEW_LINE>this.xyGraph.primaryXAxis.setRange(0, 24);<NEW_LINE>// create the trace<NEW_LINE>trace = new Trace("temp", xyGraph.primaryXAxis, xyGraph.primaryYAxis, traceDataProvider);<NEW_LINE>// set trace property<NEW_LINE>trace.setPointStyle(PointStyle.NONE);<NEW_LINE>// trace.getXAxis().setFormatPattern("HH");<NEW_LINE>trace.getYAxis().setFormatPattern("#,##0");<NEW_LINE>trace.setLineWidth(15);<NEW_LINE>trace.setTraceType(TraceType.BAR);<NEW_LINE>trace.setAreaAlpha(200);<NEW_LINE>// add the trace to xyGraph<NEW_LINE>xyGraph.addTrace(trace);<NEW_LINE>restoreState();<NEW_LINE>} | , 0, 100, 0)); |
1,548,835 | public String login(int AD_Org_ID, int AD_Role_ID, int AD_User_ID) {<NEW_LINE>if (!Ini.isSwingClient())<NEW_LINE>return null;<NEW_LINE>//<NEW_LINE>// UI<NEW_LINE>boolean changed = false;<NEW_LINE>final ISysConfigBL sysConfigBL = Services.get(ISysConfigBL.class);<NEW_LINE>ValueNamePair laf = getLookByName(sysConfigBL.getValue(SYSCONFIG_UILookFeel, Env.getAD_Client_ID(Env.getCtx())));<NEW_LINE>ValueNamePair theme = getThemeByName(sysConfigBL.getValue(SYSCONFIG_UITheme, Env.getAD_Client_ID(Env.getCtx())));<NEW_LINE>if (laf != null && theme != null) {<NEW_LINE>String clazz = laf.getValue();<NEW_LINE>String currentLaf = UIManager.getLookAndFeel().getClass().getName();<NEW_LINE>if (!Check.isEmpty(clazz) && !currentLaf.equals(clazz)) {<NEW_LINE>// laf changed<NEW_LINE>AdempierePLAF.setPLAF(laf, theme, true);<NEW_LINE>AEnv.updateUI();<NEW_LINE>changed = true;<NEW_LINE>} else {<NEW_LINE>if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) {<NEW_LINE>MetalTheme currentTheme = MetalLookAndFeel.getCurrentTheme();<NEW_LINE>String themeClass = currentTheme<MASK><NEW_LINE>String sTheme = theme.getValue();<NEW_LINE>if (sTheme != null && sTheme.length() > 0 && !sTheme.equals(themeClass)) {<NEW_LINE>ValueNamePair plaf = ValueNamePair.of(UIManager.getLookAndFeel().getClass().getName(), UIManager.getLookAndFeel().getName());<NEW_LINE>AdempierePLAF.setPLAF(plaf, theme, true);<NEW_LINE>AEnv.updateUI();<NEW_LINE>changed = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (changed)<NEW_LINE>Ini.saveProperties();<NEW_LINE>//<NEW_LINE>// Make sure the UIDefauls from sysconfig were loaded<NEW_LINE>SysConfigUIDefaultsRepository.ofCurrentLookAndFeelId().loadAllFromSysConfigTo(UIManager.getDefaults());<NEW_LINE>return null;<NEW_LINE>} | .getClass().getName(); |
296,027 | public static ListDevicePersonStatisticsResponse unmarshall(ListDevicePersonStatisticsResponse listDevicePersonStatisticsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDevicePersonStatisticsResponse.setRequestId(_ctx.stringValue("ListDevicePersonStatisticsResponse.RequestId"));<NEW_LINE>listDevicePersonStatisticsResponse.setCode<MASK><NEW_LINE>listDevicePersonStatisticsResponse.setMessage(_ctx.stringValue("ListDevicePersonStatisticsResponse.Message"));<NEW_LINE>listDevicePersonStatisticsResponse.setTotalCount(_ctx.longValue("ListDevicePersonStatisticsResponse.TotalCount"));<NEW_LINE>List<Datas> data = new ArrayList<Datas>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDevicePersonStatisticsResponse.Data.Length"); i++) {<NEW_LINE>Datas datas = new Datas();<NEW_LINE>datas.setDataSourceId(_ctx.stringValue("ListDevicePersonStatisticsResponse.Data[" + i + "].DataSourceId"));<NEW_LINE>datas.setShotTime(_ctx.stringValue("ListDevicePersonStatisticsResponse.Data[" + i + "].ShotTime"));<NEW_LINE>datas.setNumber(_ctx.stringValue("ListDevicePersonStatisticsResponse.Data[" + i + "].Number"));<NEW_LINE>data.add(datas);<NEW_LINE>}<NEW_LINE>listDevicePersonStatisticsResponse.setData(data);<NEW_LINE>return listDevicePersonStatisticsResponse;<NEW_LINE>} | (_ctx.stringValue("ListDevicePersonStatisticsResponse.Code")); |
1,152,298 | private void responseLoop() {<NEW_LINE>try {<NEW_LINE>connection.runEventLoop(new ClientConnection.Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void header(Map<String, String> properties) {<NEW_LINE>for (Map.Entry pe : properties.entrySet()) {<NEW_LINE>LOG.fine(" " + pe.getKey() + " = " + pe.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void response(V8Response response) {<NEW_LINE>if (LOG.isLoggable(Level.FINE)) {<NEW_LINE>LOG.fine("response: " + response + ", success = " + response.isSuccess() + ", running = " + response.isRunning() + ", body = " + response.getBody());<NEW_LINE>}<NEW_LINE>handleResponse(response);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void event(V8Event event) {<NEW_LINE>if (LOG.isLoggable(Level.FINE)) {<NEW_LINE>LOG.fine("event: " + event + <MASK><NEW_LINE>}<NEW_LINE>handleEvent(event);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (IOException ioex) {<NEW_LINE>LOG.log(Level.FINE, null, ioex);<NEW_LINE>Throwable cause = ioex.getCause();<NEW_LINE>if (cause != null) {<NEW_LINE>Exceptions.printStackTrace(cause);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>connection.close();<NEW_LINE>} catch (IOException ioex) {<NEW_LINE>} finally {<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ", name = " + event.getKind()); |
1,664,145 | public static void transpose(double[] out, double[] a) {<NEW_LINE>// If we are transposing ourselves we can skip a few steps but have to cache some values<NEW_LINE>if (out == a) {<NEW_LINE>double a01 = a[1], a02 = a[2], a12 = a[5];<NEW_LINE>out[1] = a[3];<NEW_LINE>out[2] = a[6];<NEW_LINE>out[3] = a01;<NEW_LINE>out[5] = a[7];<NEW_LINE>out[6] = a02;<NEW_LINE>out[7] = a12;<NEW_LINE>} else {<NEW_LINE>out<MASK><NEW_LINE>out[1] = a[3];<NEW_LINE>out[2] = a[6];<NEW_LINE>out[3] = a[1];<NEW_LINE>out[4] = a[4];<NEW_LINE>out[5] = a[7];<NEW_LINE>out[6] = a[2];<NEW_LINE>out[7] = a[5];<NEW_LINE>out[8] = a[8];<NEW_LINE>}<NEW_LINE>} | [0] = a[0]; |
351,822 | public ResponseEntity<Void> deletePetWithHttpInfo(Long petId, String apiKey) throws RestClientException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'petId' is set<NEW_LINE>if (petId == null) {<NEW_LINE>throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling deletePet");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>final Map<String, Object> uriVariables = new HashMap<String, Object>();<NEW_LINE>uriVariables.put("petId", petId);<NEW_LINE>final MultiValueMap<String, String> localVarQueryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE><MASK><NEW_LINE>final MultiValueMap<String, String> localVarCookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap<String, Object> localVarFormParams = new LinkedMultiValueMap<String, Object>();<NEW_LINE>if (apiKey != null)<NEW_LINE>localVarHeaderParams.add("api_key", apiClient.parameterToString(apiKey));<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "petstore_auth" };<NEW_LINE>ParameterizedTypeReference<Void> localReturnType = new ParameterizedTypeReference<Void>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("/pet/{petId}", HttpMethod.DELETE, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);<NEW_LINE>} | final HttpHeaders localVarHeaderParams = new HttpHeaders(); |
1,037,133 | private TimeRational timeSigOf(int count, Rational common) {<NEW_LINE>// Determine the time rational value of measure total duration<NEW_LINE>TimeRational timeRational = new TimeRational(count * common.num, common.den);<NEW_LINE>int gcd = GCD.gcd(count, timeRational.num);<NEW_LINE>// Make sure num is a multiple of count<NEW_LINE>timeRational = new TimeRational((count / gcd) * timeRational.num, (count <MASK><NEW_LINE>// No 1 as num<NEW_LINE>if (timeRational.num == 1) {<NEW_LINE>timeRational = new TimeRational(2 * timeRational.num, 2 * timeRational.den);<NEW_LINE>}<NEW_LINE>// All 1/2 values resolve as 2/4<NEW_LINE>if (timeRational.getValue().equals(Rational.HALF)) {<NEW_LINE>timeRational = new TimeRational(2, 4);<NEW_LINE>}<NEW_LINE>return timeRational;<NEW_LINE>} | / gcd) * timeRational.den); |
1,730,999 | /*<NEW_LINE>* Used for preinitialized contexts and fallback engine.<NEW_LINE>*/<NEW_LINE>PolyglotEngineImpl createDefaultEngine(TruffleLanguage<Object> hostLanguage) {<NEW_LINE>Map<String, String> options = PolyglotEngineImpl.readOptionsFromSystemProperties(new HashMap<>());<NEW_LINE>LogConfig logConfig = new LogConfig();<NEW_LINE>OptionValuesImpl engineOptions = PolyglotImpl.createEngineOptions(options, logConfig, true);<NEW_LINE>DispatchOutputStream out = <MASK><NEW_LINE>DispatchOutputStream err = INSTRUMENT.createDispatchOutput(System.err);<NEW_LINE>Handler logHandler = PolyglotEngineImpl.createLogHandler(logConfig, err);<NEW_LINE>EngineLoggerProvider loggerProvider = new PolyglotLoggers.EngineLoggerProvider(logHandler, logConfig.logLevels);<NEW_LINE>final PolyglotEngineImpl engine = new PolyglotEngineImpl(this, new String[0], out, err, System.in, engineOptions, logConfig.logLevels, loggerProvider, options, true, true, true, null, logHandler, hostLanguage, false);<NEW_LINE>return engine;<NEW_LINE>} | INSTRUMENT.createDispatchOutput(System.out); |
690,666 | protected Element createPropRef(Document refDoc, PropertyDoc property) {<NEW_LINE>CompiledPropertyMetadata propertyMetadata = property.getPropertyMetadata();<NEW_LINE><MASK><NEW_LINE>Element refProp = refDoc.createElement(ELEMENT_CONFIG_PROP);<NEW_LINE>refProp.setAttribute(ATTR_CONFIG_PROP_NAME, propName);<NEW_LINE>Element docNode = propertyDocNodes.get(propName);<NEW_LINE>if (docNode != null) {<NEW_LINE>Node docClone = refDoc.importNode(docNode, true);<NEW_LINE>refProp.appendChild(docClone);<NEW_LINE>}<NEW_LINE>Element apiElem = refDoc.createElement(ELEMENT_API);<NEW_LINE>String apiRef = getApiRef(propertyMetadata);<NEW_LINE>apiElem.setTextContent(apiRef);<NEW_LINE>refProp.appendChild(apiElem);<NEW_LINE>Element defaultElem = refDoc.createElement(ELEMENT_DEFAULT);<NEW_LINE>defaultElem.setTextContent(propertyMetadata.getDefaultValue());<NEW_LINE>refProp.appendChild(defaultElem);<NEW_LINE>List<PropertyScope> scopes = propertyMetadata.getScopes();<NEW_LINE>Element scopeElem = refDoc.createElement(ELEMENT_SCOPE);<NEW_LINE>String scopesText = getScopesText(scopes);<NEW_LINE>scopeElem.setTextContent(scopesText);<NEW_LINE>refProp.appendChild(scopeElem);<NEW_LINE>if (scopes.contains(PropertyScope.GLOBAL) && !scopes.contains(PropertyScope.CONTEXT)) {<NEW_LINE>Element contextUnawareElem = refDoc.createElement(ELEMENT_CONTEXT_UNAWARE);<NEW_LINE>refProp.appendChild(contextUnawareElem);<NEW_LINE>}<NEW_LINE>if (!propertyMetadata.getSinceVersion().isEmpty()) {<NEW_LINE>Element sinceElem = refDoc.createElement(ELEMENT_SINCE);<NEW_LINE>sinceElem.setTextContent(propertyMetadata.getSinceVersion());<NEW_LINE>refProp.appendChild(sinceElem);<NEW_LINE>}<NEW_LINE>if (propertyMetadata.isDeprecated()) {<NEW_LINE>Element deprecatedElem = refDoc.createElement(ELEMENT_DEPRECATED);<NEW_LINE>deprecatedElem.setTextContent(Boolean.TRUE.toString());<NEW_LINE>refProp.appendChild(deprecatedElem);<NEW_LINE>}<NEW_LINE>return refProp;<NEW_LINE>} | String propName = propertyMetadata.getName(); |
1,638,185 | public Map<String, Map<String, PropertyMapping>> mappingsForFunction() {<NEW_LINE>Map<String, Map<String, PropertyMapping>> ret = new HashMap<>();<NEW_LINE>Map<String, PropertyMapping> map = new HashMap<>();<NEW_LINE>val sameMode = PropertyMapping.builder().tfAttrName("padding").propertyNames(new String[] { "isSameMode" }).build();<NEW_LINE>val ratesMapping = PropertyMapping.builder().tfAttrName("rates").propertyNames(new String[] { "r0", "r1", "r2", "r3" }).build();<NEW_LINE>val stridesMapping = PropertyMapping.builder().tfAttrName("strides").propertyNames(new String[] { "s0", "s1", "s2", "s3" }).build();<NEW_LINE><MASK><NEW_LINE>map.put("r0", ratesMapping);<NEW_LINE>map.put("r1", ratesMapping);<NEW_LINE>map.put("r2", ratesMapping);<NEW_LINE>map.put("r3", ratesMapping);<NEW_LINE>map.put("s0", stridesMapping);<NEW_LINE>map.put("s1", stridesMapping);<NEW_LINE>map.put("s2", stridesMapping);<NEW_LINE>map.put("s3", stridesMapping);<NEW_LINE>try {<NEW_LINE>ret.put(onnxName(), map);<NEW_LINE>} catch (NoOpNameFoundException e) {<NEW_LINE>// ignore, we dont care about onnx for this set of ops<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ret.put(tensorflowName(), map);<NEW_LINE>} catch (NoOpNameFoundException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | map.put("isSameMode", sameMode); |
50,041 | public ListAssessmentFrameworksResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListAssessmentFrameworksResult listAssessmentFrameworksResult = new ListAssessmentFrameworksResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listAssessmentFrameworksResult;<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("frameworkMetadataList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAssessmentFrameworksResult.setFrameworkMetadataList(new ListUnmarshaller<AssessmentFrameworkMetadata>(AssessmentFrameworkMetadataJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAssessmentFrameworksResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listAssessmentFrameworksResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,413,273 | public void restored() {<NEW_LINE>// Setup the default KeywordSearch configuration files<NEW_LINE>KeywordSearchSettings.setDefaults();<NEW_LINE>final Server server = KeywordSearch.getServer();<NEW_LINE>ExecutorService jobProcessingExecutor = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat(KWS_START_THREAD_NAME).build());<NEW_LINE>Runnable kwsStartTask = new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>server.start();<NEW_LINE>} catch (SolrServerNoPortException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(<MASK><NEW_LINE>if (ex.getPortNumber() == server.getLocalSolrServerPort()) {<NEW_LINE>reportPortError(ex.getPortNumber());<NEW_LINE>} else {<NEW_LINE>reportStopPortError(ex.getPortNumber());<NEW_LINE>}<NEW_LINE>} catch (KeywordSearchModuleException | SolrServerException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.SEVERE, "Failed to start Keyword Search server: ", ex);<NEW_LINE>reportInitError(ex.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>// start KWS service on the background thread. Currently all it does is start the embedded Solr server.<NEW_LINE>jobProcessingExecutor.submit(kwsStartTask);<NEW_LINE>// tell executor no more work is coming<NEW_LINE>jobProcessingExecutor.shutdown();<NEW_LINE>} | Level.SEVERE, "Failed to start Keyword Search server: ", ex); |
348,420 | public boolean visit(SwitchStatement node) {<NEW_LINE>handleBracedCode(node, node.getExpression(), this.options.brace_position_for_switch, this.options.indent_switchstatements_compare_to_switch);<NEW_LINE>List<Statement<MASK><NEW_LINE>if (this.options.indent_switchstatements_compare_to_cases) {<NEW_LINE>int nonBreakStatementEnd = -1;<NEW_LINE>for (Statement statement : statements) {<NEW_LINE>boolean isBreaking = statement instanceof BreakStatement || statement instanceof ReturnStatement || statement instanceof ContinueStatement || statement instanceof Block;<NEW_LINE>if (isBreaking && !(statement instanceof Block))<NEW_LINE>adjustEmptyLineAfter(this.tm.lastIndexIn(statement, -1), -1);<NEW_LINE>if (statement instanceof SwitchCase) {<NEW_LINE>if (nonBreakStatementEnd >= 0) {<NEW_LINE>// indent only comments between previous and current statement<NEW_LINE>this.tm.get(nonBreakStatementEnd + 1).indent();<NEW_LINE>this.tm.firstTokenIn(statement, -1).unindent();<NEW_LINE>}<NEW_LINE>} else if (!(statement instanceof BreakStatement || statement instanceof Block)) {<NEW_LINE>indent(statement);<NEW_LINE>}<NEW_LINE>nonBreakStatementEnd = isBreaking ? -1 : this.tm.lastIndexIn(statement, -1);<NEW_LINE>}<NEW_LINE>if (nonBreakStatementEnd >= 0) {<NEW_LINE>// indent comments between last statement and closing brace<NEW_LINE>this.tm.get(nonBreakStatementEnd + 1).indent();<NEW_LINE>this.tm.lastTokenIn(node, TokenNameRBRACE).unindent();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.options.indent_breaks_compare_to_cases) {<NEW_LINE>for (Statement statement : statements) {<NEW_LINE>if (statement instanceof BreakStatement)<NEW_LINE>indent(statement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean arrowMode = statements.stream().anyMatch(s -> s instanceof SwitchCase && ((SwitchCase) s).isSwitchLabeledRule());<NEW_LINE>for (Statement statement : statements) {<NEW_LINE>if (statement instanceof Block)<NEW_LINE>// will add break in visit(Block) if necessary<NEW_LINE>continue;<NEW_LINE>if (arrowMode && !(statement instanceof SwitchCase))<NEW_LINE>continue;<NEW_LINE>if (this.options.put_empty_statement_on_new_line || !(statement instanceof EmptyStatement))<NEW_LINE>breakLineBefore(statement);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | > statements = node.statements(); |
594,222 | public static DescribeDomainISPDataResponse unmarshall(DescribeDomainISPDataResponse describeDomainISPDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDomainISPDataResponse.setRequestId(_ctx.stringValue("DescribeDomainISPDataResponse.RequestId"));<NEW_LINE>describeDomainISPDataResponse.setDomainName(_ctx.stringValue("DescribeDomainISPDataResponse.DomainName"));<NEW_LINE>describeDomainISPDataResponse.setDataInterval(_ctx.stringValue("DescribeDomainISPDataResponse.DataInterval"));<NEW_LINE>describeDomainISPDataResponse.setStartTime<MASK><NEW_LINE>describeDomainISPDataResponse.setEndTime(_ctx.stringValue("DescribeDomainISPDataResponse.EndTime"));<NEW_LINE>List<ISPProportionData> value = new ArrayList<ISPProportionData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainISPDataResponse.Value.Length"); i++) {<NEW_LINE>ISPProportionData iSPProportionData = new ISPProportionData();<NEW_LINE>iSPProportionData.setISP(_ctx.stringValue("DescribeDomainISPDataResponse.Value[" + i + "].ISP"));<NEW_LINE>iSPProportionData.setProportion(_ctx.stringValue("DescribeDomainISPDataResponse.Value[" + i + "].Proportion"));<NEW_LINE>iSPProportionData.setIspEname(_ctx.stringValue("DescribeDomainISPDataResponse.Value[" + i + "].IspEname"));<NEW_LINE>iSPProportionData.setAvgObjectSize(_ctx.stringValue("DescribeDomainISPDataResponse.Value[" + i + "].AvgObjectSize"));<NEW_LINE>iSPProportionData.setAvgResponseTime(_ctx.stringValue("DescribeDomainISPDataResponse.Value[" + i + "].AvgResponseTime"));<NEW_LINE>iSPProportionData.setBps(_ctx.stringValue("DescribeDomainISPDataResponse.Value[" + i + "].Bps"));<NEW_LINE>iSPProportionData.setQps(_ctx.stringValue("DescribeDomainISPDataResponse.Value[" + i + "].Qps"));<NEW_LINE>iSPProportionData.setAvgResponseRate(_ctx.stringValue("DescribeDomainISPDataResponse.Value[" + i + "].AvgResponseRate"));<NEW_LINE>iSPProportionData.setReqErrRate(_ctx.stringValue("DescribeDomainISPDataResponse.Value[" + i + "].ReqErrRate"));<NEW_LINE>iSPProportionData.setTotalBytes(_ctx.stringValue("DescribeDomainISPDataResponse.Value[" + i + "].TotalBytes"));<NEW_LINE>iSPProportionData.setBytesProportion(_ctx.stringValue("DescribeDomainISPDataResponse.Value[" + i + "].BytesProportion"));<NEW_LINE>iSPProportionData.setTotalQuery(_ctx.stringValue("DescribeDomainISPDataResponse.Value[" + i + "].TotalQuery"));<NEW_LINE>value.add(iSPProportionData);<NEW_LINE>}<NEW_LINE>describeDomainISPDataResponse.setValue(value);<NEW_LINE>return describeDomainISPDataResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeDomainISPDataResponse.StartTime")); |
605,022 | protected PaletteStack createMarqueeSelectionStack() {<NEW_LINE>PaletteStack stack = new PaletteStack(Messages.AbstractPaletteRoot_0, Messages.AbstractPaletteRoot_1, null);<NEW_LINE>MarqueeToolEntry marquee = new MarqueeToolEntry(Messages.AbstractPaletteRoot_2);<NEW_LINE>marquee.setToolProperty(MarqueeSelectionTool.PROPERTY_MARQUEE_BEHAVIOR, Integer<MASK><NEW_LINE>stack.add(marquee);<NEW_LINE>marquee = new MarqueeToolEntry(Messages.AbstractPaletteRoot_3);<NEW_LINE>marquee.setToolProperty(MarqueeSelectionTool.PROPERTY_MARQUEE_BEHAVIOR, Integer.valueOf(MarqueeSelectionTool.BEHAVIOR_NODES_TOUCHED_AND_RELATED_CONNECTIONS));<NEW_LINE>stack.add(marquee);<NEW_LINE>marquee = new MarqueeToolEntry(Messages.AbstractPaletteRoot_4);<NEW_LINE>marquee.setToolProperty(MarqueeSelectionTool.PROPERTY_MARQUEE_BEHAVIOR, Integer.valueOf(MarqueeSelectionTool.BEHAVIOR_CONNECTIONS_CONTAINED));<NEW_LINE>stack.add(marquee);<NEW_LINE>marquee = new MarqueeToolEntry(Messages.AbstractPaletteRoot_5);<NEW_LINE>marquee.setToolProperty(MarqueeSelectionTool.PROPERTY_MARQUEE_BEHAVIOR, Integer.valueOf(MarqueeSelectionTool.BEHAVIOR_CONNECTIONS_TOUCHED));<NEW_LINE>stack.add(marquee);<NEW_LINE>marquee = new MarqueeToolEntry(Messages.AbstractPaletteRoot_6);<NEW_LINE>marquee.setToolProperty(MarqueeSelectionTool.PROPERTY_MARQUEE_BEHAVIOR, Integer.valueOf(MarqueeSelectionTool.BEHAVIOR_NODES_CONTAINED));<NEW_LINE>stack.add(marquee);<NEW_LINE>marquee = new MarqueeToolEntry(Messages.AbstractPaletteRoot_7);<NEW_LINE>marquee.setToolProperty(MarqueeSelectionTool.PROPERTY_MARQUEE_BEHAVIOR, Integer.valueOf(MarqueeSelectionTool.BEHAVIOR_NODES_TOUCHED));<NEW_LINE>stack.add(marquee);<NEW_LINE>return stack;<NEW_LINE>} | .valueOf(MarqueeSelectionTool.BEHAVIOR_NODES_CONTAINED_AND_RELATED_CONNECTIONS)); |
1,227,669 | public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {<NEW_LINE>// Get the connected device<NEW_LINE>BluetoothDevice device = gatt.getDevice();<NEW_LINE>String address = device.getAddress();<NEW_LINE>HashMap<Object, Object> connection = connections.get(address);<NEW_LINE>if (connection == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>queueRemove(connection);<NEW_LINE>UUID characteristicUuid = characteristic.getUuid();<NEW_LINE>CallbackContext callbackContext = GetCallback(characteristicUuid, connection, operationWrite);<NEW_LINE>// Check if any other write commands are queued up<NEW_LINE>if (queueQuick.size() > 0) {<NEW_LINE>if (status == BluetoothGatt.GATT_SUCCESS) {<NEW_LINE>writeQ(connection, characteristic, gatt);<NEW_LINE>} else {<NEW_LINE>// If there was an error, clear the queue<NEW_LINE>queueQuick.clear();<NEW_LINE>if (callbackContext == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JSONObject returnObj = new JSONObject();<NEW_LINE>addDevice(returnObj, device);<NEW_LINE>addCharacteristic(returnObj, characteristic);<NEW_LINE>addProperty(returnObj, keyError, errorWrite);<NEW_LINE>addProperty(returnObj, keyMessage, logWriteFailReturn);<NEW_LINE>addProperty(returnObj, keyStatus, status);<NEW_LINE>callbackContext.error(returnObj);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>RemoveCallback(characteristicUuid, connection, operationWrite);<NEW_LINE>// If no callback, just return<NEW_LINE>if (callbackContext == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JSONObject returnObj = new JSONObject();<NEW_LINE>addDevice(returnObj, device);<NEW_LINE>addCharacteristic(returnObj, characteristic);<NEW_LINE>// If write was successful, return the written value<NEW_LINE>if (status == BluetoothGatt.GATT_SUCCESS) {<NEW_LINE>addProperty(returnObj, keyStatus, statusWritten);<NEW_LINE>addPropertyBytes(returnObj, <MASK><NEW_LINE>callbackContext.success(returnObj);<NEW_LINE>} else {<NEW_LINE>// Else it failed<NEW_LINE>addProperty(returnObj, keyError, errorWrite);<NEW_LINE>addProperty(returnObj, keyMessage, logWriteFailReturn);<NEW_LINE>addProperty(returnObj, keyStatus, status);<NEW_LINE>callbackContext.error(returnObj);<NEW_LINE>}<NEW_LINE>} | keyValue, characteristic.getValue()); |
868,887 | public RowBasedMatrix calulate(int rowId, Vector other, Binary op) {<NEW_LINE>assert other != null;<NEW_LINE>RBCompIntFloatMatrix res;<NEW_LINE>if (op.isInplace()) {<NEW_LINE>res = this;<NEW_LINE>} else {<NEW_LINE>res = new RBCompIntFloatMatrix(matrixId, clock, rows.length<MASK><NEW_LINE>}<NEW_LINE>if (null == rows[rowId]) {<NEW_LINE>initEmpty(rowId);<NEW_LINE>}<NEW_LINE>if (op.isInplace()) {<NEW_LINE>BinaryExecutor.apply(rows[rowId], other, op);<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < rows.length; i++) {<NEW_LINE>if (i == rowId) {<NEW_LINE>res.setRow(rowId, (CompIntFloatVector) BinaryExecutor.apply(rows[rowId], other, op));<NEW_LINE>} else if (rows[i] != null) {<NEW_LINE>res.setRow(rowId, rows[i].copy());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | , (int) cols, subDim); |
778,630 | void cacheBeanUpdate(String key, Map<String, Object> changes, boolean updateNaturalKey, long version) {<NEW_LINE>ServerCache cache = getBeanCache();<NEW_LINE>CachedBeanData existingData = (CachedBeanData) cache.get(key);<NEW_LINE>if (existingData != null) {<NEW_LINE>long currentVersion = existingData.getVersion();<NEW_LINE>if (version > 0 && version < currentVersion) {<NEW_LINE>if (beanLog.isDebugEnabled()) {<NEW_LINE>beanLog.debug(" REMOVE {}({}) - version conflict old:{} new:{}", cacheName, key, currentVersion, version);<NEW_LINE>}<NEW_LINE>cache.remove(key);<NEW_LINE>} else {<NEW_LINE>if (version == 0) {<NEW_LINE>version = currentVersion;<NEW_LINE>}<NEW_LINE>CachedBeanData newData = <MASK><NEW_LINE>if (beanLog.isDebugEnabled()) {<NEW_LINE>beanLog.debug(" UPDATE {}({}) changes:{}", cacheName, key, changes);<NEW_LINE>}<NEW_LINE>cache.put(key, newData);<NEW_LINE>}<NEW_LINE>if (updateNaturalKey) {<NEW_LINE>Object oldKey = calculateNaturalKey(existingData);<NEW_LINE>if (oldKey != null) {<NEW_LINE>if (natLog.isDebugEnabled()) {<NEW_LINE>natLog.debug(".. update {} REMOVE({}) - old key for ({})", cacheName, oldKey, key);<NEW_LINE>}<NEW_LINE>naturalKeyCache.remove(oldKey);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | existingData.update(changes, version); |
14,874 | private void checkNav() {<NEW_LINE>if (context.profile == EPUBProfile.EDUPUB || context.pubTypes.contains(OPFData.DC_TYPE_EDUPUB)) {<NEW_LINE>Set<Feature> sections = context.featureReport.getFeature(FeatureEnum.SECTIONS);<NEW_LINE>Set<Feature> tocLinks = context.featureReport.getFeature(FeatureEnum.TOC_LINKS);<NEW_LINE>if (sections.size() != tocLinks.size()) {<NEW_LINE>report.message(MessageId.NAV_004, tocLinks.isEmpty() ? EPUBLocation.create(path) : tocLinks.iterator().next().getLocation().get());<NEW_LINE>}<NEW_LINE>if (context.featureReport.hasFeature(FeatureEnum.AUDIO) && !context.featureReport.hasFeature(FeatureEnum.LOA)) {<NEW_LINE>report.message(MessageId.NAV_005, tocLinks.isEmpty() ? EPUBLocation.create(path) : tocLinks.iterator().next().<MASK><NEW_LINE>}<NEW_LINE>if (context.featureReport.hasFeature(FeatureEnum.FIGURE) && !context.featureReport.hasFeature(FeatureEnum.LOI)) {<NEW_LINE>report.message(MessageId.NAV_006, tocLinks.isEmpty() ? EPUBLocation.create(path) : tocLinks.iterator().next().getLocation().get());<NEW_LINE>}<NEW_LINE>if (context.featureReport.hasFeature(FeatureEnum.TABLE) && !context.featureReport.hasFeature(FeatureEnum.LOT)) {<NEW_LINE>report.message(MessageId.NAV_007, tocLinks.isEmpty() ? EPUBLocation.create(path) : tocLinks.iterator().next().getLocation().get());<NEW_LINE>}<NEW_LINE>if (context.featureReport.hasFeature(FeatureEnum.VIDEO) && !context.featureReport.hasFeature(FeatureEnum.LOV)) {<NEW_LINE>report.message(MessageId.NAV_008, tocLinks.isEmpty() ? EPUBLocation.create(path) : tocLinks.iterator().next().getLocation().get());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getLocation().get()); |
1,621,346 | public Root unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Root root = new Root();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Id", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>root.setId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Arn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>root.setArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>root.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("PolicyTypes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>root.setPolicyTypes(new ListUnmarshaller<PolicyTypeSummary>(PolicyTypeSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return root;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
154,535 | public void rollback() throws ResourceException {<NEW_LINE>svLogger.entering(CLASSNAME, "rollback", new Object[] { this, ivMC });<NEW_LINE>ResourceException re;<NEW_LINE>try {<NEW_LINE>synchronized (ivMC) {<NEW_LINE>re = ivStateManager.isValid(StateManager.LT_ROLLBACK);<NEW_LINE>if (re == null) {<NEW_LINE>ivConnection.rollback();<NEW_LINE>ivMC.setAutoCommit(prevAutoCommit);<NEW_LINE>ivStateManager.transtate = StateManager.NO_TRANSACTION_ACTIVE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SQLException se) {<NEW_LINE>svLogger.exiting(CLASSNAME, "rollback", "SQLException");<NEW_LINE>throw new ResourceException(se.getMessage());<NEW_LINE>}<NEW_LINE>if (re != null) {<NEW_LINE>svLogger.exiting(CLASSNAME, "rollback", "ResourceException");<NEW_LINE>throw new ResourceException("Cannot rollback SPI local transaction: " + re.getMessage());<NEW_LINE>}<NEW_LINE>// Reset so we can deferred enlist in a future global transaction. [d137506]<NEW_LINE>ivMC.isLazyEnlisted = false;<NEW_LINE>svLogger.info("SpiLocalTransaction rolled back. ManagedConnection state is " + ivMC.getTransactionStateAsString());<NEW_LINE><MASK><NEW_LINE>} | svLogger.exiting(CLASSNAME, "rollback"); |
1,435,896 | public boolean initializeCamera(boolean isPortrait) {<NEW_LINE>this.isPortrait = isPortrait;<NEW_LINE>// Open camera<NEW_LINE>if (mCamera == null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Log.i(TAG, "Open camera...");<NEW_LINE>mCamera = Camera.open();<NEW_LINE>if (mCamera == null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Log.w(TAG, "Camera failed to open");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pausePreview();<NEW_LINE>// Get parameters<NEW_LINE>mCamera.setParameters(setParameters(mCamera.getParameters()));<NEW_LINE>width = mPreviewSize.width;<NEW_LINE>height = mPreviewSize.height;<NEW_LINE>if (mPreviewSize == null || mPreviewFormat == 0) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Log.e(TAG, "Preview size or format error");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Define buffer size<NEW_LINE>PixelFormat pixelinfo = new PixelFormat();<NEW_LINE>PixelFormat.getPixelFormatInfo(mPreviewFormat, pixelinfo);<NEW_LINE>bitsPerPixel = pixelinfo.bitsPerPixel;<NEW_LINE>mBufferSize = mPreviewSize.width * mPreviewSize<MASK><NEW_LINE>// $NON-NLS-1$//$NON-NLS-2$<NEW_LINE>Log.d(TAG, "Pixelsize = " + pixelinfo.bitsPerPixel + " Buffersize = " + mBufferSize);<NEW_LINE>nBuffers = 1;<NEW_LINE>// Initialize frame grabbing<NEW_LINE>// mPreviewHandler = new PreviewHandler("CameraPreviewHandler");<NEW_LINE>context.runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>camPreview = new CameraPreview(context);<NEW_LINE>// camPreview.setVisibility(View.INVISIBLE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Log.d(TAG, "Camera preview started");<NEW_LINE>return true;<NEW_LINE>} | .height * pixelinfo.bitsPerPixel / 8; |
668,614 | private List<LSCompletionItem> populateSelfClassSymbolCompletionItems(Symbol symbol, BallerinaCompletionContext ctx, TypeSymbol rawType) {<NEW_LINE>Optional<ModuleMemberDeclarationNode> moduleMember = ctx.enclosedModuleMember();<NEW_LINE>if (moduleMember.isEmpty() || (!CommonUtil.isSelfClassSymbol(symbol, ctx, moduleMember.get()) && !CommonUtil.isSelfObjectSymbol(symbol, ctx.getNodeAtCursor()))) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>List<LSCompletionItem> completionItems = new ArrayList<>();<NEW_LINE>ObjectTypeSymbol objectTypeDesc = (ObjectTypeSymbol) rawType;<NEW_LINE>objectTypeDesc.fieldDescriptors().values().stream().map(classFieldSymbol -> {<NEW_LINE>CompletionItem completionItem = FieldCompletionItemBuilder.build(classFieldSymbol, true);<NEW_LINE>return new <MASK><NEW_LINE>}).forEach(completionItems::add);<NEW_LINE>objectTypeDesc.methods().values().stream().map(methodSymbol -> {<NEW_LINE>CompletionItem completionItem = FunctionCompletionItemBuilder.buildMethod(methodSymbol, ctx);<NEW_LINE>return new SymbolCompletionItem(ctx, methodSymbol, completionItem);<NEW_LINE>}).forEach(completionItems::add);<NEW_LINE>return completionItems;<NEW_LINE>} | ObjectFieldCompletionItem(ctx, classFieldSymbol, completionItem); |
407,932 | private void replaceNull(LocalValue<?> key, Object value, int index) {<NEW_LINE>Entry[] tab = table;<NEW_LINE>int len = tab.length;<NEW_LINE>Entry e;<NEW_LINE>int slotToExpunge = index;<NEW_LINE>for (int i = prevIndex(index, len); (e = tab[i]) != null; i = prevIndex(i, len)) if (e.k == null) {<NEW_LINE>slotToExpunge = i;<NEW_LINE>}<NEW_LINE>for (int i = nextIndex(index, len); (e = tab[i]) != null; i = nextIndex(i, len)) {<NEW_LINE>LocalValue<MASK><NEW_LINE>if (k == key) {<NEW_LINE>Misc.free(e.value);<NEW_LINE>e.value = value;<NEW_LINE>tab[i] = tab[index];<NEW_LINE>tab[index] = e;<NEW_LINE>if (slotToExpunge == index) {<NEW_LINE>slotToExpunge = i;<NEW_LINE>}<NEW_LINE>removeNullKeys(removeNull(slotToExpunge), len);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (k == null && slotToExpunge == index) {<NEW_LINE>slotToExpunge = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tab[index].value = Misc.free(tab[index].value);<NEW_LINE>tab[index] = new Entry(key, value);<NEW_LINE>if (slotToExpunge != index) {<NEW_LINE>removeNullKeys(removeNull(slotToExpunge), len);<NEW_LINE>}<NEW_LINE>} | <?> k = e.k; |
20,668 | public static Collection<? extends CodeTransformer> extractRules(ClassTree tree, Context context) {<NEW_LINE>ClassSymbol sym = ASTHelpers.getSymbol(tree);<NEW_LINE>RefasterRuleBuilderScanner scanner = new RefasterRuleBuilderScanner(context);<NEW_LINE>// visit abstract methods first<NEW_LINE>ImmutableList<MethodTree> methods = new Ordering<MethodTree>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(MethodTree l, MethodTree r) {<NEW_LINE>return Boolean.compare(l.getModifiers().getFlags().contains(Modifier.ABSTRACT), r.getModifiers().getFlags().contains(Modifier.ABSTRACT));<NEW_LINE>}<NEW_LINE>}.reverse().immutableSortedCopy(Iterables.filter(tree.getMembers(), MethodTree.class));<NEW_LINE>scanner.visit(methods, null);<NEW_LINE>UTemplater templater = new UTemplater(context);<NEW_LINE>List<UType> types = templater.templateTypes(<MASK><NEW_LINE>return scanner.createMatchers(Iterables.filter(types, UTypeVar.class), sym.getQualifiedName().toString(), UTemplater.annotationMap(sym));<NEW_LINE>} | sym.type.getTypeArguments()); |
1,412,630 | public boolean init() {<NEW_LINE>Intent orbot = OrbotHelper.getOrbotStartIntent(context);<NEW_LINE>if (validateOrbot) {<NEW_LINE>ArrayList<String> hashes = new ArrayList<String>();<NEW_LINE>// Tor Project signing key<NEW_LINE>hashes.add("A4:54:B8:7A:18:47:A8:9E:D7:F5:E7:0F:BA:6B:BA:96:F3:EF:29:C2:6E:09:81:20:4F:E3:47:BF:23:1D:FD:5B");<NEW_LINE>// f-droid.org signing key<NEW_LINE>hashes.add("A7:02:07:92:4F:61:FF:09:37:1D:54:84:14:5C:4B:EE:77:2C:55:C1:9E:EE:23:2F:57:70:E1:82:71:F7:CB:AE");<NEW_LINE>orbot = SignatureUtils.validateBroadcastIntent(<MASK><NEW_LINE>}<NEW_LINE>if (orbot != null) {<NEW_LINE>isInstalled = true;<NEW_LINE>handler.postDelayed(onStatusTimeout, statusTimeoutMs);<NEW_LINE>context.registerReceiver(orbotStatusReceiver, new IntentFilter(OrbotHelper.ACTION_STATUS));<NEW_LINE>context.sendBroadcast(orbot);<NEW_LINE>} else {<NEW_LINE>isInstalled = false;<NEW_LINE>for (StatusCallback cb : statusCallbacks) {<NEW_LINE>cb.onNotYetInstalled();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (isInstalled);<NEW_LINE>} | context, orbot, hashes, false); |
333,450 | public MultiTreeSPEntry[] calcPaths(int[] from, int[] to) {<NEW_LINE>for (int i = 0; i < from.length; i++) {<NEW_LINE>if (from[i] == -1)<NEW_LINE>continue;<NEW_LINE>// If two queried points are on the same node, this case can occur<NEW_LINE>MultiTreeSPEntry existing = bestWeightMapFrom.get(from[i]);<NEW_LINE>if (existing != null) {<NEW_LINE>existing.getItem(i).setWeight(0.0);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>currFrom = new MultiTreeSPEntry(from[i], EdgeIterator.NO_EDGE, 0.0, true, null, from.length);<NEW_LINE>currFrom.getItem(i).setWeight(0.0);<NEW_LINE>currFrom.setVisited(true);<NEW_LINE>prioQueue.add(currFrom);<NEW_LINE>if (!traversalMode.isEdgeBased())<NEW_LINE>bestWeightMapFrom.put(from[i], currFrom);<NEW_LINE>else<NEW_LINE>throw new IllegalStateException("Edge-based behavior not supported");<NEW_LINE>}<NEW_LINE>outEdgeExplorer = graph.createEdgeExplorer();<NEW_LINE>runUpwardSearch();<NEW_LINE>currFrom = bestWeightMapFrom.get(upwardEdgeFilter.getHighestNode());<NEW_LINE>currFrom.setVisited(true);<NEW_LINE>currFrom.resetUpdate(true);<NEW_LINE>prioQueue.clear();<NEW_LINE>prioQueue.add(currFrom);<NEW_LINE>for (int i = 0; i < from.length; i++) {<NEW_LINE>int sourceNode = from[i];<NEW_LINE>MultiTreeSPEntry <MASK><NEW_LINE>mspTree.getItem(i).setUpdate(true);<NEW_LINE>prioQueue.add(mspTree);<NEW_LINE>}<NEW_LINE>outEdgeExplorer = targetGraph.createExplorer();<NEW_LINE>runDownwardSearch();<NEW_LINE>MultiTreeSPEntry[] targets = new MultiTreeSPEntry[to.length];<NEW_LINE>for (int i = 0; i < to.length; ++i) targets[i] = bestWeightMapFrom.get(to[i]);<NEW_LINE>return targets;<NEW_LINE>} | mspTree = bestWeightMapFrom.get(sourceNode); |
886,402 | public static Renderable createCompletionDocumentation(String id, Renderable description, Object defaultValue, Deprecation deprecation) {<NEW_LINE>Builder<Renderable> renderableBuilder = ImmutableList.builder();<NEW_LINE>boolean idInserted = false;<NEW_LINE>if (deprecation != null && deprecation.getReplacement() != null) {<NEW_LINE>renderId(renderableBuilder, id, deprecation);<NEW_LINE>idInserted = true;<NEW_LINE>}<NEW_LINE>if (description != null) {<NEW_LINE>if (idInserted) {<NEW_LINE>renderableBuilder.add(lineBreak());<NEW_LINE>}<NEW_LINE>descriptionRenderable(renderableBuilder, description);<NEW_LINE>}<NEW_LINE>String deflt = formatDefaultValue(defaultValue);<NEW_LINE>if (deflt != null) {<NEW_LINE>if (idInserted || description != null) {<NEW_LINE>renderableBuilder.add(lineBreak());<NEW_LINE>}<NEW_LINE>defaultValueRenderable(renderableBuilder, deflt);<NEW_LINE>}<NEW_LINE>if (deprecation != null) {<NEW_LINE>if (idInserted || description != null) {<NEW_LINE>renderableBuilder.add(lineBreak());<NEW_LINE>}<NEW_LINE>depreactionRenderable(renderableBuilder, deprecation);<NEW_LINE>}<NEW_LINE>ImmutableList<Renderable<MASK><NEW_LINE>// Special case when there is no description, default value and deprecation data -> return `null` documentation.<NEW_LINE>if (pieces.size() == 1 && pieces.get(0) == Renderables.NO_DESCRIPTION) {<NEW_LINE>pieces = ImmutableList.of();<NEW_LINE>}<NEW_LINE>return pieces.isEmpty() ? null : concat(pieces);<NEW_LINE>} | > pieces = renderableBuilder.build(); |
14,954 | public Request<DescribeManagedJobTemplateRequest> marshall(DescribeManagedJobTemplateRequest describeManagedJobTemplateRequest) {<NEW_LINE>if (describeManagedJobTemplateRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DescribeManagedJobTemplateRequest)");<NEW_LINE>}<NEW_LINE>Request<DescribeManagedJobTemplateRequest> request = new DefaultRequest<DescribeManagedJobTemplateRequest>(describeManagedJobTemplateRequest, "AWSIot");<NEW_LINE>request.setHttpMethod(HttpMethodName.GET);<NEW_LINE>String uriResourcePath = "/managed-job-templates/{templateName}";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{templateName}", (describeManagedJobTemplateRequest.getTemplateName() == null) ? "" : StringUtils.fromString<MASK><NEW_LINE>if (describeManagedJobTemplateRequest.getTemplateVersion() != null) {<NEW_LINE>request.addParameter("templateVersion", StringUtils.fromString(describeManagedJobTemplateRequest.getTemplateVersion()));<NEW_LINE>}<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.0");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (describeManagedJobTemplateRequest.getTemplateName())); |
572,118 | private Position decodeInfo(Channel channel, SocketAddress remoteAddress, String sentence) {<NEW_LINE>Position position <MASK><NEW_LINE>getLastLocation(position, null);<NEW_LINE>DeviceSession deviceSession;<NEW_LINE>if (sentence.startsWith("$INFO")) {<NEW_LINE>Parser parser = new Parser(PATTERN_INFO, sentence);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>position.set("model", parser.next());<NEW_LINE>position.set(Position.KEY_VERSION_FW, parser.next());<NEW_LINE>position.set(Position.KEY_POWER, parser.nextInt() * 0.1);<NEW_LINE>position.set(Position.KEY_BATTERY, parser.nextInt() * 0.1);<NEW_LINE>position.set(Position.KEY_SATELLITES, parser.nextInt());<NEW_LINE>position.set(Position.KEY_RSSI, parser.nextInt());<NEW_LINE>} else {<NEW_LINE>deviceSession = getDeviceSession(channel, remoteAddress);<NEW_LINE>position.set(Position.KEY_RESULT, sentence);<NEW_LINE>}<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>return position;<NEW_LINE>}<NEW_LINE>} | = new Position(getProtocolName()); |
64,075 | private void writeColumn(String fileName, Column<?> column) {<NEW_LINE>try {<NEW_LINE>final String typeName = column.type().name();<NEW_LINE>switch(typeName) {<NEW_LINE>case FLOAT:<NEW_LINE>writeColumn(fileName, (FloatColumn) column);<NEW_LINE>break;<NEW_LINE>case DOUBLE:<NEW_LINE>writeColumn(fileName, (DoubleColumn) column);<NEW_LINE>break;<NEW_LINE>case INTEGER:<NEW_LINE>writeColumn(fileName, (IntColumn) column);<NEW_LINE>break;<NEW_LINE>case BOOLEAN:<NEW_LINE>writeColumn(fileName, (BooleanColumn) column);<NEW_LINE>break;<NEW_LINE>case LOCAL_DATE:<NEW_LINE>writeColumn(fileName, (DateColumn) column);<NEW_LINE>break;<NEW_LINE>case LOCAL_TIME:<NEW_LINE>writeColumn(fileName, (TimeColumn) column);<NEW_LINE>break;<NEW_LINE>case LOCAL_DATE_TIME:<NEW_LINE>writeColumn(fileName, (DateTimeColumn) column);<NEW_LINE>break;<NEW_LINE>case STRING:<NEW_LINE>writeColumn(fileName, (StringColumn) column);<NEW_LINE>break;<NEW_LINE>case TEXT:<NEW_LINE>writeColumn(fileName, (TextColumn) column);<NEW_LINE>break;<NEW_LINE>case INSTANT:<NEW_LINE>writeColumn(fileName, (InstantColumn) column);<NEW_LINE>break;<NEW_LINE>case SHORT:<NEW_LINE>writeColumn(fileName, (ShortColumn) column);<NEW_LINE>break;<NEW_LINE>case LONG:<NEW_LINE>writeColumn<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unhandled column type writing columns");<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException("IOException writing to file", e);<NEW_LINE>}<NEW_LINE>} | (fileName, (LongColumn) column); |
1,044,929 | protected Map<TargetClass, List<TypeCompound>> sift(Iterable<Attribute.TypeCompound> typeCompounds) {<NEW_LINE>// this will sift out the annotations that do not have the right position index<NEW_LINE>final Map<TargetClass, List<Attribute.TypeCompound>> targetClassToAnnos = super.sift(typeCompounds);<NEW_LINE>final List<Attribute.TypeCompound> targeted = <MASK><NEW_LINE>final List<Attribute.TypeCompound> valid = targetClassToAnnos.get(TargetClass.VALID);<NEW_LINE>// if this is a lambdaParam, filter out from targeted those annos that apply to method<NEW_LINE>// formal parameters if this is a method formal param, filter out from targeted those annos<NEW_LINE>// that apply to lambdas<NEW_LINE>int i = 0;<NEW_LINE>while (i < targeted.size()) {<NEW_LINE>final Tree onLambda = targeted.get(i).position.onLambda;<NEW_LINE>if (onLambda == null) {<NEW_LINE>if (!isLambdaParam) {<NEW_LINE>++i;<NEW_LINE>} else {<NEW_LINE>valid.add(targeted.remove(i));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (onLambda.equals(this.lambdaTree)) {<NEW_LINE>++i;<NEW_LINE>} else {<NEW_LINE>valid.add(targeted.remove(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return targetClassToAnnos;<NEW_LINE>} | targetClassToAnnos.get(TargetClass.TARGETED); |
1,561,546 | public void initScene() {<NEW_LINE>DirectionalLight light = new DirectionalLight(.1f, .1f, -1);<NEW_LINE>light.setPower(2);<NEW_LINE>getCurrentScene().addLight(light);<NEW_LINE>Material timeSphereMaterial = new Material();<NEW_LINE>timeSphereMaterial.enableLighting(true);<NEW_LINE>timeSphereMaterial.setDiffuseMethod(new DiffuseMethod.Lambert());<NEW_LINE>mTimeBitmap = Bitmap.createBitmap(256, 256, Config.ARGB_8888);<NEW_LINE>mTimeTexture = new AlphaMapTexture("timeTexture", mTimeBitmap);<NEW_LINE>try {<NEW_LINE>timeSphereMaterial.addTexture(mTimeTexture);<NEW_LINE>} catch (ATexture.TextureException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>timeSphereMaterial.setColorInfluence(1);<NEW_LINE>Sphere parentSphere = null;<NEW_LINE>for (int i = 0; i < 20; i++) {<NEW_LINE>Sphere timeSphere = new Sphere(.6f, 12, 12);<NEW_LINE>timeSphere.setMaterial(timeSphereMaterial);<NEW_LINE>timeSphere.setDoubleSided(true);<NEW_LINE>timeSphere.setColor((int) (Math.random() * 0xffffff));<NEW_LINE>if (parentSphere == null) {<NEW_LINE>timeSphere.setPosition(0, 0, -3);<NEW_LINE>timeSphere.setRenderChildrenAsBatch(true);<NEW_LINE><MASK><NEW_LINE>parentSphere = timeSphere;<NEW_LINE>} else {<NEW_LINE>timeSphere.setX(-3 + (float) (Math.random() * 6));<NEW_LINE>timeSphere.setY(-3 + (float) (Math.random() * 6));<NEW_LINE>timeSphere.setZ(-3 + (float) (Math.random() * 6));<NEW_LINE>parentSphere.addChild(timeSphere);<NEW_LINE>}<NEW_LINE>int direction = Math.random() < .5 ? 1 : -1;<NEW_LINE>RotateOnAxisAnimation anim = new RotateOnAxisAnimation(Vector3.Axis.Y, 0, 360 * direction);<NEW_LINE>anim.setRepeatMode(Animation.RepeatMode.INFINITE);<NEW_LINE>anim.setDurationMilliseconds(i == 0 ? 12000 : 4000 + (int) (Math.random() * 4000));<NEW_LINE>anim.setTransformable3D(timeSphere);<NEW_LINE>getCurrentScene().registerAnimation(anim);<NEW_LINE>anim.play();<NEW_LINE>}<NEW_LINE>} | getCurrentScene().addChild(timeSphere); |
555,360 | static void updateAppWidget(Context context, AppWidgetManager awm, int[] appWidgetIds) {<NEW_LINE>final var repo = NotesRepository.getInstance(context);<NEW_LINE>RemoteViews views;<NEW_LINE>for (int appWidgetId : appWidgetIds) {<NEW_LINE>try {<NEW_LINE>final var data = repo.getNoteListWidgetData(appWidgetId);<NEW_LINE>final var serviceIntent = new Intent(context, NoteListWidgetService.class);<NEW_LINE>serviceIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);<NEW_LINE>serviceIntent.setData(Uri.parse(serviceIntent.toUri(Intent.URI_INTENT_SCHEME)));<NEW_LINE>Log.v(TAG, "-- data - " + data);<NEW_LINE>views = new RemoteViews(context.getPackageName(), R.layout.widget_note_list);<NEW_LINE>views.setRemoteAdapter(<MASK><NEW_LINE>views.setPendingIntentTemplate(R.id.note_list_widget_lv, PendingIntent.getActivity(context, 0, new Intent(), pendingIntentFlagCompat(PendingIntent.FLAG_UPDATE_CURRENT | Intent.FILL_IN_COMPONENT)));<NEW_LINE>views.setEmptyView(R.id.note_list_widget_lv, R.id.widget_note_list_placeholder_tv);<NEW_LINE>awm.notifyAppWidgetViewDataChanged(appWidgetId, R.id.note_list_widget_lv);<NEW_LINE>awm.updateAppWidget(appWidgetId, views);<NEW_LINE>} catch (NoSuchElementException e) {<NEW_LINE>Log.i(TAG, "onUpdate has been triggered before the user finished configuring the widget");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | R.id.note_list_widget_lv, serviceIntent); |
1,066,018 | public void acceptComment(final RequestContext context) {<NEW_LINE>context.renderJSON(StatusCodes.ERR);<NEW_LINE>final JSONObject requestJSONObject = context.requestJSON();<NEW_LINE>final JSONObject currentUser = Sessions.getUser();<NEW_LINE>final String userId = currentUser.optString(Keys.OBJECT_ID);<NEW_LINE>final String commentId = requestJSONObject.optString(Comment.COMMENT_T_ID);<NEW_LINE>try {<NEW_LINE>final JSONObject comment = commentQueryService.getComment(commentId);<NEW_LINE>if (null == comment) {<NEW_LINE>context.renderMsg("Not found comment to accept");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String commentAuthorId = comment.optString(Comment.COMMENT_AUTHOR_ID);<NEW_LINE>if (StringUtils.equals(userId, commentAuthorId)) {<NEW_LINE>context.renderMsg(langPropsService.get("thankSelfLabel"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String articleId = <MASK><NEW_LINE>final JSONObject article = articleQueryService.getArticle(articleId);<NEW_LINE>if (!StringUtils.equals(userId, article.optString(Article.ARTICLE_AUTHOR_ID))) {<NEW_LINE>context.renderMsg(langPropsService.get("sc403Label"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>commentMgmtService.acceptComment(commentId);<NEW_LINE>context.renderJSON(StatusCodes.SUCC);<NEW_LINE>} catch (final ServiceException e) {<NEW_LINE>context.renderMsg(e.getMessage());<NEW_LINE>}<NEW_LINE>} | comment.optString(Comment.COMMENT_ON_ARTICLE_ID); |
995,263 | public DimensionValues unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DimensionValues dimensionValues = new DimensionValues();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Key", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dimensionValues.setKey(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Values", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dimensionValues.setValues(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("MatchOptions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dimensionValues.setMatchOptions(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return dimensionValues;<NEW_LINE>} | class).unmarshall(context)); |
276,307 | private void runActionIfLeaderAndMesosIsRunning() {<NEW_LINE>final boolean leadership = leaderLatch.hasLeadership();<NEW_LINE>final boolean schedulerRunning = mesosScheduler.isRunning();<NEW_LINE>if (!leadership || !schedulerRunning || !isEnabled()) {<NEW_LINE>LOG.trace("Skipping {} (period: {}) (leadership: {}, mesos running: {}, enabled: {})", getClass().getSimpleName(), JavaUtils.durationFromMillis(pollTimeUnit.toMillis(pollDelay)), leadership, schedulerRunning, isEnabled());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (stopped.get()) {<NEW_LINE>LOG.info("Singularity shutting down, will not run {} poller", getClass().getSimpleName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOG.trace("Running {} (period: {})", getClass().getSimpleName(), JavaUtils.durationFromMillis(pollTimeUnit.toMillis(pollDelay)));<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>try {<NEW_LINE>runActionOnPoll();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>boolean isZkException = Throwables.getCausalChain(t).stream().anyMatch(throwable -> throwable instanceof KeeperException);<NEW_LINE>if (isZkException) {<NEW_LINE>LOG.error("Uncaught zk exception in {}, not aborting", getClass().getSimpleName(), t);<NEW_LINE>} else {<NEW_LINE>LOG.error("Caught an exception while running {}", getClass().getSimpleName(), t);<NEW_LINE>exceptionNotifier.notify(String.format("Caught an exception while running %s", getClass()<MASK><NEW_LINE>if (abortsOnError()) {<NEW_LINE>abort.abort(AbortReason.ERROR_IN_LEADER_ONLY_POLLER, Optional.of(t));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>LOG.debug("Ran poller {} in {}", getClass().getSimpleName(), JavaUtils.duration(start));<NEW_LINE>}<NEW_LINE>} | .getSimpleName()), t); |
1,092,687 | public void doInAfterTrace(SpanEventRecorder recorder, Object target, Object[] args, Object result, Throwable throwable) {<NEW_LINE>if (collectJson) {<NEW_LINE>final boolean success = InterceptorUtils.isSuccess(throwable);<NEW_LINE>if (success) {<NEW_LINE>if (args != null) {<NEW_LINE>NormalizedBson parsedBson = MongoUtil.parseBson(args, traceBsonBindValue);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>recorder.recordException(throwable);<NEW_LINE>if (isAsynchronousInvocation(target, args, result, throwable)) {<NEW_LINE>// Trace to Disposable object<NEW_LINE>final AsyncContext asyncContext = recorder.recordNextAsyncContext();<NEW_LINE>((AsyncContextAccessor) (result))._$PINPOINT$_setAsyncContext(asyncContext);<NEW_LINE>if (isDebug) {<NEW_LINE>logger.debug("Set AsyncContext {}, result={}", asyncContext, result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | MongoUtil.recordParsedBson(recorder, parsedBson); |
1,419,261 | public static Collection<DoctrineModelInterface> findMetadataModelForRepositoryClass(@NotNull final Project project, @NotNull String repositoryClass) {<NEW_LINE>repositoryClass = <MASK><NEW_LINE>Collection<DoctrineModelInterface> models = new ArrayList<>();<NEW_LINE>for (String key : FileIndexCaches.getIndexKeysCache(project, CLASS_KEYS, DoctrineMetadataFileStubIndex.KEY)) {<NEW_LINE>for (DoctrineModelInterface repositoryDefinition : FileBasedIndex.getInstance().getValues(DoctrineMetadataFileStubIndex.KEY, key, GlobalSearchScope.allScope(project))) {<NEW_LINE>String myRepositoryClass = repositoryDefinition.getRepositoryClass();<NEW_LINE>if (StringUtils.isBlank(myRepositoryClass) || !repositoryClass.equalsIgnoreCase(StringUtils.stripStart(myRepositoryClass, "\\"))) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>models.add(repositoryDefinition);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return models;<NEW_LINE>} | StringUtils.stripStart(repositoryClass, "\\"); |
162,300 | public void testCMTOnMessage() throws Exception {<NEW_LINE>String deliveryID = "test07";<NEW_LINE>prepareTRA();<NEW_LINE>// construct a FVTMessage<NEW_LINE>FVTMessage message = new FVTMessage();<NEW_LINE><MASK><NEW_LINE>// Add a FVTXAResourceImpl for this delivery.<NEW_LINE>message.addXAResource("MDBTimedCMTBean", 47, new FVTXAResourceImpl());<NEW_LINE>// Add a option A delivery.<NEW_LINE>message.add("MDBTimedCMTBean", deliveryID, 47);<NEW_LINE>System.out.println(message.toString());<NEW_LINE>baseProvider.sendDirectMessage(deliveryID, message);<NEW_LINE>MessageEndpointTestResults results = baseProvider.getTestResult(deliveryID);<NEW_LINE>assertTrue("Number of messages delivered is 1", results.getNumberOfMessagesDelivered() == 1);<NEW_LINE>int counter = 0;<NEW_LINE>System.out.println("Waiting for results ...");<NEW_LINE>while (counter < maxSleepTime) {<NEW_LINE>if (MDBTimedCMTBean.results[7] != null) {<NEW_LINE>checkResults(MDBTimedCMTBean.results[7]);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Thread.sleep(1000);<NEW_LINE>counter++;<NEW_LINE>}<NEW_LINE>baseProvider.releaseDeliveryId(deliveryID);<NEW_LINE>} | message.addTestResult("MDBTimedCMTBean", 47); |
1,138,415 | private void drawPoints(float[] verArray, byte[] colorArray) {<NEW_LINE>if (colorArray != null) {<NEW_LINE>ByteBuffer tex = ByteBuffer.allocateDirect(colorArray.length);<NEW_LINE>tex.order(ByteOrder.nativeOrder());<NEW_LINE>tex.put(colorArray);<NEW_LINE>tex.position(0);<NEW_LINE>GLES10.glEnableClientState(GLES10.GL_COLOR_ARRAY);<NEW_LINE>GLES10.glColorPointer(4, GLES10.GL_UNSIGNED_BYTE, 0, tex);<NEW_LINE>}<NEW_LINE>ByteBuffer ver = ByteBuffer.<MASK><NEW_LINE>ver.order(ByteOrder.nativeOrder());<NEW_LINE>ver.asFloatBuffer().put(verArray);<NEW_LINE>GLES10.glEnableClientState(GLES10.GL_VERTEX_ARRAY);<NEW_LINE>GLES10.glVertexPointer(3, GLES10.GL_FLOAT, 0, ver);<NEW_LINE>GLES10.glDrawArrays(GLES10.GL_POINTS, 0, verArray.length / 3);<NEW_LINE>GLES10.glDisableClientState(GLES10.GL_VERTEX_ARRAY);<NEW_LINE>if (colorArray != null)<NEW_LINE>GLES10.glDisableClientState(GLES10.GL_COLOR_ARRAY);<NEW_LINE>} | allocateDirect(verArray.length * 4); |
384,457 | public String summaryDescription() {<NEW_LINE>// 5Y USD 2mm Rec USD-LIBOR-6M / Pay 1% : 21Jan17-21Jan22<NEW_LINE>StringBuilder buf = new StringBuilder(64);<NEW_LINE>buf.append(SummarizerUtils.datePeriod(getStartDate().getUnadjusted(), getEndDate().getUnadjusted()));<NEW_LINE>buf.append(' ');<NEW_LINE>if (getLegs().size() == 2 && getPayLeg().isPresent() && getReceiveLeg().isPresent() && getLegs().stream().allMatch(leg -> leg instanceof RateCalculationSwapLeg)) {<NEW_LINE>// normal swap<NEW_LINE>SwapLeg payLeg = getPayLeg().get();<NEW_LINE>SwapLeg recLeg = getReceiveLeg().get();<NEW_LINE>String payNotional = notional(payLeg);<NEW_LINE>String recNotional = notional(recLeg);<NEW_LINE>if (payNotional.equals(recNotional)) {<NEW_LINE>buf.append(recNotional);<NEW_LINE>buf.append(" Rec ");<NEW_LINE>buf.append(legSummary(recLeg));<NEW_LINE>buf.append(" / Pay ");<NEW_LINE>buf<MASK><NEW_LINE>} else {<NEW_LINE>buf.append("Rec ");<NEW_LINE>buf.append(legSummary(recLeg));<NEW_LINE>buf.append(' ');<NEW_LINE>buf.append(recNotional);<NEW_LINE>buf.append(" / Pay ");<NEW_LINE>buf.append(legSummary(payLeg));<NEW_LINE>buf.append(' ');<NEW_LINE>buf.append(payNotional);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// abnormal swap<NEW_LINE>buf.append(getLegs().stream().map(leg -> (SummarizerUtils.payReceive(leg.getPayReceive()) + " " + legSummary(leg) + " " + notional(leg)).trim()).collect(joining(" / ")));<NEW_LINE>}<NEW_LINE>buf.append(" : ");<NEW_LINE>buf.append(SummarizerUtils.dateRange(getStartDate().getUnadjusted(), getEndDate().getUnadjusted()));<NEW_LINE>return buf.toString();<NEW_LINE>} | .append(legSummary(payLeg)); |
587,915 | private void pollAndNotifyNetworkInterfaceAddress() {<NEW_LINE>Collection<CidrAddress> newInterfaceAddresses = getAllInterfaceAddresses();<NEW_LINE>if (networkAddressChangeListeners.isEmpty()) {<NEW_LINE>// no listeners listening, just update<NEW_LINE>lastKnownInterfaceAddresses = newInterfaceAddresses;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Look for added addresses to notify<NEW_LINE>List<CidrAddress> added = newInterfaceAddresses.stream().filter(newInterfaceAddr -> !lastKnownInterfaceAddresses.contains(newInterfaceAddr)).collect(Collectors.toList());<NEW_LINE>// Look for removed addresses to notify<NEW_LINE>List<CidrAddress> removed = lastKnownInterfaceAddresses.stream().filter(lastKnownInterfaceAddr -> !newInterfaceAddresses.contains(lastKnownInterfaceAddr)).collect(Collectors.toList());<NEW_LINE>lastKnownInterfaceAddresses = newInterfaceAddresses;<NEW_LINE>if (!added.isEmpty() || !removed.isEmpty()) {<NEW_LINE>LOGGER.debug("added {} network interfaces: {}", added.size(), Arrays.deepToString(added.toArray()));<NEW_LINE>LOGGER.debug("removed {} network interfaces: {}", removed.size(), Arrays.deepToString<MASK><NEW_LINE>notifyListeners(added, removed);<NEW_LINE>}<NEW_LINE>} | (removed.toArray())); |
1,853,772 | private void addToFreeList(OAtomicOperation atomicOperation, int pageIndex) throws IOException {<NEW_LINE>final OCacheEntry cacheEntry = loadPageForWrite(atomicOperation, fileId, pageIndex, false, true);<NEW_LINE>try {<NEW_LINE>final CellBTreeSingleValueBucketV3<K> bucket = new CellBTreeSingleValueBucketV3<>(cacheEntry);<NEW_LINE>final OCacheEntry entryPointEntry = loadPageForWrite(atomicOperation, fileId, ENTRY_POINT_INDEX, false, true);<NEW_LINE>try {<NEW_LINE>final CellBTreeSingleValueEntryPointV3<K> entryPoint <MASK><NEW_LINE>final int freeListHead = entryPoint.getFreeListHead();<NEW_LINE>entryPoint.setFreeListHead(pageIndex);<NEW_LINE>bucket.setNextFreeListPage(freeListHead);<NEW_LINE>} finally {<NEW_LINE>releasePageFromWrite(atomicOperation, entryPointEntry);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releasePageFromWrite(atomicOperation, cacheEntry);<NEW_LINE>}<NEW_LINE>} | = new CellBTreeSingleValueEntryPointV3<>(entryPointEntry); |
930,915 | public static void copyFile(File srcFile, File destFile, boolean createCopy) throws IOException {<NEW_LINE>if (createCopy) {<NEW_LINE>if (srcFile.equals(destFile) || destFile.exists()) {<NEW_LINE>int i = 1;<NEW_LINE>String name = getFileNameWithoutExtension(srcFile);<NEW_LINE>String ext = getFileExtension(srcFile);<NEW_LINE>do {<NEW_LINE>destFile = new File(destFile.getParentFile(), name + "(" + i++ + ")" + ext);<NEW_LINE>} while (destFile.exists());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (srcFile.equals(destFile)) {<NEW_LINE>throw new IOException("Source and Target Files cannot be the same");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int bufSize = 1024 * 64;<NEW_LINE>byte[] buf = new byte[bufSize];<NEW_LINE>BufferedInputStream bis = new BufferedInputStream(new FileInputStream(srcFile), bufSize);<NEW_LINE>BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(destFile), bufSize);<NEW_LINE>int size;<NEW_LINE>while ((size = bis.read(buf)) != -1) {<NEW_LINE>bos.<MASK><NEW_LINE>}<NEW_LINE>bos.flush();<NEW_LINE>bos.close();<NEW_LINE>bis.close();<NEW_LINE>} | write(buf, 0, size); |
62,765 | private void importLocations() {<NEW_LINE>String envVar = (String) JOptionPane.showInputDialog(this, "<html>Enter value:<br><br>Example: SVR*c:\\symbols*https://msdl.microsoft.com/download/symbols/<br><br>", "Enter Symbol Server Search Path Value", JOptionPane.QUESTION_MESSAGE, null, null, Objects.requireNonNullElse(System.getenv(MS_SYMBOLSERVER_ENVVAR), ""));<NEW_LINE>if (envVar == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> symbolServerPaths = getSymbolPathsFromEnvStr(envVar);<NEW_LINE>if (!symbolServerPaths.isEmpty()) {<NEW_LINE>// if the first item in the path list looks like a local symbol storage path,<NEW_LINE>// allow the user to set it as the storage dir (and remove it from the elements<NEW_LINE>// that will be added to the search list)<NEW_LINE>String firstSearchPath = symbolServerPaths.get(0);<NEW_LINE>SymbolServer symbolServer = symbolServerInstanceCreatorContext.getSymbolServerInstanceCreatorRegistry().newSymbolServer(firstSearchPath, symbolServerInstanceCreatorContext);<NEW_LINE>if (symbolServer instanceof LocalSymbolStore && ((LocalSymbolStore) symbolServer).isValid()) {<NEW_LINE>int choice = OptionDialog.showYesNoCancelDialog(this, "Set Symbol Storage Location", "Set symbol storage location to " + firstSearchPath + "?");<NEW_LINE>if (choice == OptionDialog.CANCEL_OPTION) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (choice == OptionDialog.YES_OPTION) {<NEW_LINE>symbolServerPaths.remove(0);<NEW_LINE>configChanged = true;<NEW_LINE>setSymbolStorageLocation(((LocalSymbolStore) symbolServer<MASK><NEW_LINE>symbolStorageLocationTextField.setText(symbolServer.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tableModel.addSymbolServers(symbolServerInstanceCreatorContext.getSymbolServerInstanceCreatorRegistry().createSymbolServersFromPathList(symbolServerPaths, symbolServerInstanceCreatorContext));<NEW_LINE>fireChanged();<NEW_LINE>} | ).getRootDir(), true); |
1,451,277 | public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "ble");<NEW_LINE>Long baseOffset = instruction.getAddress().toLong() * 0x100;<NEW_LINE>final String jumpOperand = environment.getNextVariableString();<NEW_LINE>final IOperandTreeNode addressOperand1 = instruction.getOperands().get(1).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode BIOperand = instruction.getOperands().get(0).getRootNode().<MASK><NEW_LINE>instructions.add(ReilHelpers.createOr(baseOffset++, OperandSize.BYTE, String.valueOf((Helpers.getCRRegisterIndex(BIOperand.getValue()) * 4) + 2), OperandSize.BYTE, String.valueOf((Helpers.getCRRegisterIndex(BIOperand.getValue()) * 4) + 0), OperandSize.BYTE, jumpOperand));<NEW_LINE>String suffix = "";<NEW_LINE>if (instruction.getMnemonic().endsWith("+")) {<NEW_LINE>suffix = "+";<NEW_LINE>}<NEW_LINE>if (instruction.getMnemonic().endsWith("-")) {<NEW_LINE>suffix = "-";<NEW_LINE>}<NEW_LINE>BranchGenerator.generate(baseOffset, environment, instruction, instructions, "ble" + suffix, jumpOperand, addressOperand1.getValue(), false, false, false, false, false, false);<NEW_LINE>} | getChildren().get(0); |
1,438,087 | private int appyReplacements(final Document result, final TextContent modelContent, final int rangeStart, final int rangeEnd, final int cursor) {<NEW_LINE>final NodeList replacements = result.getFirstChild().getChildNodes();<NEW_LINE>int newCursor = cursor;<NEW_LINE>//<NEW_LINE>// Applying replacements in reverse order to ensure correct offsets.<NEW_LINE>//<NEW_LINE>for (int i = replacements.getLength(); i > 0; --i) {<NEW_LINE>final Node r = <MASK><NEW_LINE>if (r.getNodeName().equals("replacement")) {<NEW_LINE>final int index = Integer.parseInt(r.getAttributes().getNamedItem("offset").getNodeValue());<NEW_LINE>final int length = Integer.parseInt(r.getAttributes().getNamedItem("length").getNodeValue());<NEW_LINE>// clang-format v3.4 tends to overshoot when a range is specified.<NEW_LINE>if ((index + length) >= rangeEnd || (index + length) < rangeStart) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final String text = r.getTextContent();<NEW_LINE>modelContent.replace(index, length, text);<NEW_LINE>if (newCursor > index) {<NEW_LINE>newCursor += text.length() - length;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newCursor;<NEW_LINE>} | replacements.item(i - 1); |
1,056,883 | public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {<NEW_LINE>MethodVisitor mv = super.visitMethod(access, name, descriptor, signature, exceptions);<NEW_LINE>if (name.equals(Java_Version == 8 ? "getRootDocImpl" : "getEnvironment")) {<NEW_LINE>return new MethodVisitor(ASM9, mv) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitCode() {<NEW_LINE>// push the Context<NEW_LINE>visitVarInsn(ALOAD, 0);<NEW_LINE>visitFieldInsn(GETFIELD, JavadocTool_class, "context", "Lcom/sun/tools/javac/util/Context;");<NEW_LINE>// push the ClassLoader<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE>mv.visitFieldInsn(<MASK><NEW_LINE>mv.visitLdcInsn(Type.getType("Ljavax/tools/JavaFileManager;"));<NEW_LINE>mv.visitMethodInsn(INVOKEVIRTUAL, "com/sun/tools/javac/util/Context", "get", "(Ljava/lang/Class;)Ljava/lang/Object;", false);<NEW_LINE>mv.visitTypeInsn(CHECKCAST, "javax/tools/JavaFileManager");<NEW_LINE>mv.visitFieldInsn(GETSTATIC, "javax/tools/StandardLocation", "CLASS_PATH", "Ljavax/tools/StandardLocation;");<NEW_LINE>mv.visitMethodInsn(INVOKEINTERFACE, "javax/tools/JavaFileManager", "getClassLoader", "(Ljavax/tools/JavaFileManager$Location;)Ljava/lang/ClassLoader;", true);<NEW_LINE>// call Util.initJavacPlugin(ClassLoader, Context)<NEW_LINE>visitMethodInsn(INVOKESTATIC, "manifold/javadoc/agent/Util", "initJavacPlugin", "(Ljava/lang/Object;Ljava/lang/ClassLoader;)V", false);<NEW_LINE>super.visitCode();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else {<NEW_LINE>return mv;<NEW_LINE>}<NEW_LINE>} | GETFIELD, JavadocTool_class, "context", "Lcom/sun/tools/javac/util/Context;"); |
1,172,671 | public void success(Object response) {<NEW_LINE>if (response != null) {<NEW_LINE>Map<String, Object> responseMap = (Map<String, Object>) response;<NEW_LINE>Integer action = (Integer) responseMap.get("action");<NEW_LINE>if (action != null) {<NEW_LINE>switch(action) {<NEW_LINE>case 1:<NEW_LINE>String username = (String) responseMap.get("username");<NEW_LINE>String password = (String) responseMap.get("password");<NEW_LINE>Boolean permanentPersistence = (Boolean) responseMap.get("permanentPersistence");<NEW_LINE>if (permanentPersistence != null && permanentPersistence) {<NEW_LINE>CredentialDatabase.getInstance(view.getContext()).setHttpAuthCredential(host, protocol, realm, port, username, password);<NEW_LINE>}<NEW_LINE>handler.proceed(username, password);<NEW_LINE>return;<NEW_LINE>case 2:<NEW_LINE>if (credentialsProposed.size() > 0) {<NEW_LINE>URLCredential credential = credentialsProposed.remove(0);<NEW_LINE>handler.proceed(credential.getUsername(), credential.getPassword());<NEW_LINE>} else {<NEW_LINE>handler.cancel();<NEW_LINE>}<NEW_LINE>// used custom CredentialDatabase!<NEW_LINE>// handler.useHttpAuthUsernamePassword();<NEW_LINE>return;<NEW_LINE>case 0:<NEW_LINE>default:<NEW_LINE>credentialsProposed = null;<NEW_LINE>previousAuthRequestFailureCount = 0;<NEW_LINE>handler.cancel();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>InAppWebViewClient.super.onReceivedHttpAuthRequest(<MASK><NEW_LINE>} | view, handler, host, realm); |
994,466 | public com.amazonaws.services.kms.model.CloudHsmClusterInvalidConfigurationException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.kms.model.CloudHsmClusterInvalidConfigurationException cloudHsmClusterInvalidConfigurationException = new com.amazonaws.services.kms.model.CloudHsmClusterInvalidConfigurationException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 cloudHsmClusterInvalidConfigurationException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
183,541 | public static void applyJoinResultCodegen(ResultSetProcessorAggregateGroupedForge forge, CodegenClassScope classScope, CodegenMethod method, CodegenInstanceAux instance) {<NEW_LINE>method.getBlock().ifCondition(not(exprDotMethod(REF_NEWDATA, "isEmpty"))).forEach(MultiKeyArrayOfKeys.EPTYPE, "aNewEvent", REF_NEWDATA).declareVar(EventBean.EPTYPEARRAY, "eventsPerStream", cast(EventBean.EPTYPEARRAY, exprDotMethod(ref("aNewEvent"), "getArray"))).declareVar(EPTypePremade.OBJECT.getEPType(), "mk", localMethod(forge.getGenerateGroupKeySingle(), ref("eventsPerStream"), constantTrue())).exprDotMethod(MEMBER_AGGREGATIONSVC, "applyEnter", ref("eventsPerStream"), ref("mk"), MEMBER_EXPREVALCONTEXT).blockEnd().blockEnd().ifCondition(and(notEqualsNull(REF_OLDDATA), not(exprDotMethod(REF_OLDDATA, "isEmpty")))).forEach(MultiKeyArrayOfKeys.EPTYPE, "anOldEvent", REF_OLDDATA).declareVar(EventBean.EPTYPEARRAY, "eventsPerStream", cast(EventBean.EPTYPEARRAY, exprDotMethod(ref("anOldEvent"), "getArray"))).declareVar(EPTypePremade.OBJECT.getEPType(), "mk", localMethod(forge.getGenerateGroupKeySingle(), ref("eventsPerStream"), constantFalse())).exprDotMethod(MEMBER_AGGREGATIONSVC, "applyLeave", ref("eventsPerStream"), ref("mk"), MEMBER_EXPREVALCONTEXT)<MASK><NEW_LINE>} | .blockEnd().blockEnd(); |
63,352 | public static byte[] toPdf(String fileName, byte[] bytes, String stamp) throws Exception {<NEW_LINE>Config.collect().validate();<NEW_LINE>URL serverUrl = new URL(Config.collect().url() + "/o2_collect_assemble/jaxrs/document/to/pdf");<NEW_LINE>HttpURLConnection connection = (HttpURLConnection) serverUrl.openConnection();<NEW_LINE>String boundary = "----" + StringTools.uniqueToken();<NEW_LINE>connection.setRequestMethod("POST");<NEW_LINE>connection.setDoOutput(true);<NEW_LINE>connection.setUseCaches(false);<NEW_LINE>connection.addRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary);<NEW_LINE>try (OutputStream out = connection.getOutputStream();<NEW_LINE>BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out))) {<NEW_LINE>writer.write(twoHyphens + boundary);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write("Content-Disposition: form-data; name=\"file\"; filename=\"" + (StringUtils.isEmpty(fileName) ? StringTools.uniqueToken() : fileName) + "\"");<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.<MASK><NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.flush();<NEW_LINE>out.write(bytes);<NEW_LINE>out.flush();<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(twoHyphens + boundary);<NEW_LINE>if (StringUtils.isNotEmpty(stamp)) {<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write("Content-Disposition: form-data; name=\"stamp\"");<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write("Content-Type: " + HttpMediaType.TEXT_PLAIN);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(stamp);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(twoHyphens + boundary);<NEW_LINE>}<NEW_LINE>writer.write(twoHyphens);<NEW_LINE>writer.flush();<NEW_LINE>}<NEW_LINE>String respText = null;<NEW_LINE>try (InputStream in = connection.getInputStream()) {<NEW_LINE>respText = IOUtils.toString(in, DefaultCharset.charset_utf_8);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(respText)) {<NEW_LINE>ActionResponse response = XGsonBuilder.instance().fromJson(respText, ActionResponse.class);<NEW_LINE>WrapString wrap = XGsonBuilder.instance().fromJson(response.getData(), WrapString.class);<NEW_LINE>return Base64.decodeBase64(wrap.getValue());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | write("Content-Type: " + HttpMediaType.APPLICATION_OCTET_STREAM); |
993,351 | public static ClassNode parameterizeType(final ClassNode hint, final ClassNode target) {<NEW_LINE>if (hint.isArray()) {<NEW_LINE>if (target.isArray()) {<NEW_LINE>return parameterizeType(hint.getComponentType(), target.getComponentType()).makeArray();<NEW_LINE>}<NEW_LINE>return target;<NEW_LINE>}<NEW_LINE>if (hint.isGenericsPlaceHolder()) {<NEW_LINE>ClassNode bound = hint.redirect();<NEW_LINE>return parameterizeType(bound, target);<NEW_LINE>}<NEW_LINE>if (target.redirect().getGenericsTypes() == null) {<NEW_LINE>return target;<NEW_LINE>}<NEW_LINE>if (!target.equals(hint) && implementsInterfaceOrIsSubclassOf(target, hint)) {<NEW_LINE>ClassNode nextSuperClass = <MASK><NEW_LINE>if (!hint.equals(nextSuperClass)) {<NEW_LINE>Map<String, ClassNode> genericsSpec = createGenericsSpec(hint);<NEW_LINE>extractSuperClassGenerics(hint, nextSuperClass, genericsSpec);<NEW_LINE>ClassNode result = correctToGenericsSpecRecurse(genericsSpec, nextSuperClass);<NEW_LINE>return parameterizeType(result, target);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, ClassNode> genericsSpec = createGenericsSpec(hint);<NEW_LINE>ClassNode targetRedirect = target.redirect();<NEW_LINE>genericsSpec = createGenericsSpec(targetRedirect, genericsSpec);<NEW_LINE>extractSuperClassGenerics(hint, targetRedirect, genericsSpec);<NEW_LINE>return correctToGenericsSpecRecurse(genericsSpec, targetRedirect);<NEW_LINE>} | ClassHelper.getNextSuperClass(target, hint); |
1,769,825 | private ArrayList<TorrentFile> parseJsonFileListing(JSONArray results, Torrent torrent) throws JSONException {<NEW_LINE>// Parse response<NEW_LINE>ArrayList<TorrentFile> files = new ArrayList<>();<NEW_LINE>boolean createPaths = torrent != null && torrent.getLocationDir() != null && !torrent.getLocationDir().equals("");<NEW_LINE>final String pathSep = settings.getOS().getPathSeperator();<NEW_LINE>for (int i = 0; i < results.length(); i++) {<NEW_LINE>JSONArray file = results.getJSONArray(i);<NEW_LINE>// Add the parsed torrent to the list<NEW_LINE>files.add(new // Name<NEW_LINE>// Name<NEW_LINE>TorrentFile(// Name<NEW_LINE>"" + i, file.getString(RPC_FILENAME_IDX), (// Relative path; 'wrong' path slashes will be replaced<NEW_LINE>createPaths ? // Relative path; 'wrong' path slashes will be replaced<NEW_LINE>file.getString(RPC_FILENAME_IDX).replace((pathSep.equals("/") ? "\\" : "/"), pathSep) : null), (// Full path; 'wrong' path slashes will be replaced<NEW_LINE>createPaths ? // Full path; 'wrong' path slashes will be replaced<NEW_LINE>torrent.getLocationDir() + file.getString(RPC_FILENAME_IDX).replace((pathSep.equals("/") ? "\\" : "/"), pathSep) : // Total size<NEW_LINE>null), // Part done<NEW_LINE>file.getLong(RPC_FILESIZE_IDX), // Priority<NEW_LINE>file.getLong(RPC_FILEDOWNLOADED_IDX), convertUtorrentPriority(file<MASK><NEW_LINE>}<NEW_LINE>return files;<NEW_LINE>} | .getInt(RPC_FILEPRIORITY_IDX)))); |
95,016 | public void process(ComplexEventChunk complexEventChunk) {<NEW_LINE>ComplexEventChunk<ComplexEvent> outputEventChunk = new ComplexEventChunk<>();<NEW_LINE>complexEventChunk.reset();<NEW_LINE>RateLimiterState state = stateHolder.getState();<NEW_LINE>try {<NEW_LINE>synchronized (state) {<NEW_LINE>complexEventChunk.reset();<NEW_LINE>while (complexEventChunk.hasNext()) {<NEW_LINE>ComplexEvent event = complexEventChunk.next();<NEW_LINE>if (event.getType() == ComplexEvent.Type.TIMER) {<NEW_LINE>if (event.getTimestamp() >= state.scheduledTime) {<NEW_LINE>if (state.lastEvent != null) {<NEW_LINE>outputEventChunk.add(state.lastEvent);<NEW_LINE>state.lastEvent = null;<NEW_LINE>}<NEW_LINE>state.scheduledTime = state.scheduledTime + value;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else if (event.getType() == ComplexEvent.Type.CURRENT || event.getType() == ComplexEvent.Type.EXPIRED) {<NEW_LINE>complexEventChunk.remove();<NEW_LINE>state.lastEvent = event;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>stateHolder.returnState(state);<NEW_LINE>}<NEW_LINE>outputEventChunk.reset();<NEW_LINE>if (outputEventChunk.hasNext()) {<NEW_LINE>sendToCallBacks(outputEventChunk);<NEW_LINE>}<NEW_LINE>} | scheduler.notifyAt(state.scheduledTime); |
1,111,209 | final DeleteVaultResult executeDeleteVault(DeleteVaultRequest deleteVaultRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteVaultRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteVaultRequest> request = null;<NEW_LINE>Response<DeleteVaultResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteVaultRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteVaultRequest));<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, "Glacier");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteVault");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteVaultResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteVaultResultJsonUnmarshaller());<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()); |
845,233 | private void initTypeAnnotation(NdTypeAnnotation annotation, IBinaryTypeAnnotation next) {<NEW_LINE>int[<MASK><NEW_LINE>if (typePath != null && typePath.length > 0) {<NEW_LINE>byte[] bytePath = new byte[typePath.length];<NEW_LINE>for (int idx = 0; idx < bytePath.length; idx++) {<NEW_LINE>bytePath[idx] = (byte) typePath[idx];<NEW_LINE>}<NEW_LINE>annotation.setPath(bytePath);<NEW_LINE>}<NEW_LINE>int targetType = next.getTargetType();<NEW_LINE>annotation.setTargetType(targetType);<NEW_LINE>switch(targetType) {<NEW_LINE>case AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER:<NEW_LINE>case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER:<NEW_LINE>annotation.setTargetInfo(next.getTypeParameterIndex());<NEW_LINE>break;<NEW_LINE>case AnnotationTargetTypeConstants.CLASS_EXTENDS:<NEW_LINE>annotation.setTargetInfo(next.getSupertypeIndex());<NEW_LINE>break;<NEW_LINE>case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER_BOUND:<NEW_LINE>case AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER_BOUND:<NEW_LINE>annotation.setTargetInfo((byte) next.getTypeParameterIndex(), (byte) next.getBoundIndex());<NEW_LINE>break;<NEW_LINE>case AnnotationTargetTypeConstants.FIELD:<NEW_LINE>case AnnotationTargetTypeConstants.METHOD_RETURN:<NEW_LINE>case AnnotationTargetTypeConstants.METHOD_RECEIVER:<NEW_LINE>break;<NEW_LINE>case AnnotationTargetTypeConstants.METHOD_FORMAL_PARAMETER:<NEW_LINE>annotation.setTargetInfo(next.getMethodFormalParameterIndex());<NEW_LINE>break;<NEW_LINE>case AnnotationTargetTypeConstants.THROWS:<NEW_LINE>annotation.setTargetInfo(next.getThrowsTypeIndex());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>throw new IllegalStateException("Target type not handled " + targetType);<NEW_LINE>}<NEW_LINE>initAnnotation(annotation, next.getAnnotation());<NEW_LINE>} | ] typePath = next.getTypePath(); |
1,658,392 | public void submitCompaction(CompactionKind kind, Compactable compactable, Consumer<Compactable> completionCallback) {<NEW_LINE>Objects.requireNonNull(compactable);<NEW_LINE>// add tablet to planning queue and use planningExecutor to get the plan<NEW_LINE>if (queuedForPlanning.get(kind).putIfAbsent(compactable.getExtent(), compactable) == null) {<NEW_LINE>try {<NEW_LINE>planningExecutor.execute(() -> {<NEW_LINE>try {<NEW_LINE>Optional<Compactable.Files> files = compactable.getFiles(myId, kind);<NEW_LINE>if (files.isEmpty() || files.get().candidates.isEmpty()) {<NEW_LINE>log.trace("Compactable returned no files {} {}", compactable.getExtent(), kind);<NEW_LINE>} else {<NEW_LINE>CompactionPlan plan = getCompactionPlan(kind, files.get(), compactable);<NEW_LINE>submitCompactionJob(plan, files.get(), compactable, completionCallback);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>queuedForPlanning.get(kind).<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (RejectedExecutionException e) {<NEW_LINE>queuedForPlanning.get(kind).remove(compactable.getExtent());<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | remove(compactable.getExtent()); |
613,115 | public static void serializeRowish(JsonGenerator jgen, NameMetadataDescription rowDescription, byte[] row) throws IOException {<NEW_LINE>int offset = 0;<NEW_LINE>byte[] flippedRow = null;<NEW_LINE>jgen.writeStartObject();<NEW_LINE>for (NameComponentDescription part : rowDescription.getRowParts()) {<NEW_LINE>if (part.isReverseOrder() && flippedRow == null) {<NEW_LINE>flippedRow = EncodingUtils.flipAllBits(row);<NEW_LINE>}<NEW_LINE>Pair<String, Integer> parse;<NEW_LINE>if (part.isReverseOrder()) {<NEW_LINE>parse = part.getType().convertToJson(flippedRow, offset);<NEW_LINE>} else {<NEW_LINE>parse = part.getType(<MASK><NEW_LINE>}<NEW_LINE>jgen.writeFieldName(part.getComponentName());<NEW_LINE>jgen.writeRawValue(parse.getLhSide());<NEW_LINE>offset += parse.getRhSide();<NEW_LINE>}<NEW_LINE>jgen.writeEndObject();<NEW_LINE>} | ).convertToJson(row, offset); |
859,795 | public static double[][] fft2barkmx(int nfft, int sr, int nfilts, int width, double minfreq, double maxfreq) {<NEW_LINE>int i, j, k;<NEW_LINE>double min_bark = hz2bark(minfreq);<NEW_LINE>double nyqbark = hz2bark(maxfreq) - min_bark;<NEW_LINE>double[][] wts = new double[nfilts][nfft];<NEW_LINE>for (i = 0; i < nfilts; i++) wts[i] = MathUtils.zeros(nfft);<NEW_LINE>// bark per filter<NEW_LINE>double step_barks = nyqbark / (nfilts - 1);<NEW_LINE>// Frequency of each FFT bin in Bark<NEW_LINE>int halfNfft = (nfft / 2);<NEW_LINE>double[] binbarks = new double[(halfNfft + 1)];<NEW_LINE>for (i = 0; i < (halfNfft + 1); i++) {<NEW_LINE>binbarks[i] = hz2bark(i * sr / nfft);<NEW_LINE>}<NEW_LINE>double f_bark_mid, aux;<NEW_LINE>double[] lof = new <MASK><NEW_LINE>double[] hif = new double[(halfNfft + 1)];<NEW_LINE>for (i = 1; i <= nfilts; i++) {<NEW_LINE>f_bark_mid = min_bark + (i - 1) * step_barks;<NEW_LINE>// Linear slopes in log-space (i.e. dB) intersect to trapezoidal window<NEW_LINE>for (j = 0; j < (halfNfft + 1); j++) {<NEW_LINE>lof[j] = (binbarks[j] - f_bark_mid) / width - 0.5;<NEW_LINE>hif[j] = (binbarks[j] - f_bark_mid) / width + 0.5;<NEW_LINE>}<NEW_LINE>for (k = 0; k < (halfNfft + 1); k++) {<NEW_LINE>aux = Math.min(0, Math.min(hif[k], (-2.5 * lof[k])));<NEW_LINE>wts[i - 1][k] = Math.pow(10, aux);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return wts;<NEW_LINE>} | double[(halfNfft + 1)]; |
991,176 | private IImConnection findConnectionForGroupChat(String user, String host) {<NEW_LINE>Collection<IImConnection> connActive = mApp.getActiveConnections();<NEW_LINE>ContentResolver cr = this.getContentResolver();<NEW_LINE>IImConnection result = null;<NEW_LINE>for (IImConnection conn : connActive) {<NEW_LINE>try {<NEW_LINE>Cursor pCursor = cr.query(Imps.ProviderSettings.CONTENT_URI, new String[] { Imps.ProviderSettings.NAME, Imps.ProviderSettings.VALUE }, Imps.ProviderSettings.PROVIDER + "=?", new String[] { Long.toString(conn.<MASK><NEW_LINE>Imps.ProviderSettings.QueryMap settings = new Imps.ProviderSettings.QueryMap(pCursor, cr, conn.getProviderId(), false, /* keep updated */<NEW_LINE>mHandler);<NEW_LINE>if (host.contains(settings.getDomain())) {<NEW_LINE>if (conn.getState() == ImConnection.LOGGED_IN) {<NEW_LINE>result = conn;<NEW_LINE>settings.close();<NEW_LINE>pCursor.close();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>settings.close();<NEW_LINE>pCursor.close();<NEW_LINE>} catch (RemoteException e) {<NEW_LINE>// nothing to do here<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | getProviderId()) }, null); |
1,609,849 | final ListAlgorithmsResult executeListAlgorithms(ListAlgorithmsRequest listAlgorithmsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAlgorithmsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAlgorithmsRequest> request = null;<NEW_LINE>Response<ListAlgorithmsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAlgorithmsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAlgorithmsRequest));<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, "SageMaker");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAlgorithmsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAlgorithmsResultJsonUnmarshaller());<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, "ListAlgorithms"); |
669,347 | public JSDynamicObject toZonedDateTime(Object thisObj, Object itemParam, @Cached("create(getContext())") ToTemporalDateNode toTemporalDate, @Cached("create(getContext())") ToTemporalTimeZoneNode toTemporalTimeZone) {<NEW_LINE>TemporalTime time = requireTemporalTime(thisObj);<NEW_LINE>if (!JSRuntime.isObject(itemParam)) {<NEW_LINE>throw Errors.createTypeErrorNotAnObject(itemParam);<NEW_LINE>}<NEW_LINE>JSDynamicObject item = (JSDynamicObject) itemParam;<NEW_LINE>Object temporalDateLike = JSObject.get(item, PLAIN_DATE);<NEW_LINE>if (temporalDateLike == Undefined.instance) {<NEW_LINE>errorBranch.enter();<NEW_LINE>throw TemporalErrors.createTypeErrorTemporalDateExpected();<NEW_LINE>}<NEW_LINE>JSTemporalPlainDateObject date = (JSTemporalPlainDateObject) toTemporalDate.executeDynamicObject(temporalDateLike, Undefined.instance);<NEW_LINE>Object temporalTimeZoneLike = JSObject.get(item, TemporalConstants.TIME_ZONE);<NEW_LINE>if (temporalTimeZoneLike == Undefined.instance || temporalTimeZoneLike == null) {<NEW_LINE>errorBranch.enter();<NEW_LINE>throw Errors.createTypeError("TimeZone expected");<NEW_LINE>}<NEW_LINE>JSDynamicObject <MASK><NEW_LINE>JSTemporalPlainDateTimeObject temporalDateTime = JSTemporalPlainDateTime.create(getContext(), date.getYear(), date.getMonth(), date.getDay(), time.getHour(), time.getMinute(), time.getSecond(), time.getMillisecond(), time.getMicrosecond(), time.getNanosecond(), date.getCalendar(), errorBranch);<NEW_LINE>JSTemporalInstantObject instant = TemporalUtil.builtinTimeZoneGetInstantFor(getContext(), timeZone, temporalDateTime, Disambiguation.COMPATIBLE);<NEW_LINE>return JSTemporalZonedDateTime.create(getContext(), getRealm(), instant.getNanoseconds(), timeZone, date.getCalendar());<NEW_LINE>} | timeZone = toTemporalTimeZone.executeDynamicObject(temporalTimeZoneLike); |
1,574,663 | final ListServiceActionsResult executeListServiceActions(ListServiceActionsRequest listServiceActionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listServiceActionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListServiceActionsRequest> request = null;<NEW_LINE>Response<ListServiceActionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListServiceActionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listServiceActionsRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Service Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListServiceActions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListServiceActionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListServiceActionsResultJsonUnmarshaller());<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.SIGNING_REGION, getSigningRegion()); |
559,971 | public void runCommand(CommandSender sender, List<String> args) {<NEW_LINE>sender.<MASK><NEW_LINE>this.plugin.loadConfigs();<NEW_LINE>this.plugin.getAnchorManager().loadAnchors();<NEW_LINE>this.plugin.getMVWorldManager().loadWorlds(true);<NEW_LINE>List<String> configsLoaded = new ArrayList<String>();<NEW_LINE>configsLoaded.add("Multiverse-Core - config.yml");<NEW_LINE>configsLoaded.add("Multiverse-Core - worlds.yml");<NEW_LINE>configsLoaded.add("Multiverse-Core - anchors.yml");<NEW_LINE>// Create the event<NEW_LINE>MVConfigReloadEvent configReload = new MVConfigReloadEvent(configsLoaded);<NEW_LINE>// Fire it off<NEW_LINE>this.plugin.getServer().getPluginManager().callEvent(configReload);<NEW_LINE>for (String s : configReload.getAllConfigsLoaded()) {<NEW_LINE>sender.sendMessage(s);<NEW_LINE>}<NEW_LINE>sender.sendMessage(ChatColor.GREEN + "Reload Complete!");<NEW_LINE>} | sendMessage(ChatColor.GOLD + "Reloading all Multiverse Plugin configs..."); |
1,397,837 | protected final List<String> tabCompleteCommand(final CommandSource sender, final Server server, final String label, final String[] args, final int index) {<NEW_LINE>// TODO: Pass this to the real commandmap<NEW_LINE>final Command command = server.getPluginCommand(label);<NEW_LINE>if (command == null) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>final int numArgs = args.length - index - 1;<NEW_LINE>if (ess.getSettings().isDebug()) {<NEW_LINE>ess.getLogger().info(numArgs + " " + index + " " + Arrays.toString(args));<NEW_LINE>}<NEW_LINE>String[] effectiveArgs = new String[numArgs];<NEW_LINE>System.arraycopy(args, index, effectiveArgs, 0, numArgs);<NEW_LINE>if (effectiveArgs.length == 0) {<NEW_LINE>effectiveArgs = new String[] { "" };<NEW_LINE>}<NEW_LINE>if (ess.getSettings().isDebug()) {<NEW_LINE>ess.getLogger().info(command + " -- " + Arrays.toString(effectiveArgs));<NEW_LINE>}<NEW_LINE>return command.tabComplete(sender.<MASK><NEW_LINE>} | getSender(), label, effectiveArgs); |
275,573 | public BeamSqlTable buildBeamSqlTable(Table tableDefinition) {<NEW_LINE>JSONObject tableProperties = tableDefinition.getProperties();<NEW_LINE>try {<NEW_LINE>RowJson.RowJsonDeserializer deserializer = RowJson.RowJsonDeserializer.forSchema(getSchemaIOProvider().configurationSchema()).withNullBehavior(RowJson.RowJsonDeserializer.NullBehavior.ACCEPT_MISSING_OR_NULL);<NEW_LINE>Row configurationRow = newObjectMapperWith(deserializer).readValue(tableProperties.<MASK><NEW_LINE>SchemaIO schemaIO = getSchemaIOProvider().from(tableDefinition.getLocation(), configurationRow, tableDefinition.getSchema());<NEW_LINE>return new SchemaIOTableWrapper(schemaIO);<NEW_LINE>} catch (InvalidConfigurationException | InvalidSchemaException e) {<NEW_LINE>throw new InvalidTableException(e.getMessage());<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>throw new AssertionError("Failed to re-parse TBLPROPERTIES JSON " + tableProperties.toString());<NEW_LINE>}<NEW_LINE>} | toString(), Row.class); |
1,488,590 | final ImportCertificateAuthorityCertificateResult executeImportCertificateAuthorityCertificate(ImportCertificateAuthorityCertificateRequest importCertificateAuthorityCertificateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(importCertificateAuthorityCertificateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ImportCertificateAuthorityCertificateRequest> request = null;<NEW_LINE>Response<ImportCertificateAuthorityCertificateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ImportCertificateAuthorityCertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(importCertificateAuthorityCertificateRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ImportCertificateAuthorityCertificate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ImportCertificateAuthorityCertificateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ImportCertificateAuthorityCertificateResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "ACM PCA"); |
506,257 | public void doApkBuild() throws Exception {<NEW_LINE>// TODO Merge 2 zip packages<NEW_LINE>apkFile = getApkFile();<NEW_LINE>diffAPkFile = getDiffAPkFile();<NEW_LINE>Profiler.start("build tpatch apk");<NEW_LINE>Profiler.enter("prepare dir");<NEW_LINE>File tmpWorkDir = new File(diffAPkFile.getParentFile(), "tmp-apk");<NEW_LINE>if (tmpWorkDir.exists()) {<NEW_LINE>FileUtils.deleteDirectory(tmpWorkDir);<NEW_LINE>}<NEW_LINE>if (!tmpWorkDir.exists()) {<NEW_LINE>tmpWorkDir.mkdirs();<NEW_LINE>}<NEW_LINE>BetterZip.unzipDirectory(apkFile, tmpWorkDir);<NEW_LINE>// Map zipEntityMap = new HashMap();<NEW_LINE>// ZipUtils.unzip(apkFile, tmpWorkDir.getAbsolutePath(), "UTF-8", zipEntityMap, true);<NEW_LINE>FileUtils.deleteDirectory(new File(tmpWorkDir, "assets"));<NEW_LINE>FileUtils.deleteDirectory(new File(tmpWorkDir, "res"));<NEW_LINE>FileUtils.forceDelete(new File(tmpWorkDir, "resources.arsc"));<NEW_LINE>FileUtils.forceDelete(new File(tmpWorkDir, "AndroidManifest.xml"));<NEW_LINE>File resdir = new File(diffAPkFile.getParentFile(), "tmp-diffResAp");<NEW_LINE>resdir.mkdirs();<NEW_LINE>ZipUtils.unzip(getResourceFile(), resdir.getAbsolutePath(), "UTF-8", new HashMap<String, ZipEntry>(), true);<NEW_LINE>FileUtils.copyDirectory(resdir, tmpWorkDir);<NEW_LINE>Profiler.release();<NEW_LINE>Profiler.enter("rezip");<NEW_LINE>if (getProject().hasProperty("atlas.createDiffApk")) {<NEW_LINE>BetterZip.zipDirectory(tmpWorkDir, diffAPkFile);<NEW_LINE>} else {<NEW_LINE>if (diffAPkFile.exists()) {<NEW_LINE>FileUtils.deleteDirectory(diffAPkFile);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// ZipUtils.rezip(diffAPkFile, tmpWorkDir, zipEntityMap);<NEW_LINE>Profiler.release();<NEW_LINE>FileUtils.deleteDirectory(tmpWorkDir);<NEW_LINE>FileUtils.deleteDirectory(resdir);<NEW_LINE>getLogger().warn(Profiler.dump());<NEW_LINE>} | FileUtils.moveDirectory(tmpWorkDir, diffAPkFile); |
444,208 | private void runMapreduce(ImmutableList<DeletionRequest> deletionRequests, Optional<Lock> lock) {<NEW_LINE>try {<NEW_LINE>int numReducers = Math.min(MAX_REDUCE_SHARDS, divide(deletionRequests.size(), DELETES_PER_SHARD, CEILING));<NEW_LINE>mrRunner.setJobName("Check for EPP resource references and then delete").setModuleName("backend").setDefaultReduceShards(numReducers).runMapreduce(new DeleteContactsAndHostsMapper(deletionRequests), new DeleteEppResourceReducer(), // Add an extra shard that maps over a null domain. See the mapper code for why.<NEW_LINE>ImmutableList.// Add an extra shard that maps over a null domain. See the mapper code for why.<NEW_LINE>of(new NullInput<>(), EppResourceInputs.createEntityInput(DomainBase.class)), new UnlockerOutput<Void>(lock.get(<MASK><NEW_LINE>} catch (Throwable t) {<NEW_LINE>logRespondAndUnlock(SEVERE, "Error starting mapreduce to delete contacts/hosts.", lock);<NEW_LINE>}<NEW_LINE>} | ))).sendLinkToMapreduceConsole(response); |
1,019,915 | public void cleanAutoDeclareContext(ConsumerDestination destination, ExtendedConsumerProperties<RabbitConsumerProperties> consumerProperties) {<NEW_LINE>synchronized (this.autoDeclareContext) {<NEW_LINE>Stream.of(StringUtils.tokenizeToStringArray(destination.getName(), ",", true, true)).forEach(name -> {<NEW_LINE>String group = null;<NEW_LINE>String bindingName = null;<NEW_LINE>if (destination instanceof RabbitConsumerDestination) {<NEW_LINE>group = ((RabbitConsumerDestination) destination).getGroup();<NEW_LINE>bindingName = ((<MASK><NEW_LINE>}<NEW_LINE>RabbitConsumerProperties properties = consumerProperties.getExtension();<NEW_LINE>String toRemove = properties.isQueueNameGroupOnly() ? bindingName + "." + group : name.trim();<NEW_LINE>boolean partitioned = consumerProperties.isPartitioned();<NEW_LINE>if (partitioned) {<NEW_LINE>toRemove = removePartitionPart(toRemove);<NEW_LINE>}<NEW_LINE>removeSingleton(toRemove + ".exchange");<NEW_LINE>removeQueueAndBindingBeans(properties, name.trim(), "", group, partitioned);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | RabbitConsumerDestination) destination).getBindingName(); |
72,924 | protected final void generateDeclarations(StringBuilder sb) {<NEW_LINE>if (parametersMap != null && parametersMap.size() > 0) {<NEW_LINE>Collection<String> parameterNames = parametersMap.keySet();<NEW_LINE>for (Iterator<String> it = parameterNames.iterator(); it.hasNext(); ) {<NEW_LINE>sb.append(" private JRFillParameter parameter_");<NEW_LINE>sb.append(JRStringUtil.getJavaIdentifier<MASK><NEW_LINE>sb.append(" = null;\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fieldsMap != null && fieldsMap.size() > 0) {<NEW_LINE>Collection<String> fieldNames = fieldsMap.keySet();<NEW_LINE>for (Iterator<String> it = fieldNames.iterator(); it.hasNext(); ) {<NEW_LINE>sb.append(" private JRFillField field_");<NEW_LINE>sb.append(JRStringUtil.getJavaIdentifier(it.next()));<NEW_LINE>sb.append(" = null;\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (variables != null && variables.length > 0) {<NEW_LINE>for (int i = 0; i < variables.length; i++) {<NEW_LINE>sb.append(" private JRFillVariable variable_");<NEW_LINE>sb.append(JRStringUtil.getJavaIdentifier(variables[i].getName()));<NEW_LINE>sb.append(" = null;\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (it.next())); |
75,527 | protected static boolean isCglibGetCallbacks(AnnotatedMethod am) {<NEW_LINE>Class<?> rt = am.getRawType();<NEW_LINE>// Ok, first: must return an array type<NEW_LINE>if (rt.isArray()) {<NEW_LINE>// And that type needs to be "net.sf.cglib.proxy.Callback".<NEW_LINE>// Theoretically could just be a type that implements it, but<NEW_LINE>// for now let's keep things simple, fix if need be.<NEW_LINE>Class<?<MASK><NEW_LINE>// Actually, let's just verify it's a "net.sf.cglib.*" class/interface<NEW_LINE>final String className = compType.getName();<NEW_LINE>if (className.contains(".cglib")) {<NEW_LINE>return // also, as per [JACKSON-177]<NEW_LINE>className.startsWith("net.sf.cglib") || // and [core#674]<NEW_LINE>className.startsWith("org.hibernate.repackage.cglib") || className.startsWith("org.springframework.cglib");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | > compType = rt.getComponentType(); |
408,275 | public static synchronized void updatePeerInfo(InetAddressAndPort ep, String columnName, Object value) {<NEW_LINE>if (ep.equals(FBUtilities.getBroadcastAddressAndPort()))<NEW_LINE>return;<NEW_LINE>String req = "INSERT INTO %s.%s (peer, %s) VALUES (?, ?)";<NEW_LINE>executeInternal(String.format(req, SYSTEM_KEYSPACE_NAME, PEERS_TABLE_NAME, columnName), ep.address, value);<NEW_LINE>// This column doesn't match across the two tables<NEW_LINE>if (columnName.equals("rpc_address")) {<NEW_LINE>columnName = "native_address";<NEW_LINE>}<NEW_LINE>req = "INSERT INTO %s.%s (peer, peer_port, %s) VALUES (?, ?, ?)";<NEW_LINE>executeInternal(String.format(req, SYSTEM_KEYSPACE_NAME, PEERS_V2_TABLE_NAME, columnName), ep.<MASK><NEW_LINE>} | address, ep.port, value); |
1,381,736 | public int compareTo(ErrorInfo other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = Boolean.valueOf(is_set_error()).compareTo(other.is_set_error());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_error()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = Boolean.valueOf(is_set_errorTimeSecs()).compareTo(other.is_set_errorTimeSecs());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_errorTimeSecs()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorTimeSecs, other.errorTimeSecs);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = Boolean.valueOf(is_set_errorLevel()).compareTo(other.is_set_errorLevel());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_errorLevel()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorLevel, other.errorLevel);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = Boolean.valueOf(is_set_errorCode()).compareTo(other.is_set_errorCode());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_errorCode()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | this.error, other.error); |
1,488,074 | public Secret generateBrokersSecret(ClusterCa clusterCa, ClientsCa clientsCa) {<NEW_LINE>Map<String, String> data = new HashMap<>(replicas * 4);<NEW_LINE>for (int i = 0; i < replicas; i++) {<NEW_LINE>CertAndKey cert = brokerCerts.get(KafkaCluster.kafkaPodName(cluster, i));<NEW_LINE>data.put(KafkaCluster.kafkaPodName(cluster, i) + ".key", cert.keyAsBase64String());<NEW_LINE>data.put(KafkaCluster.kafkaPodName(cluster, i) + ".crt", cert.certAsBase64String());<NEW_LINE>data.put(KafkaCluster.kafkaPodName(cluster, i) + ".p12", cert.keyStoreAsBase64String());<NEW_LINE>data.put(KafkaCluster.kafkaPodName(cluster, i) + <MASK><NEW_LINE>}<NEW_LINE>Map<String, String> annotations = Map.of(clusterCa.caCertGenerationAnnotation(), String.valueOf(clusterCa.certGeneration()), clientsCa.caCertGenerationAnnotation(), String.valueOf(clientsCa.certGeneration()));<NEW_LINE>return createSecret(KafkaCluster.brokersSecretName(cluster), data, annotations);<NEW_LINE>} | ".password", cert.storePasswordAsBase64String()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.