idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,086,509 | public void paint(BigInteger xOffset, BigInteger yOffset, GC gc) {<NEW_LINE>if (model == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>gc.setFont(font);<NEW_LINE>Rectangle clip = gc.getClipping();<NEW_LINE>BigInteger startY = yOffset.add(BigInteger.valueOf(top(clip)));<NEW_LINE>long startRow = startY.divide(lineHeightBig).max(BigInteger.ZERO).min(BigInteger.valueOf(model.getLineCount() <MASK><NEW_LINE>long endRow = startY.add(BigInteger.valueOf(clip.height + lineHeight - 1)).divide(lineHeightBig).max(BigInteger.ZERO).min(BigInteger.valueOf(model.getLineCount())).longValueExact();<NEW_LINE>Color background = gc.getBackground();<NEW_LINE>gc.setBackground(theme.memoryReadHighlight());<NEW_LINE>for (Selection read : model.getReads(startRow, endRow)) {<NEW_LINE>highlight(gc, yOffset, read);<NEW_LINE>}<NEW_LINE>gc.setBackground(theme.memoryWriteHighlight());<NEW_LINE>for (Selection write : model.getWrites(startRow, endRow)) {<NEW_LINE>highlight(gc, yOffset, write);<NEW_LINE>}<NEW_LINE>if (selection != null && selection.isSelectionVisible(startRow, endRow)) {<NEW_LINE>gc.setBackground(theme.memorySelectionHighlight());<NEW_LINE>highlight(gc, yOffset, selection);<NEW_LINE>}<NEW_LINE>gc.setBackground(background);<NEW_LINE>int y = getY(startRow, yOffset);<NEW_LINE>Iterator<Segment> it = model.getLines(startRow, endRow);<NEW_LINE>for (; it.hasNext(); y += lineHeight) {<NEW_LINE>Segment segment = it.next();<NEW_LINE>gc.drawString(new String(segment.array, segment.offset, segment.count), 0, y, true);<NEW_LINE>}<NEW_LINE>} | - 1)).longValueExact(); |
344,844 | public static HashMap topMostPopularTags(HashMap tagHashMap, int maxNumberOfTags) {<NEW_LINE>List<String> tempList = new ArrayList<String>(30);<NEW_LINE>HashMap result = new HashMap();<NEW_LINE>int i;<NEW_LINE>Set<String> keySet = tagHashMap.keySet();<NEW_LINE>for (String stringKey : keySet) {<NEW_LINE>if (tempList.size() == 0) {<NEW_LINE>tempList.add(stringKey);<NEW_LINE>} else {<NEW_LINE>for (i = 0; i < tempList.size(); ++i) {<NEW_LINE>int tagCount = ((Integer) tagHashMap.get(stringKey)).intValue();<NEW_LINE>int tempTagCount = ((Integer) tagHashMap.get(tempList.get(i))).intValue();<NEW_LINE>if (tagCount > tempTagCount) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>i = 0;<NEW_LINE>while (i < maxNumberOfTags && i < tempList.size()) {<NEW_LINE>result.put(tempList.get(i), tagHashMap.get(tempList.get(i)));<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | tempList.add(i, stringKey); |
658,396 | private static void generateIndexHtml(final PsiDirectory psiDirectory, final boolean recursive, final String outputDirectoryName) throws FileNotFoundException {<NEW_LINE>String indexHtmlName = constructOutputDirectory(psiDirectory, outputDirectoryName) + File.separator + "index.html";<NEW_LINE>OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(indexHtmlName), CharsetToolkit.UTF8_CHARSET);<NEW_LINE>final String title = PsiPackageHelper.getInstance(psiDirectory.getProject()).getQualifiedName(psiDirectory, true);<NEW_LINE>try {<NEW_LINE>writer.write("<html><head><title>" + title + "</title></head><body>");<NEW_LINE>if (recursive) {<NEW_LINE>PsiDirectory[] directories = psiDirectory.getSubdirectories();<NEW_LINE>for (PsiDirectory directory : directories) {<NEW_LINE>writer.write("<a href=\"" + directory.getName() + "/index.html\"><b>" + directory.getName() + "</b></a><br />");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PsiFile[] files = psiDirectory.getFiles();<NEW_LINE>for (PsiFile file : files) {<NEW_LINE>if (!(file instanceof PsiBinaryFile)) {<NEW_LINE>writer.write("<a href=\"" + getHTMLFileName(file) + "\">" + file.getVirtualFile(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.write("</body></html>");<NEW_LINE>writer.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error(e);<NEW_LINE>}<NEW_LINE>} | ).getName() + "</a><br />"); |
1,851,264 | public void deleteById(String id) {<NEW_LINE>String resourceGroupName = <MASK><NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds");<NEW_LINE>if (privateCloudName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id)));<NEW_LINE>}<NEW_LINE>String cloudLinkName = Utils.getValueFromIdByName(id, "cloudLinks");<NEW_LINE>if (cloudLinkName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'cloudLinks'.", id)));<NEW_LINE>}<NEW_LINE>this.delete(resourceGroupName, privateCloudName, cloudLinkName, Context.NONE);<NEW_LINE>} | Utils.getValueFromIdByName(id, "resourceGroups"); |
17,378 | public static QueryMsConfigResourcesResponse unmarshall(QueryMsConfigResourcesResponse queryMsConfigResourcesResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryMsConfigResourcesResponse.setRequestId(_ctx.stringValue("QueryMsConfigResourcesResponse.RequestId"));<NEW_LINE>queryMsConfigResourcesResponse.setResultCode(_ctx.stringValue("QueryMsConfigResourcesResponse.ResultCode"));<NEW_LINE>queryMsConfigResourcesResponse.setResultMessage(_ctx.stringValue("QueryMsConfigResourcesResponse.ResultMessage"));<NEW_LINE>queryMsConfigResourcesResponse.setPageNum(_ctx.longValue("QueryMsConfigResourcesResponse.PageNum"));<NEW_LINE>queryMsConfigResourcesResponse.setPageSize(_ctx.longValue("QueryMsConfigResourcesResponse.PageSize"));<NEW_LINE>queryMsConfigResourcesResponse.setTotalCount(_ctx.longValue("QueryMsConfigResourcesResponse.TotalCount"));<NEW_LINE>List<ResourcesItem> resources = new ArrayList<ResourcesItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryMsConfigResourcesResponse.Resources.Length"); i++) {<NEW_LINE>ResourcesItem resourcesItem = new ResourcesItem();<NEW_LINE>resourcesItem.setAppName(_ctx.stringValue<MASK><NEW_LINE>resourcesItem.setDesc(_ctx.stringValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Desc"));<NEW_LINE>resourcesItem.setId(_ctx.longValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Id"));<NEW_LINE>resourcesItem.setInstanceId(_ctx.stringValue("QueryMsConfigResourcesResponse.Resources[" + i + "].InstanceId"));<NEW_LINE>resourcesItem.setRegion(_ctx.stringValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Region"));<NEW_LINE>resourcesItem.setResourceId(_ctx.stringValue("QueryMsConfigResourcesResponse.Resources[" + i + "].ResourceId"));<NEW_LINE>List<AttributesItem> attributes = new ArrayList<AttributesItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Attributes.Length"); j++) {<NEW_LINE>AttributesItem attributesItem = new AttributesItem();<NEW_LINE>attributesItem.setAttributeName(_ctx.stringValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Attributes[" + j + "].AttributeName"));<NEW_LINE>attributesItem.setDesc(_ctx.stringValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Attributes[" + j + "].Desc"));<NEW_LINE>attributesItem.setId(_ctx.longValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Attributes[" + j + "].Id"));<NEW_LINE>attributesItem.setInstanceId(_ctx.stringValue("QueryMsConfigResourcesResponse.Resources[" + i + "].Attributes[" + j + "].InstanceId"));<NEW_LINE>attributes.add(attributesItem);<NEW_LINE>}<NEW_LINE>resourcesItem.setAttributes(attributes);<NEW_LINE>resources.add(resourcesItem);<NEW_LINE>}<NEW_LINE>queryMsConfigResourcesResponse.setResources(resources);<NEW_LINE>return queryMsConfigResourcesResponse;<NEW_LINE>} | ("QueryMsConfigResourcesResponse.Resources[" + i + "].AppName")); |
594,668 | public boolean execute(final String action, final JSONArray data, final CallbackContext callbackContext) {<NEW_LINE>if ("setListener".equals(action)) {<NEW_LINE>mListenerContext = callbackContext;<NEW_LINE>sendToListener("ready", new JSONObject());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>this.mCallbackContext = callbackContext;<NEW_LINE>// Check if the action has a handler<NEW_LINE>Boolean isValidAction = true;<NEW_LINE>try {<NEW_LINE>// Action selector<NEW_LINE>if ("init".equals(action)) {<NEW_LINE>final List<String> inAppSkus = parseStringArrayAtIndex(data, 1);<NEW_LINE>final List<String> subsSkus = parseStringArrayAtIndex(data, 2);<NEW_LINE>init(inAppSkus, subsSkus);<NEW_LINE>} else if ("getAvailableProducts".equals(action)) {<NEW_LINE>getAvailableProducts();<NEW_LINE>} else if ("getPurchases".equals(action)) {<NEW_LINE>getPurchases();<NEW_LINE>} else if ("consumePurchase".equals(action)) {<NEW_LINE>final String sku = data.getString(0);<NEW_LINE>consumePurchase(sku);<NEW_LINE>} else if ("acknowledgePurchase".equals(action)) {<NEW_LINE>final String sku = data.getString(0);<NEW_LINE>acknowledgePurchase(sku);<NEW_LINE>} else if ("buy".equals(action)) {<NEW_LINE>buy(data);<NEW_LINE>} else if ("subscribe".equals(action)) {<NEW_LINE>subscribe(data);<NEW_LINE>} else if ("manageSubscriptions".equals(action)) {<NEW_LINE>Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/account/subscriptions"));<NEW_LINE>cordova.getActivity().startActivity(browserIntent);<NEW_LINE>} else if ("manageBilling".equals(action)) {<NEW_LINE>Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/paymentmethods"));<NEW_LINE>cordova.<MASK><NEW_LINE>} else if ("launchPriceChangeConfirmationFlow".equals(action)) {<NEW_LINE>final String sku = data.getString(0);<NEW_LINE>launchPriceChangeConfirmationFlow(sku);<NEW_LINE>} else {<NEW_LINE>// No handler for the action<NEW_LINE>isValidAction = false;<NEW_LINE>}<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>callError(Constants.ERR_UNKNOWN, e.getMessage());<NEW_LINE>} catch (JSONException e) {<NEW_LINE>callError(Constants.ERR_UNKNOWN, e.getMessage());<NEW_LINE>}<NEW_LINE>// Method not found<NEW_LINE>return isValidAction;<NEW_LINE>} | getActivity().startActivity(browserIntent); |
1,740,176 | protected void configureCompileTask(AbstractNativeCompileTask task, final NativeBinarySpecInternal binary, final LanguageSourceSetInternal languageSourceSet) {<NEW_LINE>// Note that the sourceSet is the sourceSet this pre-compiled header will be used with - it's not an<NEW_LINE>// input sourceSet to the compile task.<NEW_LINE><MASK><NEW_LINE>task.setDescription("Compiles a pre-compiled header for the " + sourceSet + " of " + binary);<NEW_LINE>// Add the source of the source set to the include paths to resolve any headers that may be in source directories<NEW_LINE>task.includes(sourceSet.getSource().getSourceDirectories());<NEW_LINE>final Project project = task.getProject();<NEW_LINE>task.source(sourceSet.getPrefixHeaderFile());<NEW_LINE>task.getObjectFileDir().set(new File(binary.getNamingScheme().getOutputDirectory(project.getBuildDir(), "objs"), languageSourceSet.getProjectScopedName() + "PCH"));<NEW_LINE>task.dependsOn(project.getTasks().withType(PrefixHeaderFileGenerateTask.class).matching(new Spec<PrefixHeaderFileGenerateTask>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isSatisfiedBy(PrefixHeaderFileGenerateTask prefixHeaderFileGenerateTask) {<NEW_LINE>return prefixHeaderFileGenerateTask.getPrefixHeaderFile().equals(sourceSet.getPrefixHeaderFile());<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>// This is so that VisualCpp has the object file of the generated source file available at link time<NEW_LINE>binary.binaryInputs(task.getOutputs().getFiles().getAsFileTree().matching(new PatternSet().include("**/*.obj", "**/*.o")));<NEW_LINE>PreCompiledHeader pch = binary.getPrefixFileToPCH().get(sourceSet.getPrefixHeaderFile());<NEW_LINE>pch.setPchObjects(task.getOutputs().getFiles().getAsFileTree().matching(new PatternSet().include("**/*.pch", "**/*.gch")));<NEW_LINE>pch.builtBy(task);<NEW_LINE>} | final DependentSourceSetInternal sourceSet = (DependentSourceSetInternal) languageSourceSet; |
623,701 | public void visitBinaryExpression(BinaryExpression expr) {<NEW_LINE>// order of convert calls is important or indexes and thus recorded values get confused<NEW_LINE>Expression convertedLeftExpression = // prevent lvalue from getting turned into record(lvalue), which can no longer be assigned to<NEW_LINE>Types.ofType(expr.getOperation().getType(), Types.ASSIGNMENT_OPERATOR) ? convertAndRecordNa(expr.getLeftExpression()) : <MASK><NEW_LINE>Expression convertedRightExpression = convert(expr.getRightExpression());<NEW_LINE>Expression conversion = // morph instanceof expression to isInstance method call to be able to record rvalue<NEW_LINE>Types.ofType(expr.getOperation().getType(), Types.KEYWORD_INSTANCEOF) ? createDirectMethodCall(convertedRightExpression, resources.getAstNodeCache().Class_IsInstance, convertedLeftExpression) : new BinaryExpression(convertedLeftExpression, expr.getOperation(), convertedRightExpression);<NEW_LINE>conversion.setSourcePosition(expr);<NEW_LINE>result = record(conversion);<NEW_LINE>} | convert(expr.getLeftExpression()); |
1,580,991 | private Object builtinReplace(Object searchValue, Object replParam, Object o) {<NEW_LINE>TruffleString input = toString(o);<NEW_LINE>TruffleString searchString = toString2Node.executeString(searchValue);<NEW_LINE>boolean functionalReplace = isCallableNode.executeBoolean(replParam);<NEW_LINE>TruffleString replaceString = null;<NEW_LINE>if (!functionalReplaceProfile.profile(functionalReplace)) {<NEW_LINE>replaceString = toString3Node.executeString(replParam);<NEW_LINE>}<NEW_LINE>int pos = indexOf(input, searchString);<NEW_LINE>if (replaceNecessaryProfile.profile(pos < 0)) {<NEW_LINE>return input;<NEW_LINE>}<NEW_LINE>TruffleStringBuilder sb = Strings.builderCreate();<NEW_LINE>append(sb, input, 0, pos);<NEW_LINE>if (functionalReplaceProfile.profile(functionalReplace)) {<NEW_LINE>Object replValue = functionReplaceCall(replParam, Undefined.instance, new Object[] <MASK><NEW_LINE>append(sb, toString3Node.executeString(replValue));<NEW_LINE>} else {<NEW_LINE>appendSubstitution(sb, input, replaceString, searchString, pos, dollarProfile, this);<NEW_LINE>}<NEW_LINE>append(sb, input, pos + Strings.length(searchString), Strings.length(input));<NEW_LINE>return builderToString(sb);<NEW_LINE>} | { searchString, pos, input }); |
1,424,972 | private byte[] encrypt(byte[] in, int inOff, int inLen) throws InvalidCipherTextException {<NEW_LINE>byte[] c2 = new byte[inLen];<NEW_LINE>System.arraycopy(in, inOff, c2, 0, c2.length);<NEW_LINE>ECMultiplier multiplier = createBasePointMultiplier();<NEW_LINE>byte[] c1;<NEW_LINE>ECPoint kPB;<NEW_LINE>do {<NEW_LINE>BigInteger k = nextK();<NEW_LINE>ECPoint c1P = multiplier.multiply(ecParams.getG(), k).normalize();<NEW_LINE>c1 = c1P.getEncoded(false);<NEW_LINE>kPB = ((ECPublicKeyParameters) ecKey).getQ().multiply(k).normalize();<NEW_LINE><MASK><NEW_LINE>} while (notEncrypted(c2, in, inOff));<NEW_LINE>byte[] c3 = new byte[digest.getDigestSize()];<NEW_LINE>addFieldElement(digest, kPB.getAffineXCoord());<NEW_LINE>digest.update(in, inOff, inLen);<NEW_LINE>addFieldElement(digest, kPB.getAffineYCoord());<NEW_LINE>digest.doFinal(c3, 0);<NEW_LINE>switch(mode) {<NEW_LINE>case C1C3C2:<NEW_LINE>return Arrays.concatenate(c1, c3, c2);<NEW_LINE>default:<NEW_LINE>return Arrays.concatenate(c1, c2, c3);<NEW_LINE>}<NEW_LINE>} | kdf(digest, kPB, c2); |
1,231,021 | protected void paintAdditionalData(PaintTarget target) throws PaintException {<NEW_LINE>super.paintAdditionalData(target);<NEW_LINE>boolean hasAggregation = items instanceof AggregationContainer && isAggregatable() && !((AggregationContainer) items)<MASK><NEW_LINE>// first call, we shouldn't update aggregation group rows<NEW_LINE>if (cachedAggregatedValues == null) {<NEW_LINE>cachedAggregatedValues = new HashMap<>();<NEW_LINE>// fill with initial values<NEW_LINE>if (hasAggregation) {<NEW_LINE>for (Object itemId : getVisibleItemIds()) {<NEW_LINE>if (isGroup(itemId)) {<NEW_LINE>cachedAggregatedValues.put(itemId, getAggregatedValuesForGroup(itemId));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean cacheIsEmpty = cachedAggregatedValues.isEmpty();<NEW_LINE>boolean isAddedToCache = false;<NEW_LINE>if (hasGroups() && hasAggregation) {<NEW_LINE>target.startTag("groupRows");<NEW_LINE>for (Object itemId : getVisibleItemIds()) {<NEW_LINE>if (isGroup(itemId) && isAggregatedValuesChanged(itemId)) {<NEW_LINE>target.startTag("tr");<NEW_LINE>target.addAttribute("groupKey", groupIdMap.key(itemId));<NEW_LINE>paintUpdatesForGroupRowWithAggregation(target, itemId);<NEW_LINE>target.endTag("tr");<NEW_LINE>isAddedToCache = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>paintEditableAggregationColumns(target);<NEW_LINE>target.endTag("groupRows");<NEW_LINE>}<NEW_LINE>// if cachedAggregatedValues is empty, so rendered cells was refreshed<NEW_LINE>// and we need to paint visible columns and actions<NEW_LINE>shouldPaintWithAggregations = cacheIsEmpty || !isAddedToCache;<NEW_LINE>} | .getAggregationPropertyIds().isEmpty(); |
1,023,152 | void use(Actor actor, World world, LocalSession session, @Arg(desc = "Snapshot to use") String name) throws IOException {<NEW_LINE>LocalConfiguration config = we.getConfiguration();<NEW_LINE>checkSnapshotsConfigured(config);<NEW_LINE>if (config.snapshotRepo != null) {<NEW_LINE>legacy.use(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Want the latest snapshot?<NEW_LINE>if (name.equalsIgnoreCase("latest")) {<NEW_LINE>Snapshot snapshot;<NEW_LINE>try (Stream<Snapshot> snapshotStream = config.snapshotDatabase.getSnapshotsNewestFirst(world.getName())) {<NEW_LINE>snapshot = snapshotStream.findFirst().orElse(null);<NEW_LINE>}<NEW_LINE>if (snapshot != null) {<NEW_LINE>if (session.getSnapshotExperimental() != null) {<NEW_LINE>session.getSnapshotExperimental().close();<NEW_LINE>}<NEW_LINE>session.setSnapshot(null);<NEW_LINE>actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use.newest"));<NEW_LINE>} else {<NEW_LINE>actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world"));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>URI uri = resolveSnapshotName(config, name);<NEW_LINE>Optional<Snapshot> snapshot = config.snapshotDatabase.getSnapshot(uri);<NEW_LINE>if (snapshot.isPresent()) {<NEW_LINE>if (session.getSnapshotExperimental() != null) {<NEW_LINE>session.getSnapshotExperimental().close();<NEW_LINE>}<NEW_LINE>session.setSnapshotExperimental(snapshot.get());<NEW_LINE>actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use", TextComponent.of(name)));<NEW_LINE>} else {<NEW_LINE>actor.printError(TranslatableComponent.of("worldedit.restore.not-available"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | actor, world, session, name); |
359,803 | public void updateCells() {<NEW_LINE>int rowIndex = getSkinnable().getIndex();<NEW_LINE>if (rowIndex >= 0) {<NEW_LINE>GridView<T> gridView = getSkinnable().getGridView();<NEW_LINE>int maxCellsInRow = ((GridViewSkin<?>) gridView.getSkin()).computeMaxCellsInRow();<NEW_LINE>int totalCellsInGrid = gridView.getItems().size();<NEW_LINE>int startCellIndex = rowIndex * maxCellsInRow;<NEW_LINE>int endCellIndex = startCellIndex + maxCellsInRow - 1;<NEW_LINE>int cacheIndex = 0;<NEW_LINE>for (int cellIndex = startCellIndex; cellIndex <= endCellIndex; cellIndex++, cacheIndex++) {<NEW_LINE>if (cellIndex < totalCellsInGrid) {<NEW_LINE>// Check if we can re-use a cell at this index or create a new one<NEW_LINE>GridCell<T> cell = getCellAtIndex(cacheIndex);<NEW_LINE>if (cell == null) {<NEW_LINE>cell = createCell();<NEW_LINE>getChildren().add(cell);<NEW_LINE>}<NEW_LINE>cell.updateIndex(-1);<NEW_LINE>cell.updateIndex(cellIndex);<NEW_LINE>} else // we are going out of bounds -> exist the loop<NEW_LINE>{<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// In case we are re-using a row that previously had more cells than<NEW_LINE>// this one, we need to remove the extra cells that remain<NEW_LINE>getChildren().remove(cacheIndex, <MASK><NEW_LINE>}<NEW_LINE>} | getChildren().size()); |
1,332,324 | private LimitQueryDeterminismAnalysis analyzeLimitOrderBy(Query tieInspectorQuery, List<ColumnNameOrIndex> orderByKeys, long limit) {<NEW_LINE>QueryResult<List<Object>> result = callAndConsume(() -> prestoAction.execute(tieInspectorQuery, DETERMINISM_ANALYSIS_MAIN, new TieInspector(limit)), stats -> stats.getQueryStats().map(QueryStats::getQueryId).ifPresent(determinismAnalysisDetails::setLimitQueryAnalysisQueryId));<NEW_LINE>if (result.getResults().isEmpty()) {<NEW_LINE>return FAILED_DATA_CHANGED;<NEW_LINE>}<NEW_LINE>if (result.getResults().size() == 1) {<NEW_LINE>return DETERMINISTIC;<NEW_LINE>}<NEW_LINE>List<Object> row1 = result.<MASK><NEW_LINE>List<Object> row2 = result.getResults().get(1);<NEW_LINE>checkState(row1.size() == row2.size(), "Rows have different sizes: %s %s", row1.size(), row2.size());<NEW_LINE>Map<String, Integer> columnIndices = getColumnIndices(result.getMetadata());<NEW_LINE>for (ColumnNameOrIndex orderByKey : orderByKeys) {<NEW_LINE>int columnIndex = orderByKey.getIndex().isPresent() ? orderByKey.getIndex().get() : columnIndices.get(orderByKey.getName().orElseThrow(() -> new IllegalArgumentException(format("Invalid orderByKey: %s", orderByKey))));<NEW_LINE>if (!Objects.equals(row1.get(columnIndex), row2.get(columnIndex))) {<NEW_LINE>return DETERMINISTIC;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return NON_DETERMINISTIC;<NEW_LINE>} | getResults().get(0); |
1,138,041 | public static ListBaselineConfigsResponse unmarshall(ListBaselineConfigsResponse listBaselineConfigsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listBaselineConfigsResponse.setRequestId(_ctx.stringValue("ListBaselineConfigsResponse.RequestId"));<NEW_LINE>listBaselineConfigsResponse.setHttpStatusCode(_ctx.integerValue("ListBaselineConfigsResponse.HttpStatusCode"));<NEW_LINE>listBaselineConfigsResponse.setErrorMessage(_ctx.stringValue("ListBaselineConfigsResponse.ErrorMessage"));<NEW_LINE>listBaselineConfigsResponse.setErrorCode(_ctx.stringValue("ListBaselineConfigsResponse.ErrorCode"));<NEW_LINE>listBaselineConfigsResponse.setSuccess(_ctx.booleanValue("ListBaselineConfigsResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListBaselineConfigsResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListBaselineConfigsResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListBaselineConfigsResponse.Data.TotalCount"));<NEW_LINE>List<BaselinesItem> baselines = new ArrayList<BaselinesItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListBaselineConfigsResponse.Data.Baselines.Length"); i++) {<NEW_LINE>BaselinesItem baselinesItem = new BaselinesItem();<NEW_LINE>baselinesItem.setHourSlaDetail(_ctx.stringValue("ListBaselineConfigsResponse.Data.Baselines[" + i + "].HourSlaDetail"));<NEW_LINE>baselinesItem.setIsDefault(_ctx.booleanValue("ListBaselineConfigsResponse.Data.Baselines[" + i + "].IsDefault"));<NEW_LINE>baselinesItem.setOwner(_ctx.stringValue<MASK><NEW_LINE>baselinesItem.setProjectId(_ctx.longValue("ListBaselineConfigsResponse.Data.Baselines[" + i + "].ProjectId"));<NEW_LINE>baselinesItem.setPriority(_ctx.integerValue("ListBaselineConfigsResponse.Data.Baselines[" + i + "].Priority"));<NEW_LINE>baselinesItem.setSlaMinu(_ctx.integerValue("ListBaselineConfigsResponse.Data.Baselines[" + i + "].SlaMinu"));<NEW_LINE>baselinesItem.setSlaHour(_ctx.integerValue("ListBaselineConfigsResponse.Data.Baselines[" + i + "].SlaHour"));<NEW_LINE>baselinesItem.setBaselineId(_ctx.longValue("ListBaselineConfigsResponse.Data.Baselines[" + i + "].BaselineId"));<NEW_LINE>baselinesItem.setBaselineName(_ctx.stringValue("ListBaselineConfigsResponse.Data.Baselines[" + i + "].BaselineName"));<NEW_LINE>baselinesItem.setHourExpDetail(_ctx.stringValue("ListBaselineConfigsResponse.Data.Baselines[" + i + "].HourExpDetail"));<NEW_LINE>baselinesItem.setUseFlag(_ctx.booleanValue("ListBaselineConfigsResponse.Data.Baselines[" + i + "].UseFlag"));<NEW_LINE>baselinesItem.setExpHour(_ctx.integerValue("ListBaselineConfigsResponse.Data.Baselines[" + i + "].ExpHour"));<NEW_LINE>baselinesItem.setBaselineType(_ctx.stringValue("ListBaselineConfigsResponse.Data.Baselines[" + i + "].BaselineType"));<NEW_LINE>baselinesItem.setExpMinu(_ctx.integerValue("ListBaselineConfigsResponse.Data.Baselines[" + i + "].ExpMinu"));<NEW_LINE>baselines.add(baselinesItem);<NEW_LINE>}<NEW_LINE>data.setBaselines(baselines);<NEW_LINE>listBaselineConfigsResponse.setData(data);<NEW_LINE>return listBaselineConfigsResponse;<NEW_LINE>} | ("ListBaselineConfigsResponse.Data.Baselines[" + i + "].Owner")); |
957,079 | public DescribeUserStackAssociationsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeUserStackAssociationsResult describeUserStackAssociationsResult = new DescribeUserStackAssociationsResult();<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 describeUserStackAssociationsResult;<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("UserStackAssociations", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeUserStackAssociationsResult.setUserStackAssociations(new ListUnmarshaller<UserStackAssociation>(UserStackAssociationJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeUserStackAssociationsResult.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 describeUserStackAssociationsResult;<NEW_LINE>} | )).unmarshall(context)); |
1,513,273 | final CreateGatewayResult executeCreateGateway(CreateGatewayRequest createGatewayRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createGatewayRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateGatewayRequest> request = null;<NEW_LINE>Response<CreateGatewayResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateGatewayRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createGatewayRequest));<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, "IoTSiteWise");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateGateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "api.";<NEW_LINE>String resolvedHostPrefix = String.format("api.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateGatewayResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateGatewayResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | responseHandler, executionContext, null, endpointTraitHost); |
573,724 | public static String generateThreadDump() {<NEW_LINE>StringBuilder threadDump = new StringBuilder(System.lineSeparator());<NEW_LINE>ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();<NEW_LINE>ThreadInfo[] threadInfos = threadMXBean.getThreadInfo(threadMXBean.getAllThreadIds(), 100);<NEW_LINE>for (ThreadInfo threadInfo : threadInfos) {<NEW_LINE>// Break the stack trace into lines and then put back together using the<NEW_LINE>// appropriate line ending for the system.<NEW_LINE>threadDump.append(new BufferedReader(new StringReader(threadInfo.toString())).lines().collect(Collectors.joining(<MASK><NEW_LINE>threadDump.append(System.lineSeparator());<NEW_LINE>}<NEW_LINE>long[] deadlockThreadIds = threadMXBean.findDeadlockedThreads();<NEW_LINE>if (deadlockThreadIds != null) {<NEW_LINE>threadDump.append("-------------------List of Deadlocked Thread IDs ---------------------");<NEW_LINE>threadDump.append(System.lineSeparator());<NEW_LINE>String idsList = (Arrays.stream(deadlockThreadIds).boxed().collect(Collectors.toList())).stream().map(n -> String.valueOf(n)).collect(Collectors.joining("-", "{", "}"));<NEW_LINE>threadDump.append(idsList);<NEW_LINE>}<NEW_LINE>return threadDump.toString();<NEW_LINE>} | System.lineSeparator()))); |
206,313 | private ClassTree addPostMethod(MimeType mime, String type, WorkingCopy copy, ClassTree tree) {<NEW_LINE>Modifier[] modifiers = Constants.PUBLIC;<NEW_LINE>String[] annotations = new String[] { RestConstants.POST_ANNOTATION, RestConstants.CONSUME_MIME_ANNOTATION, RestConstants.PRODUCE_MIME_ANNOTATION };<NEW_LINE>ExpressionTree mimeTree = mime.<MASK><NEW_LINE>Object[] annotationAttrs = new Object[] { null, mimeTree, mimeTree };<NEW_LINE>// NOI18N<NEW_LINE>String bodyText = "{ //TODO\n return Response.created(context.getAbsolutePath()).build(); }";<NEW_LINE>String[] parameters = getPostPutParams();<NEW_LINE>Object[] paramTypes = getPostPutParamTypes(type);<NEW_LINE>if (type != null) {<NEW_LINE>paramTypes[paramTypes.length - 1] = type;<NEW_LINE>}<NEW_LINE>String[] paramAnnotations = getParamAnnotations(parameters.length);<NEW_LINE>Object[] paramAnnotationAttrs = getParamAnnotationAttributes(parameters.length);<NEW_LINE>GenericResourceBean subBean = getSubresourceBean();<NEW_LINE>StringBuilder comment = new StringBuilder("POST method for creating an instance of ");<NEW_LINE>comment.append(subBean == null ? bean.getName() : subBean.getName());<NEW_LINE>comment.append("\n");<NEW_LINE>for (int i = 0; i < parameters.length - 1; i++) {<NEW_LINE>comment.append("@param ");<NEW_LINE>comment.append(parameters[i]);<NEW_LINE>comment.append(" resource URI parameter\n");<NEW_LINE>}<NEW_LINE>comment.append("@param ");<NEW_LINE>comment.append(parameters[parameters.length - 1]);<NEW_LINE>comment.append(" representation for the new resource\n");<NEW_LINE>comment.append("@return an HTTP response with content of the created resource");<NEW_LINE>return JavaSourceHelper.addMethod(copy, tree, modifiers, annotations, annotationAttrs, getMethodName(HttpMethodType.POST, mime), RestConstants.HTTP_RESPONSE, parameters, paramTypes, paramAnnotations, paramAnnotationAttrs, bodyText, comment.toString());<NEW_LINE>} | expressionTree(copy.getTreeMaker()); |
36,408 | public void paint(Graphics2D g, double xStart, double xEnd, double y) {<NEW_LINE>Shape clip = g.getClip();<NEW_LINE>final Rectangle2D rectangle = new Rectangle2D.Double(xStart, y - 3, xEnd - xStart, 3);<NEW_LINE>final Rectangle2D waveClip = clip != null ? clip.getBounds2D().createIntersection(rectangle) : rectangle;<NEW_LINE>if (waveClip.isEmpty())<NEW_LINE>return;<NEW_LINE>Graphics2D g2d = (Graphics2D) g.create();<NEW_LINE>try {<NEW_LINE>g2d.setComposite(AlphaComposite.SrcOver);<NEW_LINE>g2d.setClip(waveClip);<NEW_LINE>xStart -= xStart % 4;<NEW_LINE>g2d.translate(xStart, y - 3);<NEW_LINE>UIUtil.drawImage(g2d, <MASK><NEW_LINE>} finally {<NEW_LINE>g2d.dispose();<NEW_LINE>}<NEW_LINE>} | myImage, 0, 0, null); |
1,663,046 | public static void main(String[] args) throws Exception {<NEW_LINE>Options options = new Options();<NEW_LINE>options.addOption(option(0, "l", OPTION_LOCAL, "Run the topology in local mode."));<NEW_LINE>options.addOption(option(0, "r", OPTION_REMOTE, "Deploy the topology to a remote cluster."));<NEW_LINE>options.addOption(option(0, "R", OPTION_RESOURCE, "Treat the supplied path as a classpath resource instead of a file."));<NEW_LINE>options.addOption(option(1, "s", OPTION_SLEEP, "ms", "When running locally, the amount of time to sleep (in ms.) " + "before killing the topology and shutting down the local cluster."));<NEW_LINE>options.addOption(option(0, "d", OPTION_DRY_RUN, "Do not run or deploy the topology. Just build, validate, " + "and print information about the topology."));<NEW_LINE>options.addOption(option(0, "q", OPTION_NO_DETAIL, "Suppress the printing of topology details."));<NEW_LINE>options.addOption(option(0<MASK><NEW_LINE>options.addOption(option(0, "i", OPTION_INACTIVE, "Deploy the topology, but do not activate it."));<NEW_LINE>options.addOption(option(1, "z", OPTION_ZOOKEEPER, "host:port", "When running in local mode, use the ZooKeeper at the " + "specified <host>:<port> instead of the in-process ZooKeeper. (requires Storm 0.9.3 or later)"));<NEW_LINE>options.addOption(option(1, "f", OPTION_FILTER, "file", "Perform property substitution. Use the specified file " + "as a source of properties, and replace keys identified with {$[property name]} with the value defined " + "in the properties file."));<NEW_LINE>options.addOption(option(0, "e", OPTION_ENV_FILTER, "Perform environment variable substitution. Replace keys" + "identified with `${ENV-[NAME]}` will be replaced with the corresponding `NAME` environment value"));<NEW_LINE>CommandLineParser parser = new BasicParser();<NEW_LINE>CommandLine cmd = parser.parse(options, args);<NEW_LINE>if (cmd.getArgs().length != 1) {<NEW_LINE>usage(options);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>runCli(cmd);<NEW_LINE>} | , "n", OPTION_NO_SPLASH, "Suppress the printing of the splash screen.")); |
353,859 | public Void visitAnnotation(AnnotationMirror annotation, AnnotationValue unused) {<NEW_LINE>// By explicitly adding annotations rather than relying on AnnotationMirror.toString(),<NEW_LINE>// we can import the types and make the code (hopefully) more readable.<NEW_LINE>code.add("@%s", QualifiedName.of(asElement(annotation.getAnnotationType())));<NEW_LINE>if (annotation.getElementValues().isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>code.add("(");<NEW_LINE>if (hasSingleValueWithDefaultKey(annotation)) {<NEW_LINE>AnnotationValue value = getOnlyElement(annotation.<MASK><NEW_LINE>visit(value, value);<NEW_LINE>} else {<NEW_LINE>String separator = "";<NEW_LINE>for (Entry<? extends ExecutableElement, ? extends AnnotationValue> entry : annotation.getElementValues().entrySet()) {<NEW_LINE>code.add("%s%s = ", separator, entry.getKey().getSimpleName());<NEW_LINE>visit(entry.getValue(), entry.getValue());<NEW_LINE>separator = ", ";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>code.add(")");<NEW_LINE>return null;<NEW_LINE>} | getElementValues().values()); |
44,002 | public JsonElement serialize(Table table, Type type, JsonSerializationContext context) {<NEW_LINE>JsonObject json = new JsonObject();<NEW_LINE>JsonArray data = new JsonArray();<NEW_LINE>json.addProperty("extraction_method", table.getExtractionMethod());<NEW_LINE>json.addProperty("page_number", table.getPageNumber());<NEW_LINE>json.addProperty("top", table.getTop());<NEW_LINE>json.addProperty("left", table.getLeft());<NEW_LINE>json.addProperty("width", table.getWidth());<NEW_LINE>json.addProperty("height", table.getHeight());<NEW_LINE>json.addProperty("right", table.getRight());<NEW_LINE>json.addProperty(<MASK><NEW_LINE>json.add("data", data);<NEW_LINE>for (List<RectangularTextContainer> tableRow : table.getRows()) {<NEW_LINE>JsonArray jsonRow = new JsonArray();<NEW_LINE>for (RectangularTextContainer textChunk : tableRow) jsonRow.add(context.serialize(textChunk));<NEW_LINE>data.add(jsonRow);<NEW_LINE>}<NEW_LINE>return json;<NEW_LINE>} | "bottom", table.getBottom()); |
1,704,392 | protected <T extends OperationResponse> void completeOperation(OperationResult result, OperationResponse.Builder<?, T> builder, Throwable error, CompletableFuture<T> future) {<NEW_LINE>if (result != null) {<NEW_LINE>builder.withIndex(result.index());<NEW_LINE>builder.<MASK><NEW_LINE>if (result.failed()) {<NEW_LINE>error = result.error();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (error == null) {<NEW_LINE>if (result == null) {<NEW_LINE>future.complete(builder.withStatus(RaftResponse.Status.ERROR).withError(RaftError.Type.PROTOCOL_ERROR).build());<NEW_LINE>} else {<NEW_LINE>future.complete(builder.withStatus(RaftResponse.Status.OK).withResult(result.result()).build());<NEW_LINE>}<NEW_LINE>} else if (error instanceof CompletionException && error.getCause() instanceof RaftException) {<NEW_LINE>future.complete(builder.withStatus(RaftResponse.Status.ERROR).withError(((RaftException) error.getCause()).getType(), error.getMessage()).build());<NEW_LINE>} else if (error instanceof RaftException) {<NEW_LINE>future.complete(builder.withStatus(RaftResponse.Status.ERROR).withError(((RaftException) error).getType(), error.getMessage()).build());<NEW_LINE>} else if (error instanceof PrimitiveException.ServiceException) {<NEW_LINE>log.warn("An application error occurred: {}", error.getCause());<NEW_LINE>future.complete(builder.withStatus(RaftResponse.Status.ERROR).withError(RaftError.Type.APPLICATION_ERROR).build());<NEW_LINE>} else {<NEW_LINE>log.warn("An unexpected error occurred: {}", error);<NEW_LINE>future.complete(builder.withStatus(RaftResponse.Status.ERROR).withError(RaftError.Type.PROTOCOL_ERROR, error.getMessage()).build());<NEW_LINE>}<NEW_LINE>} | withEventIndex(result.eventIndex()); |
1,470,953 | protected void masterOperation(GetSettingsRequest request, ClusterState state, ActionListener<GetSettingsResponse> listener) {<NEW_LINE>Index[] concreteIndices = indexNameExpressionResolver.concreteIndices(state, request);<NEW_LINE>ImmutableOpenMap.Builder<String, Settings> indexToSettingsBuilder = ImmutableOpenMap.builder();<NEW_LINE>ImmutableOpenMap.Builder<String, Settings> indexToDefaultSettingsBuilder = ImmutableOpenMap.builder();<NEW_LINE>for (Index concreteIndex : concreteIndices) {<NEW_LINE>IndexMetadata indexMetadata = state.getMetadata().index(concreteIndex);<NEW_LINE>if (indexMetadata == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Settings indexSettings = settingsFilter.filter(indexMetadata.getSettings());<NEW_LINE>if (request.humanReadable()) {<NEW_LINE>indexSettings = IndexMetadata.addHumanReadableSettings(indexSettings);<NEW_LINE>}<NEW_LINE>if (isFilteredRequest(request)) {<NEW_LINE>indexSettings = indexSettings.filter(k -> Regex.simpleMatch(request.names(), k));<NEW_LINE>}<NEW_LINE>indexToSettingsBuilder.put(concreteIndex.getName(), indexSettings);<NEW_LINE>if (request.includeDefaults()) {<NEW_LINE>Settings defaultSettings = settingsFilter.filter(indexScopedSettings.diff(indexSettings, Settings.EMPTY));<NEW_LINE>if (isFilteredRequest(request)) {<NEW_LINE>defaultSettings = defaultSettings.filter(k -> Regex.simpleMatch(request.names(), k));<NEW_LINE>}<NEW_LINE>indexToDefaultSettingsBuilder.put(concreteIndex.getName(), defaultSettings);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>listener.onResponse(new GetSettingsResponse(indexToSettingsBuilder.build()<MASK><NEW_LINE>} | , indexToDefaultSettingsBuilder.build())); |
611,765 | protected static void assertContextEnginePool(RegressionEnvironment env, EPStatement stmt, List<ConditionHandlerContext> contexts, int max, Map<String, Long> counts) {<NEW_LINE>assertEquals(1, contexts.size());<NEW_LINE>ConditionHandlerContext context = contexts.get(0);<NEW_LINE>assertEquals(env.runtimeURI(), context.getRuntimeURI());<NEW_LINE>assertEquals(stmt.getDeploymentId(), context.getDeploymentId());<NEW_LINE>assertEquals(stmt.getName(), context.getStatementName());<NEW_LINE>ConditionPatternRuntimeSubexpressionMax condition = (ConditionPatternRuntimeSubexpressionMax) context.getCondition();<NEW_LINE>assertEquals(max, condition.getMax());<NEW_LINE>assertEquals(counts.size(), condition.getCounts().size());<NEW_LINE>for (Map.Entry<String, Long> expected : counts.entrySet()) {<NEW_LINE>assertEquals("failed for key " + expected.getKey(), expected.getValue(), condition.getCounts().get<MASK><NEW_LINE>}<NEW_LINE>contexts.clear();<NEW_LINE>} | (expected.getKey())); |
1,554,958 | final DeleteResourcePolicyResult executeDeleteResourcePolicy(DeleteResourcePolicyRequest deleteResourcePolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteResourcePolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteResourcePolicyRequest> request = null;<NEW_LINE>Response<DeleteResourcePolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteResourcePolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteResourcePolicyRequest));<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, "Comprehend");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteResourcePolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteResourcePolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteResourcePolicyResultJsonUnmarshaller());<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()); |
1,155,816 | protected List<E> createBulkLeafNodes(List<E> objects) {<NEW_LINE>int minEntries = leafMinimum;<NEW_LINE>int maxEntries = leafCapacity;<NEW_LINE>ArrayList<E> result = new ArrayList<>();<NEW_LINE>List<List<E>> partitions = settings.bulkSplitter.partition(objects, minEntries, maxEntries);<NEW_LINE>for (List<E> partition : partitions) {<NEW_LINE>// create leaf node<NEW_LINE>N leafNode = createNewLeafNode();<NEW_LINE>// insert data<NEW_LINE>for (E o : partition) {<NEW_LINE>leafNode.addEntry(o);<NEW_LINE>}<NEW_LINE>// write to file<NEW_LINE>writeNode(leafNode);<NEW_LINE>result.add(createNewDirectoryEntry(leafNode));<NEW_LINE>if (getLogger().isDebugging()) {<NEW_LINE>getLogger().debugFine("Created leaf page " + leafNode.getPageID());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (getLogger().isDebugging()) {<NEW_LINE>getLogger().debugFine(<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | "numDataPages = " + result.size()); |
1,753,244 | public ProcessStatus processCheck(final PwmRequest pwmRequest) throws PwmUnrecoverableException, IOException {<NEW_LINE>final PwmSession pwmSession = pwmRequest.getPwmSession();<NEW_LINE>final long configuredSeconds = pwmRequest.getAppConfig().readSettingAsLong(PwmSetting.SECURITY_PAGE_LEAVE_NOTICE_TIMEOUT);<NEW_LINE>if (configuredSeconds <= 0) {<NEW_LINE>return ProcessStatus.Continue;<NEW_LINE>}<NEW_LINE>final Instant currentPageLeaveNotice = pwmSession<MASK><NEW_LINE>pwmSession.getSessionStateBean().setPageLeaveNoticeTime(null);<NEW_LINE>if (currentPageLeaveNotice == null) {<NEW_LINE>return ProcessStatus.Continue;<NEW_LINE>}<NEW_LINE>if (TimeDuration.fromCurrent(currentPageLeaveNotice).as(TimeDuration.Unit.SECONDS) <= configuredSeconds) {<NEW_LINE>return ProcessStatus.Continue;<NEW_LINE>}<NEW_LINE>LOGGER.warn(() -> "invalidating session due to dirty page leave time greater then configured timeout");<NEW_LINE>pwmRequest.invalidateSession();<NEW_LINE>pwmRequest.getPwmResponse().sendRedirect(pwmRequest.getHttpServletRequest().getRequestURI());<NEW_LINE>return ProcessStatus.Halt;<NEW_LINE>} | .getSessionStateBean().getPageLeaveNoticeTime(); |
1,437,662 | private static void validateUimap(final Map uimap) {<NEW_LINE>List<String> pages = asStringList(uimap.get("pages"));<NEW_LINE>if (pages == null) {<NEW_LINE>throw new IllegalArgumentException("in provider metadata: 'ui: pages:' not found, or not a String or String list");<NEW_LINE>}<NEW_LINE>List<String> styles = asStringList(uimap.get("styles"));<NEW_LINE>List<String> scripts = asStringList(uimap.get("scripts"));<NEW_LINE>if (null == styles && null == scripts) {<NEW_LINE>throw new IllegalArgumentException("in provider metadata: 'ui: pages:' either 'scripts' or 'styles' was expected to be a String or " + "String list");<NEW_LINE>}<NEW_LINE>Object <MASK><NEW_LINE>List<String> requirePlugins = asStringList(requires);<NEW_LINE>if (requires != null && requirePlugins == null) {<NEW_LINE>throw new IllegalArgumentException("in provider metadata: 'ui: pages: requires:' is not a String or String list");<NEW_LINE>}<NEW_LINE>} | requires = uimap.get("requires"); |
34,719 | protected void startProcessDefinitionByKey(Job job, String configuration, DeploymentManager deploymentManager, CommandContext commandContext) {<NEW_LINE>// it says getActivityId, but < 5.21, this would have the process definition key stored<NEW_LINE>String processDefinitionKey = TimerEventHandler.getActivityIdFromConfiguration(configuration);<NEW_LINE>ProcessDefinition processDefinition = null;<NEW_LINE>if (job.getTenantId() == null || ProcessEngineConfiguration.NO_TENANT_ID.equals(job.getTenantId())) {<NEW_LINE>processDefinition = deploymentManager.findDeployedLatestProcessDefinitionByKey(processDefinitionKey);<NEW_LINE>} else {<NEW_LINE>processDefinition = deploymentManager.findDeployedLatestProcessDefinitionByKeyAndTenantId(processDefinitionKey, job.getTenantId());<NEW_LINE>}<NEW_LINE>if (processDefinition == null) {<NEW_LINE>throw new ActivitiException("Could not find process definition needed for timer start event");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!deploymentManager.isProcessDefinitionSuspended(processDefinition.getId())) {<NEW_LINE>dispatchTimerFiredEvent(job, commandContext);<NEW_LINE>new StartProcessInstanceCmd<ProcessInstance>(processDefinitionKey, null, null, null, job.getTenantId()).execute(commandContext);<NEW_LINE>} else {<NEW_LINE>LOGGER.debug(<MASK><NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>LOGGER.error("exception during timer execution", e);<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("exception during timer execution", e);<NEW_LINE>throw new ActivitiException("exception during timer execution: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | "Ignoring timer of suspended process definition {}", processDefinition.getId()); |
325,227 | public void execute() throws BuildException {<NEW_LINE>try (FileOutputStream fos = new FileOutputStream(new File(getProject().getBaseDir(), exclusionFile));<NEW_LINE>OutputStreamWriter osw = new OutputStreamWriter(fos);<NEW_LINE>BufferedWriter bw = new BufferedWriter(osw)) {<NEW_LINE>Path nballPath = nball.toPath();<NEW_LINE>List<File> licenseinfofiles = Files.walk(nballPath).filter(p -> p.endsWith("licenseinfo.xml")).map(p -> p.toFile()).<MASK><NEW_LINE>FileSet licenseinfoFileset = new FileSet();<NEW_LINE>licenseinfoFileset.setProject(getProject());<NEW_LINE>licenseinfoFileset.setDir(nball.getAbsoluteFile());<NEW_LINE>for (File licenseInfoFile : licenseinfofiles) {<NEW_LINE>Licenseinfo li = Licenseinfo.parse(licenseInfoFile);<NEW_LINE>for (Fileset fs : li.getFilesets()) {<NEW_LINE>for (File f : fs.getFiles()) {<NEW_LINE>Path relativePath = nball.toPath().relativize(f.toPath());<NEW_LINE>licenseinfoFileset.appendIncludes(new String[] { relativePath.toString() });<NEW_LINE>bw.write(relativePath.toString());<NEW_LINE>bw.newLine();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>getProject().addReference(this.licenseinfoFileset, licenseinfoFileset);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new BuildException(ex);<NEW_LINE>}<NEW_LINE>} | collect(Collectors.toList()); |
909,007 | public <T> long bulkOperation(final SecurityContext securityContext, final Iterable<T> iterable, final int commitCount, String description, final BulkGraphOperation<T> operation) {<NEW_LINE>final Predicate<Long> condition = operation.getCondition();<NEW_LINE>final App app = StructrApp.getInstance(securityContext);<NEW_LINE>final boolean doValidation = operation.doValidation();<NEW_LINE>final boolean doCallbacks = operation.doCallbacks();<NEW_LINE>final boolean doNotifications = operation.doNotifications();<NEW_LINE>final Iterator<T> iterator = iterable.iterator();<NEW_LINE>long objectCount = 0L;<NEW_LINE>boolean active = true;<NEW_LINE>int page = 0;<NEW_LINE>while (active) {<NEW_LINE>active = false;<NEW_LINE>try (final Tx tx = app.tx(doValidation, doCallbacks, doNotifications)) {<NEW_LINE>while (iterator.hasNext() && (condition == null || condition.accept(objectCount))) {<NEW_LINE>T node = iterator.next();<NEW_LINE>active = true;<NEW_LINE>try {<NEW_LINE>boolean success = operation.handleGraphObject(securityContext, node);<NEW_LINE>if (success) {<NEW_LINE>objectCount++;<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>operation.<MASK><NEW_LINE>}<NEW_LINE>// commit transaction after commitCount<NEW_LINE>if ((objectCount % commitCount) == 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tx.success();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// bulk transaction failed, what to do?<NEW_LINE>operation.handleTransactionFailure(securityContext, t);<NEW_LINE>}<NEW_LINE>if (description != null) {<NEW_LINE>info("{}: {} objects processed", description, objectCount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return objectCount;<NEW_LINE>} | handleThrowable(securityContext, t, node); |
1,016,702 | static byte[] toBytes(Object object, SymbolTable symbolTable, JSONWriter.Feature... features) {<NEW_LINE>try (JSONWriter writer = new JSONWriterJSONB(new JSONWriter.Context(JSONFactory.defaultObjectWriterProvider, features), symbolTable)) {<NEW_LINE><MASK><NEW_LINE>ctx.config(features);<NEW_LINE>if (object == null) {<NEW_LINE>writer.writeNull();<NEW_LINE>} else {<NEW_LINE>Class<?> valueClass = object.getClass();<NEW_LINE>boolean fieldBased = (ctx.features & JSONWriter.Feature.FieldBased.mask) != 0;<NEW_LINE>ObjectWriter objectWriter = ctx.provider.getObjectWriter(valueClass, valueClass, fieldBased);<NEW_LINE>if ((ctx.features & JSONWriter.Feature.BeanToArray.mask) != 0) {<NEW_LINE>objectWriter.writeArrayMappingJSONB(writer, object, null, null, 0);<NEW_LINE>} else {<NEW_LINE>objectWriter.writeJSONB(writer, object, null, null, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return writer.getBytes();<NEW_LINE>}<NEW_LINE>} | JSONWriter.Context ctx = writer.context; |
1,746,698 | private List<NameValueCountPair> groupByCreatorPerson(Business business, Predicate predicate) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Review.class);<NEW_LINE><MASK><NEW_LINE>CriteriaQuery<Tuple> cq = cb.createQuery(Tuple.class);<NEW_LINE>Root<Review> root = cq.from(Review.class);<NEW_LINE>Path<String> pathCreatorPerson = root.get(Review_.creatorPerson);<NEW_LINE>cq.multiselect(pathCreatorPerson, cb.count(root)).where(predicate).groupBy(pathCreatorPerson);<NEW_LINE>List<Tuple> os = em.createQuery(cq).getResultList();<NEW_LINE>List<NameValueCountPair> list = new ArrayList<>();<NEW_LINE>NameValueCountPair pair = null;<NEW_LINE>for (Tuple o : os) {<NEW_LINE>pair = new NameValueCountPair();<NEW_LINE>pair.setName(o.get(pathCreatorPerson));<NEW_LINE>pair.setValue(o.get(pathCreatorPerson));<NEW_LINE>pair.setCount(o.get(1, Long.class));<NEW_LINE>list.add(pair);<NEW_LINE>}<NEW_LINE>return list.stream().sorted(Comparator.comparing(NameValueCountPair::getCount).reversed()).collect(Collectors.toList());<NEW_LINE>} | CriteriaBuilder cb = em.getCriteriaBuilder(); |
1,325,818 | public void onTrainingEnd(Trainer trainer) {<NEW_LINE>Metrics metrics = trainer.getMetrics();<NEW_LINE>if (metrics == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float p50;<NEW_LINE>float p90;<NEW_LINE>if (metrics.hasMetric("train")) {<NEW_LINE>// possible no train metrics if only one iteration is executed<NEW_LINE>p50 = metrics.percentile("train", 50).getValue().longValue() / 1_000_000f;<NEW_LINE>p90 = metrics.percentile("train", 90).getValue().longValue() / 1_000_000f;<NEW_LINE>logger.info(String.format("train P50: %.3f ms, P90: %.3f ms", p50, p90));<NEW_LINE>}<NEW_LINE>if (metrics.hasMetric("forward")) {<NEW_LINE>p50 = metrics.percentile("forward", 50).getValue().longValue() / 1_000_000f;<NEW_LINE>p90 = metrics.percentile("forward", 90).getValue().longValue() / 1_000_000f;<NEW_LINE>logger.info(String.format("forward P50: %.3f ms, P90: %.3f ms", p50, p90));<NEW_LINE>}<NEW_LINE>if (metrics.hasMetric("training-metrics")) {<NEW_LINE>p50 = metrics.percentile("training-metrics", 50).getValue().longValue() / 1_000_000f;<NEW_LINE>p90 = metrics.percentile("training-metrics", 90).getValue().longValue() / 1_000_000f;<NEW_LINE>logger.info(String.format("training-metrics P50: %.3f ms, P90: %.3f ms", p50, p90));<NEW_LINE>}<NEW_LINE>if (metrics.hasMetric("backward")) {<NEW_LINE>p50 = metrics.percentile("backward", 50).getValue().longValue() / 1_000_000f;<NEW_LINE>p90 = metrics.percentile("backward", 90).getValue().longValue() / 1_000_000f;<NEW_LINE>logger.info(String.format("backward P50: %.3f ms, P90: %.3f ms", p50, p90));<NEW_LINE>}<NEW_LINE>if (metrics.hasMetric("step")) {<NEW_LINE>p50 = metrics.percentile("step", 50).getValue<MASK><NEW_LINE>p90 = metrics.percentile("step", 90).getValue().longValue() / 1_000_000f;<NEW_LINE>logger.info(String.format("step P50: %.3f ms, P90: %.3f ms", p50, p90));<NEW_LINE>}<NEW_LINE>if (metrics.hasMetric("epoch")) {<NEW_LINE>p50 = metrics.percentile("epoch", 50).getValue().longValue() / 1_000_000_000f;<NEW_LINE>p90 = metrics.percentile("epoch", 90).getValue().longValue() / 1_000_000_000f;<NEW_LINE>logger.info(String.format("epoch P50: %.3f s, P90: %.3f s", p50, p90));<NEW_LINE>}<NEW_LINE>} | ().longValue() / 1_000_000f; |
1,283,817 | public OptionRestrictionRegex unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>OptionRestrictionRegex optionRestrictionRegex = new OptionRestrictionRegex();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return optionRestrictionRegex;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Pattern", targetDepth)) {<NEW_LINE>optionRestrictionRegex.setPattern(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Label", targetDepth)) {<NEW_LINE>optionRestrictionRegex.setLabel(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return optionRestrictionRegex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | XMLEvent xmlEvent = context.nextEvent(); |
664,836 | public MultipleObjectsBundle generate() {<NEW_LINE>// we actually need some clusters.<NEW_LINE>if (generators.isEmpty()) {<NEW_LINE>throw new AbortException("No clusters specified.");<NEW_LINE>}<NEW_LINE>// Assert that cluster dimensions agree.<NEW_LINE>final int dim = generators.<MASK><NEW_LINE>for (GeneratorInterface c : generators) {<NEW_LINE>if (c.getDim() != dim) {<NEW_LINE>throw new AbortException("Cluster dimensions do not agree.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Prepare result bundle<NEW_LINE>MultipleObjectsBundle bundle = new MultipleObjectsBundle();<NEW_LINE>VectorFieldTypeInformation<DoubleVector> type = new VectorFieldTypeInformation<>(DoubleVector.FACTORY, dim);<NEW_LINE>bundle.appendColumn(type, new ArrayList<>());<NEW_LINE>bundle.appendColumn(TypeUtil.CLASSLABEL, new ArrayList<>());<NEW_LINE>bundle.appendColumn(Model.TYPE, new ArrayList<Model>());<NEW_LINE>// generate clusters<NEW_LINE>ClassLabel[] labels = new ClassLabel[generators.size()];<NEW_LINE>Model[] models = new Model[generators.size()];<NEW_LINE>initLabelsAndModels(generators, labels, models, relabelClusters);<NEW_LINE>final AssignPoint assignment;<NEW_LINE>if (!testAgainstModel) {<NEW_LINE>assignment = new AssignPoint();<NEW_LINE>} else if (relabelClusters == null) {<NEW_LINE>assignment = new TestModel();<NEW_LINE>} else if (!relabelDistance) {<NEW_LINE>assignment = new AssignLabelsByDensity(labels);<NEW_LINE>} else {<NEW_LINE>assignment = new AssignLabelsByDistance(labels);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < labels.length; i++) {<NEW_LINE>final GeneratorInterface curclus = generators.get(i);<NEW_LINE>assignment.newCluster(i, curclus);<NEW_LINE>// Only dynamic generators allow rejection / model testing:<NEW_LINE>GeneratorInterfaceDynamic cursclus = (curclus instanceof GeneratorInterfaceDynamic) ? (GeneratorInterfaceDynamic) curclus : null;<NEW_LINE>int kept = 0;<NEW_LINE>while (kept < curclus.getSize()) {<NEW_LINE>// generate the "missing" number of points<NEW_LINE>List<double[]> newp = curclus.generate(curclus.getSize() - kept);<NEW_LINE>for (double[] p : newp) {<NEW_LINE>int bestc = assignment.getAssignment(i, p);<NEW_LINE>if (bestc < 0 && cursclus != null) {<NEW_LINE>cursclus.incrementDiscarded();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>bundle.appendSimple(DoubleVector.wrap(p), labels[bestc], models[bestc]);<NEW_LINE>++kept;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bundle;<NEW_LINE>} | get(0).getDim(); |
1,538,323 | void serializeV1(BucketState<BucketID> state, DataOutputView out) throws IOException {<NEW_LINE>SimpleVersionedSerialization.writeVersionAndSerialize(bucketIdSerializer, state.getBucketId(), out);<NEW_LINE>out.writeUTF(state.getBucketPath().toString());<NEW_LINE>out.writeLong(state.getInProgressFileCreationTime());<NEW_LINE>// put the current open part file<NEW_LINE>if (state.hasInProgressResumableFile()) {<NEW_LINE>final RecoverableWriter.ResumeRecoverable resumable = state.getInProgressResumableFile();<NEW_LINE>out.writeBoolean(true);<NEW_LINE>SimpleVersionedSerialization.writeVersionAndSerialize(resumableSerializer, resumable, out);<NEW_LINE>} else {<NEW_LINE>out.writeBoolean(false);<NEW_LINE>}<NEW_LINE>// put the map of pending files per checkpoint<NEW_LINE>final Map<Long, List<RecoverableWriter.CommitRecoverable>> pendingCommitters = state.getCommittableFilesPerCheckpoint();<NEW_LINE>// manually keep the version here to safe some bytes<NEW_LINE>out.writeInt(commitableSerializer.getVersion());<NEW_LINE>out.writeInt(pendingCommitters.size());<NEW_LINE>for (Entry<Long, List<RecoverableWriter.CommitRecoverable>> resumablesForCheckpoint : pendingCommitters.entrySet()) {<NEW_LINE>List<RecoverableWriter.CommitRecoverable<MASK><NEW_LINE>out.writeLong(resumablesForCheckpoint.getKey());<NEW_LINE>out.writeInt(resumables.size());<NEW_LINE>for (RecoverableWriter.CommitRecoverable resumable : resumables) {<NEW_LINE>byte[] serialized = commitableSerializer.serialize(resumable);<NEW_LINE>out.writeInt(serialized.length);<NEW_LINE>out.write(serialized);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > resumables = resumablesForCheckpoint.getValue(); |
113,042 | public static ZemberekGrpcConfiguration loadFromFile(Path path) throws IOException {<NEW_LINE>KeyValueReader reader = new KeyValueReader("=", "#");<NEW_LINE>Map<String, String> keyValues = reader.loadFromFile(path.toFile());<NEW_LINE>String lmVal = keyValues.get("normalization.lm");<NEW_LINE>if (lmVal == null) {<NEW_LINE>throw new IllegalStateException(path + " file does not contain normalization.lm key");<NEW_LINE>}<NEW_LINE>String normalizationRootVal = keyValues.get("normalization.dataRoot");<NEW_LINE>if (normalizationRootVal == null) {<NEW_LINE>throw new IllegalStateException(path + " file does not contain normalization.dataRoot key");<NEW_LINE>}<NEW_LINE>Path lmPath = Paths.get(lmVal);<NEW_LINE>IOUtil.checkFileArgument(lmPath, "Language model path");<NEW_LINE>Path normalizationPath = Paths.get(normalizationRootVal);<NEW_LINE><MASK><NEW_LINE>return new ZemberekGrpcConfiguration(lmPath, normalizationPath);<NEW_LINE>} | IOUtil.checkFileArgument(normalizationPath, "Normalization root path"); |
1,103,339 | public static void viewCurrentSite(Context context, SiteModel site, boolean openFromHeader) {<NEW_LINE>AnalyticsTracker.Stat stat = openFromHeader ? AnalyticsTracker.Stat.OPENED_VIEW_SITE_FROM_HEADER : AnalyticsTracker.Stat.OPENED_VIEW_SITE;<NEW_LINE>AnalyticsUtils.trackWithSiteDetails(stat, site);<NEW_LINE>if (site == null) {<NEW_LINE>ToastUtils.showToast(context, R.string.blog_not_found, ToastUtils.Duration.SHORT);<NEW_LINE>} else if (site.getUrl() == null) {<NEW_LINE>ToastUtils.showToast(context, R.string.<MASK><NEW_LINE>AppLog.w(AppLog.T.UTILS, "Site URL is null. Login URL: " + site.getLoginUrl());<NEW_LINE>} else {<NEW_LINE>String siteUrl = site.getUrl();<NEW_LINE>if (site.isWPCom()) {<NEW_LINE>// Show wp.com sites authenticated<NEW_LINE>WPWebViewActivity.openUrlByUsingGlobalWPCOMCredentials(context, siteUrl, true);<NEW_LINE>} else if (!TextUtils.isEmpty(site.getUsername()) && !TextUtils.isEmpty(site.getPassword())) {<NEW_LINE>// Show self-hosted sites as authenticated since we should have the username & password<NEW_LINE>WPWebViewActivity.openUrlByUsingBlogCredentials(context, site, null, siteUrl, new String[] {}, false, true, false);<NEW_LINE>} else {<NEW_LINE>// Show non-wp.com sites without a password unauthenticated. These would be Jetpack sites that are<NEW_LINE>// connected through REST API.<NEW_LINE>WPWebViewActivity.openURL(context, siteUrl, true, site.isPrivateWPComAtomic() ? site.getSiteId() : 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | blog_not_found, ToastUtils.Duration.SHORT); |
881,578 | public FormatWalkResult format(String name, String type, String declaredType, int thisTypeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter) throws CorruptDataException {<NEW_LINE>if (thisTypeCode == this.typeCode) {<NEW_LINE>Object o = null;<NEW_LINE>try {<NEW_LINE>o = <MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Cast failed on " + pointerClass.getName(), e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Scalar value = (Scalar) atMethod.invoke(o, 0L);<NEW_LINE>formatShortScalar(value, out);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>Throwable cause = e.getCause();<NEW_LINE>if (cause instanceof CorruptDataException) {<NEW_LINE>throw (CorruptDataException) cause;<NEW_LINE>} else if (cause instanceof RuntimeException) {<NEW_LINE>throw (RuntimeException) cause;<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Problem invoking at() method on " + pointerClass.getName(), e);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Problem invoking at() method on " + pointerClass.getName(), e);<NEW_LINE>}<NEW_LINE>return FormatWalkResult.STOP_WALKING;<NEW_LINE>} else {<NEW_LINE>return FormatWalkResult.KEEP_WALKING;<NEW_LINE>}<NEW_LINE>} | castMethod.invoke(null, address); |
727,619 | public final void handleReversalForInvoice(final org.compiere.model.I_C_Invoice invoice) {<NEW_LINE>final IInvoiceDAO invoiceDAO = Services.get(IInvoiceDAO.class);<NEW_LINE>final int reversalInvoiceId = invoice.getReversal_ID();<NEW_LINE>Check.assume(reversalInvoiceId > invoice.getC_Invoice_ID(), "Invoice {} shall be the original invoice and not it's reversal", invoice);<NEW_LINE>final org.compiere.model.I_C_Invoice reversalInvoice = invoice.getReversal();<NEW_LINE>// services<NEW_LINE>final IMatchInvBL matchInvBL = Services.get(IMatchInvBL.class);<NEW_LINE>final IMatchInvDAO matchInvDAO = Services.get(IMatchInvDAO.class);<NEW_LINE>final IAttributeSetInstanceBL attributeSetInstanceBL = Services.get(IAttributeSetInstanceBL.class);<NEW_LINE>for (final I_C_InvoiceLine il : invoiceDAO.retrieveLines(invoice)) {<NEW_LINE>// task 08627: unlink possible inOutLines because the inOut might now be reactivated and they might be deleted.<NEW_LINE>// Unlinking them now is more performant than selecting an unlinking them when the inOutLine is actually deleted.<NEW_LINE>il.setM_InOutLine(null);<NEW_LINE>InterfaceWrapperHelper.save(il);<NEW_LINE>//<NEW_LINE>// Retrieve the reversal invoice line<NEW_LINE>final I_C_InvoiceLine reversalLine = <MASK><NEW_LINE>// 08809<NEW_LINE>// Also set the Attribute Set Instance in the reversal line<NEW_LINE>attributeSetInstanceBL.cloneASI(reversalLine, il);<NEW_LINE>InterfaceWrapperHelper.save(reversalLine);<NEW_LINE>//<NEW_LINE>// Create M_MatchInv reversal records, linked to reversal invoice line and original inout line.<NEW_LINE>final List<I_M_MatchInv> matchInvs = matchInvDAO.retrieveForInvoiceLine(il);<NEW_LINE>for (final I_M_MatchInv matchInv : matchInvs) {<NEW_LINE>final I_M_InOutLine inoutLine = matchInv.getM_InOutLine();<NEW_LINE>final StockQtyAndUOMQty qtyToMatchExact = StockQtyAndUOMQtys.create(matchInv.getQty().negate(), ProductId.ofRepoId(inoutLine.getM_Product_ID()), matchInv.getQtyInUOM().negate(), UomId.ofRepoId(matchInv.getC_UOM_ID()));<NEW_LINE>matchInvBL.createMatchInvBuilder().setContext(reversalLine).setC_InvoiceLine(reversalLine).setM_InOutLine(inoutLine).setDateTrx(reversalInvoice.getDateInvoiced()).setQtyToMatchExact(qtyToMatchExact).build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | invoiceDAO.retrieveReversalLine(il, reversalInvoiceId); |
488,341 | public byte[] serialize(PendingSplitsState state) throws IOException {<NEW_LINE>// optimization: the splits lazily cache their own serialized form<NEW_LINE>if (state.serializedFormCache != null) {<NEW_LINE>return state.serializedFormCache;<NEW_LINE>}<NEW_LINE>final DataOutputSerializer out = SERIALIZER_CACHE.get();<NEW_LINE>out.writeInt(splitSerializer.getVersion());<NEW_LINE>if (state instanceof SnapshotPendingSplitsState) {<NEW_LINE>out.writeInt(SNAPSHOT_PENDING_SPLITS_STATE_FLAG);<NEW_LINE>serializeSnapshotPendingSplitsState((SnapshotPendingSplitsState) state, out);<NEW_LINE>} else if (state instanceof StreamPendingSplitsState) {<NEW_LINE>out.writeInt(BINLOG_PENDING_SPLITS_STATE_FLAG);<NEW_LINE>serializeBinlogPendingSplitsState((StreamPendingSplitsState) state, out);<NEW_LINE>} else if (state instanceof HybridPendingSplitsState) {<NEW_LINE>out.writeInt(HYBRID_PENDING_SPLITS_STATE_FLAG);<NEW_LINE>serializeHybridPendingSplitsState<MASK><NEW_LINE>} else {<NEW_LINE>throw new IOException("Unsupported to serialize PendingSplitsState class: " + state.getClass().getName());<NEW_LINE>}<NEW_LINE>final byte[] result = out.getCopyOfBuffer();<NEW_LINE>// optimization: cache the serialized from, so we avoid the byte work during repeated<NEW_LINE>// serialization<NEW_LINE>state.serializedFormCache = result;<NEW_LINE>out.clear();<NEW_LINE>return result;<NEW_LINE>} | ((HybridPendingSplitsState) state, out); |
537,231 | private void init(Map<String, String> requestMap, CompiledQueryProfile queryProfile, Map<String, Embedder> embedders, ZoneInfo zoneInfo) {<NEW_LINE>startTime = httpRequest.getJDiscRequest().creationTime(TimeUnit.MILLISECONDS);<NEW_LINE>if (queryProfile != null) {<NEW_LINE>// Move all request parameters to the query profile<NEW_LINE>Properties queryProfileProperties = new QueryProfileProperties(queryProfile, embedders);<NEW_LINE>properties().chain(queryProfileProperties);<NEW_LINE>setPropertiesFromRequestMap(<MASK><NEW_LINE>// Create the full chain<NEW_LINE>properties().chain(new QueryProperties(this, queryProfile.getRegistry(), embedders)).chain(new ModelObjectMap()).chain(new RequestContextProperties(requestMap, zoneInfo)).chain(queryProfileProperties).chain(new DefaultProperties());<NEW_LINE>// Pass the values from the query profile which maps through a field in the Query object model<NEW_LINE>// through the property chain to cause those values to be set in the Query object model<NEW_LINE>setFieldsFrom(queryProfileProperties, requestMap);<NEW_LINE>// We need special handling for "select" because it can be both the prefix of the nested JSON select<NEW_LINE>// parameters, and a plain select expression. The latter will be disallowed by query profile types<NEW_LINE>// since they contain the former.<NEW_LINE>String select = requestMap.get(Select.SELECT);<NEW_LINE>if (select != null)<NEW_LINE>properties().set(Select.SELECT, select);<NEW_LINE>} else {<NEW_LINE>// bypass these complications if there is no query profile to get values from and validate against<NEW_LINE>properties().chain(new QueryProperties(this, CompiledQueryProfileRegistry.empty, embedders)).chain(new PropertyMap()).chain(new DefaultProperties());<NEW_LINE>setPropertiesFromRequestMap(requestMap, properties(), false);<NEW_LINE>}<NEW_LINE>properties().setParentQuery(this);<NEW_LINE>traceProperties();<NEW_LINE>} | requestMap, properties(), true); |
1,277,861 | public void initializeTypes(Method theMethod, Class<? extends Collection<?>> theOuterCollectionType, Class<? extends Collection<?>> theInnerCollectionType, Class<?> theParameterType) {<NEW_LINE>if (theOuterCollectionType != null) {<NEW_LINE>throw new ConfigurationException(Msg.code(459) + "Method '" + theMethod.getName() + "' in type '" + theMethod.getDeclaringClass().getCanonicalName() + "' is annotated with @" + Count.<MASK><NEW_LINE>}<NEW_LINE>if (!String.class.equals(theParameterType)) {<NEW_LINE>throw new ConfigurationException(Msg.code(460) + "Method '" + theMethod.getName() + "' in type '" + theMethod.getDeclaringClass().getCanonicalName() + "' is annotated with @" + Count.class.getName() + " but type '" + theParameterType + "' is an invalid type, must be one of Integer or IntegerType");<NEW_LINE>}<NEW_LINE>myType = theParameterType;<NEW_LINE>} | class.getName() + " but can not be of collection type"); |
1,215,018 | private static String collectFailureReasons(MatchOperation root) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("match failed: ").append(root.type).append('\n');<NEW_LINE>Collections.reverse(root.failures);<NEW_LINE>Iterator<MatchOperation> iterator = root.failures.iterator();<NEW_LINE>Set previousPaths = new HashSet();<NEW_LINE>int index = 0;<NEW_LINE>int prevDepth = -1;<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>MatchOperation mo = iterator.next();<NEW_LINE>if (previousPaths.contains(mo.context.path) || mo.isXmlAttributeOrMap()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>previousPaths.add(mo.context.path);<NEW_LINE>if (mo.context.depth != prevDepth) {<NEW_LINE>prevDepth = mo.context.depth;<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>String prefix = StringUtils.repeat(' ', index * 2);<NEW_LINE>sb.append(prefix).append(mo.context.path).append(" | ").append(mo.failReason);<NEW_LINE>sb.append(" (").append(mo.actual.type).append(':').append(mo.expected.type).append(")");<NEW_LINE>sb.append('\n');<NEW_LINE>if (mo.context.xml) {<NEW_LINE>sb.append(prefix).append(mo.actual.getAsXmlString()).append('\n');<NEW_LINE>sb.append(prefix).append(mo.expected.getAsXmlString()).append('\n');<NEW_LINE>} else {<NEW_LINE>Match.Value expected = mo.expected.getSortedLike(mo.actual);<NEW_LINE>sb.append(prefix).append(mo.actual.getWithinSingleQuotesIfString<MASK><NEW_LINE>sb.append(prefix).append(expected.getWithinSingleQuotesIfString()).append('\n');<NEW_LINE>}<NEW_LINE>if (iterator.hasNext()) {<NEW_LINE>sb.append('\n');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | ()).append('\n'); |
193,825 | private Stmt isIfNodeWithOneStatement(ASTNode secondLabelsBody) {<NEW_LINE>if (!(secondLabelsBody instanceof ASTIfNode)) {<NEW_LINE>// pattern broken as this should be a IfNode<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// check that the body of ASTIfNode has a single ASTStatementSequence<NEW_LINE>ASTIfNode ifNode = (ASTIfNode) secondLabelsBody;<NEW_LINE>List<Object> ifSubBodies = ifNode.get_SubBodies();<NEW_LINE>if (ifSubBodies.size() != 1) {<NEW_LINE>// if body should always have oneSubBody<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// if has one SubBody<NEW_LINE>List ifBody = (<MASK><NEW_LINE>// Looking for a statement sequence node with a single stmt<NEW_LINE>if (ifBody.size() != 1) {<NEW_LINE>// there should only be one body<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// The only subBody has one ASTNode<NEW_LINE>ASTNode ifBodysBody = (ASTNode) ifBody.get(0);<NEW_LINE>if (!(ifBodysBody instanceof ASTStatementSequenceNode)) {<NEW_LINE>// had to be a STMTSEQ node<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// the only ASTnode is a ASTStatementSequence<NEW_LINE>List<AugmentedStmt> statements = ((ASTStatementSequenceNode) ifBodysBody).getStatements();<NEW_LINE>if (statements.size() != 1) {<NEW_LINE>// there is more than one statement<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// there is only one statement return the statement<NEW_LINE>AugmentedStmt as = statements.get(0);<NEW_LINE>Stmt s = as.get_Stmt();<NEW_LINE>return s;<NEW_LINE>} | List) ifSubBodies.get(0); |
1,528,743 | public CategoryInfo saveBaseInfo(EntityManagerContainer emc, CategoryInfo categoryInfo) throws Exception {<NEW_LINE>AppInfo appInfo = null;<NEW_LINE>CategoryInfo categoryInfo_tmp = null;<NEW_LINE>if (categoryInfo.getId() == null) {<NEW_LINE>categoryInfo.setId(CategoryInfo.createId());<NEW_LINE>}<NEW_LINE>appInfo = emc.find(categoryInfo.getAppId(), AppInfo.class);<NEW_LINE>categoryInfo_tmp = emc.find(categoryInfo.getId(), CategoryInfo.class);<NEW_LINE>emc.beginTransaction(AppInfo.class);<NEW_LINE>emc.beginTransaction(CategoryInfo.class);<NEW_LINE>if (categoryInfo_tmp == null) {<NEW_LINE>categoryInfo.setAppName(appInfo.getAppName());<NEW_LINE>emc.persist(categoryInfo, CheckPersistType.all);<NEW_LINE>} else {<NEW_LINE>categoryInfo_tmp.setAppId(appInfo.getId());<NEW_LINE>categoryInfo_tmp.setAppName(appInfo.getAppName());<NEW_LINE>categoryInfo_tmp.setCategoryAlias(categoryInfo.getCategoryAlias());<NEW_LINE>categoryInfo_tmp.setCategoryMemo(categoryInfo.getCategoryMemo());<NEW_LINE>categoryInfo_tmp.setCategoryName(categoryInfo.getCategoryName());<NEW_LINE>categoryInfo_tmp.setFormId(categoryInfo.getFormId());<NEW_LINE>categoryInfo_tmp.setFormName(categoryInfo.getFormName());<NEW_LINE>categoryInfo_tmp.setParentId(categoryInfo.getParentId());<NEW_LINE>categoryInfo_tmp.setReadFormId(categoryInfo.getReadFormId());<NEW_LINE>categoryInfo_tmp.setReadFormName(categoryInfo.getReadFormName());<NEW_LINE>emc.check(categoryInfo_tmp, CheckPersistType.all);<NEW_LINE>}<NEW_LINE>if (appInfo.getCategoryList() == null) {<NEW_LINE>appInfo.setCategoryList(new ArrayList<String>());<NEW_LINE>}<NEW_LINE>if (!appInfo.getCategoryList().contains(categoryInfo.getId())) {<NEW_LINE>appInfo.getCategoryList().<MASK><NEW_LINE>}<NEW_LINE>emc.commit();<NEW_LINE>return categoryInfo;<NEW_LINE>} | add(categoryInfo.getId()); |
931,710 | public void createAndSplitGetKeysMethod(ClassWriter cw, Map<String, BField> fields, String className) {<NEW_LINE>MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "getKeys", RECORD_GET_KEYS, "()[TK;", null);<NEW_LINE>mv.visitCode();<NEW_LINE>int selfIndex = 0;<NEW_LINE>int keysVarIndex = 1;<NEW_LINE>mv.visitTypeInsn(NEW, LINKED_HASH_SET);<NEW_LINE>mv.visitInsn(DUP);<NEW_LINE>mv.visitMethodInsn(INVOKESPECIAL, LINKED_HASH_SET, JVM_INIT_METHOD, "()V", false);<NEW_LINE>mv.visitVarInsn(ASTORE, keysVarIndex);<NEW_LINE>if (!fields.isEmpty()) {<NEW_LINE>mv.visitVarInsn(ALOAD, selfIndex);<NEW_LINE>mv.visitVarInsn(ALOAD, keysVarIndex);<NEW_LINE>mv.visitMethodInsn(INVOKEVIRTUAL, className, "getKeys", LINKED_HASH_SET_OP, false);<NEW_LINE>splitGetKeysMethod(cw, fields, className);<NEW_LINE>}<NEW_LINE>mv.visitVarInsn(ALOAD, keysVarIndex);<NEW_LINE>// this<NEW_LINE><MASK><NEW_LINE>mv.visitMethodInsn(INVOKESPECIAL, LINKED_HASH_MAP, "keySet", RECORD_SET, false);<NEW_LINE>mv.visitMethodInsn(INVOKEINTERFACE, SET, "addAll", ADD_COLLECTION, true);<NEW_LINE>mv.visitInsn(POP);<NEW_LINE>mv.visitVarInsn(ALOAD, keysVarIndex);<NEW_LINE>mv.visitInsn(DUP);<NEW_LINE>mv.visitMethodInsn(INVOKEINTERFACE, SET, "size", "()I", true);<NEW_LINE>mv.visitTypeInsn(ANEWARRAY, B_STRING_VALUE);<NEW_LINE>mv.visitMethodInsn(INVOKEINTERFACE, SET, "toArray", TO_ARRAY, true);<NEW_LINE>mv.visitInsn(ARETURN);<NEW_LINE>mv.visitMaxs(0, 0);<NEW_LINE>mv.visitEnd();<NEW_LINE>} | mv.visitVarInsn(ALOAD, selfIndex); |
1,512,251 | public MemberFabricConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>MemberFabricConfiguration memberFabricConfiguration = new MemberFabricConfiguration();<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("AdminUsername", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>memberFabricConfiguration.setAdminUsername(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("AdminPassword", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>memberFabricConfiguration.setAdminPassword(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return memberFabricConfiguration;<NEW_LINE>} | class).unmarshall(context)); |
1,768,540 | final DeleteListenerResult executeDeleteListener(DeleteListenerRequest deleteListenerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteListenerRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteListenerRequest> request = null;<NEW_LINE>Response<DeleteListenerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteListenerRequestMarshaller().marshall(super.beforeMarshalling(deleteListenerRequest));<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, "Elastic Load Balancing v2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteListener");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteListenerResult> responseHandler = new StaxResponseHandler<DeleteListenerResult>(new DeleteListenerResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
936,697 | final UpdateVTLDeviceTypeResult executeUpdateVTLDeviceType(UpdateVTLDeviceTypeRequest updateVTLDeviceTypeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateVTLDeviceTypeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateVTLDeviceTypeRequest> request = null;<NEW_LINE>Response<UpdateVTLDeviceTypeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateVTLDeviceTypeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateVTLDeviceTypeRequest));<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, "Storage Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateVTLDeviceType");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateVTLDeviceTypeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateVTLDeviceTypeResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,320,651 | public void drawTo(Graphic graphic, Style highLight) {<NEW_LINE>int yOffs = 0;<NEW_LINE>if (!relayIsClosed)<NEW_LINE>yOffs = SIZE2 / 2;<NEW_LINE>for (int p = 0; p < poles; p++) {<NEW_LINE>graphic.drawPolygon(new Polygon(false).add(SIZE * 2, p * SIZE * 2 + SIZE).add(SIZE * 2 - SIZE2 / 2, p * SIZE * 2 + SIZE).add(SIZE * 2 - SIZE2 / 2, p * SIZE * 2 + SIZE2 <MASK><NEW_LINE>if (relayIsClosed) {<NEW_LINE>graphic.drawLine(new Vector(0, p * SIZE * 2), new Vector(SIZE * 2, p * SIZE * 2), Style.NORMAL);<NEW_LINE>} else {<NEW_LINE>graphic.drawLine(new Vector(0, p * SIZE * 2), new Vector(SIZE * 2 - 4, p * SIZE * 2 + yOffs * 2), Style.NORMAL);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>graphic.drawLine(new Vector(SIZE, (poles - 1) * SIZE * 2 + yOffs), new Vector(SIZE, 1 - SIZE), Style.DASH);<NEW_LINE>// the coil<NEW_LINE>graphic.drawPolygon(new Polygon(true).add(SIZE2, -SIZE).add(SIZE2, -SIZE * 3).add(SIZE + SIZE2, -SIZE * 3).add(SIZE + SIZE2, -SIZE), Style.NORMAL);<NEW_LINE>graphic.drawLine(new Vector(SIZE2, -SIZE - SIZE2), new Vector(SIZE + SIZE2, -SIZE * 2 - SIZE2), Style.THIN);<NEW_LINE>graphic.drawLine(new Vector(SIZE2, -SIZE * 2), new Vector(0, -SIZE * 2), Style.NORMAL);<NEW_LINE>graphic.drawLine(new Vector(SIZE + SIZE2, -SIZE * 2), new Vector(SIZE * 2, -SIZE * 2), Style.NORMAL);<NEW_LINE>if (label != null && label.length() > 0)<NEW_LINE>graphic.drawText(new Vector(SIZE, -SIZE * 3 - 4), label, Orientation.CENTERBOTTOM, Style.SHAPE_PIN);<NEW_LINE>} | + 2), Style.NORMAL); |
644,806 | private static List<Byte> flatten(final ConditionNode root, final Map<ConditionNode, Integer> nodeIds) {<NEW_LINE>final List<Byte> flattenedTree <MASK><NEW_LINE>addAll(flattenedTree, getType(root));<NEW_LINE>final List<Byte> payload = getPayload(root);<NEW_LINE>addAll(flattenedTree, ByteHelpers.toBigEndianDword(payload.size()));<NEW_LINE>flattenedTree.addAll(payload);<NEW_LINE>addAll(flattenedTree, ByteHelpers.toBigEndianDword(root.getChildren().size()));<NEW_LINE>for (final ConditionNode child : root.getChildren()) {<NEW_LINE>addAll(flattenedTree, ByteHelpers.toBigEndianDword(nodeIds.get(child)));<NEW_LINE>}<NEW_LINE>for (final ConditionNode child : root.getChildren()) {<NEW_LINE>flattenedTree.addAll(flatten(child, nodeIds));<NEW_LINE>}<NEW_LINE>return flattenedTree;<NEW_LINE>} | = new ArrayList<Byte>(); |
1,748,365 | final SuspendGameServerGroupResult executeSuspendGameServerGroup(SuspendGameServerGroupRequest suspendGameServerGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(suspendGameServerGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SuspendGameServerGroupRequest> request = null;<NEW_LINE>Response<SuspendGameServerGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SuspendGameServerGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(suspendGameServerGroupRequest));<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, "GameLift");<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<SuspendGameServerGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SuspendGameServerGroupResultJsonUnmarshaller());<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, "SuspendGameServerGroup"); |
413,445 | public Delta delta(DiscoveryNodes other) {<NEW_LINE>List<DiscoveryNode> <MASK><NEW_LINE>List<DiscoveryNode> added = new ArrayList<>();<NEW_LINE>for (DiscoveryNode node : other) {<NEW_LINE>if (!this.nodeExists(node)) {<NEW_LINE>removed.add(node);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (DiscoveryNode node : this) {<NEW_LINE>if (!other.nodeExists(node)) {<NEW_LINE>added.add(node);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DiscoveryNode previousMasterNode = null;<NEW_LINE>DiscoveryNode newMasterNode = null;<NEW_LINE>if (masterNodeId != null) {<NEW_LINE>if (other.masterNodeId == null || !other.masterNodeId.equals(masterNodeId)) {<NEW_LINE>previousMasterNode = other.getMasterNode();<NEW_LINE>newMasterNode = getMasterNode();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Delta(previousMasterNode, newMasterNode, localNodeId, Collections.unmodifiableList(removed), Collections.unmodifiableList(added));<NEW_LINE>} | removed = new ArrayList<>(); |
1,170,024 | public BatchResult<Integer, ValidationDemo> batchGet(Set<Integer> ids) {<NEW_LINE>Map<Integer, ValidationDemo> resultMap = new HashMap<>();<NEW_LINE>Map<Integer, RestLiServiceException> errorMap = new HashMap<>();<NEW_LINE>// Generate entities that are missing a required field<NEW_LINE>for (Integer id : ids) {<NEW_LINE>if (id == 0) {<NEW_LINE>errorMap.put(id, new RestLiServiceException(HttpStatus.S_400_BAD_REQUEST));<NEW_LINE>} else if (id == 1) {<NEW_LINE>ValidationDemo.UnionFieldWithInlineRecord union = new ValidationDemo.UnionFieldWithInlineRecord();<NEW_LINE>union.setMyRecord(new myRecord().setFoo1(100).setFoo2(200));<NEW_LINE>resultMap.put(id, new ValidationDemo().setStringA("a").setStringB("b").setUnionFieldWithInlineRecord(union));<NEW_LINE>} else {<NEW_LINE>ValidationDemo.UnionFieldWithInlineRecord <MASK><NEW_LINE>union.setMyRecord(new myRecord());<NEW_LINE>ValidationDemo validationDemo = new ValidationDemo().setStringA("a").setStringB("b").setUnionFieldWithInlineRecord(union);<NEW_LINE>resultMap.put(id, validationDemo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>;<NEW_LINE>return new BatchResult<>(resultMap, errorMap);<NEW_LINE>} | union = new ValidationDemo.UnionFieldWithInlineRecord(); |
1,587,454 | private int putInCacheIfAbsent(final char[] key1, final char[] key2, final char[] key3, int value) {<NEW_LINE>int index;<NEW_LINE>HashtableOfObject key1Value = (HashtableOfObject) this.methodsAndFieldsCache.get(key1);<NEW_LINE>if (key1Value == null) {<NEW_LINE>key1Value = new HashtableOfObject();<NEW_LINE>this.methodsAndFieldsCache.put(key1, key1Value);<NEW_LINE>CachedIndexEntry cachedIndexEntry = new CachedIndexEntry(key3, value);<NEW_LINE>index = -value;<NEW_LINE>key1Value.put(key2, cachedIndexEntry);<NEW_LINE>} else {<NEW_LINE>Object key2Value = key1Value.get(key2);<NEW_LINE>if (key2Value == null) {<NEW_LINE>CachedIndexEntry cachedIndexEntry = new CachedIndexEntry(key3, value);<NEW_LINE>index = -value;<NEW_LINE>key1Value.put(key2, cachedIndexEntry);<NEW_LINE>} else if (key2Value instanceof CachedIndexEntry) {<NEW_LINE>// adding a second entry<NEW_LINE>CachedIndexEntry entry = (CachedIndexEntry) key2Value;<NEW_LINE>if (CharOperation.equals(key3, entry.signature)) {<NEW_LINE>index = entry.index;<NEW_LINE>} else {<NEW_LINE>CharArrayCache charArrayCache = new CharArrayCache();<NEW_LINE>charArrayCache.putIfAbsent(entry.signature, entry.index);<NEW_LINE>index = charArrayCache.putIfAbsent(key3, value);<NEW_LINE>key1Value.put(key2, charArrayCache);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>CharArrayCache charArrayCache = (CharArrayCache) key2Value;<NEW_LINE>index = <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return index;<NEW_LINE>} | charArrayCache.putIfAbsent(key3, value); |
1,664,283 | public void testEntityProviderPriorities(HttpServletRequest req, HttpServletResponse resp) throws Exception {<NEW_LINE>MyObject requestObject = new MyObject();<NEW_LINE>requestObject.setMyString("hello");<NEW_LINE>requestObject.setMyInt(5);<NEW_LINE>Response response = target(req, "providerPriorityApp/rest/test/myParam").request(MediaType.TEXT_PLAIN).put<MASK><NEW_LINE>response.bufferEntity();<NEW_LINE>System.out.println("testEntityProviderPriorities responseEntity = " + response.readEntity(String.class));<NEW_LINE>MyObject responseObject = response.readEntity(MyObject.class);<NEW_LINE>// check that the response object was not altered during request<NEW_LINE>assertEquals("Response object contains unexpected values", requestObject.getMyString(), responseObject.getMyString());<NEW_LINE>assertEquals("Response object contains unexpected values", requestObject.getMyInt(), responseObject.getMyInt());<NEW_LINE>// check that the expected providers processed the response object<NEW_LINE>assertEquals("The higher priority MessageBodyReader was not selected", 2, responseObject.getMbrVersion());<NEW_LINE>assertEquals("The higher priority ContextResolver in the MessageBodyReader was not selected", 2, responseObject.getContextResolverVersionFromReader());<NEW_LINE>assertEquals("The higher priority MessageBodyWriter was not selected", 2, responseObject.getMbwVersion());<NEW_LINE>assertEquals("The higher priority ContextResolver in the MessageBodyWriter was not selected", 2, responseObject.getContextResolverVersionFromWriter());<NEW_LINE>assertEquals("The higher priority ParamConverterProvider was not selected", 2, responseObject.getParamConverterVersion());<NEW_LINE>} | (Entity.text(requestObject)); |
1,825,654 | // this method comes from<NEW_LINE>// https://github.com/jacoco/jacoco/blob/master/jacoco-maven-plugin/src/org/jacoco/maven/ReportAggregateMojo.java<NEW_LINE>@Override<NEW_LINE>List<MavenProject> findDependencies() {<NEW_LINE>final List<MavenProject> result = new ArrayList<>();<NEW_LINE>final List<String> scopeList = Arrays.asList(Artifact.SCOPE_COMPILE, Artifact.SCOPE_RUNTIME, Artifact.SCOPE_PROVIDED, Artifact.SCOPE_TEST);<NEW_LINE>for (final Object dependencyObject : getProject().getDependencies()) {<NEW_LINE><MASK><NEW_LINE>if (scopeList.contains(dependency.getScope())) {<NEW_LINE>final MavenProject project = findProjectFromReactor(dependency);<NEW_LINE>if (project != null) {<NEW_LINE>result.add(project);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | final Dependency dependency = (Dependency) dependencyObject; |
238,908 | public void messageReceived(final RecoveryFileChunkRequest request, TransportChannel channel) throws Exception {<NEW_LINE>try (RecoveryRef recoveryRef = onGoingRecoveries.getRecoverySafe(request.recoveryId(), request.shardId())) {<NEW_LINE>final RecoveryTarget recoveryTarget = recoveryRef.target();<NEW_LINE>final RecoveryState.Index indexState = recoveryTarget.state().getIndex();<NEW_LINE>if (request.sourceThrottleTimeInNanos() != RecoveryState.Index.UNKNOWN) {<NEW_LINE>indexState.<MASK><NEW_LINE>}<NEW_LINE>RateLimiter rateLimiter = recoverySettings.rateLimiter();<NEW_LINE>if (rateLimiter != null) {<NEW_LINE>long bytes = bytesSinceLastPause.addAndGet(request.content().length());<NEW_LINE>if (bytes > rateLimiter.getMinPauseCheckBytes()) {<NEW_LINE>// Time to pause<NEW_LINE>bytesSinceLastPause.addAndGet(-bytes);<NEW_LINE>long throttleTimeInNanos = rateLimiter.pause(bytes);<NEW_LINE>indexState.addTargetThrottling(throttleTimeInNanos);<NEW_LINE>recoveryTarget.indexShard().recoveryStats().addThrottleTime(throttleTimeInNanos);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final ActionListener<TransportResponse> listener = new ChannelActionListener<>(channel, Actions.FILE_CHUNK, request);<NEW_LINE>recoveryTarget.writeFileChunk(request.metadata(), request.position(), request.content(), request.lastChunk(), request.totalTranslogOps(), ActionListener.wrap(nullVal -> listener.onResponse(TransportResponse.Empty.INSTANCE), listener::onFailure));<NEW_LINE>}<NEW_LINE>} | addSourceThrottling(request.sourceThrottleTimeInNanos()); |
601,620 | private String substitute(String text) throws IOException {<NEW_LINE>int startPos;<NEW_LINE>if ((startPos = text.indexOf("${")) == -1) {<NEW_LINE>return text;<NEW_LINE>}<NEW_LINE>// Find matching "}".<NEW_LINE>int braceDepth = 1;<NEW_LINE>int endPos = startPos + 2;<NEW_LINE>while (endPos < text.length() && braceDepth > 0) {<NEW_LINE>if (text.charAt(endPos) == '{')<NEW_LINE>braceDepth++;<NEW_LINE>else if (text.charAt(endPos) == '}')<NEW_LINE>braceDepth--;<NEW_LINE>endPos++;<NEW_LINE>}<NEW_LINE>if (braceDepth != 0)<NEW_LINE>throw new IOException("Mismatched \"{}\" in template string: " + text);<NEW_LINE>final String variableExpression = text.substring(startPos + 2, endPos - 1);<NEW_LINE>// Find the end of the variable name<NEW_LINE>String value = null;<NEW_LINE>for (int i = 0; i < variableExpression.length(); i++) {<NEW_LINE>char ch = variableExpression.charAt(i);<NEW_LINE>if (ch == ':' && i < variableExpression.length() - 1 && variableExpression.charAt(i + 1) == '-') {<NEW_LINE>value = substituteWithDefault(variableExpression.substring(0, i), variableExpression<MASK><NEW_LINE>break;<NEW_LINE>} else if (ch == '?') {<NEW_LINE>value = substituteWithConditional(variableExpression.substring(0, i), variableExpression.substring(i + 1));<NEW_LINE>break;<NEW_LINE>} else if (ch != '_' && !Character.isJavaIdentifierPart(ch)) {<NEW_LINE>throw new IOException("Invalid variable in " + text);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (value == null) {<NEW_LINE>value = substituteWithDefault(variableExpression, "");<NEW_LINE>}<NEW_LINE>return text.substring(0, startPos) + value + text.substring(endPos);<NEW_LINE>} | .substring(i + 2)); |
901,941 | private static void start_deployment(JsonObject jsonObject) {<NEW_LINE>String user = jsonObject.get("user").getAsJsonObject().get("login").getAsString();<NEW_LINE>Map<String, String> map = new HashMap<>();<NEW_LINE>map.put("environment", "QA");<NEW_LINE>map.put("deploy_user", user);<NEW_LINE>Gson gson = new Gson();<NEW_LINE>String payload = gson.toJson(map);<NEW_LINE>try {<NEW_LINE>GitHub gitHub = GitHubBuilder<MASK><NEW_LINE>GHRepository repository = gitHub.getRepository(jsonObject.get("head").getAsJsonObject().get("repo").getAsJsonObject().get("full_name").getAsString());<NEW_LINE>GHDeployment deployment = new GHDeploymentBuilder(repository, jsonObject.get("head").getAsJsonObject().get("sha").getAsString()).description("Auto Deploy after merge").payload(payload).autoMerge(false).create();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | .fromEnvironment().build(); |
664,242 | public void onClick(DialogInterface dialog, int which) {<NEW_LINE>// reset<NEW_LINE>mTotalLoopClosures = 0;<NEW_LINE>int index = STATUS_TEXTS_POSE_INDEX;<NEW_LINE>mMapNodes = 0;<NEW_LINE>mStatusTexts[index++] = getString(<MASK><NEW_LINE>mStatusTexts[index++] = getString(R.string.words) + 0;<NEW_LINE>mStatusTexts[index++] = getString(R.string.database_size) + 0;<NEW_LINE>mStatusTexts[index++] = getString(R.string.points) + 0;<NEW_LINE>mStatusTexts[index++] = getString(R.string.polygons) + 0;<NEW_LINE>mStatusTexts[index++] = getString(R.string.update_time) + 0;<NEW_LINE>mStatusTexts[index++] = getString(R.string.features) + 0;<NEW_LINE>mStatusTexts[index++] = getString(R.string.rehearsal) + 0;<NEW_LINE>mStatusTexts[index++] = getString(R.string.total_loop) + 0;<NEW_LINE>mStatusTexts[index++] = getString(R.string.inliers) + 0;<NEW_LINE>mStatusTexts[index++] = getString(R.string.hypothesis) + 0;<NEW_LINE>mStatusTexts[index++] = getString(R.string.fps) + 0;<NEW_LINE>mStatusTexts[index++] = getString(R.string.distance) + 0;<NEW_LINE>mStatusTexts[index++] = String.format("Pose (x,y,z): 0 0 0");<NEW_LINE>updateStatusTexts();<NEW_LINE>mItemDataRecorderMode.setChecked(!dataRecorderOldState);<NEW_LINE>RTABMapLib.setDataRecorderMode(nativeApplication, mItemDataRecorderMode.isChecked());<NEW_LINE>mOpenedDatabasePath = "";<NEW_LINE>SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getActivity());<NEW_LINE>boolean databaseInMemory = sharedPref.getBoolean(getString(R.string.pref_key_db_in_memory), Boolean.parseBoolean(getString(R.string.pref_default_db_in_memory)));<NEW_LINE>String tmpDatabase = mWorkingDirectory + RTABMAP_TMP_DB;<NEW_LINE>RTABMapLib.openDatabase(nativeApplication, tmpDatabase, databaseInMemory, false, true);<NEW_LINE>mItemLocalizationMode.setEnabled(!mItemDataRecorderMode.isChecked());<NEW_LINE>if (mItemDataRecorderMode.isChecked()) {<NEW_LINE>mToast.makeText(getActivity(), String.format("Data recorder mode activated! Tip: You can increase data update rate in Parameters menu under Mapping options."), mToast.LENGTH_LONG).show();<NEW_LINE>} else {<NEW_LINE>mToast.makeText(getActivity(), String.format("Data recorder mode deactivated!"), mToast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>} | R.string.nodes) + 0; |
1,467,592 | public WorkloadRecordStore create(PrivateKeyStore keyStore) {<NEW_LINE>final String tableName = System.getProperty(ZTSConsts.ZTS_PROP_WORKLOAD_DYNAMODB_TABLE_NAME);<NEW_LINE>if (StringUtil.isEmpty(tableName)) {<NEW_LINE>LOGGER.error("Workload Store DynamoDB table name not specified");<NEW_LINE>throw new ResourceException(ResourceException.SERVICE_UNAVAILABLE, "DynamoDB table name not specified");<NEW_LINE>}<NEW_LINE>final String serviceIndexName = <MASK><NEW_LINE>if (StringUtil.isEmpty(serviceIndexName)) {<NEW_LINE>LOGGER.error("Workload Store DynamoDB index by name service not specified");<NEW_LINE>throw new ResourceException(ResourceException.SERVICE_UNAVAILABLE, "DynamoDB index workload-service-index not specified");<NEW_LINE>}<NEW_LINE>final String ipIndexName = System.getProperty(ZTSConsts.ZTS_PROP_WORKLOAD_DYNAMODB_INDEX_IP_NAME);<NEW_LINE>if (StringUtil.isEmpty(ipIndexName)) {<NEW_LINE>LOGGER.error("Workload Store DynamoDB index by name ip not specified");<NEW_LINE>throw new ResourceException(ResourceException.SERVICE_UNAVAILABLE, "DynamoDB index workload-ip-index not specified");<NEW_LINE>}<NEW_LINE>AmazonDynamoDB client = getDynamoDBClient(null, keyStore);<NEW_LINE>return new DynamoDBWorkloadRecordStore(client, tableName, serviceIndexName, ipIndexName);<NEW_LINE>} | System.getProperty(ZTSConsts.ZTS_PROP_WORKLOAD_DYNAMODB_INDEX_SERVICE_NAME); |
215,775 | public GetPendingJobExecutionsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetPendingJobExecutionsResult getPendingJobExecutionsResult = new GetPendingJobExecutionsResult();<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 getPendingJobExecutionsResult;<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("inProgressJobs", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getPendingJobExecutionsResult.setInProgressJobs(new ListUnmarshaller<JobExecutionSummary>(JobExecutionSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("queuedJobs", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getPendingJobExecutionsResult.setQueuedJobs(new ListUnmarshaller<JobExecutionSummary>(JobExecutionSummaryJsonUnmarshaller.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 getPendingJobExecutionsResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,373,830 | protected DataType readDataType(CachedRow columnMetadataResultSet, Column column, Database database) throws DatabaseException {<NEW_LINE>// For an explanation of the information encoded in the column length, please see<NEW_LINE>// https://www.ibm.com/support/knowledgecenter/SSGU8G_11.50.0/com.ibm.sqlr.doc/ids_sqr_027.htm<NEW_LINE>String typeName = columnMetadataResultSet.getString("TYPE_NAME").toUpperCase();<NEW_LINE>if ("DATETIME".equals(typeName) || "INTERVAL".equals(typeName)) {<NEW_LINE>int colLength = columnMetadataResultSet.getInt("COLUMN_SIZE");<NEW_LINE>int firstQualifierType = (colLength % 256) / 16;<NEW_LINE>int lastQualifierType <MASK><NEW_LINE>String type = "DATETIME".equals(typeName) ? "DATETIME" : "INTERVAL";<NEW_LINE>String firstQualifier = qualifiers.get(firstQualifierType);<NEW_LINE>String lastQualifier = qualifiers.get(lastQualifierType);<NEW_LINE>if (firstQualifier == null) {<NEW_LINE>throw new liquibase.exception.DatabaseException(String.format("Encountered unknown firstQualifier code (%d) for column '%s', basic date type '%s', " + "while trying to decipher information encoded in the column length (%d)", firstQualifierType, column.toString(), typeName, colLength));<NEW_LINE>}<NEW_LINE>if (lastQualifier == null) {<NEW_LINE>throw new liquibase.exception.DatabaseException(String.format("Encountered unknown lastQualifier code (%d) for column '%s', basic date type '%s', " + "while trying to decipher information encoded in the column length (%d)", firstQualifierType, column.toString(), typeName, colLength));<NEW_LINE>}<NEW_LINE>DataType dataTypeMetaData = new DataType(type + " " + firstQualifier + " TO " + lastQualifier);<NEW_LINE>dataTypeMetaData.setColumnSizeUnit(DataType.ColumnSizeUnit.BYTE);<NEW_LINE>return dataTypeMetaData;<NEW_LINE>} else {<NEW_LINE>return super.readDataType(columnMetadataResultSet, column, database);<NEW_LINE>}<NEW_LINE>} | = (colLength % 256) % 16; |
1,290,619 | public static ItemUsage calculateUsage(final IndexNameExpressionResolver indexNameExpressionResolver, final ClusterState state, final String policyName) {<NEW_LINE>final List<String> indices = state.metadata().indices().values().stream().filter(indexMetadata -> policyName.equals(indexMetadata.getLifecyclePolicyName())).map(indexMetadata -> indexMetadata.getIndex().getName()).collect(Collectors.toList());<NEW_LINE>final List<String> allDataStreams = indexNameExpressionResolver.<MASK><NEW_LINE>final List<String> dataStreams = allDataStreams.stream().filter(dsName -> {<NEW_LINE>String indexTemplate = MetadataIndexTemplateService.findV2Template(state.metadata(), dsName, false);<NEW_LINE>if (indexTemplate != null) {<NEW_LINE>Settings settings = MetadataIndexTemplateService.resolveSettings(state.metadata(), indexTemplate);<NEW_LINE>return policyName.equals(LifecycleSettings.LIFECYCLE_NAME_SETTING.get(settings));<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>final List<String> composableTemplates = state.metadata().templatesV2().keySet().stream().filter(templateName -> {<NEW_LINE>Settings settings = MetadataIndexTemplateService.resolveSettings(state.metadata(), templateName);<NEW_LINE>return policyName.equals(LifecycleSettings.LIFECYCLE_NAME_SETTING.get(settings));<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>return new ItemUsage(indices, dataStreams, composableTemplates);<NEW_LINE>} | dataStreamNames(state, IndicesOptions.LENIENT_EXPAND_OPEN_CLOSED_HIDDEN); |
1,373,818 | final UpdateWorkloadResult executeUpdateWorkload(UpdateWorkloadRequest updateWorkloadRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateWorkloadRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateWorkloadRequest> request = null;<NEW_LINE>Response<UpdateWorkloadResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateWorkloadRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateWorkloadRequest));<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, "WellArchitected");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateWorkload");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateWorkloadResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateWorkloadResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
1,559,473 | public boolean handleRequest(MessageContext context) {<NEW_LINE>WebComponentInvocation inv = null;<NEW_LINE>try {<NEW_LINE>WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();<NEW_LINE>InvocationManager invManager = wscImpl.getInvocationManager();<NEW_LINE>inv = WebComponentInvocation.class.<MASK><NEW_LINE>Method webServiceMethodInPreHandler = inv.getWebServiceMethod();<NEW_LINE>if (webServiceMethodInPreHandler != null) {<NEW_LINE>// Now that application handlers have run, do another method<NEW_LINE>// lookup and compare the results with the original one. This<NEW_LINE>// ensures that the application handlers have not changed<NEW_LINE>// the message context in any way that would impact which<NEW_LINE>// method is invoked.<NEW_LINE>Method postHandlerMethod = wsUtil.getInvMethod((com.sun.xml.rpc.spi.runtime.Tie) inv.getWebServiceTie(), context);<NEW_LINE>if (!webServiceMethodInPreHandler.equals(postHandlerMethod)) {<NEW_LINE>throw new UnmarshalException("Original method " + webServiceMethodInPreHandler + " does not match post-handler method ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.log(Level.WARNING, LogUtils.POST_WEBHANDLER_ERROR, e.toString());<NEW_LINE>wsUtil.throwSOAPFaultException(e.getMessage(), context);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | cast(invManager.getCurrentInvocation()); |
1,836,494 | final DeleteBotVersionResult executeDeleteBotVersion(DeleteBotVersionRequest deleteBotVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteBotVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteBotVersionRequest> request = null;<NEW_LINE>Response<DeleteBotVersionResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DeleteBotVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteBotVersionRequest));<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, "Lex Model Building Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteBotVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteBotVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteBotVersionResultJsonUnmarshaller());<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); |
578,565 | private void updateItemState(String itemName, String tvCommand) {<NEW_LINE>if (tvCommand.contains("ambilight")) {<NEW_LINE>String[] layer = command2LayerString(tvCommand);<NEW_LINE>HSBType state = new HSBType(getAmbilightColor(ip + ":" + port, layer));<NEW_LINE>eventPublisher.postUpdate(itemName, state);<NEW_LINE>} else if (tvCommand.contains("volume")) {<NEW_LINE>if (tvCommand.contains("mute")) {<NEW_LINE>eventPublisher.postUpdate(itemName, getTVVolume(ip + ":" + port).mute ? OnOffType.ON : OnOffType.OFF);<NEW_LINE>} else {<NEW_LINE>eventPublisher.postUpdate(itemName, new DecimalType(getTVVolume(ip + ":" + port).volume));<NEW_LINE>}<NEW_LINE>} else if (tvCommand.contains("source")) {<NEW_LINE>eventPublisher.postUpdate(itemName, new StringType(getSource(ip + ":" + port)));<NEW_LINE>} else {<NEW_LINE>logger.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} | error("Could not parse item state\"" + tvCommand + "\" for polling"); |
32,470 | public void readApis() throws Exception {<NEW_LINE>current = nextToken();<NEW_LINE>if (current == JsonToken.END_ARRAY) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>while (nextToken() != JsonToken.END_ARRAY) {<NEW_LINE>// Traverse each api definition<NEW_LINE>while (nextToken() != JsonToken.END_OBJECT) {<NEW_LINE>if (jp.getCurrentName().equals(ApiBean.class.getSimpleName())) {<NEW_LINE>current = nextToken();<NEW_LINE>ApiBean apiBean = <MASK><NEW_LINE>dispatcher.api(apiBean);<NEW_LINE>} else {<NEW_LINE>OrgElementsEnum fieldName = OrgElementsEnum.valueOf(jp.getCurrentName());<NEW_LINE>current = nextToken();<NEW_LINE>switch(fieldName) {<NEW_LINE>case Versions:<NEW_LINE>readApiVersions();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Unhandled entity " + fieldName + " with token " + current);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | jp.readValueAs(ApiBean.class); |
1,374,826 | public Request<ListBotsRequest> marshall(ListBotsRequest listBotsRequest) {<NEW_LINE>if (listBotsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListBotsRequest)");<NEW_LINE>}<NEW_LINE>Request<ListBotsRequest> request = new DefaultRequest<MASK><NEW_LINE>request.setHttpMethod(HttpMethodName.GET);<NEW_LINE>String uriResourcePath = "/instance/{InstanceId}/bots";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{InstanceId}", (listBotsRequest.getInstanceId() == null) ? "" : StringUtils.fromString(listBotsRequest.getInstanceId()));<NEW_LINE>if (listBotsRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("nextToken", StringUtils.fromString(listBotsRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>if (listBotsRequest.getMaxResults() != null) {<NEW_LINE>request.addParameter("maxResults", StringUtils.fromInteger(listBotsRequest.getMaxResults()));<NEW_LINE>}<NEW_LINE>if (listBotsRequest.getLexVersion() != null) {<NEW_LINE>request.addParameter("lexVersion", StringUtils.fromString(listBotsRequest.getLexVersion()));<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.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | <ListBotsRequest>(listBotsRequest, "AmazonConnect"); |
1,760,083 | private MigrateStruct buildMigrateStuct(final MigrateVmOnHypervisorMsg msg) {<NEW_LINE>MigrateStruct s = new MigrateStruct();<NEW_LINE>s.vmUuid = msg.getVmInventory().getUuid();<NEW_LINE>s.srcHostUuid = msg.getSrcHostUuid();<NEW_LINE>s.dstHostUuid = msg.getDestHostInventory().getUuid();<NEW_LINE>s.storageMigrationPolicy = msg.getStorageMigrationPolicy();<NEW_LINE>s.migrateFromDestition = msg.isMigrateFromDestination();<NEW_LINE>s.strategy = msg.getStrategy();<NEW_LINE>MigrateNetworkExtensionPoint.MigrateInfo migrateIpInfo = null;<NEW_LINE>for (MigrateNetworkExtensionPoint ext : pluginRgty.getExtensionList(MigrateNetworkExtensionPoint.class)) {<NEW_LINE>MigrateNetworkExtensionPoint.MigrateInfo r = ext.getMigrationAddressForVM(s.srcHostUuid, s.dstHostUuid);<NEW_LINE>if (r == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>migrateIpInfo = r;<NEW_LINE>}<NEW_LINE>s.dstHostMnIp = msg.getDestHostInventory().getManagementIp();<NEW_LINE>s.dstHostMigrateIp = migrateIpInfo == null <MASK><NEW_LINE>s.srcHostMnIp = Q.New(HostVO.class).eq(HostVO_.uuid, msg.getSrcHostUuid()).select(HostVO_.managementIp).findValue();<NEW_LINE>s.srcHostMigrateIp = migrateIpInfo == null ? s.srcHostMnIp : migrateIpInfo.srcMigrationAddress;<NEW_LINE>return s;<NEW_LINE>} | ? s.dstHostMnIp : migrateIpInfo.dstMigrationAddress; |
570,034 | final DescribeExportImageTasksResult executeDescribeExportImageTasks(DescribeExportImageTasksRequest describeExportImageTasksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeExportImageTasksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeExportImageTasksRequest> request = null;<NEW_LINE>Response<DescribeExportImageTasksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeExportImageTasksRequestMarshaller().marshall(super.beforeMarshalling(describeExportImageTasksRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeExportImageTasks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeExportImageTasksResult> responseHandler = new StaxResponseHandler<DescribeExportImageTasksResult>(new DescribeExportImageTasksResultStaxUnmarshaller());<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()); |
1,761,649 | public void render(RenderContext ctx, Repainter repainter) {<NEW_LINE>if (expanded) {<NEW_LINE>ctx.setBackgroundColor(colors().titleBackground);<NEW_LINE>ctx.fillRect(0, 0, width, TITLE_HEIGHT);<NEW_LINE>ctx.setForegroundColor(colors().textMain);<NEW_LINE>ctx.drawIcon(arrowDown(ctx.theme), 0, 0, TITLE_HEIGHT);<NEW_LINE>ctx.drawText(Fonts.Style.Normal, summary.getTitle(), LABEL_OFFSET, 0, TITLE_HEIGHT);<NEW_LINE>double x = Math.max(LABEL_TOGGLE_X, LABEL_OFFSET + Math.ceil(ctx.measure(Fonts.Style.Normal, summary.getTitle()).w) + LABEL_MARGIN);<NEW_LINE>if (filter != null) {<NEW_LINE>ctx.drawIcon(filtered ? unfoldMore(ctx.theme) : unfoldLess(ctx.theme), x, 0, TITLE_HEIGHT);<NEW_LINE>x += LABEL_ICON_SIZE;<NEW_LINE>}<NEW_LINE>if (hovered || pinState.isPinned()) {<NEW_LINE>ctx.drawIcon(pinState.icon(ctx), Math.max(x, LABEL_PIN_X), 0, TITLE_HEIGHT);<NEW_LINE>}<NEW_LINE>ctx.setForegroundColor(colors().panelBorder);<NEW_LINE>ctx.drawLine(0, height - 1, width - 1, height - 1);<NEW_LINE>summary.decorateTitle(ctx, repainter);<NEW_LINE>ctx.withTranslation(0, TITLE_HEIGHT, () -> detail.render(ctx, repainter.translated(0, TITLE_HEIGHT)));<NEW_LINE>} else {<NEW_LINE>ctx.withClip(0, 0, LABEL_WIDTH, height, () -> {<NEW_LINE>ctx.setForegroundColor(colors().textMain);<NEW_LINE>ctx.drawIcon(arrowRight(ctx.theme), 0, 0, TITLE_HEIGHT);<NEW_LINE>ctx.drawTextLeftTruncate(Fonts.Style.Normal, summary.getTitle(), LABEL_OFFSET, 0, LABEL_PIN_X - LABEL_MARGIN - LABEL_OFFSET, TITLE_HEIGHT);<NEW_LINE>if (hovered || pinState.isPinned()) {<NEW_LINE>ctx.drawIcon(pinState.icon(ctx), LABEL_PIN_X, 0, TITLE_HEIGHT);<NEW_LINE>}<NEW_LINE>if (!summary.getSubTitle().isEmpty()) {<NEW_LINE>ctx.setForegroundColor(colors().textAlt);<NEW_LINE>ctx.drawText(Fonts.Style.Normal, summary.getSubTitle(), LABEL_OFFSET, TITLE_HEIGHT);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ctx.setForegroundColor(colors().panelBorder);<NEW_LINE>ctx.drawLine(LABEL_WIDTH - 1, 0, <MASK><NEW_LINE>ctx.drawLine(0, height - 1, width, height - 1);<NEW_LINE>summary.render(ctx, repainter);<NEW_LINE>}<NEW_LINE>} | LABEL_WIDTH - 1, height - 1); |
392,232 | @PUT<NEW_LINE>@Path("{name}/groups")<NEW_LINE>@Consumes(APPLICATION_JSON)<NEW_LINE>@Produces(APPLICATION_JSON)<NEW_LINE>public Iterable<String> modifySecretGroups(@Auth AutomationClient automationClient, @PathParam("name") String name, @Valid ModifyGroupsRequestV2 request) {<NEW_LINE>// TODO: Use latest version instead of non-versioned<NEW_LINE>Secret secret = secretController.getSecretByName(name).orElseThrow(NotFoundException::new);<NEW_LINE>String user = automationClient.getName();<NEW_LINE><MASK><NEW_LINE>Set<String> oldGroups = aclDAO.getGroupsFor(secret).stream().map(Group::getName).collect(toSet());<NEW_LINE>Set<String> groupsToAdd = Sets.difference(request.addGroups(), oldGroups);<NEW_LINE>Set<String> groupsToRemove = Sets.intersection(request.removeGroups(), oldGroups);<NEW_LINE>// TODO: should optimize AclDAO to use names and return only name column<NEW_LINE>groupsToGroupIds(groupsToAdd).forEach((maybeGroupId) -> maybeGroupId.ifPresent((groupId) -> aclDAO.findAndAllowAccess(secretId, groupId, auditLog, user, new HashMap<>())));<NEW_LINE>groupsToGroupIds(groupsToRemove).forEach((maybeGroupId) -> maybeGroupId.ifPresent((groupId) -> aclDAO.findAndRevokeAccess(secretId, groupId, auditLog, user, new HashMap<>())));<NEW_LINE>return aclDAO.getGroupsFor(secret).stream().map(Group::getName).collect(toSet());<NEW_LINE>} | long secretId = secret.getId(); |
100,195 | public <T> Mono<T> run(final Mono<T> run, final Function<Throwable, Mono<T>> fallback, final Resilience4JConf resilience4JConf) {<NEW_LINE>RateLimiter rateLimiter = Resilience4JRegistryFactory.rateLimiter(resilience4JConf.getId(), resilience4JConf.getRateLimiterConfig());<NEW_LINE>CircuitBreaker circuitBreaker = Resilience4JRegistryFactory.circuitBreaker(resilience4JConf.getId(), resilience4JConf.getCircuitBreakerConfig());<NEW_LINE>Mono<T> to = run.transformDeferred(CircuitBreakerOperator.of(circuitBreaker)).transformDeferred(RateLimiterOperator.of(rateLimiter)).timeout(resilience4JConf.getTimeLimiterConfig().getTimeoutDuration()).doOnError(TimeoutException.class, t -> circuitBreaker.onError(resilience4JConf.getTimeLimiterConfig().getTimeoutDuration().toMillis(), TimeUnit.MILLISECONDS, t));<NEW_LINE>if (Objects.nonNull(fallback)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return to;<NEW_LINE>} | to = to.onErrorResume(fallback); |
1,471,519 | protected Map verifyAndExtract(byte[] signed_stuff, byte[] public_key) throws BuddyPluginException {<NEW_LINE>int signature_length = ((int) signed_stuff[0]) & 0xff;<NEW_LINE>byte[] signature = new byte[signature_length];<NEW_LINE>byte[] data = new byte[signed_stuff.length - 1 - signature_length];<NEW_LINE>System.arraycopy(signed_stuff, 1, signature, 0, signature_length);<NEW_LINE>System.arraycopy(signed_stuff, 1 + signature_length, <MASK><NEW_LINE>try {<NEW_LINE>if (ecc_handler.verify(public_key, data, signature)) {<NEW_LINE>return (BDecoder.decode(data));<NEW_LINE>} else {<NEW_LINE>logMessage(null, "Signature verification failed");<NEW_LINE>return (null);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>rethrow("Verification failed", e);<NEW_LINE>return (null);<NEW_LINE>}<NEW_LINE>} | data, 0, data.length); |
239,511 | private void addDAMLOILVocabulary() {<NEW_LINE>synonymMap.put(daml("subClassOf"), RDFS_SUBCLASS_OF.getIRI());<NEW_LINE>synonymMap.put(daml("imports"), OWL_IMPORTS.getIRI());<NEW_LINE>synonymMap.put(daml("range"<MASK><NEW_LINE>synonymMap.put(daml("hasValue"), OWL_HAS_VALUE.getIRI());<NEW_LINE>synonymMap.put(daml("type"), RDF_TYPE.getIRI());<NEW_LINE>synonymMap.put(daml("domain"), RDFS_DOMAIN.getIRI());<NEW_LINE>synonymMap.put(daml("versionInfo"), OWL_VERSION_INFO.getIRI());<NEW_LINE>synonymMap.put(daml("comment"), RDFS_COMMENT.getIRI());<NEW_LINE>synonymMap.put(daml("onProperty"), OWL_ON_PROPERTY.getIRI());<NEW_LINE>synonymMap.put(daml("toClass"), OWL_ALL_VALUES_FROM.getIRI());<NEW_LINE>synonymMap.put(daml("hasClass"), OWL_SOME_VALUES_FROM.getIRI());<NEW_LINE>synonymMap.put(daml("Restriction"), OWL_RESTRICTION.getIRI());<NEW_LINE>synonymMap.put(daml("Class"), OWL_CLASS.getIRI());<NEW_LINE>synonymMap.put(daml("Thing"), OWL_THING.getIRI());<NEW_LINE>synonymMap.put(daml("Nothing"), OWL_NOTHING.getIRI());<NEW_LINE>synonymMap.put(daml("minCardinality"), OWL_MIN_CARDINALITY.getIRI());<NEW_LINE>synonymMap.put(daml("cardinality"), OWL_CARDINALITY.getIRI());<NEW_LINE>synonymMap.put(daml("maxCardinality"), OWL_MAX_CARDINALITY.getIRI());<NEW_LINE>synonymMap.put(daml("inverseOf"), OWL_INVERSE_OF.getIRI());<NEW_LINE>synonymMap.put(daml("samePropertyAs"), OWL_EQUIVALENT_PROPERTY.getIRI());<NEW_LINE>synonymMap.put(daml("hasClassQ"), OWL_ON_CLASS.getIRI());<NEW_LINE>synonymMap.put(daml("cardinalityQ"), OWL_CARDINALITY.getIRI());<NEW_LINE>synonymMap.put(daml("maxCardinalityQ"), OWL_MAX_CARDINALITY.getIRI());<NEW_LINE>synonymMap.put(daml("minCardinalityQ"), OWL_MIN_CARDINALITY.getIRI());<NEW_LINE>synonymMap.put(daml("complementOf"), OWL_COMPLEMENT_OF.getIRI());<NEW_LINE>synonymMap.put(daml("unionOf"), OWL_UNION_OF.getIRI());<NEW_LINE>synonymMap.put(daml("intersectionOf"), OWL_INTERSECTION_OF.getIRI());<NEW_LINE>synonymMap.put(daml("label"), RDFS_LABEL.getIRI());<NEW_LINE>synonymMap.put(daml("ObjectProperty"), OWL_OBJECT_PROPERTY.getIRI());<NEW_LINE>synonymMap.put(daml("DatatypeProperty"), OWL_DATA_PROPERTY.getIRI());<NEW_LINE>} | ), RDFS_RANGE.getIRI()); |
10,519 | public Result createAllClusters(UUID customerUUID) {<NEW_LINE>// TODO: add assertions that only expected params are set or bad_request<NEW_LINE>// Basically taskParams.clusters[]->userIntent and may be few more things<NEW_LINE>Customer customer = Customer.getOrBadRequest(customerUUID);<NEW_LINE>UniverseConfigureTaskParams taskParams = bindFormDataToTaskParams(<MASK><NEW_LINE>taskParams.clusterOperation = UniverseConfigureTaskParams.ClusterOperationType.CREATE;<NEW_LINE>taskParams.currentClusterType = ClusterType.PRIMARY;<NEW_LINE>universeCRUDHandler.configure(customer, taskParams);<NEW_LINE>if (taskParams.clusters.stream().anyMatch(cluster -> cluster.clusterType == ClusterType.ASYNC)) {<NEW_LINE>taskParams.currentClusterType = ClusterType.ASYNC;<NEW_LINE>universeCRUDHandler.configure(customer, taskParams);<NEW_LINE>}<NEW_LINE>UniverseResp universeResp = universeCRUDHandler.createUniverse(customer, taskParams);<NEW_LINE>auditService().createAuditEntryWithReqBody(ctx(), Audit.TargetType.Universe, Objects.toString(universeResp.universeUUID, null), Audit.ActionType.CreateCluster, request().body().asJson(), universeResp.taskUUID);<NEW_LINE>return new YBPTask(universeResp.taskUUID, universeResp.universeUUID).asResult();<NEW_LINE>} | request(), UniverseConfigureTaskParams.class); |
834,288 | public static NestedDeviceInformation calculateNestedDeviceInformation(IDevice target, SiteWhereTenant tenant) throws SiteWhereException {<NEW_LINE>NestedDeviceInformation nested = new NestedDeviceInformation();<NEW_LINE>// No parent set. Treat target device as gateway.<NEW_LINE>if (target.getParentDeviceId() == null) {<NEW_LINE>nested.setGateway(target);<NEW_LINE>return nested;<NEW_LINE>}<NEW_LINE>// Resolve parent and verify it exists.<NEW_LINE>IDevice parent = getDeviceManagement().getDevice(target.getParentDeviceId());<NEW_LINE>if (parent == null) {<NEW_LINE>throw new SiteWhereException("Parent device reference points to device that does not exist.");<NEW_LINE>}<NEW_LINE>// Parent should contain a mapping entry for the target device.<NEW_LINE>IDeviceElementMapping mapping = DeviceUtils.findMappingFor(parent, target.getToken());<NEW_LINE>// Fall back to target as gateway if no mapping exists. This should not<NEW_LINE>// happen.<NEW_LINE>if (mapping == null) {<NEW_LINE>nested.setGateway(target);<NEW_LINE>return nested;<NEW_LINE>}<NEW_LINE>nested.setGateway(parent);<NEW_LINE>nested.setNested(target);<NEW_LINE>nested.<MASK><NEW_LINE>return nested;<NEW_LINE>} | setPath(mapping.getDeviceElementSchemaPath()); |
653,545 | public static ListRpcServicesResponse unmarshall(ListRpcServicesResponse listRpcServicesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listRpcServicesResponse.setRequestId(_ctx.stringValue("ListRpcServicesResponse.RequestId"));<NEW_LINE>RpcServices rpcServices = new RpcServices();<NEW_LINE>Pagination pagination = new Pagination();<NEW_LINE>pagination.setTotalCount(_ctx.integerValue("ListRpcServicesResponse.RpcServices.Pagination.TotalCount"));<NEW_LINE>pagination.setTotalPageCount(_ctx.integerValue("ListRpcServicesResponse.RpcServices.Pagination.TotalPageCount"));<NEW_LINE>pagination.setPageIndex(_ctx.integerValue("ListRpcServicesResponse.RpcServices.Pagination.PageIndex"));<NEW_LINE>pagination.setPageSize<MASK><NEW_LINE>rpcServices.setPagination(pagination);<NEW_LINE>List<ListItem> list = new ArrayList<ListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListRpcServicesResponse.RpcServices.List.Length"); i++) {<NEW_LINE>ListItem listItem = new ListItem();<NEW_LINE>listItem.setId(_ctx.longValue("ListRpcServicesResponse.RpcServices.List[" + i + "].Id"));<NEW_LINE>listItem.setAppKey(_ctx.stringValue("ListRpcServicesResponse.RpcServices.List[" + i + "].AppKey"));<NEW_LINE>listItem.setInterfaceName(_ctx.stringValue("ListRpcServicesResponse.RpcServices.List[" + i + "].InterfaceName"));<NEW_LINE>listItem.setGroupName(_ctx.stringValue("ListRpcServicesResponse.RpcServices.List[" + i + "].GroupName"));<NEW_LINE>listItem.setType(_ctx.stringValue("ListRpcServicesResponse.RpcServices.List[" + i + "].Type"));<NEW_LINE>listItem.setParams(_ctx.stringValue("ListRpcServicesResponse.RpcServices.List[" + i + "].Params"));<NEW_LINE>listItem.setIsDelete(_ctx.stringValue("ListRpcServicesResponse.RpcServices.List[" + i + "].IsDelete"));<NEW_LINE>listItem.setGmtCreate(_ctx.longValue("ListRpcServicesResponse.RpcServices.List[" + i + "].GmtCreate"));<NEW_LINE>listItem.setGmtModified(_ctx.longValue("ListRpcServicesResponse.RpcServices.List[" + i + "].GmtModified"));<NEW_LINE>listItem.setMethodName(_ctx.stringValue("ListRpcServicesResponse.RpcServices.List[" + i + "].MethodName"));<NEW_LINE>listItem.setVersionCode(_ctx.stringValue("ListRpcServicesResponse.RpcServices.List[" + i + "].VersionCode"));<NEW_LINE>list.add(listItem);<NEW_LINE>}<NEW_LINE>rpcServices.setList(list);<NEW_LINE>listRpcServicesResponse.setRpcServices(rpcServices);<NEW_LINE>return listRpcServicesResponse;<NEW_LINE>} | (_ctx.integerValue("ListRpcServicesResponse.RpcServices.Pagination.PageSize")); |
189,478 | public com.squareup.okhttp.Call revokedjwtGetCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/revokedjwt";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String <MASK><NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>} | localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
1,097,929 | public static void updateMetadata(final File file, final PropertyMap map, final boolean calcChecksums) throws FrameworkException {<NEW_LINE>final java.io.File fileOnDisk = file.getFileOnDisk(false);<NEW_LINE>if (fileOnDisk != null && fileOnDisk.exists()) {<NEW_LINE>try {<NEW_LINE>final PropertyKey<Long> fileModificationDateKey = StructrApp.key(File.class, "fileModificationDate");<NEW_LINE>final PropertyKey<String> contentTypeKey = StructrApp.key(File.class, "contentType");<NEW_LINE>final PropertyKey<Long> sizeKey = StructrApp.key(File.class, "size");<NEW_LINE>String contentType = file.getContentType();<NEW_LINE>// Don't overwrite existing MIME type<NEW_LINE>if (StringUtils.isBlank(contentType)) {<NEW_LINE>try {<NEW_LINE>contentType = getContentMimeType(file);<NEW_LINE><MASK><NEW_LINE>} catch (IOException ex) {<NEW_LINE>logger.debug("Unable to detect content MIME type", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>map.put(fileModificationDateKey, fileOnDisk.lastModified());<NEW_LINE>if (calcChecksums) {<NEW_LINE>map.putAll(getChecksums(file, fileOnDisk));<NEW_LINE>}<NEW_LINE>if (contentType != null) {<NEW_LINE>// modify type when image type is detected AND the type is "File"<NEW_LINE>if (contentType.startsWith("image/") && Boolean.FALSE.equals(Image.class.isAssignableFrom(file.getClass())) && File.class.getSimpleName().equals(file.getClass().getSimpleName())) {<NEW_LINE>map.put(AbstractNode.type, Image.class.getSimpleName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long fileSize = FileHelper.getSize(fileOnDisk);<NEW_LINE>if (fileSize >= 0) {<NEW_LINE>map.put(sizeKey, fileSize);<NEW_LINE>}<NEW_LINE>file.unlockSystemPropertiesOnce();<NEW_LINE>file.setProperties(SecurityContext.getSuperUserInstance(), map);<NEW_LINE>} catch (IOException ioex) {<NEW_LINE>logger.warn("Unable to access {} on disk: {}", fileOnDisk, ioex.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | map.put(contentTypeKey, contentType); |
189,428 | private //<NEW_LINE>MethodSpec messageEquals(NameAllocator nameAllocator, MessageType type) {<NEW_LINE>NameAllocator localNameAllocator = nameAllocator.clone();<NEW_LINE>String otherName = localNameAllocator.newName("other");<NEW_LINE>String oName = localNameAllocator.newName("o");<NEW_LINE>TypeName javaType = typeName(type.getType());<NEW_LINE>MethodSpec.Builder result = MethodSpec.methodBuilder("equals").addAnnotation(Override.class).addModifiers(PUBLIC).returns(boolean.class).addParameter(Object.class, otherName);<NEW_LINE>result.addStatement("if ($N == this) return true", otherName);<NEW_LINE>result.addStatement("if (!($N instanceof $T)) return false", otherName, javaType);<NEW_LINE>result.addStatement("$T $N = ($T) $N", javaType, oName, javaType, otherName);<NEW_LINE>result.addCode("$[return unknownFields().equals($N.unknownFields())", oName);<NEW_LINE>List<Field> fields = type.getFieldsAndOneOfFields();<NEW_LINE>for (Field field : fields) {<NEW_LINE>String fieldName = localNameAllocator.get(field);<NEW_LINE>if (field.isRequired() || field.isRepeated() || field.getType().isMap()) {<NEW_LINE>result.<MASK><NEW_LINE>} else {<NEW_LINE>result.addCode("\n&& $1T.equals($2L, $3N.$2L)", Internal.class, fieldName, oName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.addCode(";\n$]");<NEW_LINE>return result.build();<NEW_LINE>} | addCode("\n&& $1L.equals($2N.$1L)", fieldName, oName); |
1,091,809 | public FlowableEventListener createEventThrowingEventListener(EventListener eventListener) {<NEW_LINE>BaseDelegateEventListener result = null;<NEW_LINE>if (ImplementationType.IMPLEMENTATION_TYPE_THROW_SIGNAL_EVENT.equals(eventListener.getImplementationType())) {<NEW_LINE>result = new SignalThrowingEventListener();<NEW_LINE>((SignalThrowingEventListener) result).setSignalName(eventListener.getImplementation());<NEW_LINE>((SignalThrowingEventListener) result).setProcessInstanceScope(true);<NEW_LINE>} else if (ImplementationType.IMPLEMENTATION_TYPE_THROW_GLOBAL_SIGNAL_EVENT.equals(eventListener.getImplementationType())) {<NEW_LINE>result = new SignalThrowingEventListener();<NEW_LINE>((SignalThrowingEventListener) result).setSignalName(eventListener.getImplementation());<NEW_LINE>((SignalThrowingEventListener) result).setProcessInstanceScope(false);<NEW_LINE>} else if (ImplementationType.IMPLEMENTATION_TYPE_THROW_MESSAGE_EVENT.equals(eventListener.getImplementationType())) {<NEW_LINE>result = new MessageThrowingEventListener();<NEW_LINE>((MessageThrowingEventListener) result).setMessageName(eventListener.getImplementation());<NEW_LINE>} else if (ImplementationType.IMPLEMENTATION_TYPE_THROW_ERROR_EVENT.equals(eventListener.getImplementationType())) {<NEW_LINE>result = new ErrorThrowingEventListener();<NEW_LINE>((ErrorThrowingEventListener) result).<MASK><NEW_LINE>}<NEW_LINE>if (result == null) {<NEW_LINE>throw new FlowableIllegalArgumentException("Cannot create an event-throwing event-listener, unknown implementation type: " + eventListener.getImplementationType());<NEW_LINE>}<NEW_LINE>result.setEntityClass(getEntityType(eventListener.getEntityType()));<NEW_LINE>return result;<NEW_LINE>} | setErrorCode(eventListener.getImplementation()); |
172,159 | public static void main(String[] args) {<NEW_LINE>CommandSpec spec = CommandSpec.create();<NEW_LINE>spec.addOption(OptionSpec.builder("-V", "--verbose").build());<NEW_LINE>spec.addOption(// so, this option is of type List<File><NEW_LINE>OptionSpec.builder("-f", "--file").paramLabel("FILES").type(List.class).// so, this option is of type List<File><NEW_LINE>auxiliaryTypes(File.class).description("The files to process").build());<NEW_LINE>spec.addOption(OptionSpec.builder("-n", "--num").paramLabel("COUNT").type(int[].class).splitRegex(",").description("Comma-separated list of integers").build());<NEW_LINE>CommandLine commandLine = new CommandLine(spec);<NEW_LINE>args = new String[] { "--verbose", "-f", "file1", "--file=file2", "-n1,2,3" };<NEW_LINE>ParseResult pr = commandLine.parseArgs(args);<NEW_LINE>// Querying for options<NEW_LINE>// lists all command line args<NEW_LINE>List<String<MASK><NEW_LINE>assert Arrays.asList(args).equals(originalArgs);<NEW_LINE>// as specified on command line<NEW_LINE>assert pr.hasMatchedOption("--verbose");<NEW_LINE>// other aliases work also<NEW_LINE>assert pr.hasMatchedOption("-V");<NEW_LINE>// single-character alias works too<NEW_LINE>assert pr.hasMatchedOption('V');<NEW_LINE>// and, command name without hyphens<NEW_LINE>assert pr.hasMatchedOption("verbose");<NEW_LINE>// Matched Option Values<NEW_LINE>List<File> defaultValue = Collections.emptyList();<NEW_LINE>List<File> expected = Arrays.asList(new File("file1"), new File("file2"));<NEW_LINE>assert expected.equals(pr.matchedOptionValue('f', defaultValue));<NEW_LINE>assert expected.equals(pr.matchedOptionValue("--file", defaultValue));<NEW_LINE>assert Arrays.equals(new int[] { 1, 2, 3 }, pr.matchedOptionValue('n', new int[0]));<NEW_LINE>// Command line arguments after splitting but before type conversion<NEW_LINE>assert "1".equals(pr.matchedOption('n').stringValues().get(0));<NEW_LINE>assert "2".equals(pr.matchedOption('n').stringValues().get(1));<NEW_LINE>assert "3".equals(pr.matchedOption('n').stringValues().get(2));<NEW_LINE>// Command line arguments as found on the command line<NEW_LINE>assert "1,2,3".equals(pr.matchedOption("--num").originalStringValues().get(0));<NEW_LINE>} | > originalArgs = pr.originalArgs(); |
1,500,830 | public static <T extends Node & IPannablePane> PanningGestures<T> attachViewPortGestures(T pannableCanvas, boolean configurable) {<NEW_LINE>PanningGestures<T> panningGestures = new PanningGestures<>(pannableCanvas);<NEW_LINE>if (configurable) {<NEW_LINE>panningGestures.useViewportGestures = new SimpleBooleanProperty(true);<NEW_LINE>panningGestures.useViewportGestures.addListener((o, oldVal, newVal) -> {<NEW_LINE>final Parent parent = pannableCanvas.parentProperty().get();<NEW_LINE>if (parent == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (newVal) {<NEW_LINE>parent.addEventHandler(MouseEvent.MOUSE_PRESSED, panningGestures.onMousePressedEventHandler);<NEW_LINE>parent.addEventHandler(MouseEvent.MOUSE_DRAGGED, panningGestures.onMouseDraggedEventHandler);<NEW_LINE>parent.addEventHandler(ScrollEvent.ANY, panningGestures.onScrollEventHandler);<NEW_LINE>} else {<NEW_LINE>parent.removeEventHandler(MouseEvent.MOUSE_PRESSED, panningGestures.onMousePressedEventHandler);<NEW_LINE>parent.removeEventHandler(MouseEvent.MOUSE_DRAGGED, panningGestures.onMouseDraggedEventHandler);<NEW_LINE>parent.removeEventHandler(ScrollEvent.ANY, panningGestures.onScrollEventHandler);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>pannableCanvas.parentProperty().addListener((o, oldVal, newVal) -> {<NEW_LINE>if (oldVal != null) {<NEW_LINE>oldVal.removeEventHandler(MouseEvent.MOUSE_PRESSED, panningGestures.onMousePressedEventHandler);<NEW_LINE>oldVal.removeEventHandler(MouseEvent.MOUSE_DRAGGED, panningGestures.onMouseDraggedEventHandler);<NEW_LINE>oldVal.removeEventHandler(ScrollEvent.ANY, panningGestures.onScrollEventHandler);<NEW_LINE>}<NEW_LINE>if (newVal != null) {<NEW_LINE>newVal.addEventHandler(<MASK><NEW_LINE>newVal.addEventHandler(MouseEvent.MOUSE_DRAGGED, panningGestures.onMouseDraggedEventHandler);<NEW_LINE>newVal.addEventHandler(ScrollEvent.ANY, panningGestures.onScrollEventHandler);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return panningGestures;<NEW_LINE>} | MouseEvent.MOUSE_PRESSED, panningGestures.onMousePressedEventHandler); |
1,676,829 | public void authenticate() throws AlluxioStatusException {<NEW_LINE>LOG.debug("Authenticating channel: {}. AuthType: {}", mChannelKey.toStringShort(), mAuthType);<NEW_LINE>ChannelAuthenticationScheme authScheme = getChannelAuthScheme(mAuthType, mParentSubject, mChannelKey.<MASK><NEW_LINE>try {<NEW_LINE>// Create client-side driver for establishing authenticated channel with the target.<NEW_LINE>mAuthDriver = new AuthenticatedChannelClientDriver(createSaslClientHandler(mChannelKey.getServerAddress(), authScheme, mParentSubject), mChannelKey);<NEW_LINE>// Initialize client-server authentication drivers.<NEW_LINE>SaslAuthenticationServiceGrpc.SaslAuthenticationServiceStub serverStub = SaslAuthenticationServiceGrpc.newStub(mConnection.getChannel());<NEW_LINE>StreamObserver<SaslMessage> requestObserver = serverStub.authenticate(mAuthDriver);<NEW_LINE>mAuthDriver.setServerObserver(requestObserver);<NEW_LINE>// Start authentication with the target. (This is blocking.)<NEW_LINE>long authTimeout = mConfiguration.getMs(PropertyKey.NETWORK_CONNECTION_AUTH_TIMEOUT);<NEW_LINE>mAuthDriver.startAuthenticatedChannel(authTimeout);<NEW_LINE>// Intercept authenticated channel with channel-id injector.<NEW_LINE>mConnection.interceptChannel(new ChannelIdInjector(mChannelKey.getChannelId()));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>AlluxioStatusException e = AlluxioStatusException.fromThrowable(t);<NEW_LINE>// Build a pretty message for authentication failure.<NEW_LINE>String message = String.format("Channel authentication failed with code:%s. Channel: %s, AuthType: %s, Error: %s", e.getStatusCode().name(), mChannelKey.toStringShort(), mAuthType, e.toString());<NEW_LINE>throw AlluxioStatusException.from(Status.fromCode(e.getStatusCode()).withDescription(message).withCause(t));<NEW_LINE>}<NEW_LINE>} | getServerAddress().getSocketAddress()); |
1,062,403 | public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>// noinspection unchecked<NEW_LINE>final List<PlaylistSong> songs = <MASK><NEW_LINE>int title;<NEW_LINE>CharSequence content;<NEW_LINE>if (songs.size() > 1) {<NEW_LINE>title = R.string.remove_songs_from_playlist_title;<NEW_LINE>content = Html.fromHtml(getString(R.string.remove_x_songs_from_playlist, songs.size()));<NEW_LINE>} else {<NEW_LINE>title = R.string.remove_song_from_playlist_title;<NEW_LINE>content = Html.fromHtml(getString(R.string.remove_song_x_from_playlist, songs.get(0).title));<NEW_LINE>}<NEW_LINE>return new MaterialDialog.Builder(getActivity()).title(title).content(content).positiveText(R.string.remove_action).negativeText(android.R.string.cancel).onPositive((dialog, which) -> {<NEW_LINE>if (getActivity() == null)<NEW_LINE>return;<NEW_LINE>PlaylistsUtil.removeFromPlaylist(getActivity(), songs);<NEW_LINE>}).build();<NEW_LINE>} | getArguments().getParcelableArrayList("songs"); |
28,746 | public void updatePet(Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException {<NEW_LINE>Object postBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet", new ApiException(400, "Missing the required parameter 'body' when calling updatePet"));<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String path = "/pet";<NEW_LINE>// query params<NEW_LINE>List<Pair> queryParams = new ArrayList<Pair>();<NEW_LINE>// header params<NEW_LINE>Map<String, String> headerParams = new HashMap<String, String>();<NEW_LINE>// form params<NEW_LINE>Map<String, String> formParams = new HashMap<String, String>();<NEW_LINE>String[<MASK><NEW_LINE>String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";<NEW_LINE>if (contentType.startsWith("multipart/form-data")) {<NEW_LINE>// file uploading<NEW_LINE>MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();<NEW_LINE>HttpEntity httpEntity = localVarBuilder.build();<NEW_LINE>postBody = httpEntity;<NEW_LINE>} else {<NEW_LINE>// normal form params<NEW_LINE>}<NEW_LINE>String[] authNames = new String[] { "petstore_auth" };<NEW_LINE>try {<NEW_LINE>String localVarResponse = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames);<NEW_LINE>if (localVarResponse != null) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (ApiException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (ExecutionException ex) {<NEW_LINE>if (ex.getCause() instanceof VolleyError) {<NEW_LINE>VolleyError volleyError = (VolleyError) ex.getCause();<NEW_LINE>if (volleyError.networkResponse != null) {<NEW_LINE>throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw ex;<NEW_LINE>} catch (TimeoutException ex) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>} | ] contentTypes = { "application/json", "application/xml" }; |
1,687,661 | public void onSetting(PluginSetting setting) {<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_DEBUG, "Start"));<NEW_LINE>if (mCommandArea == null) {<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, "CommandArea is null"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (setting == null) {<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, "setting is null"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (setting.getName().equalsIgnoreCase("Height")) {<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_DEBUG, "Height"));<NEW_LINE>if (Integer.valueOf(setting.getValue()) >= 0) {<NEW_LINE>mHeight = Integer.valueOf(setting.getValue());<NEW_LINE>mCommandArea.setMinimumHeight(mHeight);<NEW_LINE>mCommandAreaPanel.removeAllViews();<NEW_LINE>mCommandAreaPanel.addView(mCommandArea, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, mHeight));<NEW_LINE>}<NEW_LINE>} else if (setting.getName().equalsIgnoreCase("Image")) {<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_DEBUG, "Image"));<NEW_LINE>String newFileName = getButtonPicture(setting.getValue());<NEW_LINE>if (newFileName != null)<NEW_LINE>mBackgroundFileName = newFileName;<NEW_LINE>} else if (setting.getName().equalsIgnoreCase("Color")) {<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_DEBUG, "Color"));<NEW_LINE>if ((setting.getValue() != null) && (setting.getValue().length() > 0)) {<NEW_LINE>try {<NEW_LINE>mColor = Color.<MASK><NEW_LINE>mCommandArea.setBackgroundColor(mColor);<NEW_LINE>} catch (// Color is not recognized<NEW_LINE>IllegalArgumentException e) {<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_DEBUG, e.getMessage()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (setting.getName().equalsIgnoreCase("Visibility")) {<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_DEBUG, "Visibility"));<NEW_LINE>if (setting.getValue().compareToIgnoreCase("visible") == 0) {<NEW_LINE>mCommandAreaPanel.setVisibility(View.VISIBLE);<NEW_LINE>} else if (setting.getValue().compareToIgnoreCase("hidden") == 0) {<NEW_LINE>mCommandAreaPanel.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, "Passed parameter has wrong format"));<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, "Passed URL is not formatted correctly"));<NEW_LINE>}<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_DEBUG, "End"));<NEW_LINE>} | parseColor(setting.getValue()); |
836,957 | int[] computeOffsets(Graphics gg, @Nonnull JComponent component) {<NEW_LINE>if (myPainters.isEmpty())<NEW_LINE>return ArrayUtil.EMPTY_INT_ARRAY;<NEW_LINE>int i = 0;<NEW_LINE>int[] offsets = new int[2 + myPainters.size() * 2];<NEW_LINE>// store current graphics transform<NEW_LINE>Graphics2D g = (Graphics2D) gg;<NEW_LINE>AffineTransform tx = g.getTransform();<NEW_LINE>// graphics tx offsets include graphics scale<NEW_LINE>offsets[i++] = <MASK><NEW_LINE>offsets[i++] = (int) tx.getTranslateY();<NEW_LINE>// calculate relative offsets for painters<NEW_LINE>Rectangle r = null;<NEW_LINE>Component prev = null;<NEW_LINE>for (Painter painter : myPainters) {<NEW_LINE>if (!painter.needsRepaint())<NEW_LINE>continue;<NEW_LINE>Component cur = myPainter2Component.get(painter);<NEW_LINE>if (cur != prev || r == null) {<NEW_LINE>Container curParent = cur.getParent();<NEW_LINE>if (curParent == null)<NEW_LINE>continue;<NEW_LINE>r = SwingUtilities.convertRectangle(curParent, cur.getBounds(), component);<NEW_LINE>prev = cur;<NEW_LINE>}<NEW_LINE>// component offsets don't include graphics scale, so compensate<NEW_LINE>offsets[i++] = (int) (r.x * tx.getScaleX());<NEW_LINE>offsets[i++] = (int) (r.y * tx.getScaleY());<NEW_LINE>}<NEW_LINE>return offsets;<NEW_LINE>} | (int) tx.getTranslateX(); |
132,781 | private void validateSchedulingInfo(boolean schedulingInfoOptional) throws InvalidJobException {<NEW_LINE>if (schedulingInfoOptional && schedulingInfo == null)<NEW_LINE>return;<NEW_LINE>if (schedulingInfo == null)<NEW_LINE>throw new InvalidJobException("No scheduling info provided");<NEW_LINE>if (schedulingInfo.getStages() == null)<NEW_LINE>throw new InvalidJobException("No stages defined in scheduling info");<NEW_LINE>int withNumberOfStages = schedulingInfo.getStages().size();<NEW_LINE>int startingIdx = 1;<NEW_LINE>if (schedulingInfo.forStage(0) != null) {<NEW_LINE>// jobMaster stage 0 definition exists, adjust index range<NEW_LINE>startingIdx = 0;<NEW_LINE>withNumberOfStages--;<NEW_LINE>}<NEW_LINE>for (int i = startingIdx; i <= withNumberOfStages; i++) {<NEW_LINE>StageSchedulingInfo stage = schedulingInfo.getStages().get(i);<NEW_LINE>if (stage == null)<NEW_LINE>throw new InvalidJobException("No definition for stage " + i + " in scheduling info for " + withNumberOfStages + " stage job");<NEW_LINE>if (stage.getNumberOfInstances() < 1)<NEW_LINE>throw new InvalidJobException("Number of instance for stage " + i + " must be >0, not " + stage.getNumberOfInstances());<NEW_LINE>MachineDefinition machineDefinition = stage.getMachineDefinition();<NEW_LINE>if (machineDefinition.getCpuCores() <= 0)<NEW_LINE>throw new InvalidJobException("cpuCores must be >0.0, not " + machineDefinition.getCpuCores());<NEW_LINE>if (machineDefinition.getMemoryMB() <= 0)<NEW_LINE>throw new InvalidJobException(<MASK><NEW_LINE>if (machineDefinition.getDiskMB() < 0)<NEW_LINE>throw new InvalidJobException("disk must be >=0, not " + machineDefinition.getDiskMB());<NEW_LINE>if (machineDefinition.getNumPorts() < 0)<NEW_LINE>throw new InvalidJobException("numPorts must be >=0, not " + machineDefinition.getNumPorts());<NEW_LINE>}<NEW_LINE>} | "memory must be <0.0, not " + machineDefinition.getMemoryMB()); |
1,506,649 | public void onMatch(RelOptRuleCall call) {<NEW_LINE>final HashGroupJoin hashGroupJoin = call.rel(0);<NEW_LINE>RelTraitSet emptyTraitSet = hashGroupJoin.getCluster().getPlanner().emptyTraitSet();<NEW_LINE>RelNode left = convert(hashGroupJoin.getLeft(), emptyTraitSet.replace(MppConvention.INSTANCE));<NEW_LINE>RelNode right = convert(hashGroupJoin.getRight(), emptyTraitSet.replace(MppConvention.INSTANCE));<NEW_LINE>List<Pair<RelDistribution, Pair<RelNode, RelNode>>> <MASK><NEW_LINE>JoinInfo joinInfo = JoinInfo.of(left, right, hashGroupJoin.getEqualCondition());<NEW_LINE>RelDataType keyDataType = CalciteUtils.getJoinKeyDataType(hashGroupJoin.getCluster().getTypeFactory(), hashGroupJoin, joinInfo.leftKeys, joinInfo.rightKeys);<NEW_LINE>// Hash Shuffle<NEW_LINE>RelNode hashLeft = RuleUtils.ensureKeyDataTypeDistribution(left, keyDataType, joinInfo.leftKeys);<NEW_LINE>RelNode hashRight = RuleUtils.ensureKeyDataTypeDistribution(right, keyDataType, joinInfo.rightKeys);<NEW_LINE>implementationList.add(Pair.of(RelDistributions.ANY, Pair.of(hashLeft, hashRight)));<NEW_LINE>if (PlannerContext.getPlannerContext(call).getParamManager().getBoolean(ConnectionParams.ENABLE_BROADCAST_JOIN)) {<NEW_LINE>// Broadcast Shuffle<NEW_LINE>RelNode broadCostLeft = convert(left, left.getTraitSet().replace(RelDistributions.BROADCAST_DISTRIBUTED));<NEW_LINE>implementationList.add(Pair.of(RelDistributions.ANY, Pair.of(broadCostLeft, right)));<NEW_LINE>RelNode broadcastRight = convert(right, right.getTraitSet().replace(RelDistributions.BROADCAST_DISTRIBUTED));<NEW_LINE>implementationList.add(Pair.of(RelDistributions.ANY, Pair.of(left, broadcastRight)));<NEW_LINE>}<NEW_LINE>for (Pair<RelDistribution, Pair<RelNode, RelNode>> implementation : implementationList) {<NEW_LINE>HashGroupJoin newHashGroupJoin = hashGroupJoin.copy(hashGroupJoin.getTraitSet().replace(MppConvention.INSTANCE).replace(implementation.left), hashGroupJoin.getCondition(), implementation.right.left, implementation.right.right, hashGroupJoin.getJoinType(), hashGroupJoin.isSemiJoinDone());<NEW_LINE>call.transformTo(newHashGroupJoin);<NEW_LINE>}<NEW_LINE>} | implementationList = new ArrayList<>(); |
479,423 | private void mountComponentInternal(@Nullable Rect currentVisibleArea, boolean processVisibilityOutputs) {<NEW_LINE>final LayoutState layoutState = mMainThreadLayoutState;<NEW_LINE>if (layoutState == null) {<NEW_LINE>Log.w(TAG, "Main Thread Layout state is not found");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// We are investigating a crash where mLithoView becomes null during the execution of this<NEW_LINE>// function. Use a local copy.<NEW_LINE>final LithoView lithoViewRef = mLithoView;<NEW_LINE>if (lithoViewRef == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final boolean isDirtyMount = lithoViewRef.isMountStateDirty();<NEW_LINE>mIsMounting = true;<NEW_LINE>if (!mHasMounted) {<NEW_LINE>mIsFirstMount = true;<NEW_LINE>mHasMounted = true;<NEW_LINE>}<NEW_LINE>// currentVisibleArea null or empty => mount all<NEW_LINE>try {<NEW_LINE>lithoViewRef.<MASK><NEW_LINE>if (isDirtyMount) {<NEW_LINE>recordRenderData(layoutState);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw ComponentUtils.wrapWithMetadata(this, e);<NEW_LINE>} finally {<NEW_LINE>mIsMounting = false;<NEW_LINE>mRootHeightAnimation = null;<NEW_LINE>mRootWidthAnimation = null;<NEW_LINE>if (isDirtyMount) {<NEW_LINE>lithoViewRef.onDirtyMountComplete();<NEW_LINE>if (mLithoView == null) {<NEW_LINE>ComponentsReporter.emitMessage(ComponentsReporter.LogLevel.WARNING, M_LITHO_VIEW_IS_NULL, "mLithoView is unexpectedly null");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | mount(layoutState, currentVisibleArea, processVisibilityOutputs); |
1,732,994 | private void unprotectedRemoveJobReleatedMeta(LoadJob job) {<NEW_LINE>long dbId = job.getDbId();<NEW_LINE>String label = job.getLabel();<NEW_LINE>// 1. remove from idToLoadJob<NEW_LINE>idToLoadJob.<MASK><NEW_LINE>// 2. remove from dbIdToLabelToLoadJobs<NEW_LINE>Map<String, List<LoadJob>> labelToLoadJobs = dbIdToLabelToLoadJobs.get(dbId);<NEW_LINE>List<LoadJob> sameLabelJobs = labelToLoadJobs.get(label);<NEW_LINE>sameLabelJobs.remove(job);<NEW_LINE>if (sameLabelJobs.isEmpty()) {<NEW_LINE>labelToLoadJobs.remove(label);<NEW_LINE>}<NEW_LINE>if (labelToLoadJobs.isEmpty()) {<NEW_LINE>dbIdToLabelToLoadJobs.remove(dbId);<NEW_LINE>}<NEW_LINE>// 3. remove spark launcher log<NEW_LINE>if (job instanceof SparkLoadJob) {<NEW_LINE>((SparkLoadJob) job).clearSparkLauncherLog();<NEW_LINE>}<NEW_LINE>} | remove(job.getId()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.