idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,097,540 | public void initialize(Python3Core core) {<NEW_LINE>super.initialize(core);<NEW_LINE>ArrayList<String> haveFunctions = new ArrayList<>();<NEW_LINE>Collections.addAll(haveFunctions, "HAVE_FACCESSAT", "HAVE_FCHDIR", "HAVE_FCHMOD", "HAVE_FCHMODAT", "HAVE_FDOPENDIR", "HAVE_FSTATAT", "HAVE_FTRUNCATE", "HAVE_FUTIMES", "HAVE_LUTIMES", "HAVE_MKDIRAT", "HAVE_OPENAT", "HAVE_READLINKAT", "HAVE_RENAMEAT", "HAVE_SYMLINKAT", "HAVE_UNLINKAT");<NEW_LINE>// Not implemented yet:<NEW_LINE>// "HAVE_FCHOWN", "HAVE_FCHOWNAT", "HAVE_FEXECVE", "HAVE_FPATHCONF", "HAVE_FSTATVFS",<NEW_LINE>// "HAVE_FUTIMESAT", "HAVE_LINKAT", "HAVE_LCHFLAGS", "HAVE_LCHMOD", "HAVE_LCHOWN",<NEW_LINE>// "HAVE_LSTAT", "HAVE_MEMFD_CREATE", "HAVE_MKFIFOAT", "HAVE_MKNODAT"<NEW_LINE>if (PosixConstants.HAVE_FUTIMENS.value) {<NEW_LINE>haveFunctions.add("HAVE_FUTIMENS");<NEW_LINE>}<NEW_LINE>if (PosixConstants.HAVE_UTIMENSAT.value) {<NEW_LINE>haveFunctions.add("HAVE_UTIMENSAT");<NEW_LINE>}<NEW_LINE>builtinConstants.put("_have_functions", core.factory().createList(haveFunctions.toArray()));<NEW_LINE>builtinConstants.put("environ", core.factory().createDict());<NEW_LINE>StructSequence.initType(core, STAT_RESULT_DESC);<NEW_LINE>StructSequence.initType(core, TERMINAL_SIZE_DESC);<NEW_LINE>StructSequence.initType(core, UNAME_RESULT_DESC);<NEW_LINE>// The stat_result and terminal_size classes are formally part of the 'os' module, although<NEW_LINE>// they are exposed by the 'posix' module. In CPython, they are defined in posixmodule.c,<NEW_LINE>// with their __module__ being set to 'os', and later they are imported by os.py.<NEW_LINE>// Our infrastructure in PythonBuiltinClassType currently does not allow us to<NEW_LINE>// define a class in one module (os) and make it public in another (posix), so we create<NEW_LINE>// them directly in the 'os' module, and expose them in the `posix` module as well.<NEW_LINE>// Note that the classes are still re-imported by os.py.<NEW_LINE>PythonModule posix = core.lookupBuiltinModule("posix");<NEW_LINE>posix.setAttribute(PythonBuiltinClassType.PStatResult.getName(), core.lookupType(PythonBuiltinClassType.PStatResult));<NEW_LINE>posix.setAttribute(PythonBuiltinClassType.PTerminalSize.getName(), core.lookupType(PythonBuiltinClassType.PTerminalSize));<NEW_LINE>posix.setAttribute("error", core<MASK><NEW_LINE>} | .lookupType(PythonBuiltinClassType.OSError)); |
761,785 | public DescribeReplicationInstancesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeReplicationInstancesResult describeReplicationInstancesResult = new DescribeReplicationInstancesResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeReplicationInstancesResult;<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("Marker", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeReplicationInstancesResult.setMarker(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ReplicationInstances", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeReplicationInstancesResult.setReplicationInstances(new ListUnmarshaller<ReplicationInstance>(ReplicationInstanceJsonUnmarshaller.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 describeReplicationInstancesResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
230,684 | public List<Environment> listEnvironments(@NonNull final Cluster cluster, final String environmentNamePrefix) throws InternalServiceException {<NEW_LINE>try {<NEW_LINE>final DynamoDBQueryExpression<EnvironmentDDBRecord> queryExpression = new DynamoDBQueryExpression<EnvironmentDDBRecord>().withHashKeyValues(EnvironmentDDBRecord.withHashKeys(cluster.generateAccountIdCluster()));<NEW_LINE>if (environmentNamePrefix != null) {<NEW_LINE>queryExpression.withRangeKeyCondition(ENVIRONMENT_NAME_RANGE_KEY, new Condition().withComparisonOperator(ComparisonOperator.BEGINS_WITH).withAttributeValueList(new AttributeValue().withS(environmentNamePrefix)));<NEW_LINE>}<NEW_LINE>return dynamoDBMapper.query(EnvironmentDDBRecord.class, queryExpression).stream().map(environmentMapper::toEnvironment).collect(Collectors.toList());<NEW_LINE>} catch (final AmazonServiceException e) {<NEW_LINE>throw new InternalServiceException(String.format("Could not query environments for cluster %s", cluster<MASK><NEW_LINE>}<NEW_LINE>} | .toString()), e); |
1,714,588 | protected void loadData() {<NEW_LINE>data = new LinkedHashMap<String, Vector>();<NEW_LINE>for (MWMInOutBoundLine inBoundline : getInOutBoundLines()) {<NEW_LINE>inBoundline.setMovementQty(Env.ZERO);<NEW_LINE>inBoundline.saveEx();<NEW_LINE>}<NEW_LINE>for (MWMInOutBoundLineMA inBoundlineMA : getDocumentLines()) {<NEW_LINE>MProduct product = null;<NEW_LINE>MAttributeSetInstance asi = null;<NEW_LINE>String lotNo = null;<NEW_LINE>String serNo = null;<NEW_LINE>Integer referenceId = null;<NEW_LINE>BigDecimal qty = null;<NEW_LINE>boolean reset = false;<NEW_LINE>MWMInOutBoundLine inBoundline = (MWMInOutBoundLine) inBoundlineMA.getWM_InOutBoundLine();<NEW_LINE>// inBoundline.setMovementQty(Env.ZERO);<NEW_LINE>// inBoundline.saveEx();<NEW_LINE>int M_Product_ID = inBoundline.getM_Product_ID();<NEW_LINE>int M_AttributeSetInstance_ID = inBoundlineMA.getM_AttributeSetInstance_ID();<NEW_LINE>if (M_Product_ID > 0)<NEW_LINE>product = MProduct.get(Env.getCtx(), M_Product_ID);<NEW_LINE>else<NEW_LINE>continue;<NEW_LINE>if (M_AttributeSetInstance_ID > 0) {<NEW_LINE>asi = new MAttributeSetInstance(Env.getCtx(), M_AttributeSetInstance_ID, null);<NEW_LINE>lotNo = asi.getLot();<NEW_LINE>serNo = asi.getSerNo();<NEW_LINE>} else {<NEW_LINE>M_AttributeSetInstance_ID = 0;<NEW_LINE>reset = true;<NEW_LINE>}<NEW_LINE>// referenceId = inBoundline.getC_OrderLine_ID();<NEW_LINE>qty = inBoundlineMA.getMovementQty();<NEW_LINE>ArrayList<Object> values = null;<NEW_LINE>while (qty.signum() != 0) {<NEW_LINE>if (getSource() != null && source.size() > 0) {<NEW_LINE>values = checkProduct(product, qty, reset);<NEW_LINE>if (values == null)<NEW_LINE>throw new AdempiereException("@M_Product_ID@ ; " + product.getName() + " @InValid@");<NEW_LINE>}<NEW_LINE>referenceId = (Integer) values.get(ID);<NEW_LINE><MASK><NEW_LINE>if (lotNo != null && lotNo.length() > 0)<NEW_LINE>key = key + lotNo;<NEW_LINE>if (serNo != null && serNo.length() > 0)<NEW_LINE>key = key + serNo;<NEW_LINE>if (serNo == null)<NEW_LINE>key = key + "#" + referenceId;<NEW_LINE>Vector<Object> line = new Vector<Object>(6);<NEW_LINE>line.add(product.getValue());<NEW_LINE>line.add(product.getName());<NEW_LINE>line.add(lotNo);<NEW_LINE>line.add(serNo);<NEW_LINE>BigDecimal qtyDelivered = (BigDecimal) values.get(QTY_DELIVERED);<NEW_LINE>qty = qty.subtract(qtyDelivered);<NEW_LINE>line.add(qtyDelivered);<NEW_LINE>line.add(inBoundline.get_ID());<NEW_LINE>line.add(referenceId != null ? referenceId.intValue() : 0);<NEW_LINE>data.put(key, line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String key = product.getValue(); |
1,041,156 | protected void forward(int offset, ChronoUnit unit, boolean focusDayCell, boolean withAnimation) {<NEW_LINE>if (withAnimation) {<NEW_LINE>if (tempImageTransition == null || tempImageTransition.getStatus() == Status.STOPPED) {<NEW_LINE>Pane monthContent = (Pane) calendarPlaceHolder.getChildren().get(0);<NEW_LINE>this.getParent().setManaged(false);<NEW_LINE>SnapshotParameters snapShotparams = new SnapshotParameters();<NEW_LINE><MASK><NEW_LINE>WritableImage temp = monthContent.snapshot(snapShotparams, new WritableImage((int) monthContent.getWidth(), (int) monthContent.getHeight()));<NEW_LINE>ImageView tempImage = new ImageView(temp);<NEW_LINE>calendarPlaceHolder.getChildren().add(calendarPlaceHolder.getChildren().size() - 2, tempImage);<NEW_LINE>TranslateTransition imageTransition = new TranslateTransition(Duration.millis(160), tempImage);<NEW_LINE>imageTransition.setToX(-offset * calendarPlaceHolder.getWidth());<NEW_LINE>imageTransition.setOnFinished((finish) -> calendarPlaceHolder.getChildren().remove(tempImage));<NEW_LINE>monthContent.setTranslateX(offset * calendarPlaceHolder.getWidth());<NEW_LINE>TranslateTransition contentTransition = new TranslateTransition(Duration.millis(160), monthContent);<NEW_LINE>contentTransition.setToX(0);<NEW_LINE>tempImageTransition = new ParallelTransition(imageTransition, contentTransition);<NEW_LINE>tempImageTransition.setOnFinished((finish) -> {<NEW_LINE>calendarPlaceHolder.getChildren().remove(tempImage);<NEW_LINE>this.getParent().setManaged(true);<NEW_LINE>});<NEW_LINE>tempImageTransition.play();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>YearMonth yearMonth = selectedYearMonth.get();<NEW_LINE>DateCell dateCell = currentFocusedDayCell;<NEW_LINE>if (dateCell == null || !(dayCellDate(dateCell).getMonth() == yearMonth.getMonth())) {<NEW_LINE>dateCell = findDayCellOfDate(yearMonth.atDay(1));<NEW_LINE>}<NEW_LINE>goToDayCell(dateCell, offset, unit, focusDayCell);<NEW_LINE>} | snapShotparams.setFill(Color.TRANSPARENT); |
889,002 | private void createRangeIndexForColumn(SegmentDirectory.Writer segmentWriter, ColumnMetadata columnMetadata, RangeIndexCreatorProvider indexCreatorProvider) throws IOException {<NEW_LINE>File indexDir = _segmentMetadata.getIndexDir();<NEW_LINE>String segmentName = _segmentMetadata.getName();<NEW_LINE>String columnName = columnMetadata.getColumnName();<NEW_LINE>File inProgress = new File(indexDir, columnName + ".range.inprogress");<NEW_LINE>File rangeIndexFile = new File(indexDir, columnName + V1Constants.Indexes.BITMAP_RANGE_INDEX_FILE_EXTENSION);<NEW_LINE>if (!inProgress.exists()) {<NEW_LINE>// Marker file does not exist, which means last run ended normally.<NEW_LINE>// Create a marker file.<NEW_LINE>FileUtils.touch(inProgress);<NEW_LINE>} else {<NEW_LINE>// Marker file exists, which means last run gets interrupted.<NEW_LINE>// Remove range index if exists.<NEW_LINE>// For v1 and v2, it's the actual range index. For v3, it's the temporary range index.<NEW_LINE>FileUtils.deleteQuietly(rangeIndexFile);<NEW_LINE>}<NEW_LINE>// Create new range index for the column.<NEW_LINE>LOGGER.info("Creating new range index for segment: {}, column: {}", segmentName, columnName);<NEW_LINE>if (columnMetadata.hasDictionary()) {<NEW_LINE>handleDictionaryBasedColumn(segmentWriter, columnMetadata, indexCreatorProvider);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// For v3, write the generated range index file into the single file and remove it.<NEW_LINE>if (_segmentMetadata.getVersion() == SegmentVersion.v3) {<NEW_LINE>LoaderUtils.writeIndexToV3Format(segmentWriter, columnName, rangeIndexFile, ColumnIndexType.RANGE_INDEX);<NEW_LINE>}<NEW_LINE>// Delete the marker file.<NEW_LINE>FileUtils.deleteQuietly(inProgress);<NEW_LINE>LOGGER.info("Created range index for segment: {}, column: {}", segmentName, columnName);<NEW_LINE>} | handleNonDictionaryBasedColumn(segmentWriter, columnMetadata, indexCreatorProvider); |
290,477 | public EmojiPopup build(@NonNull final EditText editText) {<NEW_LINE>EmojiManager.getInstance().verifyInstalled();<NEW_LINE>checkNotNull(editText, "EditText can't be null");<NEW_LINE>if (recentEmoji == null) {<NEW_LINE>recentEmoji = new <MASK><NEW_LINE>}<NEW_LINE>final EmojiPopup emojiPopup = new EmojiPopup(this, editText);<NEW_LINE>emojiPopup.onSoftKeyboardCloseListener = onSoftKeyboardCloseListener;<NEW_LINE>emojiPopup.onEmojiClickListener = onEmojiClickListener;<NEW_LINE>emojiPopup.onSoftKeyboardOpenListener = onSoftKeyboardOpenListener;<NEW_LINE>emojiPopup.onEmojiPopupShownListener = onEmojiPopupShownListener;<NEW_LINE>emojiPopup.onEmojiPopupDismissListener = onEmojiPopupDismissListener;<NEW_LINE>emojiPopup.onEmojiBackspaceClickListener = onEmojiBackspaceClickListener;<NEW_LINE>emojiPopup.popupWindowHeight = Math.max(popupWindowHeight, 0);<NEW_LINE>return emojiPopup;<NEW_LINE>} | RecentEmojiManager(rootView.getContext()); |
1,702,662 | private static void parseCurve(Element plotElem, ProductPlot plotObj) {<NEW_LINE>ProductCurve curve = null;<NEW_LINE>NodeList childElements = plotElem.getElementsByTagName("curve");<NEW_LINE>if (childElements != null && childElements.getLength() > 0) {<NEW_LINE>for (int i = 0; i < childElements.getLength(); i++) {<NEW_LINE>curve = new ProductCurve();<NEW_LINE>Element curveElem = (<MASK><NEW_LINE>// check to see if there is any <varcase> ... </varcase><NEW_LINE>NodeList varcaseElements = curveElem.getElementsByTagName("varcase");<NEW_LINE>if (varcaseElements != null && varcaseElements.getLength() > 0) {<NEW_LINE>for (int j = 0; j < varcaseElements.getLength(); j++) {<NEW_LINE>Element varcaseElem = (Element) varcaseElements.item(j);<NEW_LINE>NodeList varElements = varcaseElem.getElementsByTagName("var");<NEW_LINE>ProductVarcase varcase = new ProductVarcase();<NEW_LINE>parseVarList(varElements, varcaseElem, varcase);<NEW_LINE>curve.addVarcase(varcase);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// otherwise retrieve <var> ...</var><NEW_LINE>NodeList varElements = curveElem.getElementsByTagName("var");<NEW_LINE>parseVarList(varElements, curveElem, curve);<NEW_LINE>}<NEW_LINE>plotObj.addCurve(curve);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Element) childElements.item(i); |
626,596 | protected void computeWeightedScore(int c_x, int c_y) {<NEW_LINE>// compute the score for each angle in the histogram<NEW_LINE>for (int y = rect.y0; y < rect.y1; y++) {<NEW_LINE>int indexX = derivX.startIndex + derivX.stride * y + rect.x0;<NEW_LINE>int indexY = derivY.startIndex + derivY.stride * y + rect.x0;<NEW_LINE>int indexW = (y - c_y + radiusScale) * weights.width + rect.x0 - c_x + radiusScale;<NEW_LINE>for (int x = rect.x0; x < rect.x1; x++, indexX++, indexY++, indexW++) {<NEW_LINE>float w = weights.data[indexW];<NEW_LINE>short dx = derivX.data[indexX];<NEW_LINE>short dy = derivY.data[indexY];<NEW_LINE>double angle = Math.atan2(dy, dx);<NEW_LINE>// compute which discretized angle it is<NEW_LINE>int discreteAngle = (int) ((angle <MASK><NEW_LINE>// sum up the "score" for this angle<NEW_LINE>sumDerivX[discreteAngle] += w * dx;<NEW_LINE>sumDerivY[discreteAngle] += w * dy;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | + angleRound) / angleDiv) % numAngles; |
1,367,713 | private void generateReleaseNotes(Project project, ProjectLayout layout, TaskContainer tasks, GradleDocumentationExtension extension) {<NEW_LINE>TaskProvider<RenderMarkdown> releaseNotesMarkdown = tasks.register("releaseNotesMarkdown", RenderMarkdown.class, task -> {<NEW_LINE>task.setGroup("release notes");<NEW_LINE>task.setDescription("Generate release notes HTML page from Markdown.");<NEW_LINE>task.getInputEncoding().convention(Charset.defaultCharset().name());<NEW_LINE>task.getOutputEncoding().convention(Charset.defaultCharset().name());<NEW_LINE>task.getMarkdownFile().convention(extension.getReleaseNotes().getMarkdownFile());<NEW_LINE>task.getDestinationFile().convention(extension.getStagingRoot().file("release-notes/raw.html"));<NEW_LINE>});<NEW_LINE>TaskProvider<DecorateReleaseNotes> releaseNotesPostProcess = tasks.register("releaseNotes", DecorateReleaseNotes.class, task -> {<NEW_LINE>task.setGroup("release notes");<NEW_LINE>task.setDescription("Transforms generated release notes.");<NEW_LINE>task.getHtmlFile().convention(releaseNotesMarkdown.flatMap(RenderMarkdown::getDestinationFile));<NEW_LINE>task.getBaseCssFile().convention(extension.getReleaseNotes().getBaseCssFile());<NEW_LINE>task.getReleaseNotesCssFile().convention(extension.getReleaseNotes().getReleaseNotesCssFile());<NEW_LINE>task.getReleaseNotesJavascriptFile().convention(extension.getReleaseNotes().getReleaseNotesJsFile());<NEW_LINE>task.getJquery().from(extension.getReleaseNotes().getJquery());<NEW_LINE>ModuleIdentityExtension moduleIdentity = project.getExtensions().getByType(ModuleIdentityExtension.class);<NEW_LINE>MapProperty<String, String> replacementTokens = task.getReplacementTokens();<NEW_LINE>replacementTokens.put("version", moduleIdentity.getVersion().map(GradleVersion::getVersion));<NEW_LINE>replacementTokens.put("baseVersion", moduleIdentity.getVersion().map(v -> v.getBaseVersion().getVersion()));<NEW_LINE>task.getDestinationFile().convention(extension.getStagingRoot<MASK><NEW_LINE>});<NEW_LINE>Configuration jquery = project.getConfigurations().create("jquery", conf -> {<NEW_LINE>conf.setDescription("JQuery dependencies embedded by release notes.");<NEW_LINE>});<NEW_LINE>extension.releaseNotes(releaseNotes -> {<NEW_LINE>releaseNotes.getMarkdownFile().convention(extension.getSourceRoot().file("release/notes.md"));<NEW_LINE>releaseNotes.getRenderedDocumentation().convention(releaseNotesPostProcess.flatMap(DecorateReleaseNotes::getDestinationFile));<NEW_LINE>releaseNotes.getBaseCssFile().convention(extension.getSourceRoot().file("css/base.css"));<NEW_LINE>releaseNotes.getReleaseNotesCssFile().convention(extension.getSourceRoot().file("css/release-notes.css"));<NEW_LINE>releaseNotes.getReleaseNotesJsFile().convention(extension.getSourceRoot().file("release/content/script.js"));<NEW_LINE>releaseNotes.getJquery().from(jquery);<NEW_LINE>});<NEW_LINE>} | ().file("release-notes/release-notes.html")); |
768,578 | public void asyncReadEntry(ReadHandle lh, long firstEntry, long lastEntry, boolean isSlowestReader, final ReadEntriesCallback callback, Object ctx) {<NEW_LINE>lh.readAsync(firstEntry, lastEntry).thenAcceptAsync(ledgerEntries -> {<NEW_LINE>List<Entry> entries = Lists.newArrayList();<NEW_LINE>long totalSize = 0;<NEW_LINE>try {<NEW_LINE>for (LedgerEntry e : ledgerEntries) {<NEW_LINE>// Insert the entries at the end of the list (they will be unsorted for now)<NEW_LINE>EntryImpl entry = create(e, interceptor);<NEW_LINE>entries.add(entry);<NEW_LINE>totalSize += entry.getLength();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>ledgerEntries.close();<NEW_LINE>}<NEW_LINE>mlFactoryMBean.recordCacheMiss(entries.size(), totalSize);<NEW_LINE>ml.mbean.addReadEntriesSample(entries.size(), totalSize);<NEW_LINE><MASK><NEW_LINE>}, ml.getExecutor().chooseThread(ml.getName())).exceptionally(exception -> {<NEW_LINE>callback.readEntriesFailed(createManagedLedgerException(exception), ctx);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>} | callback.readEntriesComplete(entries, ctx); |
658,084 | private DeployInheritInfo createInfo(Class<?> cls) {<NEW_LINE>DeployInheritInfo info = new DeployInheritInfo(cls);<NEW_LINE>Class<?> parent = findParent(cls);<NEW_LINE>if (parent != null) {<NEW_LINE>info.setParent(parent);<NEW_LINE>}<NEW_LINE>Inheritance ia = AnnotationUtil.typeGet(cls, Inheritance.class);<NEW_LINE>if (ia != null) {<NEW_LINE>ia.strategy();<NEW_LINE>}<NEW_LINE>DiscriminatorColumn da = AnnotationUtil.typeGet(cls, DiscriminatorColumn.class);<NEW_LINE>if (da != null) {<NEW_LINE>// lowercase the discriminator column for RawSql and JSON<NEW_LINE>info.setColumnName(da.name().toLowerCase());<NEW_LINE>DiscriminatorType discriminatorType = da.discriminatorType();<NEW_LINE>info.setColumnType(discriminatorType);<NEW_LINE>if (discriminatorType == DiscriminatorType.STRING) {<NEW_LINE>info.<MASK><NEW_LINE>}<NEW_LINE>info.setColumnDefn(da.columnDefinition());<NEW_LINE>}<NEW_LINE>if (!info.isAbstract()) {<NEW_LINE>// do not search recursive<NEW_LINE>DiscriminatorValue dv = AnnotationUtil.get(cls, DiscriminatorValue.class);<NEW_LINE>if (dv != null) {<NEW_LINE>info.setDiscriminatorValue(dv.value());<NEW_LINE>} else {<NEW_LINE>info.setDiscriminatorDefaultValue(cls);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return info;<NEW_LINE>} | setColumnLength(da.length()); |
1,203,300 | public void run(@Nonnull final ProgressIndicator indicator) {<NEW_LINE>myIndicator = indicator;<NEW_LINE>long startCompilationStamp = System.currentTimeMillis();<NEW_LINE>indicator.setIndeterminate(false);<NEW_LINE>myBuildViewService.onStart(mySessionId, startCompilationStamp, () -> {<NEW_LINE>}, indicator);<NEW_LINE>final Semaphore semaphore = ((CompilerManagerImpl) CompilerManager.getInstance(myProject)).getCompilationSemaphore();<NEW_LINE>boolean acquired = false;<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>while (!acquired) {<NEW_LINE>acquired = semaphore.tryAcquire(300, TimeUnit.MILLISECONDS);<NEW_LINE>if (!acquired && !myWaitForPreviousSession) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (indicator.isCanceled()) {<NEW_LINE>// give up obtaining the semaphore,<NEW_LINE>// let compile work begin in order to stop gracefuly on cancel event<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ignored) {<NEW_LINE>}<NEW_LINE>if (!isHeadless()) {<NEW_LINE>addIndicatorDelegate();<NEW_LINE>}<NEW_LINE>myCompileWork.run();<NEW_LINE>} catch (ProcessCanceledException ignored) {<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>indicator.stop();<NEW_LINE>myBuildViewService.<MASK><NEW_LINE>} finally {<NEW_LINE>if (acquired) {<NEW_LINE>semaphore.release();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | onEnd(mySessionId, myExitStatus, myEndCompilationStamp); |
1,491,970 | private boolean httpPostSend(String successCode, String urlPrefix, String content) {<NEW_LINE>URL url = null;<NEW_LINE>InputStream in = null;<NEW_LINE>OutputStreamWriter writer = null;<NEW_LINE>URLConnection conn = null;<NEW_LINE>boolean sendSuccess = false;<NEW_LINE>try {<NEW_LINE>url = new URL(urlPrefix);<NEW_LINE>conn = url.openConnection();<NEW_LINE>conn.setConnectTimeout(2000);<NEW_LINE>conn.setReadTimeout(3000);<NEW_LINE>conn.setDoOutput(true);<NEW_LINE>conn.setDoInput(true);<NEW_LINE>conn.setRequestProperty("content-type", "application/x-www-form-urlencoded;charset=UTF-8");<NEW_LINE>writer = new <MASK><NEW_LINE>writer.write(content);<NEW_LINE>writer.flush();<NEW_LINE>in = conn.getInputStream();<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(Files.forIO().readFrom(in, "utf-8")).append("");<NEW_LINE>if (sb.toString().contains(successCode)) {<NEW_LINE>sendSuccess = true;<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>m_logger.error(e.getMessage(), e);<NEW_LINE>return false;<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (in != null) {<NEW_LINE>in.close();<NEW_LINE>}<NEW_LINE>if (writer != null) {<NEW_LINE>writer.close();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>}<NEW_LINE>if (!sendSuccess) {<NEW_LINE>recordSendLog(urlPrefix, content);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | OutputStreamWriter(conn.getOutputStream()); |
1,476,592 | public int compareTo(@Nonnull GuildChannel o) {<NEW_LINE><MASK><NEW_LINE>// if bucket matters<NEW_LINE>if (getType().getSortBucket() != o.getType().getSortBucket())<NEW_LINE>return Integer.compare(getType().getSortBucket(), o.getType().getSortBucket());<NEW_LINE>// if position matters<NEW_LINE>if (o instanceof IPositionableChannel && this instanceof IPositionableChannel) {<NEW_LINE>IPositionableChannel oPositionableChannel = (IPositionableChannel) o;<NEW_LINE>IPositionableChannel thisPositionableChannel = (IPositionableChannel) this;<NEW_LINE>if (thisPositionableChannel.getPositionRaw() != oPositionableChannel.getPositionRaw()) {<NEW_LINE>return Integer.compare(thisPositionableChannel.getPositionRaw(), oPositionableChannel.getPositionRaw());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// last resort by id<NEW_LINE>return Long.compareUnsigned(id, o.getIdLong());<NEW_LINE>} | Checks.notNull(o, "Channel"); |
1,568,850 | private void processBean(boolean register, Object bean) {<NEW_LINE>U.notNull(bean, "bean");<NEW_LINE>U.must(!((bean instanceof Class<?>)), "The bean must be an instance, not a class!");<NEW_LINE>Class<?> clazz = bean.getClass();<NEW_LINE>if (!Cls.isAppBeanType(clazz)) {<NEW_LINE>throw new RuntimeException("Expected a bean, but found value of type: " + clazz.getName());<NEW_LINE>}<NEW_LINE>if (!Msc.matchingProfile(clazz)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Log.debug("Processing bean", <MASK><NEW_LINE>List<String> componentPaths = getControllerUris(clazz);<NEW_LINE>for (String ctxPath : componentPaths) {<NEW_LINE>for (Method method : Cls.getMethods(clazz)) {<NEW_LINE>if (shouldExpose(method)) {<NEW_LINE>registerOrDeregister(register, bean, ctxPath, method);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "class", clazz, "instance", bean); |
1,175,951 | public void done(IJobChangeEvent event) {<NEW_LINE>if (imageData[0] != null) {<NEW_LINE>UIUtils.getDisplay().asyncExec(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>Image image = new Image(UIUtils.getDisplay(), imageData[0]);<NEW_LINE>if (image != null) {<NEW_LINE>// Scale the image to 48x48 in case it's not.<NEW_LINE><MASK><NEW_LINE>if (scaledImageData.x != IMAGE_SIZE || scaledImageData.y != IMAGE_SIZE) {<NEW_LINE>// dispose the previous one<NEW_LINE>image.dispose();<NEW_LINE>// Scale the image data and create a new image<NEW_LINE>scaledImageData = scaledImageData.scaledTo(IMAGE_SIZE, IMAGE_SIZE);<NEW_LINE>image = ImageDescriptor.createFromImageData(scaledImageData).createImage();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>label.setImage(image);<NEW_LINE>templateImages.put(template, image);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | ImageData scaledImageData = image.getImageData(); |
834,111 | final DescribeClientVpnRoutesResult executeDescribeClientVpnRoutes(DescribeClientVpnRoutesRequest describeClientVpnRoutesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeClientVpnRoutesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeClientVpnRoutesRequest> request = null;<NEW_LINE>Response<DescribeClientVpnRoutesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeClientVpnRoutesRequestMarshaller().marshall(super.beforeMarshalling(describeClientVpnRoutesRequest));<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, "DescribeClientVpnRoutes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeClientVpnRoutesResult> responseHandler = new StaxResponseHandler<DescribeClientVpnRoutesResult>(new DescribeClientVpnRoutesResultStaxUnmarshaller());<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()); |
604,556 | /*<NEW_LINE>* Recover syntax on invalid qualified name.<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected Object syntaxRecoverQualifiedName(int primitiveToken) throws InvalidInputException {<NEW_LINE>if (this.cursorLocation == ((int) this.identifierPositionStack[this.identifierPtr])) {<NEW_LINE>// special case of completion just before the dot.<NEW_LINE>return createTypeReference(primitiveToken);<NEW_LINE>}<NEW_LINE>int idLength = this.identifierLengthStack[this.identifierLengthPtr];<NEW_LINE>char[][] tokens = new char[idLength][];<NEW_LINE>int startPtr = this.identifierPtr - idLength + 1;<NEW_LINE>System.arraycopy(this.identifierStack, startPtr, tokens, 0, idLength);<NEW_LINE>long[] positions = new long[idLength + 1];<NEW_LINE>System.arraycopy(this.identifierPositionStack, startPtr, positions, 0, idLength);<NEW_LINE>positions[idLength] = (((long) this.tokenPreviousPosition) << 32) + this.tokenPreviousPosition;<NEW_LINE>this.completionNode = new CompletionOnJavadocQualifiedTypeReference(tokens, CharOperation.NO_CHAR, positions, <MASK><NEW_LINE>if (CompletionEngine.DEBUG) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.println(" completion partial qualified type=" + this.completionNode);<NEW_LINE>}<NEW_LINE>return this.completionNode;<NEW_LINE>} | this.tagSourceStart, this.tagSourceEnd); |
1,650,959 | private static double[][] sparseMeans(List<? extends DBIDs> clusters, double[][] means, Relation<? extends SparseNumberVector> relation) {<NEW_LINE>final int k = means.length;<NEW_LINE>double[][] newMeans <MASK><NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>DBIDs list = clusters.get(i);<NEW_LINE>if (list.isEmpty()) {<NEW_LINE>// Keep degenerated means as-is for now.<NEW_LINE>newMeans[i] = means[i];<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>double[] mean = new double[means[i].length];<NEW_LINE>// Add remaining vectors (sparse):<NEW_LINE>for (DBIDIter iter = list.iter(); iter.valid(); iter.advance()) {<NEW_LINE>sparsePlusEquals(mean, relation.get(iter));<NEW_LINE>}<NEW_LINE>newMeans[i] = timesEquals(mean, 1. / list.size());<NEW_LINE>}<NEW_LINE>return newMeans;<NEW_LINE>} | = new double[k][]; |
50,359 | public void run(Result result, SchedulerEvent event) {<NEW_LINE>// remove the last occurrences - the CSL caches the last found occurences for us<NEW_LINE>range2Attribs = null;<NEW_LINE>if (cancelled) {<NEW_LINE>cancelled = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Preferences node = MarkOccurencesSettings.getCurrentNode();<NEW_LINE>Map<OffsetRange, ColoringAttributes> <MASK><NEW_LINE>if (node.getBoolean(MarkOccurencesSettings.ON_OFF, true)) {<NEW_LINE>for (OffsetRange r : compute((ParserResult) result, caretPosition)) {<NEW_LINE>localRange2Attribs.put(r, ColoringAttributes.MARK_OCCURRENCES);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cancelled) {<NEW_LINE>cancelled = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!node.getBoolean(MarkOccurencesSettings.KEEP_MARKS, true) || localRange2Attribs.size() > 0) {<NEW_LINE>// store the occurrences if not empty, return null in getOccurrences() otherwise<NEW_LINE>range2Attribs = localRange2Attribs;<NEW_LINE>}<NEW_LINE>} | localRange2Attribs = new HashMap<>(); |
1,144,662 | public void execute(AdminCommandContext context) {<NEW_LINE>final ActionReport report = context.getActionReport();<NEW_LINE>final String target = "default template";<NEW_LINE>try {<NEW_LINE>HashMap<String, String> props = null;<NEW_LINE>props = (HashMap<String, String>) loggingConfigFactory.provide().getLoggingProperties();<NEW_LINE>List<String> keys = new ArrayList<String>();<NEW_LINE>keys.addAll(props.keySet());<NEW_LINE>Collections.sort(keys);<NEW_LINE>Iterator<String> it2 = keys.iterator();<NEW_LINE>// The following Map & List are used to hold the REST data<NEW_LINE>Map<String, String> logAttributes = new HashMap<String, String>();<NEW_LINE>while (it2.hasNext()) {<NEW_LINE>String name = it2.next();<NEW_LINE>if (!name.endsWith(".level") && !name.equals(".level")) {<NEW_LINE>final ActionReport.MessagePart part = report.getTopMessagePart().addChild();<NEW_LINE>part.setMessage(name + "\t" + "<" + props.get(name) + ">");<NEW_LINE>logAttributes.put(name<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Properties restData = new Properties();<NEW_LINE>restData.put("logAttributes", logAttributes);<NEW_LINE>report.setExtraProperties(restData);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>report.setMessage(localStrings.getLocalString("get.log.attribute.failed", "Could not get logging attributes for {0}.", target));<NEW_LINE>report.setActionExitCode(ActionReport.ExitCode.FAILURE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>report.setActionExitCode(ActionReport.ExitCode.SUCCESS);<NEW_LINE>} | , props.get(name)); |
1,499,084 | public String replyAjax(@PathVariable String id, @PathVariable(required = false) String title, HttpServletRequest req, HttpServletResponse res, Model model) throws IOException {<NEW_LINE>if (!utils.isFeedbackEnabled()) {<NEW_LINE>return "redirect:" + HOMEPAGE;<NEW_LINE>}<NEW_LINE>Post showPost = pc.read(id);<NEW_LINE>Profile authUser = utils.getAuthUser(req);<NEW_LINE>if (authUser != null && showPost != null && !showPost.isClosed() && !showPost.isReply()) {<NEW_LINE>// create new answer<NEW_LINE>Reply answer = utils.populate(req<MASK><NEW_LINE>Map<String, String> error = utils.validate(answer);<NEW_LINE>if (!error.containsKey("body")) {<NEW_LINE>answer.setTitle(showPost.getTitle());<NEW_LINE>answer.setCreatorid(authUser.getId());<NEW_LINE>answer.setParentid(showPost.getId());<NEW_LINE>answer.create();<NEW_LINE>showPost.setAnswercount(showPost.getAnswercount() + 1);<NEW_LINE>if (showPost.getAnswercount() >= ScooldUtils.getConfig().maxRepliesPerPost()) {<NEW_LINE>showPost.setCloserid("0");<NEW_LINE>}<NEW_LINE>// update without adding revisions<NEW_LINE>pc.update(showPost);<NEW_LINE>utils.addBadgeAndUpdate(authUser, Profile.Badge.EUREKA, answer.getCreatorid().equals(showPost.getCreatorid()));<NEW_LINE>answer.setAuthor(authUser);<NEW_LINE>model.addAttribute("showPost", showPost);<NEW_LINE>model.addAttribute("answerslist", Collections.singletonList(answer));<NEW_LINE>} else {<NEW_LINE>model.addAttribute("error", error);<NEW_LINE>model.addAttribute("path", "feedback.vm");<NEW_LINE>res.setStatus(400);<NEW_LINE>}<NEW_LINE>return "reply";<NEW_LINE>}<NEW_LINE>if (utils.isAjaxRequest(req)) {<NEW_LINE>res.setStatus(200);<NEW_LINE>return "reply";<NEW_LINE>} else {<NEW_LINE>return "redirect:" + FEEDBACKLINK + "/" + id;<NEW_LINE>}<NEW_LINE>} | , new Reply(), "body"); |
1,276,500 | public boolean process(List<Point2D_I32> contour) {<NEW_LINE>// Reset internal book keeping variables<NEW_LINE>reset();<NEW_LINE>if (loops) {<NEW_LINE>// Reject pathological case<NEW_LINE>if (contour.size() < 3)<NEW_LINE>return false;<NEW_LINE>if (!findInitialTriangle(contour))<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>// Reject pathological case<NEW_LINE>if (contour.size() < 2)<NEW_LINE>return false;<NEW_LINE>// two end points are the seeds. Plus they can't change<NEW_LINE>addCorner(0);<NEW_LINE>addCorner(contour.size() - 1);<NEW_LINE>initializeScore(contour, false);<NEW_LINE>}<NEW_LINE>savePolyline();<NEW_LINE>sequentialSideFit(contour, loops);<NEW_LINE>if (fatalError)<NEW_LINE>return false;<NEW_LINE>int MIN_SIZE = loops ? 3 : 2;<NEW_LINE>double bestScore = Double.MAX_VALUE;<NEW_LINE>int bestSize = -1;<NEW_LINE>for (int i = 0; i < Math.min(maxSides - (MIN_SIZE - 1), polylines.size); i++) {<NEW_LINE>if (polylines.get(i).score < bestScore) {<NEW_LINE><MASK><NEW_LINE>bestScore = bestPolyline.score;<NEW_LINE>bestSize = i + MIN_SIZE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// There was no good match within the min/max size requirement<NEW_LINE>if (bestSize < minSides || bestPolyline == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// make sure all the sides are within error tolerance<NEW_LINE>for (int i = 0, j = bestSize - 1; i < bestSize; j = i, i++) {<NEW_LINE>Point2D_I32 a = contour.get(bestPolyline.splits.get(i));<NEW_LINE>Point2D_I32 b = contour.get(bestPolyline.splits.get(j));<NEW_LINE>double length = a.distance(b);<NEW_LINE>double thresholdSideError = this.maxSideError.compute(length);<NEW_LINE>if (bestPolyline.sideErrors.get(i) >= thresholdSideError * thresholdSideError) {<NEW_LINE>bestPolyline = null;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | bestPolyline = polylines.get(i); |
509,315 | public void export(JasperPrint jp, String fileName, HttpServletResponse response) throws JRException, IOException {<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>// Create a JRXlsExporter instance<NEW_LINE>JRXlsExporter exporter = new JRXlsExporter();<NEW_LINE>// Here we assign the parameters jp and baos to the exporter<NEW_LINE>exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);<NEW_LINE>exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos);<NEW_LINE>// Excel specific parameters<NEW_LINE>exporter.setParameter(JRXlsAbstractExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE);<NEW_LINE>exporter.setParameter(JRXlsAbstractExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);<NEW_LINE>exporter.setParameter(<MASK><NEW_LINE>// Retrieve the exported report in PDF format<NEW_LINE>exporter.exportReport();<NEW_LINE>// Specifies the response header<NEW_LINE>response.setHeader("Content-Disposition", "inline; filename=" + fileName);<NEW_LINE>// Make sure to set the correct content type<NEW_LINE>// Each format has its own content type<NEW_LINE>response.setContentType("application/vnd.ms-excel");<NEW_LINE>response.setContentLength(baos.size());<NEW_LINE>// Retrieve the output stream<NEW_LINE>ServletOutputStream outputStream = response.getOutputStream();<NEW_LINE>// Write to the output stream<NEW_LINE>baos.writeTo(outputStream);<NEW_LINE>// Flush the stream<NEW_LINE>outputStream.flush();<NEW_LINE>} | JRXlsAbstractExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE); |
174,759 | public static void init(String[] args, ClientBaseConfig config, boolean createEndpoint) throws IOException {<NEW_LINE>CommandLine cmd = new CommandLine(config);<NEW_LINE>config.register(cmd);<NEW_LINE>try {<NEW_LINE>ParseResult result = cmd.parseArgs(args);<NEW_LINE>if (result.isVersionHelpRequested()) {<NEW_LINE>String version = StringUtil.CALIFORNIUM_VERSION == null ? "" : StringUtil.CALIFORNIUM_VERSION;<NEW_LINE>System.out.println("\nCalifornium (Cf) " + cmd.getCommandName() + " " + version);<NEW_LINE>cmd.printVersionHelp(System.out);<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>config.defaults();<NEW_LINE>if (config.helpRequested) {<NEW_LINE>cmd.usage(System.out);<NEW_LINE>if (config.authHelpRequested) {<NEW_LINE>System.out.println();<NEW_LINE><MASK><NEW_LINE>print(" ", ConnectorConfig.MAX_WIDTH, Arrays.asList(AuthenticationMode.values()), System.out);<NEW_LINE>}<NEW_LINE>if (config.cipherHelpRequested) {<NEW_LINE>List<CipherSuite> list = new ArrayList<CipherSuite>();<NEW_LINE>for (CipherSuite cipherSuite : CipherSuite.values()) {<NEW_LINE>if (cipherSuite.isSupported() && !CipherSuite.TLS_NULL_WITH_NULL_NULL.equals(cipherSuite)) {<NEW_LINE>list.add(cipherSuite);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println(" --cipher: values");<NEW_LINE>print(" ", ConnectorConfig.MAX_WIDTH, list, System.out);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (ParameterException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>System.err.println(ex.getMessage());<NEW_LINE>System.err.println();<NEW_LINE>cmd.usage(System.err);<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>if (createEndpoint) {<NEW_LINE>CoapEndpoint coapEndpoint = createEndpoint(config, null);<NEW_LINE>coapEndpoint.start();<NEW_LINE>LOGGER.info("endpoint started at {}", coapEndpoint.getAddress());<NEW_LINE>EndpointManager.getEndpointManager().setDefaultEndpoint(coapEndpoint);<NEW_LINE>}<NEW_LINE>} | System.out.println(" --auth: values"); |
522,384 | public SortClusterConfig load() {<NEW_LINE>HttpGet httpGet = null;<NEW_LINE>try {<NEW_LINE>String clusterName = this.context.getString(CommonPropertiesHolder.KEY_CLUSTER_ID);<NEW_LINE>String url = ManagerUrlHandler.getSortClusterConfigUrl() + "?apiVersion=1.0&clusterName=" + clusterName + "&md5=";<NEW_LINE>if (StringUtils.isNotBlank(this.md5)) {<NEW_LINE>url += this.md5;<NEW_LINE>}<NEW_LINE>LOG.info("start to request {} to get config info", url);<NEW_LINE>httpGet = new HttpGet(url);<NEW_LINE>httpGet.addHeader(HttpHeaders.CONNECTION, "close");<NEW_LINE>// request with get<NEW_LINE>CloseableHttpResponse response = httpClient.execute(httpGet);<NEW_LINE>String returnStr = EntityUtils.toString(response.getEntity());<NEW_LINE>LOG.info("end to request {},result:{}", url, returnStr);<NEW_LINE>// get groupId <-> topic and m value.<NEW_LINE>SortClusterResponse clusterResponse = gson.fromJson(returnStr, SortClusterResponse.class);<NEW_LINE>int errCode = clusterResponse.getCode();<NEW_LINE>if (errCode != SortClusterResponse.SUCC && errCode != SortClusterResponse.NOUPDATE) {<NEW_LINE>LOG.info("Fail to get config info from url:{}, error code is {}, msg is {}", url, clusterResponse.getCode(<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>this.md5 = clusterResponse.getMd5();<NEW_LINE>return clusterResponse.getData();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOG.error("exception caught", ex);<NEW_LINE>return null;<NEW_LINE>} finally {<NEW_LINE>if (httpGet != null) {<NEW_LINE>httpGet.releaseConnection();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), clusterResponse.getMsg()); |
1,833,684 | private void initView() {<NEW_LINE>setContentView(R.layout.activity_video_divide);<NEW_LINE>mPreview = findViewById(R.id.preview);<NEW_LINE>mPlaybackButton = <MASK><NEW_LINE>mFrameListParent = findViewById(R.id.recycler_parent);<NEW_LINE>mFrameList = findViewById(R.id.recycler_frame_list);<NEW_LINE>mScrollViewParent = findViewById(R.id.scroll_view_parent);<NEW_LINE>mScrollView = findViewById(R.id.scroll_view);<NEW_LINE>ImageView middleLineImage = findViewById(R.id.middle_line_image);<NEW_LINE>ViewGroup topGroup = findViewById(R.id.top_group);<NEW_LINE>WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);<NEW_LINE>mFrameWidth = mFrameHeight = wm.getDefaultDisplay().getWidth() / 6;<NEW_LINE>middleLineImage.getLayoutParams().height = mFrameHeight;<NEW_LINE>mScrollView.setOnScrollListener(new OnViewScrollListener());<NEW_LINE>topGroup.setOnTouchListener(new OnTopViewTouchListener());<NEW_LINE>} | findViewById(R.id.pause_playback); |
1,416,127 | private void updateTabVisibility(ModelItem mi) {<NEW_LINE>int index = 0;<NEW_LINE>// Header - always visible<NEW_LINE>boolean showHeaders = mi != null;<NEW_LINE>index = showHideTab(jHeadersPanel, showHeaders, index);<NEW_LINE>// Request Data:<NEW_LINE>boolean postDataVisible = mi != null && mi.hasPostData();<NEW_LINE>index = showHideTab(jRequestPanel, postDataVisible, index);<NEW_LINE>// Response:<NEW_LINE>boolean hasResponseData = mi != null && mi.hasResponseData();<NEW_LINE>index = showHideTab(jResponsePanel, hasResponseData, index);<NEW_LINE>// Frames:<NEW_LINE>boolean hasFrames = mi != null && mi.hasFrames();<NEW_LINE>index = <MASK><NEW_LINE>// Call Stack:<NEW_LINE>boolean hasCallStack = mi != null && mi.hasCallStack();<NEW_LINE>showHideTab(jCallStackPanel, hasCallStack, index);<NEW_LINE>} | showHideTab(jFramesPanel, hasFrames, index); |
1,117,559 | private static String metadataCompleteFalse(String project, String thisApplicationClassName) throws Exception {<NEW_LINE>Class<?> thisApplication = Class.forName(thisApplicationClassName);<NEW_LINE>try (ScanResult scanResult = new ClassGraph().enableAnnotationInfo().whitelistPackages(thisApplication.getPackage().getName(), Compilable.class.getPackage().getName()).scan()) {<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>String moduleClassName = moduleClassName(scanResult, project);<NEW_LINE>sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");<NEW_LINE>sb.append("<web-app id=\"" + project + "\" metadata-complete=\"false\" version=\"3.0\">");<NEW_LINE>sb.<MASK><NEW_LINE>sb.append("<context-param>");<NEW_LINE>sb.append("<param-name>project</param-name>");<NEW_LINE>sb.append("<param-value>" + moduleClassName + "</param-value>");<NEW_LINE>sb.append("</context-param>");<NEW_LINE>sb.append("<welcome-file-list>");<NEW_LINE>sb.append("<welcome-file>/index.html</welcome-file>");<NEW_LINE>sb.append("</welcome-file-list>");<NEW_LINE>sb.append("</web-app>");<NEW_LINE>return sb.toString();<NEW_LINE>}<NEW_LINE>} | append("<display-name>" + project + "</display-name>"); |
79,145 | public void draw(UShape shape) {<NEW_LINE>final double x = translate.getDx();<NEW_LINE>final double y = translate.getDy();<NEW_LINE>if (shape instanceof URectangle) {<NEW_LINE>final URectangle rect = (URectangle) shape;<NEW_LINE>if (mode == CompressionMode.ON_X) {<NEW_LINE>final double x2 = ct(x + rect.getWidth());<NEW_LINE>shape = rect.withWidth<MASK><NEW_LINE>} else {<NEW_LINE>final double y2 = ct(y + rect.getHeight());<NEW_LINE>shape = rect.withHeight(y2 - ct(y));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (shape instanceof CenteredText) {<NEW_LINE>final CenteredText centeredText = (CenteredText) shape;<NEW_LINE>final TextBlock text = centeredText.getText();<NEW_LINE>final double totalWidth = centeredText.getTotalWidth();<NEW_LINE>final double realSpaceWidth;<NEW_LINE>if (mode == CompressionMode.ON_X)<NEW_LINE>realSpaceWidth = ct(x + totalWidth) - ct(x);<NEW_LINE>else<NEW_LINE>realSpaceWidth = totalWidth;<NEW_LINE>final double textWidth = text.calculateDimension(getStringBounder()).getWidth();<NEW_LINE>final double pos = (realSpaceWidth - textWidth) / 2;<NEW_LINE>text.drawU(getUg().apply(getTranslate(x, y)).apply(UTranslate.dx(pos)));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (shape instanceof ULine)<NEW_LINE>drawLine(x, y, (ULine) shape);<NEW_LINE>else<NEW_LINE>getUg().apply(getTranslate(x, y)).draw(shape);<NEW_LINE>} | (x2 - ct(x)); |
978,982 | public boolean upgrade(Request request, HttpFields.Mutable responseFields) {<NEW_LINE>if (HttpMethod.PRI.is(request.getMethod())) {<NEW_LINE>getParser().directUpgrade();<NEW_LINE>} else {<NEW_LINE>HttpField settingsField = request.getFields().getField(HttpHeader.HTTP2_SETTINGS);<NEW_LINE>if (settingsField == null)<NEW_LINE>throw new BadMessageException(<MASK><NEW_LINE>String value = settingsField.getValue();<NEW_LINE>final byte[] settings = Base64.getUrlDecoder().decode(value == null ? "" : value);<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("{} {}: {}", this, HttpHeader.HTTP2_SETTINGS, TypeUtil.toHexString(settings));<NEW_LINE>SettingsFrame settingsFrame = SettingsBodyParser.parseBody(BufferUtil.toBuffer(settings));<NEW_LINE>if (settingsFrame == null) {<NEW_LINE>LOG.warn("Invalid {} header value: {}", HttpHeader.HTTP2_SETTINGS, value);<NEW_LINE>throw new BadMessageException();<NEW_LINE>}<NEW_LINE>responseFields.put(HttpHeader.UPGRADE, "h2c");<NEW_LINE>responseFields.put(HttpHeader.CONNECTION, "Upgrade");<NEW_LINE>getParser().standardUpgrade();<NEW_LINE>// We fake that we received a client preface, so that we can send the<NEW_LINE>// server preface as the first HTTP/2 frame as required by the spec.<NEW_LINE>// When the client sends the real preface, the parser won't notify it.<NEW_LINE>upgradeFrames.add(new PrefaceFrame());<NEW_LINE>// This is the settings from the HTTP2-Settings header.<NEW_LINE>upgradeFrames.add(settingsFrame);<NEW_LINE>// Remember the request to send a response.<NEW_LINE>upgradeFrames.add(new HeadersFrame(1, request, null, true));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | "Missing " + HttpHeader.HTTP2_SETTINGS + " header"); |
291,256 | final GetGroupsForCapacityReservationResult executeGetGroupsForCapacityReservation(GetGroupsForCapacityReservationRequest getGroupsForCapacityReservationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getGroupsForCapacityReservationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetGroupsForCapacityReservationRequest> request = null;<NEW_LINE>Response<GetGroupsForCapacityReservationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetGroupsForCapacityReservationRequestMarshaller().marshall(super.beforeMarshalling(getGroupsForCapacityReservationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetGroupsForCapacityReservation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetGroupsForCapacityReservationResult> responseHandler = new StaxResponseHandler<GetGroupsForCapacityReservationResult>(new GetGroupsForCapacityReservationResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
542,111 | public static IQueryParameterAnd<?> parseQueryParams(FhirContext theContext, RestSearchParameterTypeEnum paramType, String theUnqualifiedParamName, List<QualifiedParamList> theParameters) {<NEW_LINE>QueryParameterAndBinder binder;<NEW_LINE>switch(paramType) {<NEW_LINE>case COMPOSITE:<NEW_LINE>throw new UnsupportedOperationException(Msg.code(496));<NEW_LINE>case DATE:<NEW_LINE>binder = new QueryParameterAndBinder(DateAndListParam.class, Collections.emptyList());<NEW_LINE>break;<NEW_LINE>case NUMBER:<NEW_LINE>binder = new QueryParameterAndBinder(NumberAndListParam.class, Collections.emptyList());<NEW_LINE>break;<NEW_LINE>case QUANTITY:<NEW_LINE>binder = new QueryParameterAndBinder(QuantityAndListParam.class, Collections.emptyList());<NEW_LINE>break;<NEW_LINE>case REFERENCE:<NEW_LINE>binder = new QueryParameterAndBinder(ReferenceAndListParam.class, Collections.emptyList());<NEW_LINE>break;<NEW_LINE>case STRING:<NEW_LINE>binder = new QueryParameterAndBinder(StringAndListParam.class, Collections.emptyList());<NEW_LINE>break;<NEW_LINE>case TOKEN:<NEW_LINE>binder = new QueryParameterAndBinder(TokenAndListParam.class, Collections.emptyList());<NEW_LINE>break;<NEW_LINE>case URI:<NEW_LINE>binder = new QueryParameterAndBinder(UriAndListParam.class, Collections.emptyList());<NEW_LINE>break;<NEW_LINE>case HAS:<NEW_LINE>binder = new QueryParameterAndBinder(HasAndListParam.class, Collections.emptyList());<NEW_LINE>break;<NEW_LINE>case SPECIAL:<NEW_LINE>binder = new QueryParameterAndBinder(SpecialAndListParam.<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException(Msg.code(497) + "Parameter '" + theUnqualifiedParamName + "' has type " + paramType + " which is currently not supported.");<NEW_LINE>}<NEW_LINE>return binder.parse(theContext, theUnqualifiedParamName, theParameters);<NEW_LINE>} | class, Collections.emptyList()); |
241,684 | public static void handleDeleteVariableInstanceEntityCount(VariableInstanceEntity variableInstance, boolean fireDeleteEvent, TaskServiceConfiguration taskServiceConfiguration) {<NEW_LINE>if (variableInstance.getTaskId() != null && isTaskRelatedEntityCountEnabledGlobally(taskServiceConfiguration)) {<NEW_LINE>CountingTaskEntity countingTaskEntity = (CountingTaskEntity) taskServiceConfiguration.getTaskEntityManager().findById(variableInstance.getTaskId());<NEW_LINE>if (isTaskRelatedEntityCountEnabled(countingTaskEntity, taskServiceConfiguration)) {<NEW_LINE>countingTaskEntity.setVariableCount(countingTaskEntity.getVariableCount() - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FlowableEventDispatcher eventDispatcher = taskServiceConfiguration.getEventDispatcher();<NEW_LINE>if (fireDeleteEvent && eventDispatcher != null && eventDispatcher.isEnabled()) {<NEW_LINE>eventDispatcher.dispatchEvent(FlowableVariableEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_DELETED, variableInstance), taskServiceConfiguration.getEngineName());<NEW_LINE>eventDispatcher.dispatchEvent(FlowableVariableEventBuilder.createVariableEvent(FlowableEngineEventType.VARIABLE_DELETED, variableInstance, null, variableInstance.getType()<MASK><NEW_LINE>}<NEW_LINE>} | ), taskServiceConfiguration.getEngineName()); |
1,439,210 | /* *<NEW_LINE>* Checks a Web document.<NEW_LINE>*<NEW_LINE>* @throws IOException if loading of the URL fails for some reason<NEW_LINE>*/<NEW_LINE>public void checkHttpURL(String document, String userAgent, ErrorHandler errorHandler) throws IOException, SAXException {<NEW_LINE>CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL));<NEW_LINE>validator.reset();<NEW_LINE>httpRes = new PrudentHttpEntityResolver<MASK><NEW_LINE>if (this.allowCss) {<NEW_LINE>httpRes.setAllowCss(true);<NEW_LINE>}<NEW_LINE>httpRes.setAllowHtml(true);<NEW_LINE>httpRes.setUserAgent(userAgent);<NEW_LINE>try {<NEW_LINE>documentInput = (TypedInputSource) httpRes.resolveEntity(null, document);<NEW_LINE>String contentType = documentInput.getType();<NEW_LINE>documentInput.setSystemId(document);<NEW_LINE>for (String param : contentType.replace(" ", "").split(";")) {<NEW_LINE>if (param.startsWith("charset=")) {<NEW_LINE>documentInput.setEncoding(param.split("=", 2)[1]);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (documentInput.getType().startsWith("text/css")) {<NEW_LINE>checkAsCss(documentInput);<NEW_LINE>} else if (documentInput.getType().startsWith("text/html")) {<NEW_LINE>checkAsHTML(documentInput);<NEW_LINE>} else {<NEW_LINE>checkAsXML(documentInput);<NEW_LINE>}<NEW_LINE>} catch (ResourceNotRetrievableException e) {<NEW_LINE>}<NEW_LINE>} | (-1, true, errorHandler); |
1,736,489 | private void addReaderWriterForType(AdditionalReaderWriter additionalReaderWriter, Type paramType) {<NEW_LINE>DotName dotName = paramType.name();<NEW_LINE>if (dotName.equals(JSONP_JSON_NUMBER) || dotName.equals(JSONP_JSON_VALUE) || dotName.equals(JSONP_JSON_STRING)) {<NEW_LINE>additionalReaderWriter.add(JsonValueHandler.class, APPLICATION_JSON, javax.json.JsonValue.class);<NEW_LINE>} else if (dotName.equals(JSONP_JSON_ARRAY)) {<NEW_LINE>additionalReaderWriter.add(JsonArrayHandler.class, APPLICATION_JSON, javax.json.JsonArray.class);<NEW_LINE>} else if (dotName.equals(JSONP_JSON_OBJECT)) {<NEW_LINE>additionalReaderWriter.add(JsonObjectHandler.class, APPLICATION_JSON, javax.json.JsonObject.class);<NEW_LINE>} else if (dotName.equals(JSONP_JSON_STRUCTURE)) {<NEW_LINE>additionalReaderWriter.add(JsonStructureHandler.class, APPLICATION_JSON, <MASK><NEW_LINE>}<NEW_LINE>} | javax.json.JsonStructure.class); |
59,577 | private ClientLifecycleEventListener updateAndGetEventListener() {<NEW_LINE>boolean contains = false;<NEW_LINE>ClientLifecycleEventListener eventListener = null;<NEW_LINE>for (final Map.Entry<String, ClientLifecycleEventListener> pluginEventListenerEntry : eventListeners.getPluginEventListenersMap().entrySet()) {<NEW_LINE>final String id = pluginEventListenerEntry.getKey();<NEW_LINE>final <MASK><NEW_LINE>if (listener.getClass().getClassLoader().equals(eventListenerProvider.getClass().getClassLoader()) && id.equals(pluginId)) {<NEW_LINE>contains = true;<NEW_LINE>eventListener = listener;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!contains) {<NEW_LINE>try {<NEW_LINE>eventListener = eventListenerProvider.getClientLifecycleEventListener(eventListenerProviderInput);<NEW_LINE>if (eventListener != null) {<NEW_LINE>eventListeners.put(pluginId, eventListener);<NEW_LINE>}<NEW_LINE>} catch (final Throwable t) {<NEW_LINE>log.warn("Uncaught exception was thrown from extension with id \"{}\" in client lifecycle event listener provider. " + "Extensions are responsible on their own to handle exceptions.", pluginId, t);<NEW_LINE>Exceptions.rethrowError(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return eventListener;<NEW_LINE>} | ClientLifecycleEventListener listener = pluginEventListenerEntry.getValue(); |
1,078,526 | public Request<ListSecurityProfilePermissionsRequest> marshall(ListSecurityProfilePermissionsRequest listSecurityProfilePermissionsRequest) {<NEW_LINE>if (listSecurityProfilePermissionsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListSecurityProfilePermissionsRequest)");<NEW_LINE>}<NEW_LINE>Request<ListSecurityProfilePermissionsRequest> request = new DefaultRequest<ListSecurityProfilePermissionsRequest>(listSecurityProfilePermissionsRequest, "AmazonConnect");<NEW_LINE><MASK><NEW_LINE>String uriResourcePath = "/security-profiles-permissions/{InstanceId}/{SecurityProfileId}";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{SecurityProfileId}", (listSecurityProfilePermissionsRequest.getSecurityProfileId() == null) ? "" : StringUtils.fromString(listSecurityProfilePermissionsRequest.getSecurityProfileId()));<NEW_LINE>uriResourcePath = uriResourcePath.replace("{InstanceId}", (listSecurityProfilePermissionsRequest.getInstanceId() == null) ? "" : StringUtils.fromString(listSecurityProfilePermissionsRequest.getInstanceId()));<NEW_LINE>if (listSecurityProfilePermissionsRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("nextToken", StringUtils.fromString(listSecurityProfilePermissionsRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>if (listSecurityProfilePermissionsRequest.getMaxResults() != null) {<NEW_LINE>request.addParameter("maxResults", StringUtils.fromInteger(listSecurityProfilePermissionsRequest.getMaxResults()));<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>} | request.setHttpMethod(HttpMethodName.GET); |
98,604 | protected static BundleEntryComponent provider(Bundle bundle, Provider provider) {<NEW_LINE>org.hl7.fhir.dstu3.model.Organization organizationResource = new org.hl7.fhir.dstu3.model.Organization();<NEW_LINE>List<CodeableConcept> organizationType <MASK><NEW_LINE>organizationType.add(mapCodeToCodeableConcept(new Code("http://hl7.org/fhir/organization-type", "prov", "Healthcare Provider"), "http://hl7.org/fhir/organization-type"));<NEW_LINE>organizationResource.addIdentifier().setSystem("https://github.com/synthetichealth/synthea").setValue((String) provider.getResourceID());<NEW_LINE>organizationResource.setId(provider.getResourceID());<NEW_LINE>organizationResource.setName(provider.name);<NEW_LINE>organizationResource.setType(organizationType);<NEW_LINE>Address address = new Address().addLine(provider.address).setCity(provider.city).setPostalCode(provider.zip).setState(provider.state);<NEW_LINE>if (COUNTRY_CODE != null) {<NEW_LINE>address.setCountry(COUNTRY_CODE);<NEW_LINE>}<NEW_LINE>organizationResource.addAddress(address);<NEW_LINE>Point2D.Double coord = provider.getLonLat();<NEW_LINE>if (coord != null) {<NEW_LINE>Extension geolocation = address.addExtension();<NEW_LINE>geolocation.setUrl("http://hl7.org/fhir/StructureDefinition/geolocation");<NEW_LINE>geolocation.addExtension("latitude", new DecimalType(coord.getY()));<NEW_LINE>geolocation.addExtension("longitude", new DecimalType(coord.getX()));<NEW_LINE>}<NEW_LINE>if (provider.phone != null && !provider.phone.isEmpty()) {<NEW_LINE>ContactPoint contactPoint = new ContactPoint().setSystem(ContactPointSystem.PHONE).setValue(provider.phone);<NEW_LINE>organizationResource.addTelecom(contactPoint);<NEW_LINE>}<NEW_LINE>if (USE_SHR_EXTENSIONS) {<NEW_LINE>organizationResource.setMeta(new Meta().addProfile(SHR_EXT + "shr-entity-Organization"));<NEW_LINE>// required fields for this profile are identifier, type, address, and contact<NEW_LINE>organizationResource.addIdentifier().setSystem("urn:ietf:rfc:3986").setValue("urn:uuid:" + provider.getResourceID());<NEW_LINE>organizationResource.addContact().setName(new HumanName().setText("Synthetic Provider"));<NEW_LINE>}<NEW_LINE>return newEntry(bundle, organizationResource, provider.getResourceID());<NEW_LINE>} | = new ArrayList<CodeableConcept>(); |
1,689,366 | private void processConfig(Map<String, Object> props) {<NEW_LINE>if (props == null || props.isEmpty())<NEW_LINE>return;<NEW_LINE>if ((Boolean) props.get(KEY_ENABLED)) {<NEW_LINE>id = (String) props.get(KEY_ID);<NEW_LINE>className = (<MASK><NEW_LINE>invokeBeforeSSO = (Boolean) props.get(KEY_INVOKE_BEFORE_SSO);<NEW_LINE>invokeAfterSSO = (Boolean) props.get(KEY_INVOKE_AFTER_SSO);<NEW_LINE>pid = (String) props.get(CFG_KEY_PROPERTIES_PID);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Shared liberty interceptor config - interceptors element: ");<NEW_LINE>Tr.debug(tc, " invokeBeforeSSO=" + invokeBeforeSSO + " invokeAfterSSO=" + invokeAfterSSO);<NEW_LINE>}<NEW_LINE>processProperties();<NEW_LINE>initInterceptor();<NEW_LINE>} else {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Skipping TAI that is not enable: " + props);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String) props.get(KEY_CLASS_NAME); |
718,144 | public boolean applyFirewallRules(Network network, List<? extends FirewallRule> rules) throws ResourceUnavailableException {<NEW_LINE>// Find the external firewall in this zone<NEW_LINE>long zoneId = network.getDataCenterId();<NEW_LINE>DataCenterVO <MASK><NEW_LINE>ExternalFirewallDeviceVO fwDeviceVO = getExternalFirewallForNetwork(network);<NEW_LINE>// During destroy, device reference may already been clean up, then we just return true<NEW_LINE>if (fwDeviceVO == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>HostVO externalFirewall = _hostDao.findById(fwDeviceVO.getHostId());<NEW_LINE>assert (externalFirewall != null);<NEW_LINE>if (network.getState() == Network.State.Allocated) {<NEW_LINE>s_logger.debug("External firewall was asked to apply firewall rules for network with ID " + network.getId() + "; this network is not implemented. Skipping backend commands.");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>List<FirewallRuleTO> rulesTO = new ArrayList<FirewallRuleTO>();<NEW_LINE>NetworkVO networkVO = _networkDao.findById(network.getId());<NEW_LINE>NetworkOfferingVO offering = _networkOfferingDao.findById(networkVO.getNetworkOfferingId());<NEW_LINE>Boolean defaultEgressPolicy = offering.isEgressDefaultPolicy();<NEW_LINE>for (FirewallRule rule : rules) {<NEW_LINE>if (rule.getSourceCidrList() == null && (rule.getPurpose() == Purpose.Firewall || rule.getPurpose() == Purpose.NetworkACL)) {<NEW_LINE>_fwRulesDao.loadSourceCidrs((FirewallRuleVO) rule);<NEW_LINE>}<NEW_LINE>FirewallRuleTO ruleTO;<NEW_LINE>if (rule.getPurpose() == Purpose.Firewall && rule.getTrafficType() == FirewallRule.TrafficType.Egress) {<NEW_LINE>String guestVlanTag = BroadcastDomainType.getValue(network.getBroadcastUri());<NEW_LINE>String guestCidr = network.getCidr();<NEW_LINE>ruleTO = new FirewallRuleTO(rule, guestVlanTag, rule.getTrafficType(), guestCidr, defaultEgressPolicy, rule.getType());<NEW_LINE>} else {<NEW_LINE>IpAddress sourceIp = _networkModel.getIp(rule.getSourceIpAddressId());<NEW_LINE>Vlan vlan = _vlanDao.findById(sourceIp.getVlanId());<NEW_LINE>ruleTO = new FirewallRuleTO(rule, vlan.getVlanTag(), sourceIp.getAddress().addr());<NEW_LINE>}<NEW_LINE>rulesTO.add(ruleTO);<NEW_LINE>}<NEW_LINE>// Firewall rules configured for staticNAT/PF<NEW_LINE>sendFirewallRules(rulesTO, zone, externalFirewall.getId());<NEW_LINE>return true;<NEW_LINE>} | zone = _dcDao.findById(zoneId); |
1,158,501 | public OptExpression visitPhysicalDistribution(OptExpression exchangeExpr, DecodeContext context) {<NEW_LINE>visitProjectionBefore(exchangeExpr, context);<NEW_LINE>OptExpression childExpr = exchangeExpr.inputAt(0);<NEW_LINE>context.hasEncoded = false;<NEW_LINE>OptExpression newChildExpr = childExpr.getOp().accept(this, childExpr, context);<NEW_LINE>if (context.hasEncoded) {<NEW_LINE>PhysicalDistributionOperator exchangeOperator = (PhysicalDistributionOperator) exchangeExpr.getOp();<NEW_LINE>if (!(exchangeOperator.getDistributionSpec() instanceof HashDistributionSpec)) {<NEW_LINE>exchangeOperator.setGlobalDicts(context.globalDicts);<NEW_LINE>exchangeExpr.setChild(0, newChildExpr);<NEW_LINE>return visitProjectionAfter(exchangeExpr, context);<NEW_LINE>}<NEW_LINE>if (exchangeOperator.couldApplyStringDict(context.stringColumnIdToDictColumnIds.keySet())) {<NEW_LINE>PhysicalDistributionOperator newExchangeOper = rewriteDistribution(exchangeOperator, context);<NEW_LINE>OptExpression result = OptExpression.create(newExchangeOper, newChildExpr);<NEW_LINE>result.setStatistics(exchangeExpr.getStatistics());<NEW_LINE>result.setLogicalProperty(exchangeExpr.getLogicalProperty());<NEW_LINE>return visitProjectionAfter(result, context);<NEW_LINE>} else {<NEW_LINE>insertDecodeExpr(exchangeExpr, Collections.singletonList(newChildExpr), 0, context);<NEW_LINE>return visitProjectionAfter(exchangeExpr, context);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return visitProjectionAfter(exchangeExpr, context);<NEW_LINE>} | exchangeExpr.setChild(0, newChildExpr); |
232,298 | public void process(Page page) {<NEW_LINE>// http://progressdaily.diandian.com/post/2013-01-24/40046867275<NEW_LINE>List<String> requests = page.getHtml().xpath("//a[@class=\"area_link flat_btn\"]/@href").all();<NEW_LINE>if (requests.size() > 2) {<NEW_LINE>requests = requests.subList(0, 2);<NEW_LINE>}<NEW_LINE>page.addTargetRequests(requests);<NEW_LINE>page.addTargetRequests(page.getHtml().links().regex<MASK><NEW_LINE>page.putField("items", page.getHtml().xpath("//ul[@class=\"dishes menu_dishes\"]/li/span[@class=\"name\"]/text()"));<NEW_LINE>page.putField("prices", page.getHtml().xpath("//ul[@class=\"dishes menu_dishes\"]/li/span[@class=\"price_outer\"]/span[@class=\"price\"]/text()"));<NEW_LINE>} | ("(.*/restaurant/[^#]+)").all()); |
653,391 | public static DescribeHealthCheckListResponse unmarshall(DescribeHealthCheckListResponse describeHealthCheckListResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeHealthCheckListResponse.setRequestId(_ctx.stringValue("DescribeHealthCheckListResponse.RequestId"));<NEW_LINE>List<HealthCheckItem> healthCheckList <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeHealthCheckListResponse.HealthCheckList.Length"); i++) {<NEW_LINE>HealthCheckItem healthCheckItem = new HealthCheckItem();<NEW_LINE>healthCheckItem.setInstanceId(_ctx.stringValue("DescribeHealthCheckListResponse.HealthCheckList[" + i + "].InstanceId"));<NEW_LINE>healthCheckItem.setBizProtocol(_ctx.stringValue("DescribeHealthCheckListResponse.HealthCheckList[" + i + "].Protocol"));<NEW_LINE>healthCheckItem.setFrontendPort(_ctx.integerValue("DescribeHealthCheckListResponse.HealthCheckList[" + i + "].FrontendPort"));<NEW_LINE>HealthCheck healthCheck = new HealthCheck();<NEW_LINE>healthCheck.setType(_ctx.stringValue("DescribeHealthCheckListResponse.HealthCheckList[" + i + "].HealthCheck.Type"));<NEW_LINE>healthCheck.setDomain(_ctx.stringValue("DescribeHealthCheckListResponse.HealthCheckList[" + i + "].HealthCheck.Domain"));<NEW_LINE>healthCheck.setUri(_ctx.stringValue("DescribeHealthCheckListResponse.HealthCheckList[" + i + "].HealthCheck.Uri"));<NEW_LINE>healthCheck.setDown(_ctx.integerValue("DescribeHealthCheckListResponse.HealthCheckList[" + i + "].HealthCheck.Down"));<NEW_LINE>healthCheck.setInterval(_ctx.integerValue("DescribeHealthCheckListResponse.HealthCheckList[" + i + "].HealthCheck.Interval"));<NEW_LINE>healthCheck.setPort(_ctx.integerValue("DescribeHealthCheckListResponse.HealthCheckList[" + i + "].HealthCheck.Port"));<NEW_LINE>healthCheck.setTimeout(_ctx.integerValue("DescribeHealthCheckListResponse.HealthCheckList[" + i + "].HealthCheck.Timeout"));<NEW_LINE>healthCheck.setUp(_ctx.integerValue("DescribeHealthCheckListResponse.HealthCheckList[" + i + "].HealthCheck.Up"));<NEW_LINE>healthCheckItem.setHealthCheck(healthCheck);<NEW_LINE>healthCheckList.add(healthCheckItem);<NEW_LINE>}<NEW_LINE>describeHealthCheckListResponse.setHealthCheckList(healthCheckList);<NEW_LINE>return describeHealthCheckListResponse;<NEW_LINE>} | = new ArrayList<HealthCheckItem>(); |
608,051 | private List<MaterialRevision> createFinalRevisionsForScmChildren(PipelineTimelineEntry latestRootNodeInstance, List<RootFanInNode> scmChildren, List<DependencyFanInNode> depChildren) {<NEW_LINE>Set<FaninScmMaterial> scmMaterialsFromDepChildren = scmMaterialsOfDepChildren(depChildren);<NEW_LINE>List<MaterialRevision> finalRevisions = new ArrayList<>();<NEW_LINE>for (RootFanInNode child : scmChildren) {<NEW_LINE>child.setScmRevision(scmMaterialsFromDepChildren);<NEW_LINE>MaterialConfig materialConfig = child.materialConfig;<NEW_LINE>Material material = materialConfigConverter.toMaterial(materialConfig);<NEW_LINE>MaterialRevision revision = new MaterialRevision(material);<NEW_LINE>if (latestRootNodeInstance != null) {<NEW_LINE>PipelineInstanceModel pipeline = pipelineDao.findPipelineHistoryByNameAndCounter(latestRootNodeInstance.getPipelineName(), latestRootNodeInstance.getCounter());<NEW_LINE>for (MaterialRevision materialRevision : pipeline.getCurrentRevisions()) {<NEW_LINE>if (materialRevision.getMaterial().getFingerprint().equals(child.materialConfig.getFingerprint())) {<NEW_LINE>List<Modification> modificationsSince = materialRepository.findModificationsSinceAndUptil(material, materialRevision, child.scmRevision);<NEW_LINE>revision.addModifications(modificationsSince);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (revision.getModifications().isEmpty() && child.scmRevision == null) {<NEW_LINE>MaterialRevisions latestRevisions = materialRepository.<MASK><NEW_LINE>finalRevisions.addAll(latestRevisions.getRevisions());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (revision.getModifications().isEmpty()) {<NEW_LINE>revision = new MaterialRevision(material, materialRepository.findModificationWithRevision(material, child.scmRevision.revision));<NEW_LINE>}<NEW_LINE>finalRevisions.add(revision);<NEW_LINE>}<NEW_LINE>return finalRevisions;<NEW_LINE>} | findLatestRevisions(new MaterialConfigs(materialConfig)); |
582,315 | public DataType toDataType() throws DuplicateNameException, IOException {<NEW_LINE>StructureDataType struct = new StructureDataType(getCommandName(), 0);<NEW_LINE>struct.add(DWORD, "cmd", null);<NEW_LINE>struct.add(DWORD, "cmdsize", null);<NEW_LINE>if (is32bit) {<NEW_LINE>struct.add(DWORD, "vmaddr", null);<NEW_LINE>struct.add(DWORD, "fileoff", null);<NEW_LINE>struct.add(DWORD, "unknown", null);<NEW_LINE>} else {<NEW_LINE>struct.add(QWORD, "vmaddr", null);<NEW_LINE>struct.<MASK><NEW_LINE>struct.add(QWORD, "unknown", null);<NEW_LINE>}<NEW_LINE>int stringSize = getCommandSize() - (8 + 3 * (is32bit ? 4 : 8));<NEW_LINE>struct.add(new StringDataType(), stringSize, "fileSetEntryname", null);<NEW_LINE>struct.setCategoryPath(new CategoryPath(MachConstants.DATA_TYPE_CATEGORY));<NEW_LINE>return struct;<NEW_LINE>} | add(QWORD, "fileoff", null); |
1,299,430 | private void checkRealmAdminManagementRoles(RealmModel realm) {<NEW_LINE>// don't need to do this for master realm<NEW_LINE>if (realm.getName().equals(Config.getAdminRealm())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String realmAdminClientId = getRealmAdminClientId(realm);<NEW_LINE>ClientModel <MASK><NEW_LINE>RoleModel adminRole = realmAdminClient.getRole(AdminRoles.REALM_ADMIN);<NEW_LINE>// if realm-admin role isn't in the realm model, create it<NEW_LINE>if (adminRole == null) {<NEW_LINE>adminRole = realmAdminClient.addRole(AdminRoles.REALM_ADMIN);<NEW_LINE>adminRole.setDescription("${role_" + AdminRoles.REALM_ADMIN + "}");<NEW_LINE>}<NEW_LINE>for (String r : AdminRoles.ALL_REALM_ROLES) {<NEW_LINE>RoleModel found = realmAdminClient.getRole(r);<NEW_LINE>if (found == null) {<NEW_LINE>addAndSetAdminRole(r, realmAdminClient, adminRole);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addQueryCompositeRoles(realmAdminClient);<NEW_LINE>} | realmAdminClient = realm.getClientByClientId(realmAdminClientId); |
1,500,740 | public boolean doAlert(AlertConfigWithParams alertConfig, AlertTemplate alertTemplate) throws AlertException {<NEW_LINE>AlertLarkParams alertLarkParams = alertConfig.getLarkParams();<NEW_LINE>if (alertLarkParams.getIsAtAll()) {<NEW_LINE>alertTemplate.setAtAll(true);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// format markdown<NEW_LINE>String markdown = FreemarkerUtils.format(template, alertTemplate);<NEW_LINE>Map<String, Object> cardMap = mapper.readValue(markdown, new TypeReference<Map<String, Object>>() {<NEW_LINE>});<NEW_LINE>Map<String, Object> body = new HashMap<>();<NEW_LINE>// get sign<NEW_LINE>if (alertLarkParams.getSecretEnable()) {<NEW_LINE>long timestamp = System.currentTimeMillis() / 1000;<NEW_LINE>String sign = getSign(alertLarkParams.getSecretToken(), timestamp);<NEW_LINE>body.put("timestamp", timestamp);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>body.put("msg_type", "interactive");<NEW_LINE>body.put("card", cardMap);<NEW_LINE>sendMessage(alertLarkParams, body);<NEW_LINE>return true;<NEW_LINE>} catch (AlertException alertException) {<NEW_LINE>throw alertException;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new AlertException("Failed send lark alert", e);<NEW_LINE>}<NEW_LINE>} | body.put("sign", sign); |
76,077 | public void onError(Exception exception) {<NEW_LINE>if (!this.openFuture.isDone()) {<NEW_LINE>this.onOpenComplete(exception);<NEW_LINE>}<NEW_LINE>if (this.getIsClosingOrClosed()) {<NEW_LINE>if (!this.closeFuture.isDone()) {<NEW_LINE>TRACE_LOGGER.info("Closing internal send link '{}' of requestresponselink to {} failed.", this.sendLink.getName(), this.parent.linkPath, exception);<NEW_LINE>AsyncUtil.completeFutureExceptionally(this.closeFuture, exception);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>TRACE_LOGGER.info("Internal send link '{}' of requestresponselink to '{}' encountered error.", this.sendLink.getName(), this.parent.linkPath, exception);<NEW_LINE>this.parent.underlyingFactory.deregisterForConnectionError(this.sendLink);<NEW_LINE>this.matchingReceiveLink.close();<NEW_LINE>this.parent.underlyingFactory.deregisterForConnectionError(this.matchingReceiveLink);<NEW_LINE>this.parent.<MASK><NEW_LINE>}<NEW_LINE>} | onInnerLinksClosed(this.linkGeneration, exception); |
1,549,243 | private Mono<Response<Flux<ByteBuffer>>> createOrUpdateWithResponseAsync(String resourceGroupName, String serviceName, String serviceRegistryName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (serviceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (serviceRegistryName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter serviceRegistryName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serviceName, serviceRegistryName, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
704,776 | // Needs to run before the main correction code or it can move the player into blocks<NEW_LINE>// This is counteracted by the main collision code pushing them out<NEW_LINE>@Override<NEW_LINE>public void beforeCorrectPosition(int x, int y, int z, BoundingBox playerCollision) {<NEW_LINE>// In Bedrock, snow layers round down to half blocks but you can't sink into them at all<NEW_LINE>// This means the collision each half block reaches above where it should be on Java so the player has to be<NEW_LINE>// pushed down<NEW_LINE>if (layers == 4 || layers == 8) {<NEW_LINE>double playerMinY = playerCollision.getMiddleY() - (playerCollision.getSizeY() / 2);<NEW_LINE>double boxMaxY = (boundingBoxes[0].getMiddleY() + y) + (boundingBoxes[0].getSizeY() / 2);<NEW_LINE>// If the player is in the buggy area, push them down<NEW_LINE>if (playerMinY > boxMaxY && playerMinY <= (boxMaxY + 0.125)) {<NEW_LINE>playerCollision.translate(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | 0, boxMaxY - playerMinY, 0); |
417,561 | public void remove() {<NEW_LINE>byte[] currentLeafKey = getCurrentLeafNode().getKeyBytes();<NEW_LINE>Toolkit toolkit = art.removeSpecifyKey(art.getRoot(), currentLeafKey, 0);<NEW_LINE>if (toolkit == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (containers != null) {<NEW_LINE>containers.remove(toolkit.matchedContainerId);<NEW_LINE>}<NEW_LINE>Node node = toolkit.freshMatchedParentNode;<NEW_LINE>if (depth - 1 >= 0) {<NEW_LINE>// update the parent node to a fresh node as the parent node may changed by the<NEW_LINE>// art adaptive removing logic<NEW_LINE>NodeEntry <MASK><NEW_LINE>oldEntry.visited = oldEntry.node == node;<NEW_LINE>oldEntry.node = node;<NEW_LINE>oldEntry.startFromNextSiblingPosition = true;<NEW_LINE>if (node.nodeType != NodeType.LEAF_NODE) {<NEW_LINE>oldEntry.position = node.getChildPos(oldEntry.leafNodeNextSiblingKey);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | oldEntry = stack[depth - 1]; |
858,816 | private I_C_OrderLine createChargeOrderLine(final I_C_Order newOrder, final I_C_Contract_Change changeConditions, final BigDecimal additionalCharge) {<NEW_LINE>final MOrderLine chargeOlPO = new MOrderLine((MOrder) InterfaceWrapperHelper.getPO(newOrder));<NEW_LINE>final de.metas.interfaces.I_C_OrderLine chargeOl = InterfaceWrapperHelper.create(chargeOlPO, de.metas.interfaces.I_C_OrderLine.class);<NEW_LINE>chargeOlPO.setM_Product_ID(changeConditions.getM_Product_ID());<NEW_LINE><MASK><NEW_LINE>chargeOlPO.setQtyEntered(BigDecimal.ONE);<NEW_LINE>chargeOlPO.setPrice();<NEW_LINE>chargeOl.setIsManualPrice(true);<NEW_LINE>chargeOlPO.setPriceActual(additionalCharge.add(chargeOlPO.getPriceActual()));<NEW_LINE>chargeOlPO.setPriceEntered(additionalCharge.add(chargeOlPO.getPriceEntered()));<NEW_LINE>save(chargeOl);<NEW_LINE>logger.debug("created new order line " + chargeOlPO);<NEW_LINE>return chargeOl;<NEW_LINE>} | chargeOlPO.setQtyOrdered(BigDecimal.ONE); |
208,711 | public CreateQuantumTaskResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateQuantumTaskResult createQuantumTaskResult = new CreateQuantumTaskResult();<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 createQuantumTaskResult;<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("quantumTaskArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createQuantumTaskResult.setQuantumTaskArn(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 createQuantumTaskResult;<NEW_LINE>} | class).unmarshall(context)); |
3,661 | final DescribeTransitGatewayVpcAttachmentsResult executeDescribeTransitGatewayVpcAttachments(DescribeTransitGatewayVpcAttachmentsRequest describeTransitGatewayVpcAttachmentsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeTransitGatewayVpcAttachmentsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeTransitGatewayVpcAttachmentsRequest> request = null;<NEW_LINE>Response<DescribeTransitGatewayVpcAttachmentsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeTransitGatewayVpcAttachmentsRequestMarshaller().marshall(super.beforeMarshalling(describeTransitGatewayVpcAttachmentsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeTransitGatewayVpcAttachmentsResult> responseHandler = new StaxResponseHandler<DescribeTransitGatewayVpcAttachmentsResult>(new DescribeTransitGatewayVpcAttachmentsResultStaxUnmarshaller());<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, "DescribeTransitGatewayVpcAttachments"); |
426,506 | private static boolean isEqual(TableValueImpl lhsTable, TableValueImpl rhsTable, List<ValuePair> checkedValues) {<NEW_LINE>ValuePair compValuePair = new ValuePair(lhsTable, rhsTable);<NEW_LINE>if (checkedValues.contains(compValuePair)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>checkedValues.add(compValuePair);<NEW_LINE>if (lhsTable.size() != rhsTable.size()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean isLhsKeyedTable = ((BTableType) lhsTable.getType())<MASK><NEW_LINE>boolean isRhsKeyedTable = ((BTableType) rhsTable.getType()).getFieldNames().length > 0;<NEW_LINE>Object[] lhsTableValues = lhsTable.values().toArray();<NEW_LINE>Object[] rhsTableValues = rhsTable.values().toArray();<NEW_LINE>if (isLhsKeyedTable == isRhsKeyedTable) {<NEW_LINE>for (int i = 0; i < lhsTableValues.length; i++) {<NEW_LINE>if (!isEqual(lhsTableValues[i], rhsTableValues[i], checkedValues)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | .getFieldNames().length > 0; |
1,245,926 | protected void registerMathStubs(GraalHotSpotVMConfig hotSpotVMConfig, HotSpotProviders providers, OptionValues options) {<NEW_LINE>if (GraalArithmeticStubs.getValue(options)) {<NEW_LINE>link(new AMD64MathStub(SIN, options, providers, registerStubCall(SIN.foreignCallSignature, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));<NEW_LINE>link(new AMD64MathStub(COS, options, providers, registerStubCall(COS.foreignCallSignature, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));<NEW_LINE>link(new AMD64MathStub(TAN, options, providers, registerStubCall(TAN.foreignCallSignature, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));<NEW_LINE>link(new AMD64MathStub(EXP, options, providers, registerStubCall(EXP.foreignCallSignature, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));<NEW_LINE>link(new AMD64MathStub(LOG, options, providers, registerStubCall(LOG.foreignCallSignature, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));<NEW_LINE>link(new AMD64MathStub(LOG10, options, providers, registerStubCall(LOG10.foreignCallSignature, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));<NEW_LINE>link(new AMD64MathStub(POW, options, providers, registerStubCall(POW.foreignCallSignature, LEAF, <MASK><NEW_LINE>} else {<NEW_LINE>super.registerMathStubs(hotSpotVMConfig, providers, options);<NEW_LINE>}<NEW_LINE>} | REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS))); |
426,444 | private void executeQuery(HttpServletRequest request, HttpServletResponse response, String query, Map<String, Object> variables, String operationName) throws IOException {<NEW_LINE>GraphQLContext context = new GraphQLContext.Builder().of("request", request).of("response", response).of("bindingContext", bindingContext).build();<NEW_LINE>ExecutionInput.Builder contextBuilder = ExecutionInput.newExecutionInput().context(context).query(query);<NEW_LINE>if (variables != null) {<NEW_LINE>contextBuilder.variables(variables);<NEW_LINE>}<NEW_LINE>if (operationName != null) {<NEW_LINE>contextBuilder.operationName(operationName);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>String apiCall = operationName;<NEW_LINE>// if (!CommonUtils.isEmpty(apiCall)) {<NEW_LINE>// if (variables != null) {<NEW_LINE>// apiCall += " (" + variables + ")";<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>if (apiCall != null) {<NEW_LINE>log.debug("API > " + apiCall);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>ExecutionResult executionResult = graphQL.execute(executionInput);<NEW_LINE>Map<String, Object> resJSON = executionResult.toSpecification();<NEW_LINE>String resString = gson.toJson(resJSON);<NEW_LINE>setDevelHeaders(request, response);<NEW_LINE>response.setContentType(GraphQLConstants.CONTENT_TYPE_JSON_UTF8);<NEW_LINE>response.getWriter().print(resString);<NEW_LINE>} | ExecutionInput executionInput = contextBuilder.build(); |
1,548,358 | public void visit(InvocationExpr expr) {<NEW_LINE>ClassReader cls = context.getClassSource().get(expr.getMethod().getClassName());<NEW_LINE>if (cls != null) {<NEW_LINE>InteropUtil.processInclude(cls.getAnnotations(), includes);<NEW_LINE>MethodReader method = cls.getMethod(expr.getMethod().getDescriptor());<NEW_LINE>if (method != null) {<NEW_LINE>InteropUtil.processInclude(method.getAnnotations(), includes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean needParenthesis = false;<NEW_LINE>Intrinsic intrinsic = context.getIntrinsic(expr.getMethod());<NEW_LINE>if (intrinsic != null) {<NEW_LINE>pushLocation(expr.getLocation());<NEW_LINE>if (needsCallSiteId() && isManagedMethodCall(context.getCharacteristics(), expr.getMethod())) {<NEW_LINE>needParenthesis = true;<NEW_LINE>withCallSite();<NEW_LINE>}<NEW_LINE>intrinsic.apply(intrinsicContext, expr);<NEW_LINE>popLocation(expr.getLocation());<NEW_LINE>if (needParenthesis) {<NEW_LINE>writer.print(")");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>pushLocation(expr.getLocation());<NEW_LINE>if (needsCallSiteId() && isManagedMethodCall(context.getCharacteristics(), expr.getMethod())) {<NEW_LINE>needParenthesis = true;<NEW_LINE>withCallSite();<NEW_LINE>}<NEW_LINE>switch(expr.getType()) {<NEW_LINE>case CONSTRUCTOR:<NEW_LINE>generateCallToConstructor(expr.getMethod(), expr.getArguments());<NEW_LINE>break;<NEW_LINE>case SPECIAL:<NEW_LINE>case STATIC:<NEW_LINE>generateDirectCall(expr.getMethod(), expr.getArguments());<NEW_LINE>break;<NEW_LINE>case DYNAMIC:<NEW_LINE>{<NEW_LINE>generateVirtualCall(expr.getMethod(<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (needParenthesis) {<NEW_LINE>writer.print(")");<NEW_LINE>}<NEW_LINE>popLocation(expr.getLocation());<NEW_LINE>} | ), expr.getArguments()); |
1,584,232 | public Optional<PlanNode> visitGroupId(GroupIdNode node, Map<VariableReferenceExpression, VariableReferenceExpression> context) {<NEW_LINE>Optional<PlanNode> source = node.getSource().accept(this, context);<NEW_LINE>if (!source.isPresent()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>ImmutableMap.Builder<VariableReferenceExpression, VariableReferenceExpression> groupingColumns = ImmutableMap.builder();<NEW_LINE>for (Entry<VariableReferenceExpression, VariableReferenceExpression> entry : node.getGroupingColumns().entrySet()) {<NEW_LINE>VariableReferenceExpression column = context.get(entry.getValue());<NEW_LINE>VariableReferenceExpression reference = variableAllocator.newVariable(column, "gid");<NEW_LINE>context.put(entry.getKey(), reference);<NEW_LINE>groupingColumns.put(reference, column);<NEW_LINE>}<NEW_LINE>ImmutableList.Builder<List<VariableReferenceExpression>> groupingSets = ImmutableList.builder();<NEW_LINE>for (List<VariableReferenceExpression> groupingSet : node.getGroupingSets()) {<NEW_LINE>groupingSets.add(groupingSet.stream().map(context::get).collect(toImmutableList()));<NEW_LINE>}<NEW_LINE>VariableReferenceExpression groupId = variableAllocator.newVariable("groupid", INTEGER);<NEW_LINE>context.put(<MASK><NEW_LINE>return Optional.of(new GroupIdNode(source.get().getSourceLocation(), planNodeidAllocator.getNextId(), source.get(), groupingSets.build(), groupingColumns.build(), node.getAggregationArguments().stream().map(context::get).collect(toImmutableList()), groupId));<NEW_LINE>} | node.getGroupIdVariable(), groupId); |
511,875 | private void checkNameCollisions(Multimap<String, MemberDescriptor> jsMembersByName, Member member) {<NEW_LINE>checkOverrideConsistency(member);<NEW_LINE>if (member.isNative()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String name = member.getDescriptor().getSimpleJsName();<NEW_LINE>Set<MemberDescriptor> potentiallyCollidingMembers = new LinkedHashSet<>(jsMembersByName.get(name));<NEW_LINE>// Remove self.<NEW_LINE>boolean removed = potentiallyCollidingMembers.removeIf(<MASK><NEW_LINE>checkState(removed);<NEW_LINE>// Remove native members.<NEW_LINE>potentiallyCollidingMembers.removeIf(MemberDescriptor::isNative);<NEW_LINE>if (potentiallyCollidingMembers.isEmpty()) {<NEW_LINE>// No conflicting members, proceed.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MemberDescriptor potentiallyCollidingMember = potentiallyCollidingMembers.iterator().next();<NEW_LINE>if (potentiallyCollidingMembers.size() == 1 && isJsPropertyAccessorPair(member.getDescriptor(), potentiallyCollidingMember)) {<NEW_LINE>if (!checkJsPropertyConsistency(member.getSourcePosition(), (MethodDescriptor) member.getDescriptor(), (MethodDescriptor) potentiallyCollidingMember)) {<NEW_LINE>// remove colliding method, to avoid duplicate error messages.<NEW_LINE>jsMembersByName.get(name).removeIf(member.getDescriptor()::isSameMember);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>problems.error(member.getSourcePosition(), "'%s' and '%s' cannot both use the same JavaScript name '%s'.", member.getDescriptor().getReadableDescription(), potentiallyCollidingMember.getReadableDescription(), name);<NEW_LINE>// remove colliding method, to avoid duplicate error messages.<NEW_LINE>jsMembersByName.get(name).removeIf(member.getDescriptor()::isSameMember);<NEW_LINE>} | member.getDescriptor()::isSameMember); |
820,571 | public static Set<StoredConfigKey> changedValues(final StoredConfiguration originalConfiguration, final StoredConfiguration modifiedConfiguration) {<NEW_LINE>final Instant startTime = Instant.now();<NEW_LINE>final Predicate<StoredConfigKey> hashTester = key -> {<NEW_LINE>final Optional<String> hash1 = originalConfiguration.readStoredValue(key).map(StoredValue::valueHash);<NEW_LINE>final Optional<String> hash2 = modifiedConfiguration.readStoredValue(key<MASK><NEW_LINE>return !hash1.equals(hash2);<NEW_LINE>};<NEW_LINE>final Set<StoredConfigKey> deltaReferences = Stream.concat(CollectionUtil.iteratorToStream(originalConfiguration.keys()), CollectionUtil.iteratorToStream(modifiedConfiguration.keys())).distinct().filter(hashTester).collect(Collectors.toUnmodifiableSet());<NEW_LINE>LOGGER.trace(() -> "generated " + deltaReferences.size() + " changeLog items via compare", () -> TimeDuration.fromCurrent(startTime));<NEW_LINE>return deltaReferences;<NEW_LINE>} | ).map(StoredValue::valueHash); |
167,296 | private Problem reallyUndoRefactoring(boolean saveAfterDone) {<NEW_LINE>try {<NEW_LINE>ListIterator it = internalList.listIterator(internalList.size());<NEW_LINE>fireProgressListenerStart(0, internalList.size() + 1);<NEW_LINE>ArrayList<RefactoringElementImplementation> fileChanges = SPIAccessor.DEFAULT.getFileChanges(bag);<NEW_LINE>ArrayList<Transaction> commits = SPIAccessor.DEFAULT.getCommits(bag);<NEW_LINE>for (ListIterator<RefactoringElementImplementation> fileChangeIterator = fileChanges.listIterator(fileChanges.size()); fileChangeIterator.hasPrevious(); ) {<NEW_LINE>RefactoringElementImplementation f = fileChangeIterator.previous();<NEW_LINE>if (f.isEnabled()) {<NEW_LINE>f.undoChange();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Transaction commit : SPIAccessor.DEFAULT.getCommits(bag)) {<NEW_LINE>SPIAccessor.DEFAULT.check(commit, true);<NEW_LINE>}<NEW_LINE>UndoableWrapper wrapper = MimeLookup.getLookup("").lookup(UndoableWrapper.class);<NEW_LINE>for (ListIterator<Transaction> commitIterator = commits.listIterator(commits.size()); commitIterator.hasPrevious(); ) {<NEW_LINE>final Transaction commit = commitIterator.previous();<NEW_LINE>setWrappers(commit, wrapper);<NEW_LINE>commit.rollback();<NEW_LINE>unsetWrappers(commit, wrapper);<NEW_LINE>}<NEW_LINE>wrapper.close();<NEW_LINE>for (Transaction commit : SPIAccessor.DEFAULT.getCommits(bag)) {<NEW_LINE>SPIAccessor.DEFAULT.sum(commit);<NEW_LINE>}<NEW_LINE>while (it.hasPrevious()) {<NEW_LINE>fireProgressListenerStep();<NEW_LINE>RefactoringElementImplementation element = <MASK><NEW_LINE>if (element.isEnabled() && !((element.getStatus() == RefactoringElement.GUARDED) || (element.getStatus() == RefactoringElement.READ_ONLY))) {<NEW_LINE>element.undoChange();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (saveAfterDone) {<NEW_LINE>LifecycleManager.getDefault().saveAll();<NEW_LINE>}<NEW_LINE>fireProgressListenerStep();<NEW_LINE>} finally {<NEW_LINE>fireProgressListenerStop();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | (RefactoringElementImplementation) it.previous(); |
244,317 | private void enableLiveUpdates(boolean enable) {<NEW_LINE>if (!Algorithms.isEmpty(adapter.mapsList)) {<NEW_LINE>AlarmManager alarmMgr = (AlarmManager) app.getSystemService(Context.ALARM_SERVICE);<NEW_LINE>List<LocalIndexInfo> mapsToUpdate = getMapsToUpdate(adapter.mapsList, settings);<NEW_LINE>for (LocalIndexInfo li : mapsToUpdate) {<NEW_LINE><MASK><NEW_LINE>PendingIntent alarmIntent = getPendingIntent(app, fileName);<NEW_LINE>if (enable) {<NEW_LINE>final CommonPreference<Integer> updateFrequencyPreference = preferenceUpdateFrequency(fileName, settings);<NEW_LINE>final CommonPreference<Integer> timeOfDayPreference = preferenceTimeOfDayToUpdate(fileName, settings);<NEW_LINE>UpdateFrequency updateFrequency = UpdateFrequency.values()[updateFrequencyPreference.get()];<NEW_LINE>TimeOfDay timeOfDayToUpdate = TimeOfDay.values()[timeOfDayPreference.get()];<NEW_LINE>setAlarmForPendingIntent(alarmIntent, alarmMgr, updateFrequency, timeOfDayToUpdate);<NEW_LINE>} else {<NEW_LINE>alarmMgr.cancel(alarmIntent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String fileName = li.getFileName(); |
1,614,448 | final CreateWorkspaceResult executeCreateWorkspace(CreateWorkspaceRequest createWorkspaceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createWorkspaceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<CreateWorkspaceRequest> request = null;<NEW_LINE>Response<CreateWorkspaceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateWorkspaceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createWorkspaceRequest));<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, "IoTTwinMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateWorkspace");<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<CreateWorkspaceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateWorkspaceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,025,352 | public static void fromMappingsGem(ValueMappingsGem mappingsGem, ExecutableElement method, FormattingMessager messager, List<ValueMappingOptions> mappings) {<NEW_LINE>boolean anyFound = false;<NEW_LINE>for (ValueMappingGem mappingGem : mappingsGem.value().get()) {<NEW_LINE>ValueMappingOptions mapping = fromMappingGem(mappingGem);<NEW_LINE>if (mapping != null) {<NEW_LINE>if (!mappings.contains(mapping)) {<NEW_LINE>mappings.add(mapping);<NEW_LINE>} else {<NEW_LINE>messager.printMessage(method, mappingGem.mirror(), mappingGem.target().getAnnotationValue(), Message.VALUEMAPPING_DUPLICATE_SOURCE, mappingGem.<MASK><NEW_LINE>}<NEW_LINE>if (ANY_REMAINING.equals(mapping.source) || ANY_UNMAPPED.equals(mapping.source)) {<NEW_LINE>if (anyFound) {<NEW_LINE>messager.printMessage(method, mappingGem.mirror(), mappingGem.target().getAnnotationValue(), Message.VALUEMAPPING_ANY_AREADY_DEFINED, mappingGem.source().get());<NEW_LINE>}<NEW_LINE>anyFound = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | source().get()); |
1,029,972 | private void stop(boolean swallowException) {<NEW_LINE>log.trace("Stopping the schema registry group member.");<NEW_LINE>// Interrupt any outstanding poll calls<NEW_LINE>if (client != null) {<NEW_LINE>client.wakeup();<NEW_LINE>}<NEW_LINE>// Wait for processing thread to complete<NEW_LINE>if (executor != null) {<NEW_LINE>executor.shutdown();<NEW_LINE>try {<NEW_LINE>executor.awaitTermination(30, TimeUnit.SECONDS);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>throw new RuntimeException("Interrupted waiting for schema registry group processing thread to exit", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Do final cleanup<NEW_LINE>AtomicReference<Throwable> firstException = new AtomicReference<Throwable>();<NEW_LINE>this.stopped.set(true);<NEW_LINE><MASK><NEW_LINE>closeQuietly(metrics, "consumer metrics", firstException);<NEW_LINE>closeQuietly(client, "consumer network client", firstException);<NEW_LINE>AppInfoParser.unregisterAppInfo(JMX_PREFIX, clientId, metrics);<NEW_LINE>if (firstException.get() != null && !swallowException) {<NEW_LINE>throw new KafkaException("Failed to stop the schema registry group member", firstException.get());<NEW_LINE>} else {<NEW_LINE>log.debug("The schema registry group member has stopped.");<NEW_LINE>}<NEW_LINE>} | closeQuietly(coordinator, "coordinator", firstException); |
1,453,242 | public void trigger(DelegateExecution execution, String triggerName, Object triggerData) {<NEW_LINE>CommandContext commandContext = Context.getCommandContext();<NEW_LINE>ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);<NEW_LINE>ExecutionEntityManager executionEntityManager = processEngineConfiguration.getExecutionEntityManager();<NEW_LINE>ExecutionEntity executionEntity = (ExecutionEntity) execution;<NEW_LINE>String eventName = EventDefinitionExpressionUtil.determineSignalName(commandContext, signalEventDefinition, ProcessDefinitionUtil.getBpmnModel(execution.getProcessDefinitionId()), execution);<NEW_LINE>StartEvent startEvent = (StartEvent) execution.getCurrentFlowElement();<NEW_LINE>if (startEvent.isInterrupting()) {<NEW_LINE>List<ExecutionEntity> childExecutions = executionEntityManager.collectChildren(executionEntity.getParent());<NEW_LINE>for (int i = childExecutions.size() - 1; i >= 0; i--) {<NEW_LINE>ExecutionEntity childExecutionEntity = childExecutions.get(i);<NEW_LINE>if (!childExecutionEntity.isEnded() && !childExecutionEntity.getId().equals(executionEntity.getId())) {<NEW_LINE>executionEntityManager.deleteExecutionAndRelatedData(childExecutionEntity, DeleteReason.EVENT_SUBPROCESS_INTERRUPTING + "(" + startEvent.getId() + ")", false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>EventSubscriptionService eventSubscriptionService = processEngineConfiguration.getEventSubscriptionServiceConfiguration().getEventSubscriptionService();<NEW_LINE>List<EventSubscriptionEntity> eventSubscriptions = executionEntity.getEventSubscriptions();<NEW_LINE>for (EventSubscriptionEntity eventSubscription : eventSubscriptions) {<NEW_LINE>if (eventSubscription instanceof SignalEventSubscriptionEntity && eventSubscription.getEventName().equals(eventName)) {<NEW_LINE>eventSubscriptionService.deleteEventSubscription(eventSubscription);<NEW_LINE>CountingEntityUtil.handleDeleteEventSubscriptionEntityCount(eventSubscription);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ExecutionEntity newSubProcessExecution = executionEntityManager.createChildExecution(executionEntity.getParent());<NEW_LINE>newSubProcessExecution.setCurrentFlowElement((SubProcess) executionEntity.getCurrentFlowElement().getParentContainer());<NEW_LINE>newSubProcessExecution.setEventScope(false);<NEW_LINE>newSubProcessExecution.setScope(true);<NEW_LINE>processEngineConfiguration.getActivityInstanceEntityManager().recordActivityStart(newSubProcessExecution);<NEW_LINE>ExecutionEntity outgoingFlowExecution = executionEntityManager.createChildExecution(newSubProcessExecution);<NEW_LINE>outgoingFlowExecution.setCurrentFlowElement(startEvent);<NEW_LINE>processEngineConfiguration.<MASK><NEW_LINE>leave(outgoingFlowExecution);<NEW_LINE>} | getActivityInstanceEntityManager().recordActivityStart(outgoingFlowExecution); |
1,605,748 | public void registerDependency(GradleCoordinate coordinate, DependencyType type) {<NEW_LINE>if (type != DependencyType.IMPLEMENTATION) {<NEW_LINE>throw new UnsupportedOperationException("Unsupported dependency type in Blaze: " + type);<NEW_LINE>}<NEW_LINE>BlazeProjectData blazeProjectData = BlazeProjectDataManager.getInstance(project).getBlazeProjectData();<NEW_LINE>if (blazeProjectData == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AndroidResourceModuleRegistry registry = AndroidResourceModuleRegistry.getInstance(project);<NEW_LINE>TargetIdeInfo targetIdeInfo = blazeProjectData.getTargetMap().get(registry.getTargetKey(module));<NEW_LINE>if (targetIdeInfo == null || targetIdeInfo.getBuildFile() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// TODO: automagically edit deps instead of just opening the BUILD file?<NEW_LINE>// Need to translate Gradle coordinates into blaze targets.<NEW_LINE>// Will probably need to hardcode for each dependency.<NEW_LINE>FileEditorManager <MASK><NEW_LINE>PsiElement buildTargetPsi = BuildReferenceManager.getInstance(project).resolveLabel(targetIdeInfo.getKey().getLabel());<NEW_LINE>if (buildTargetPsi != null) {<NEW_LINE>// If we can find a PSI for the target,<NEW_LINE>// then we can jump straight to the target in the build file.<NEW_LINE>fileEditorManager.openTextEditor(new OpenFileDescriptor(project, buildTargetPsi.getContainingFile().getVirtualFile(), buildTargetPsi.getTextOffset()), true);<NEW_LINE>} else {<NEW_LINE>// If not, just the build file is good enough.<NEW_LINE>ArtifactLocation buildFile = targetIdeInfo.getBuildFile();<NEW_LINE>File buildIoFile = Preconditions.checkNotNull(OutputArtifactResolver.resolve(project, blazeProjectData.getArtifactLocationDecoder(), buildFile), "Fail to find file %s", buildFile.getRelativePath());<NEW_LINE>VirtualFile buildVirtualFile = VfsUtils.resolveVirtualFile(buildIoFile, /* refreshIfNeeded= */<NEW_LINE>true);<NEW_LINE>if (buildVirtualFile != null) {<NEW_LINE>fileEditorManager.openFile(buildVirtualFile, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | fileEditorManager = FileEditorManager.getInstance(project); |
5,622 | public void populateFromParamsMap(Map<String, String[]> params) {<NEW_LINE>if (params.containsKey(Params.NAME.getValue()))<NEW_LINE>setName(params.get(Params.NAME.getValue())[0]);<NEW_LINE>if (params.containsKey(Params.MEETING_ID.getValue()))<NEW_LINE>setMeetingID(params.get(Params.MEETING_ID.getValue())[0]);<NEW_LINE>if (params.containsKey(Params.VOICE_BRIDGE.getValue()))<NEW_LINE>setVoiceBridgeString(params.get(Params.VOICE_BRIDGE.getValue())[0]);<NEW_LINE>if (params.containsKey(Params.ATTENDEE_PW.getValue()))<NEW_LINE>setAttendeePW(params.get(Params.ATTENDEE_PW.<MASK><NEW_LINE>if (params.containsKey(Params.MODERATOR_PW.getValue()))<NEW_LINE>setModeratorPW(params.get(Params.MODERATOR_PW.getValue())[0]);<NEW_LINE>if (params.containsKey(Params.IS_BREAKOUT_ROOM.getValue()))<NEW_LINE>setBreakoutRoomString(params.get(Params.IS_BREAKOUT_ROOM.value)[0]);<NEW_LINE>if (params.containsKey(Params.RECORD.getValue()))<NEW_LINE>setRecordString(params.get(Params.RECORD.getValue())[0]);<NEW_LINE>} | getValue())[0]); |
218,052 | public static QueryRegistrantProfilesResponse unmarshall(QueryRegistrantProfilesResponse queryRegistrantProfilesResponse, UnmarshallerContext context) {<NEW_LINE>queryRegistrantProfilesResponse.setRequestId(context.stringValue("QueryRegistrantProfilesResponse.RequestId"));<NEW_LINE>queryRegistrantProfilesResponse.setTotalItemNum(context.integerValue("QueryRegistrantProfilesResponse.TotalItemNum"));<NEW_LINE>queryRegistrantProfilesResponse.setCurrentPageNum(context.integerValue("QueryRegistrantProfilesResponse.CurrentPageNum"));<NEW_LINE>queryRegistrantProfilesResponse.setTotalPageNum(context.integerValue("QueryRegistrantProfilesResponse.TotalPageNum"));<NEW_LINE>queryRegistrantProfilesResponse.setPageSize(context.integerValue("QueryRegistrantProfilesResponse.PageSize"));<NEW_LINE>queryRegistrantProfilesResponse.setPrePage(context.booleanValue("QueryRegistrantProfilesResponse.PrePage"));<NEW_LINE>queryRegistrantProfilesResponse.setNextPage(context.booleanValue("QueryRegistrantProfilesResponse.NextPage"));<NEW_LINE>List<RegistrantProfile> registrantProfiles = new ArrayList<RegistrantProfile>();<NEW_LINE>for (int i = 0; i < context.lengthValue("QueryRegistrantProfilesResponse.RegistrantProfiles.Length"); i++) {<NEW_LINE>RegistrantProfile registrantProfile = new RegistrantProfile();<NEW_LINE>registrantProfile.setRegistrantProfileId(context.longValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].RegistrantProfileId"));<NEW_LINE>registrantProfile.setCreateTime(context.stringValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].CreateTime"));<NEW_LINE>registrantProfile.setUpdateTime(context.stringValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].UpdateTime"));<NEW_LINE>registrantProfile.setDefaultRegistrantProfile(context.booleanValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].DefaultRegistrantProfile"));<NEW_LINE>registrantProfile.setRegistrantName(context.stringValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].RegistrantName"));<NEW_LINE>registrantProfile.setRegistrantOrganization(context.stringValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].RegistrantOrganization"));<NEW_LINE>registrantProfile.setCountry(context.stringValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].Country"));<NEW_LINE>registrantProfile.setProvince(context.stringValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].Province"));<NEW_LINE>registrantProfile.setCity(context.stringValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].City"));<NEW_LINE>registrantProfile.setAddress(context.stringValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].Address"));<NEW_LINE>registrantProfile.setEmail(context.stringValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].Email"));<NEW_LINE>registrantProfile.setPostalCode(context.stringValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].PostalCode"));<NEW_LINE>registrantProfile.setTelArea(context.stringValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].TelArea"));<NEW_LINE>registrantProfile.setTelephone(context.stringValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].Telephone"));<NEW_LINE>registrantProfile.setTelExt(context.stringValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].TelExt"));<NEW_LINE>registrantProfile.setEmailVerificationStatus(context.integerValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].EmailVerificationStatus"));<NEW_LINE>registrantProfile.setRegistrantType(context.stringValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].RegistrantType"));<NEW_LINE>registrantProfile.setRealNameStatus(context.stringValue<MASK><NEW_LINE>registrantProfile.setRegistrantProfileType(context.stringValue("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].RegistrantProfileType"));<NEW_LINE>registrantProfiles.add(registrantProfile);<NEW_LINE>}<NEW_LINE>queryRegistrantProfilesResponse.setRegistrantProfiles(registrantProfiles);<NEW_LINE>return queryRegistrantProfilesResponse;<NEW_LINE>} | ("QueryRegistrantProfilesResponse.RegistrantProfiles[" + i + "].RealNameStatus")); |
718,240 | public void run() {<NEW_LINE>try {<NEW_LINE>SevenZFile sevenZFile = new SevenZFile(new File(filePath));<NEW_LINE>SevenZArchiveEntry entry = sevenZFile.getNextEntry();<NEW_LINE>while (entry != null) {<NEW_LINE>if (entry.isDirectory()) {<NEW_LINE>entry = sevenZFile.getNextEntry();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String childName = "default_file";<NEW_LINE>SevenZArchiveEntry entry1;<NEW_LINE>for (Map<String, SevenZArchiveEntry> entryMap : entriesToBeExtracted) {<NEW_LINE>childName = entryMap.keySet().iterator().next();<NEW_LINE>entry1 = entryMap.values().iterator().next();<NEW_LINE>if (entry.getName().equals(entry1.getName())) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FileOutputStream out <MASK><NEW_LINE>byte[] content = new byte[(int) entry.getSize()];<NEW_LINE>sevenZFile.read(content, 0, content.length);<NEW_LINE>out.write(content);<NEW_LINE>out.close();<NEW_LINE>entry = sevenZFile.getNextEntry();<NEW_LINE>}<NEW_LINE>sevenZFile.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>KkFileUtils.deleteFileByPath(filePath);<NEW_LINE>} | = new FileOutputStream(fileDir + childName); |
812,196 | public void addPet(Pet body, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {<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 addPet", new ApiException(400, "Missing the required parameter 'body' when calling addPet"));<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String path = "/pet".replaceAll("\\{format\\}", "json");<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[] contentTypes = { "application/json", "application/xml" };<NEW_LINE>String contentType = contentTypes.length > <MASK><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>apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, new Response.Listener<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(String localVarResponse) {<NEW_LINE>responseListener.onResponse(localVarResponse);<NEW_LINE>}<NEW_LINE>}, new Response.ErrorListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onErrorResponse(VolleyError error) {<NEW_LINE>errorListener.onErrorResponse(error);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (ApiException ex) {<NEW_LINE>errorListener.onErrorResponse(new VolleyError(ex));<NEW_LINE>}<NEW_LINE>} | 0 ? contentTypes[0] : "application/json"; |
1,253,836 | private boolean S4U2SelfTest(StringBuffer sb) {<NEW_LINE>boolean pass = false;<NEW_LINE>try {<NEW_LINE>if (krb5conf != null && krb5Keytab != null) {<NEW_LINE>setSystemProperty("KRB5_KTNAME", krb5Keytab);<NEW_LINE>setSystemProperty("java.security.krb5.conf", krb5conf);<NEW_LINE>}<NEW_LINE>String token = SpnegoHelper.buildS4U2ProxyAuthorizationUsingS4U2Self(upn, spn, lifetime, delegate, delegateServiceSpn, jaas, krb5Keytab);<NEW_LINE>writeLine(sb, "We were able to obtain the following " + upn + " spnego token: " + token);<NEW_LINE>pass = true;<NEW_LINE>writeLine(sb, "S4U2Self Call API Test Succeeded");<NEW_LINE><MASK><NEW_LINE>} catch (GSSException e) {<NEW_LINE>writeLine(sb, "S4U2Self Call API Test failed. Unexpected GSSException thrown Major=" + e.getMajor());<NEW_LINE>} catch (PrivilegedActionException e) {<NEW_LINE>writeLine(sb, "S4U2Self Call API Test failed. Unexpected PrivilegedActionException thrown " + e.getMessage());<NEW_LINE>} catch (Exception e) {<NEW_LINE>writeLine(sb, "S4U2Self Call API Test failed. Unexpected Exception thrown " + e.getMessage());<NEW_LINE>}<NEW_LINE>return pass;<NEW_LINE>} | writeLine(sb, "Spnego token:" + token); |
1,065,693 | private List<Rule> buildMapValidation(Map map, List<Map> entries) throws Exception {<NEW_LINE>List<Rule> rules = new ArrayList<>(2);<NEW_LINE>List<String> required = entries.stream().filter(this::isRequired).map(entry -> {<NEW_LINE>try {<NEW_LINE>return readNotNull(entry, String.class, MAP_ENTRY_KEY_KEY);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Unexpected error", e);<NEW_LINE>}<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<Object> exclusives = (List<Object>) cast(List.class, EXCLUSIVES_KEY, map.get(EXCLUSIVES_KEY));<NEW_LINE>if (exclusives != null) {<NEW_LINE>Collection<Set<String>> exclusiveSets = exclusives.stream().map(item -> {<NEW_LINE>if (item instanceof String) {<NEW_LINE>return Collections.singleton((String) item);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>List<String> strings = castList(String.class, cast(List.class, null, item));<NEW_LINE>return new HashSet<>(strings);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Unexpected error", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>rules.add(<MASK><NEW_LINE>} else {<NEW_LINE>rules.add(new RequiredRule(required));<NEW_LINE>}<NEW_LINE>return rules.isEmpty() ? Collections.emptyList() : rules;<NEW_LINE>} | new ExclusiveRule(exclusiveSets, required)); |
710,990 | public Request<ModifyVpnTunnelCertificateRequest> marshall(ModifyVpnTunnelCertificateRequest modifyVpnTunnelCertificateRequest) {<NEW_LINE>if (modifyVpnTunnelCertificateRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ModifyVpnTunnelCertificateRequest> request = new DefaultRequest<ModifyVpnTunnelCertificateRequest>(modifyVpnTunnelCertificateRequest, "AmazonEC2");<NEW_LINE>request.addParameter("Action", "ModifyVpnTunnelCertificate");<NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE><MASK><NEW_LINE>if (modifyVpnTunnelCertificateRequest.getVpnConnectionId() != null) {<NEW_LINE>request.addParameter("VpnConnectionId", StringUtils.fromString(modifyVpnTunnelCertificateRequest.getVpnConnectionId()));<NEW_LINE>}<NEW_LINE>if (modifyVpnTunnelCertificateRequest.getVpnTunnelOutsideIpAddress() != null) {<NEW_LINE>request.addParameter("VpnTunnelOutsideIpAddress", StringUtils.fromString(modifyVpnTunnelCertificateRequest.getVpnTunnelOutsideIpAddress()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.setHttpMethod(HttpMethodName.POST); |
509,774 | protected IRODSFileSystem configure(final IRODSFileSystem client) {<NEW_LINE>final SettableJargonProperties properties = new SettableJargonProperties(client.getJargonProperties());<NEW_LINE>properties.<MASK><NEW_LINE>final PreferencesReader preferences = new HostPreferences(host);<NEW_LINE>final int timeout = ConnectionTimeoutFactory.get(preferences).getTimeout() * 1000;<NEW_LINE>properties.setIrodsSocketTimeout(timeout);<NEW_LINE>properties.setIrodsParallelSocketTimeout(timeout);<NEW_LINE>properties.setGetBufferSize(preferences.getInteger("connection.chunksize"));<NEW_LINE>properties.setPutBufferSize(preferences.getInteger("connection.chunksize"));<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Configure client %s with properties %s", client, properties));<NEW_LINE>}<NEW_LINE>client.getIrodsSession().setJargonProperties(properties);<NEW_LINE>client.getIrodsSession().setX509TrustManager(trust);<NEW_LINE>return client;<NEW_LINE>} | setEncoding(host.getEncoding()); |
1,745,179 | private void computeRemainingRows(int row0, int row1, WorkSpace ws) {<NEW_LINE>int disparityMax = Math.min(left.width, this.disparityMax);<NEW_LINE>for (int row = row0 + regionHeight; row < row1; row++) {<NEW_LINE>int oldRow = (row - row0) % regionHeight;<NEW_LINE>// subtract first row from vertical score<NEW_LINE>final float[] scores = ws.horizontalScore[oldRow];<NEW_LINE>for (int i = 0; i < widthDisparityBlock; i++) {<NEW_LINE>ws.verticalScore[i] -= scores[i];<NEW_LINE>}<NEW_LINE>growBorderL.growRow(row, radiusX, radiusX, ws.leftRow, 0);<NEW_LINE>growBorderR.growRow(row, radiusX, <MASK><NEW_LINE>scoreRows.scoreRow(row, ws.leftRow, ws.rightRow, scores, disparityMin, disparityMax, regionWidth, ws.elementScore);<NEW_LINE>// add the new score<NEW_LINE>for (int i = 0; i < widthDisparityBlock; i++) {<NEW_LINE>ws.verticalScore[i] += scores[i];<NEW_LINE>}<NEW_LINE>// compute disparity<NEW_LINE>if (scoreRows.isRequireNormalize()) {<NEW_LINE>scoreRows.normalizeRegionScores(row - regionHeight + 1 + radiusY, ws.verticalScore, disparityMin, disparityMax, regionWidth, regionHeight, ws.verticalScoreNorm);<NEW_LINE>ws.computeDisparity.process(row - regionHeight + 1 + radiusY, ws.verticalScoreNorm);<NEW_LINE>} else {<NEW_LINE>ws.computeDisparity.process(row - regionHeight + 1 + radiusY, ws.verticalScore);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | radiusX, ws.rightRow, 0); |
413,323 | public LinearGraphAnswer performAction(@Nonnull ActionContext context) {<NEW_LINE>CollapsedGraph.Modification modification <MASK><NEW_LINE>modification.removeAdditionalEdges();<NEW_LINE>modification.resetNodesVisibility();<NEW_LINE>LinearGraph delegateGraph = context.getDelegatedGraph();<NEW_LINE>for (int nodeIndex = 0; nodeIndex < delegateGraph.nodesCount(); nodeIndex++) {<NEW_LINE>if (modification.isNodeHidden(nodeIndex))<NEW_LINE>continue;<NEW_LINE>GraphFragment fragment = context.myDelegatedFragmentGenerators.linearFragmentGenerator.getLongDownFragment(nodeIndex);<NEW_LINE>if (fragment != null) {<NEW_LINE>Set<Integer> middleNodes = context.myDelegatedFragmentGenerators.fragmentGenerator.getMiddleNodes(fragment.upNodeIndex, fragment.downNodeIndex, true);<NEW_LINE>for (Integer nodeIndexForHide : middleNodes) modification.hideNode(nodeIndexForHide);<NEW_LINE>modification.createEdge(new GraphEdge(fragment.upNodeIndex, fragment.downNodeIndex, null, GraphEdgeType.DOTTED));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new DeferredGraphAnswer(GraphChangesUtil.SOME_CHANGES, modification);<NEW_LINE>} | = context.myCollapsedGraph.startModification(); |
440,593 | private void exportCollectedHUsIfRequired(@NonNull final Collection<ExportHUCandidate> huCandidates) {<NEW_LINE>if (huCandidates.isEmpty()) {<NEW_LINE>Loggables.withLogger(logger, Level<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!externalSystemConfigRepo.isAnyConfigActive(getExternalSystemType())) {<NEW_LINE>Loggables.withLogger(logger, Level.DEBUG).addLog("No active config found for external system type: {}! No action is performed!", getExternalSystemType());<NEW_LINE>// nothing to do<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (final ExportHUCandidate exportHUCandidate : huCandidates) {<NEW_LINE>final I_M_HU topLevelParent = handlingUnitsBL.getTopLevelParent(exportHUCandidate.getHuId());<NEW_LINE>final TableRecordReference topLevelRef = TableRecordReference.of(I_M_HU.Table_Name, topLevelParent.getM_HU_ID());<NEW_LINE>exportToExternalSystemIfRequired(topLevelRef, () -> getAdditionalExternalSystemConfigIds(exportHUCandidate));<NEW_LINE>}<NEW_LINE>} | .DEBUG).addLog("HuId list to sync empty! No action is performed!"); |
296,957 | static ReusablePort create(int port) throws IOException {<NEW_LINE>// Why not upgrading TonY to Java 9+ given port reuse is supported in Java 9+?<NEW_LINE>// - In Linkedin, as of now(2020/08), only Java 8 and 11 are officially supported, but Java 11<NEW_LINE>// introduces incompatibility with Play version tony-portal<NEW_LINE>// (https://github.com/linkedin/TonY/tree/master/tony-portal) is using. Upgrading Play to a<NEW_LINE>// Java 11-compatible version requires non-trivial amount of effort.<NEW_LINE>Preconditions.checkArgument(port > 0, "Port must > 0.");<NEW_LINE>String socketBindingProcess = String.format("python %s -p %s", RESERVE_PORT_SCRIPT_PATH, port);<NEW_LINE>ProcessBuilder taskProcessBuilder = new ProcessBuilder("bash", "-c", socketBindingProcess);<NEW_LINE>taskProcessBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);<NEW_LINE>taskProcessBuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);<NEW_LINE>if (isPortAvailable(port)) {<NEW_LINE><MASK><NEW_LINE>// Launching the python process binding the socket. The python process will create a file<NEW_LINE>// after port is bound. TonY needs to wait the file creation.<NEW_LINE>Process taskProcess = taskProcessBuilder.start();<NEW_LINE>boolean portSuccessfulyCreated = waitTillPortReserved(port);<NEW_LINE>if (!portSuccessfulyCreated) {<NEW_LINE>LOG.info("Port " + port + " failed to be reserved");<NEW_LINE>killSocketBindingProcess(taskProcess);<NEW_LINE>throw new IOException("Fail to bind to the port " + port);<NEW_LINE>}<NEW_LINE>LOG.info("Port " + port + " is reserved");<NEW_LINE>return new ReusablePort(taskProcess, port);<NEW_LINE>} else {<NEW_LINE>LOG.info("Port " + port + " is no longer available");<NEW_LINE>throw new IOException("Fail to bind to the port " + port);<NEW_LINE>}<NEW_LINE>} | LOG.debug("Starting process " + socketBindingProcess); |
1,405,383 | public static int vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, @Nullable @NativeType("char const *") CharSequence pLayerName, @NativeType("uint32_t *") int[] pPropertyCount, @Nullable @NativeType("VkExtensionProperties *") VkExtensionProperties.Buffer pProperties) {<NEW_LINE>long __functionAddress = physicalDevice.getCapabilities().vkEnumerateDeviceExtensionProperties;<NEW_LINE>if (CHECKS) {<NEW_LINE>check(pPropertyCount, 1);<NEW_LINE>checkSafe(pProperties, pPropertyCount[0]);<NEW_LINE>}<NEW_LINE>MemoryStack stack = stackGet();<NEW_LINE>int stackPointer = stack.getPointer();<NEW_LINE>try {<NEW_LINE>stack.nUTF8Safe(pLayerName, true);<NEW_LINE>long pLayerNameEncoded = pLayerName == null ? NULL : stack.getPointerAddress();<NEW_LINE>return callPPPPI(physicalDevice.address(), pLayerNameEncoded, pPropertyCount<MASK><NEW_LINE>} finally {<NEW_LINE>stack.setPointer(stackPointer);<NEW_LINE>}<NEW_LINE>} | , memAddressSafe(pProperties), __functionAddress); |
1,070,896 | public void testBasicPassivation() throws Exception {<NEW_LINE>SessionIdCache.clearAll();<NEW_LINE>final InitialContext ic = new InitialContext();<NEW_LINE>StatefulSessionBeanLocal sBean = (StatefulSessionBeanLocal) ic.lookup(BeanName);<NEW_LINE>assertNotNull(sBean);<NEW_LINE>final String beanId = sBean.getSessionId();<NEW_LINE>assertTrue(SessionIdCache.sessionList.contains(beanId));<NEW_LINE>SessionIdCache.removeActivatePassivate(beanId);<NEW_LINE>final String description = "This is a test with beanId = " + beanId;<NEW_LINE>final String mutatedDescription = "MUTATION:" + description;<NEW_LINE>final PassivateEntity newEntity = sBean.newEntity(description);<NEW_LINE>assertNotNull(newEntity);<NEW_LINE>assertTrue(SessionIdCache<MASK><NEW_LINE>assertTrue(SessionIdCache.activateList.contains(beanId));<NEW_LINE>SessionIdCache.removeActivatePassivate(beanId);<NEW_LINE>final PassivateEntity findEntity = sBean.findEntity(newEntity.getId());<NEW_LINE>assertNotNull(findEntity);<NEW_LINE>assertNotSame(newEntity, findEntity);<NEW_LINE>assertTrue(SessionIdCache.passivateList.contains(beanId));<NEW_LINE>assertTrue(SessionIdCache.activateList.contains(beanId));<NEW_LINE>SessionIdCache.removeActivatePassivate(beanId);<NEW_LINE>findEntity.setDescription(mutatedDescription);<NEW_LINE>final PassivateEntity updatedEntity = sBean.updateEntity(findEntity);<NEW_LINE>assertNotNull(updatedEntity);<NEW_LINE>assertNotSame(updatedEntity, findEntity);<NEW_LINE>assertTrue(SessionIdCache.passivateList.contains(beanId));<NEW_LINE>assertTrue(SessionIdCache.activateList.contains(beanId));<NEW_LINE>SessionIdCache.removeActivatePassivate(beanId);<NEW_LINE>sBean.removeEntity(updatedEntity);<NEW_LINE>assertTrue(SessionIdCache.passivateList.contains(beanId));<NEW_LINE>assertTrue(SessionIdCache.activateList.contains(beanId));<NEW_LINE>sBean.remove();<NEW_LINE>// writer.println("SUCCESS:testBasicPassivation");<NEW_LINE>} | .passivateList.contains(beanId)); |
1,082,718 | public static void configureJavaDocTask(@Nullable String featureName, SourceSet sourceSet, TaskContainer tasks, @Nullable JavaPluginExtension javaPluginExtension) {<NEW_LINE>String javadocTaskName = sourceSet.getJavadocTaskName();<NEW_LINE>if (!tasks.getNames().contains(javadocTaskName)) {<NEW_LINE>tasks.register(javadocTaskName, Javadoc.class, javadoc -> {<NEW_LINE>javadoc.setDescription("Generates Javadoc API documentation for the " + (featureName == null ? "main source code." <MASK><NEW_LINE>javadoc.setGroup(JavaBasePlugin.DOCUMENTATION_GROUP);<NEW_LINE>javadoc.setClasspath(sourceSet.getOutput().plus(sourceSet.getCompileClasspath()));<NEW_LINE>javadoc.setSource(sourceSet.getAllJava());<NEW_LINE>if (javaPluginExtension != null) {<NEW_LINE>javadoc.getConventionMapping().map("destinationDir", () -> javaPluginExtension.getDocsDir().dir(javadocTaskName).get().getAsFile());<NEW_LINE>javadoc.getModularity().getInferModulePath().convention(javaPluginExtension.getModularity().getInferModulePath());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | : "'" + featureName + "' feature.")); |
1,061,595 | public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {<NEW_LINE>String trackingId = System.getenv("GA_TRACKING_ID");<NEW_LINE>HttpClient client = HttpClientBuilder.create().build();<NEW_LINE>URIBuilder builder = new URIBuilder();<NEW_LINE>// API Version.<NEW_LINE>builder.setScheme("http").setHost("www.google-analytics.com").setPath("/collect").// API Version.<NEW_LINE>addParameter(// API Version.<NEW_LINE>"v", // Tracking ID / Property ID.<NEW_LINE>"1").// Tracking ID / Property ID.<NEW_LINE>addParameter(// Tracking ID / Property ID.<NEW_LINE>"tid", // Anonymous Client Identifier. Ideally, this should be a UUID that<NEW_LINE>trackingId).// is associated with particular user, device, or browser instance.<NEW_LINE>addParameter("cid", // Event hit type.<NEW_LINE>"555").// Event hit type.<NEW_LINE>addParameter(// Event hit type.<NEW_LINE>"t", // Event category.<NEW_LINE>"event").// Event category.<NEW_LINE>addParameter(// Event category.<NEW_LINE>"ec", // Event action.<NEW_LINE>"example").// Event action.<NEW_LINE>addParameter(// Event action.<NEW_LINE>"ea", "test action");<NEW_LINE>URI uri = null;<NEW_LINE>try {<NEW_LINE>uri = builder.build();<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new ServletException("Problem building URI", e);<NEW_LINE>}<NEW_LINE>HttpPost request = new HttpPost(uri);<NEW_LINE>client.execute(request);<NEW_LINE>resp.<MASK><NEW_LINE>} | getWriter().println("Event tracked."); |
103,689 | final DescribeDataIngestionJobResult executeDescribeDataIngestionJob(DescribeDataIngestionJobRequest describeDataIngestionJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDataIngestionJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDataIngestionJobRequest> request = null;<NEW_LINE>Response<DescribeDataIngestionJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDataIngestionJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDataIngestionJobRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "LookoutEquipment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDataIngestionJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDataIngestionJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDataIngestionJobResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,783,806 | private void initKeys(String json) {<NEW_LINE>try {<NEW_LINE>org.jose4j.jwk.JsonWebKeySet jwkSet = new org.jose4j.jwk.JsonWebKeySet(json);<NEW_LINE>for (JsonWebKey jwkKey : jwkSet.getJsonWebKeys()) {<NEW_LINE>if (isSupportedJwkKey(jwkKey)) {<NEW_LINE>if (jwkKey.getKeyId() != null) {<NEW_LINE>keysWithKeyId.put(jwkKey.getKeyId(), jwkKey.getKey());<NEW_LINE>}<NEW_LINE>// 'x5t' may not be available but the certificate `x5c` may be so 'x5t' can be calculated early<NEW_LINE>boolean calculateThumbprintIfMissing = true;<NEW_LINE>String x5t = ((PublicJsonWebKey<MASK><NEW_LINE>if (x5t != null && jwkKey.getKey() != null) {<NEW_LINE>keysWithThumbprints.put(x5t, jwkKey.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (keysWithKeyId.isEmpty() && keysWithThumbprints.isEmpty() && jwkSet.getJsonWebKeys().size() == 1 && isSupportedJwkKey(jwkSet.getJsonWebKeys().get(0))) {<NEW_LINE>keyWithoutKeyIdAndThumbprint = jwkSet.getJsonWebKeys().get(0).getKey();<NEW_LINE>}<NEW_LINE>} catch (JoseException ex) {<NEW_LINE>throw new OIDCException(ex);<NEW_LINE>}<NEW_LINE>} | ) jwkKey).getX509CertificateSha1Thumbprint(calculateThumbprintIfMissing); |
64,055 | public static SslContext createSSLContext(boolean isServer) throws SSLException, CertificateException {<NEW_LINE>SslContext sslCtx;<NEW_LINE>SelfSignedCertificate ssc = new SelfSignedCertificate();<NEW_LINE>if (isServer) {<NEW_LINE>sslCtx = SslContextBuilder.forServer(ssc.certificate(), ssc.privateKey()).sslProvider(SslProvider.JDK).ciphers(Http2SecurityUtil.CIPHERS, SupportedCipherSuiteFilter.INSTANCE).applicationProtocolConfig(new ApplicationProtocolConfig(Protocol.ALPN, SelectorFailureBehavior.NO_ADVERTISE, SelectedListenerFailureBehavior.ACCEPT, ApplicationProtocolNames.HTTP_2, ApplicationProtocolNames.HTTP_1_1)).build();<NEW_LINE>} else {<NEW_LINE>sslCtx = SslContextBuilder.forClient().sslProvider(SslProvider.JDK).ciphers(Http2SecurityUtil.CIPHERS, SupportedCipherSuiteFilter.INSTANCE).trustManager(InsecureTrustManagerFactory.INSTANCE).applicationProtocolConfig(new ApplicationProtocolConfig(Protocol.ALPN, SelectorFailureBehavior.NO_ADVERTISE, SelectedListenerFailureBehavior.ACCEPT, ApplicationProtocolNames<MASK><NEW_LINE>}<NEW_LINE>return sslCtx;<NEW_LINE>} | .HTTP_2)).build(); |
1,511,654 | public Block parseBlock(RawBlock rawBlock) throws BlockHashNotConnectingException, BlockHeightNotConnectingException {<NEW_LINE><MASK><NEW_LINE>int blockHeight = rawBlock.getHeight();<NEW_LINE>log.trace("Parse block at height={} ", blockHeight);<NEW_LINE>validateIfBlockIsConnecting(rawBlock);<NEW_LINE>daoStateService.onNewBlockHeight(blockHeight);<NEW_LINE>// We create a block from the rawBlock but the transaction list is not set yet (is empty)<NEW_LINE>final Block block = new Block(blockHeight, rawBlock.getTime(), rawBlock.getHash(), rawBlock.getPreviousBlockHash());<NEW_LINE>if (isBlockAlreadyAdded(rawBlock)) {<NEW_LINE>log.warn("Block was already added.");<NEW_LINE>DevEnv.logErrorAndThrowIfDevMode("Block was already added. rawBlock=" + rawBlock);<NEW_LINE>} else {<NEW_LINE>daoStateService.onNewBlockWithEmptyTxs(block);<NEW_LINE>}<NEW_LINE>// Worst case is that all txs in a block are depending on another, so only one get resolved at each iteration.<NEW_LINE>// Min tx size is 189 bytes (normally about 240 bytes), 1 MB can contain max. about 5300 txs (usually 2000).<NEW_LINE>// Realistically we don't expect more than a few recursive calls.<NEW_LINE>// There are some blocks with testing such dependency chains like block 130768 where at each iteration only<NEW_LINE>// one get resolved.<NEW_LINE>// Lately there is a patter with 24 iterations observed<NEW_LINE>rawBlock.getRawTxs().forEach(rawTx -> txParser.findTx(rawTx, genesisTxId, genesisBlockHeight, genesisTotalSupply).ifPresent(tx -> daoStateService.onNewTxForLastBlock(block, tx)));<NEW_LINE>daoStateService.onParseBlockComplete(block);<NEW_LINE>long duration = System.currentTimeMillis() - startTs;<NEW_LINE>if (duration > 10) {<NEW_LINE>log.info("Parsing {} transactions at block height {} took {} ms", rawBlock.getRawTxs().size(), blockHeight, duration);<NEW_LINE>}<NEW_LINE>return block;<NEW_LINE>} | long startTs = System.currentTimeMillis(); |
1,071,473 | public void addAnomalyTS(CombinedDomainXYPlot plot, DataSequence observedSeries, DataSequence expectedSeries) {<NEW_LINE>// Compute the time-series of errors.<NEW_LINE>HashMap<String, ArrayList<Float>> allErrors = aes.initAnomalyErrors(observedSeries, expectedSeries);<NEW_LINE>Float sDAutoSensitivity = (float) 0.0;<NEW_LINE>Float amntAutoSensitivity = (float) 0.0;<NEW_LINE>if (config.getProperty("AUTO_SENSITIVITY_ANOMALY_PCNT") != null) {<NEW_LINE>amntAutoSensitivity = new Float<MASK><NEW_LINE>}<NEW_LINE>if (config.getProperty("AUTO_SENSITIVITY_SD") != null) {<NEW_LINE>sDAutoSensitivity = new Float(config.getProperty("AUTO_SENSITIVITY_SD"));<NEW_LINE>}<NEW_LINE>String errorDebug = "";<NEW_LINE>for (int i = 0; i < (aes.getIndexToError().keySet()).size(); i++) {<NEW_LINE>Float[] fArray = (allErrors.get(aes.getIndexToError().get(i))).toArray(new Float[(allErrors.get(aes.getIndexToError().get(i))).size()]);<NEW_LINE>XYDataset data1 = createDataset(fArray, aes.getIndexToError().get(i));<NEW_LINE>XYItemRenderer renderer1 = new StandardXYItemRenderer();<NEW_LINE>NumberAxis rangeAxis1 = new NumberAxis(aes.getIndexToError().get(i));<NEW_LINE>XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1);<NEW_LINE>// Get threshold.<NEW_LINE>Float d = AutoSensitivity.getLowDensitySensitivity(fArray, sDAutoSensitivity, amntAutoSensitivity);<NEW_LINE>subplot1.addRangeMarker(new ValueMarker(d));<NEW_LINE>subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);<NEW_LINE>plot.add(subplot1, 1);<NEW_LINE>errorDebug += aes.getIndexToError().get(i) + ": " + d + " ";<NEW_LINE>}<NEW_LINE>System.out.println(errorDebug);<NEW_LINE>} | (config.getProperty("AUTO_SENSITIVITY_ANOMALY_PCNT")); |
1,141,807 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String labPlanName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (labPlanName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, labPlanName, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
1,021,482 | public void onScriptCallbackEvent(ScriptCallbackEvent scriptCallbackEvent) {<NEW_LINE>switch(scriptCallbackEvent.getEventName()) {<NEW_LINE>case "confirmFriendsChatKick":<NEW_LINE>{<NEW_LINE>if (!config.confirmKicks() || kickConfirmed) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Set a flag so the script doesn't instantly kick them<NEW_LINE>final int[<MASK><NEW_LINE>final int size = client.getIntStackSize();<NEW_LINE>intStack[size - 1] = 1;<NEW_LINE>// Get name of player we are trying to kick<NEW_LINE>final String[] stringStack = client.getStringStack();<NEW_LINE>final int stringSize = client.getStringStackSize();<NEW_LINE>final String kickPlayerName = stringStack[stringSize - 1];<NEW_LINE>// Show a chatbox panel confirming the kick<NEW_LINE>clientThread.invokeLater(() -> confirmKickPlayer(kickPlayerName));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ] intStack = client.getIntStack(); |
1,222,661 | protected static boolean putInt(ContentResolver cr, String name, int value) {<NEW_LINE>boolean changed = !Objects.equals(get(cr).put(name, value), value);<NEW_LINE>if (Settings.Secure.LOCATION_MODE.equals(name)) {<NEW_LINE>if (RuntimeEnvironment.getApiLevel() <= P) {<NEW_LINE>// do this after setting location mode but before invoking contentobservers, so that<NEW_LINE>// observers for both settings will see the correct values<NEW_LINE>boolean gps = (value == Settings.Secure.LOCATION_MODE_SENSORS_ONLY || value == Settings.Secure.LOCATION_MODE_HIGH_ACCURACY);<NEW_LINE>boolean network = (value == Settings.Secure.LOCATION_MODE_BATTERY_SAVING || value == Settings.Secure.LOCATION_MODE_HIGH_ACCURACY);<NEW_LINE>Settings.Secure.setLocationProviderEnabled(cr, LocationManager.GPS_PROVIDER, gps);<NEW_LINE>Settings.Secure.setLocationProviderEnabled(<MASK><NEW_LINE>}<NEW_LINE>Intent modeBroadcast = new Intent(LocationManager.MODE_CHANGED_ACTION);<NEW_LINE>if (RuntimeEnvironment.getApiLevel() >= R) {<NEW_LINE>modeBroadcast.putExtra(LocationManager.EXTRA_LOCATION_ENABLED, value != LOCATION_MODE_OFF);<NEW_LINE>}<NEW_LINE>RuntimeEnvironment.getApplication().sendBroadcast(modeBroadcast);<NEW_LINE>}<NEW_LINE>if (changed && cr != null) {<NEW_LINE>cr.notifyChange(Settings.Secure.getUriFor(name), null);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | cr, LocationManager.NETWORK_PROVIDER, network); |
193,971 | public void upload2() {<NEW_LINE>// BEGIN: com.azure.storage.blob.specialized.cryptography.EncryptedBlobAsyncClient.uploadWithResponse#Flux-ParallelTransferOptions-BlobHttpHeaders-Map-AccessTier-BlobRequestConditions<NEW_LINE>BlobHttpHeaders headers = new BlobHttpHeaders().setContentMd5("data".getBytes(StandardCharsets.UTF_8)).setContentLanguage("en-US").setContentType("binary");<NEW_LINE>Map<String, String> metadata = new HashMap<>(Collections.singletonMap("metadata", "value"));<NEW_LINE>BlobRequestConditions requestConditions = new BlobRequestConditions().setLeaseId(leaseId).setIfUnmodifiedSince(OffsetDateTime.now<MASK><NEW_LINE>ParallelTransferOptions parallelTransferOptions = new ParallelTransferOptions().setBlockSizeLong(blockSize).setMaxConcurrency(maxConcurrency);<NEW_LINE>client.uploadWithResponse(data, parallelTransferOptions, headers, metadata, AccessTier.HOT, requestConditions).subscribe(response -> System.out.printf("Uploaded BlockBlob MD5 is %s%n", Base64.getEncoder().encodeToString(response.getValue().getContentMd5())));<NEW_LINE>// END: com.azure.storage.blob.specialized.cryptography.EncryptedBlobAsyncClient.uploadWithResponse#Flux-ParallelTransferOptions-BlobHttpHeaders-Map-AccessTier-BlobRequestConditions<NEW_LINE>} | ().minusDays(3)); |
965,082 | protected Element createSectionRoot(FOConversionContext conversionContext, Document document, ConversionSectionWrapper sectionWrapper, Element currentParent) throws Docx4JException {<NEW_LINE>Element pageSequence = document.createElementNS(XSL_FO, "page-sequence");<NEW_LINE>int pageNumberInitial = sectionWrapper.getPageNumberInformation().getPageStart();<NEW_LINE>String pageFormat = sectionWrapper.getPageNumberInformation().getPageFormat();<NEW_LINE>pageSequence.setAttribute("master-reference", sectionWrapper.getId());<NEW_LINE>pageSequence.setAttribute("id", "section_" + sectionWrapper.getId());<NEW_LINE>pageFormat = FormattingSwitchHelper.getFoPageNumberFormat(pageFormat);<NEW_LINE>if (pageNumberInitial > -1) {<NEW_LINE>pageSequence.setAttribute("initial-page-number"<MASK><NEW_LINE>}<NEW_LINE>if (pageFormat != null) {<NEW_LINE>pageSequence.setAttribute("format", pageFormat);<NEW_LINE>}<NEW_LINE>return pageSequence;<NEW_LINE>} | , Integer.toString(pageNumberInitial)); |
1,650,839 | public void contribute(BuildContext context, AotOptions aotOptions) {<NEW_LINE>try {<NEW_LINE>Set<SpringFactory> springFactories = loadSpringFactories(context);<NEW_LINE>FactoriesCodeContributors contributors = new FactoriesCodeContributors(aotOptions);<NEW_LINE>CodeGenerator codeGenerator = contributors.createCodeGenerator(springFactories, context, aotOptions);<NEW_LINE>context.addSourceFiles(SourceFiles.fromJavaFile<MASK><NEW_LINE>codeGenerator.generateStaticFactoryClasses().forEach(javaFile -> {<NEW_LINE>context.addSourceFiles(SourceFiles.fromJavaFile(javaFile));<NEW_LINE>});<NEW_LINE>ClassPathResource factoriesLoader = new ClassPathResource("SpringFactoriesLoader.java", getClass());<NEW_LINE>context.addSourceFiles(SourceFiles.fromStaticFile("org.springframework.core.io.support", "SpringFactoriesLoader", factoriesLoader.getInputStream()));<NEW_LINE>} catch (Exception exc) {<NEW_LINE>throw new CodeGenerationException("Could not generate spring.factories source code", exc);<NEW_LINE>}<NEW_LINE>} | (codeGenerator.generateStaticSpringFactories())); |
1,077,260 | private int createInternal(String path, long mode, FuseFileInfo fi) {<NEW_LINE>final AlluxioURI <MASK><NEW_LINE>if (uri.getName().length() > MAX_NAME_LENGTH) {<NEW_LINE>LOG.error("Failed to create {}: file name longer than {} characters", path, MAX_NAME_LENGTH);<NEW_LINE>return -ErrorCodes.ENAMETOOLONG();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>FileOutStream os = mFileSystem.createFile(uri, CreateFilePOptions.newBuilder().setMode(new Mode((short) mode).toProto()).build());<NEW_LINE>long fid = mNextOpenFileId.getAndIncrement();<NEW_LINE>mCreateFileEntries.add(new CreateFileEntry<>(fid, path, os));<NEW_LINE>fi.fh.set(fid);<NEW_LINE>mAuthPolicy.setUserGroupIfNeeded(uri);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>LOG.error("Failed to create {}", path, t);<NEW_LINE>return -ErrorCodes.EIO();<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | uri = mPathResolverCache.getUnchecked(path); |
399,199 | // from java.hints/src/org/netbeans/modules/java/hints/errors/Utilities.java:<NEW_LINE>private static TypeMirror resolveCapturedType(CompilationInfo info, TypeMirror tm) {<NEW_LINE>if (tm == null) {<NEW_LINE>return tm;<NEW_LINE>}<NEW_LINE>if (tm.getKind() == TypeKind.ERROR) {<NEW_LINE>tm = info.getTrees().getOriginalType((ErrorType) tm);<NEW_LINE>}<NEW_LINE>TypeMirror type = resolveCapturedTypeInt(info, tm);<NEW_LINE>if (type == null) {<NEW_LINE>return tm;<NEW_LINE>}<NEW_LINE>if (type.getKind() == TypeKind.WILDCARD) {<NEW_LINE>TypeMirror tmirr = ((WildcardType) type).getExtendsBound();<NEW_LINE>if (tmirr != null)<NEW_LINE>return tmirr;<NEW_LINE>else {<NEW_LINE>// no extends, just '?'<NEW_LINE>// NOI18N<NEW_LINE>TypeElement te = info.getElements().getTypeElement("java.lang.Object");<NEW_LINE>return te == null <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return type;<NEW_LINE>} | ? null : te.asType(); |
1,521,643 | public boolean execute(CtElement element) {<NEW_LINE>ControlFlowBuilder builder = new ControlFlowBuilder();<NEW_LINE>ControlFlowGraph graph = builder.build(element);<NEW_LINE>graph.simplify();<NEW_LINE>// System.out.println(graph.toGraphVisText());<NEW_LINE>// System.out.println(graph.toGraphVisText());<NEW_LINE>List<ControlFlowNode> exits = graph.findNodesOfKind(BranchKind.EXIT);<NEW_LINE>int returnCount = 0;<NEW_LINE>int incomingCount = -1;<NEW_LINE>for (ControlFlowNode n : exits) {<NEW_LINE>Set<ControlFlowEdge> <MASK><NEW_LINE>incomingCount = edges.size();<NEW_LINE>for (ControlFlowEdge in : edges) {<NEW_LINE>if (in.getSourceNode().getStatement() != null && in.getSourceNode().getStatement() instanceof CtReturn) {<NEW_LINE>returnCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return returnCount == incomingCount || returnCount == 0;<NEW_LINE>} | edges = graph.incomingEdgesOf(n); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.