idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
264,117 | private TransportAddress bindAddress(final InetAddress hostAddress) {<NEW_LINE>final AtomicReference<Exception> lastException = new AtomicReference<>();<NEW_LINE>final AtomicReference<InetSocketAddress> boundSocket = new AtomicReference<>();<NEW_LINE>boolean success = port.iterate(portNumber -> {<NEW_LINE>try {<NEW_LINE>synchronized (httpServerChannels) {<NEW_LINE>HttpServerChannel httpServerChannel = bind(new InetSocketAddress(hostAddress, portNumber));<NEW_LINE>httpServerChannels.add(httpServerChannel);<NEW_LINE>boundSocket.<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>lastException.set(e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>if (!success) {<NEW_LINE>throw new BindHttpException("Failed to bind to " + NetworkAddress.format(hostAddress, port), lastException.get());<NEW_LINE>}<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Bound http to address {{}}", NetworkAddress.format(boundSocket.get()));<NEW_LINE>}<NEW_LINE>return new TransportAddress(boundSocket.get());<NEW_LINE>} | set(httpServerChannel.getLocalAddress()); |
395,405 | public Stream<AtomicResults> subtract(@Name("container") Object container, @Name("propertyName") String property, @Name("number") Number number, @Name(value = "times", defaultValue = "5") Long times) {<NEW_LINE>checkIsEntity(container);<NEW_LINE>Entity entity = Util.rebind(tx, (Entity) container);<NEW_LINE>final Number[] newValue = new Number[1];<NEW_LINE>final Number[] oldValue = new Number[1];<NEW_LINE>final ExecutionContext executionContext = new ExecutionContext(tx, entity, property);<NEW_LINE>retry(executionContext, (context) -> {<NEW_LINE>oldValue[0] = (Number) entity.getProperty(property);<NEW_LINE>newValue[0] = AtomicUtils.sub((Number) entity<MASK><NEW_LINE>entity.setProperty(property, newValue[0]);<NEW_LINE>return context.entity.getProperty(property);<NEW_LINE>}, times);<NEW_LINE>return Stream.of(new AtomicResults(entity, property, oldValue[0], newValue[0]));<NEW_LINE>} | .getProperty(property), number); |
1,460,953 | public static IPoweredTask readFromNBT(@Nonnull NBTTagCompound nbtRoot) {<NEW_LINE>IMachineRecipe recipe;<NEW_LINE>float usedEnergy = nbtRoot.getFloat(KEY_USED_ENERGY);<NEW_LINE>long seed = nbtRoot.getLong(KEY_SEED);<NEW_LINE>float outputMultiplier = nbtRoot.getFloat(KEY_CHANCE_OUTPUT);<NEW_LINE>float chanceMultiplier = nbtRoot.getFloat(KEY_CHANCE_MULTI);<NEW_LINE>boolean hasCustomEnergyCost = false;<NEW_LINE>float requiredEnergy = 0;<NEW_LINE>if (nbtRoot.hasKey(KEY_CUSTOM_ENERGY)) {<NEW_LINE>hasCustomEnergyCost = true;<NEW_LINE>requiredEnergy = nbtRoot.getFloat(KEY_CUSTOM_ENERGY);<NEW_LINE>}<NEW_LINE>NBTTagList inputItems = (NBTTagList) nbtRoot.getTag(KEY_INPUT_STACKS);<NEW_LINE>NNList<MachineRecipeInput> ins <MASK><NEW_LINE>for (int i = 0; i < inputItems.tagCount(); i++) {<NEW_LINE>NBTTagCompound stackTag = inputItems.getCompoundTagAt(i);<NEW_LINE>MachineRecipeInput mi = MachineRecipeInput.readFromNBT(stackTag);<NEW_LINE>ins.add(mi);<NEW_LINE>}<NEW_LINE>String uid = nbtRoot.getString(KEY_RECIPE);<NEW_LINE>recipe = MachineRecipeRegistry.instance.getRecipeForUid(uid);<NEW_LINE>if (recipe != null) {<NEW_LINE>// TODO: Check if it is harmful if the recipe changed its input items in the meantime. Do we use the items we got from our nbt when the task is complete?<NEW_LINE>// If not, why do we store them?<NEW_LINE>final PoweredTask poweredTask = new PoweredTask(recipe, usedEnergy, seed, outputMultiplier, chanceMultiplier, ins);<NEW_LINE>if (hasCustomEnergyCost) {<NEW_LINE>poweredTask.setRequiredEnergy(requiredEnergy);<NEW_LINE>}<NEW_LINE>return poweredTask;<NEW_LINE>}<NEW_LINE>// TODO: Do something with the items we have here. Currently they are voided, which is not ideal.<NEW_LINE>return null;<NEW_LINE>} | = new NNList<MachineRecipeInput>(); |
889,190 | public void evaluate(Evaluation evaluation) {<NEW_LINE>DecisionResultCollector decision = new DecisionResultCollector() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onComplete(Result result) {<NEW_LINE>if (isGranted(result.getResults().iterator().next())) {<NEW_LINE>evaluation.grant();<NEW_LINE>} else {<NEW_LINE>evaluation.deny();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>AuthorizationProvider authorization = evaluation.getAuthorizationProvider();<NEW_LINE>Policy policy = evaluation.getPolicy();<NEW_LINE>DefaultEvaluation defaultEvaluation = DefaultEvaluation.class.cast(evaluation);<NEW_LINE>Map<Policy, Map<Object, Decision.Effect>> decisionCache = defaultEvaluation.getDecisionCache();<NEW_LINE>ResourcePermission permission = evaluation.getPermission();<NEW_LINE>for (Policy associatedPolicy : policy.getAssociatedPolicies()) {<NEW_LINE>Map<Object, Decision.Effect> decisions = decisionCache.computeIfAbsent(associatedPolicy, p <MASK><NEW_LINE>Decision.Effect effect = decisions.get(permission);<NEW_LINE>DefaultEvaluation eval = new DefaultEvaluation(evaluation.getPermission(), evaluation.getContext(), policy, associatedPolicy, decision, authorization, decisionCache);<NEW_LINE>if (effect == null) {<NEW_LINE>PolicyProvider policyProvider = authorization.getProvider(associatedPolicy.getType());<NEW_LINE>policyProvider.evaluate(eval);<NEW_LINE>eval.denyIfNoEffect();<NEW_LINE>decisions.put(permission, eval.getEffect());<NEW_LINE>} else {<NEW_LINE>eval.setEffect(effect);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>decision.onComplete(permission);<NEW_LINE>} | -> new HashMap<>()); |
390,805 | public SplitResult<OffsetRange> trySplit(double fractionOfRemainder) {<NEW_LINE>// If current tracking range is no longer growable, split it as a normal range.<NEW_LINE>if (range.getTo() != Long.MAX_VALUE || range.getTo() == range.getFrom()) {<NEW_LINE>return super.trySplit(fractionOfRemainder);<NEW_LINE>}<NEW_LINE>// If current range has been done, there is no more space to split.<NEW_LINE>if (lastAttemptedOffset != null && lastAttemptedOffset == Long.MAX_VALUE) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>BigDecimal cur = (lastAttemptedOffset == null) ? BigDecimal.valueOf(range.getFrom()).subtract(BigDecimal.ONE, MathContext.DECIMAL128) : BigDecimal.valueOf(lastAttemptedOffset);<NEW_LINE>// Fetch the estimated end offset. If the estimated end is smaller than the next offset, use<NEW_LINE>// the next offset as end.<NEW_LINE>BigDecimal estimateRangeEnd = BigDecimal.valueOf(rangeEndEstimator.estimate()).max(cur.add(BigDecimal.ONE, MathContext.DECIMAL128));<NEW_LINE>// Convert to BigDecimal in computation to prevent overflow, which may result in loss of<NEW_LINE>// precision.<NEW_LINE>// split = cur + max(1, (estimateRangeEnd - cur) * fractionOfRemainder)<NEW_LINE>BigDecimal splitPos = cur.add(estimateRangeEnd.subtract(cur, MathContext.DECIMAL128).multiply(BigDecimal.valueOf(fractionOfRemainder), MathContext.DECIMAL128).max(BigDecimal<MASK><NEW_LINE>long split = splitPos.longValue();<NEW_LINE>if (split > estimateRangeEnd.longValue()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>OffsetRange res = new OffsetRange(split, range.getTo());<NEW_LINE>this.range = new OffsetRange(range.getFrom(), split);<NEW_LINE>return SplitResult.of(range, res);<NEW_LINE>} | .ONE), MathContext.DECIMAL128); |
245,455 | public byte[] bytesValue() {<NEW_LINE>if (token == JSONToken.HEX) {<NEW_LINE>int start = np + 1, len = sp;<NEW_LINE>if (len % 2 != 0) {<NEW_LINE>throw new JSONException("illegal state. " + len);<NEW_LINE>}<NEW_LINE>byte[] bytes <MASK><NEW_LINE>for (int i = 0; i < bytes.length; ++i) {<NEW_LINE>char c0 = text.charAt(start + i * 2);<NEW_LINE>char c1 = text.charAt(start + i * 2 + 1);<NEW_LINE>int b0 = c0 - (c0 <= 57 ? 48 : 55);<NEW_LINE>int b1 = c1 - (c1 <= 57 ? 48 : 55);<NEW_LINE>bytes[i] = (byte) ((b0 << 4) | b1);<NEW_LINE>}<NEW_LINE>return bytes;<NEW_LINE>}<NEW_LINE>return IOUtils.decodeBase64(text, np + 1, sp);<NEW_LINE>} | = new byte[len / 2]; |
28,622 | private void walkNodeTree(FileVisitor<Map.Entry<String, WorkspaceNode>> visitor) throws IOException {<NEW_LINE>Stack<Iterator<Map.Entry<String, WorkspaceNode>>> iterators = new Stack<>();<NEW_LINE>Stack<Map.Entry<String, WorkspaceNode>> groups = new Stack<>();<NEW_LINE>iterators.push(this.children.entrySet().iterator());<NEW_LINE>while (!iterators.isEmpty()) {<NEW_LINE>if (!iterators.peek().hasNext()) {<NEW_LINE>if (groups.isEmpty()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>visitor.postVisitDirectory(groups.pop(), null);<NEW_LINE>iterators.pop();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Map.Entry<String, WorkspaceNode> nextEntry = iterators.peek().next();<NEW_LINE>WorkspaceNode nextNode = nextEntry.getValue();<NEW_LINE>if (nextNode instanceof WorkspaceGroup) {<NEW_LINE>visitor.preVisitDirectory(nextEntry, null);<NEW_LINE>WorkspaceGroup nextGroup = (WorkspaceGroup) nextNode;<NEW_LINE>groups.push(nextEntry);<NEW_LINE>iterators.push(nextGroup.getChildren().entrySet().iterator());<NEW_LINE>} else if (nextNode instanceof WorkspaceFileRef) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>// Unreachable<NEW_LINE>throw new HumanReadableException("Expected a workspace to only contain groups and file references");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | visitor.visitFile(nextEntry, null); |
1,787,619 | public void appendToForm(final DefaultFormBuilder builder) {<NEW_LINE>final Box box = Box.createHorizontalBox();<NEW_LINE>box.setBorder(new EmptyBorder(5, 0, 5, 0));<NEW_LINE>filenameField = new JTextField();<NEW_LINE>filenameField.setText(value);<NEW_LINE>filenameField.addFocusListener(new FocusListener() {<NEW_LINE><NEW_LINE>public void focusLost(FocusEvent e) {<NEW_LINE>final String text = filenameField.getText();<NEW_LINE>if (text == null || text.length() == 0) {<NEW_LINE>filenameField.setText(value);<NEW_LINE>JOptionPane.showConfirmDialog(e.getComponent(), TextUtils.getText("OptionPanel.path_property_may_not_be_empty"), "", JOptionPane.WARNING_MESSAGE);<NEW_LINE>} else {<NEW_LINE>value = text;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>public void focusGained(FocusEvent e) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>box.add(filenameField);<NEW_LINE>box.add(Box.createHorizontalStrut(3));<NEW_LINE>selectButton = new JButton();<NEW_LINE>LabelAndMnemonicSetter.setLabelAndMnemonic(selectButton, TextUtils.getText("browse"));<NEW_LINE>selectButton<MASK><NEW_LINE>selectButton.setMaximumSize(new Dimension(1000, 1000));<NEW_LINE>box.add(selectButton);<NEW_LINE>appendToForm(builder, box);<NEW_LINE>} | .addActionListener(new SelectFileAction()); |
1,090,435 | public void marshall(ThingGroupIndexingConfiguration thingGroupIndexingConfiguration, AwsJsonWriter jsonWriter) throws Exception {<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (thingGroupIndexingConfiguration.getThingGroupIndexingMode() != null) {<NEW_LINE>String thingGroupIndexingMode = thingGroupIndexingConfiguration.getThingGroupIndexingMode();<NEW_LINE>jsonWriter.name("thingGroupIndexingMode");<NEW_LINE>jsonWriter.value(thingGroupIndexingMode);<NEW_LINE>}<NEW_LINE>if (thingGroupIndexingConfiguration.getManagedFields() != null) {<NEW_LINE>java.util.List<Field> managedFields = thingGroupIndexingConfiguration.getManagedFields();<NEW_LINE>jsonWriter.name("managedFields");<NEW_LINE>jsonWriter.beginArray();<NEW_LINE>for (Field managedFieldsItem : managedFields) {<NEW_LINE>if (managedFieldsItem != null) {<NEW_LINE>FieldJsonMarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.endArray();<NEW_LINE>}<NEW_LINE>if (thingGroupIndexingConfiguration.getCustomFields() != null) {<NEW_LINE>java.util.List<Field> customFields = thingGroupIndexingConfiguration.getCustomFields();<NEW_LINE>jsonWriter.name("customFields");<NEW_LINE>jsonWriter.beginArray();<NEW_LINE>for (Field customFieldsItem : customFields) {<NEW_LINE>if (customFieldsItem != null) {<NEW_LINE>FieldJsonMarshaller.getInstance().marshall(customFieldsItem, jsonWriter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.endArray();<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>} | ).marshall(managedFieldsItem, jsonWriter); |
1,833,201 | private Tree createDynamicTree() {<NEW_LINE>// Create a new tree<NEW_LINE>Tree dynamicTree = new Tree();<NEW_LINE>// Add some default tree items<NEW_LINE>for (int i = 0; i < 5; i++) {<NEW_LINE>TreeItem item = dynamicTree.addTextItem(constants.cwTreeItem() + " " + i);<NEW_LINE>// Temporarily add an item so we can expand this node<NEW_LINE>item.addTextItem("");<NEW_LINE>}<NEW_LINE>// Add a handler that automatically generates some children<NEW_LINE>dynamicTree.addOpenHandler(new OpenHandler<TreeItem>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onOpen(OpenEvent<TreeItem> event) {<NEW_LINE>TreeItem item = event.getTarget();<NEW_LINE>if (item.getChildCount() == 1) {<NEW_LINE>// Close the item immediately<NEW_LINE>item.setState(false, false);<NEW_LINE>// Add a random number of children to the item<NEW_LINE>String itemText = item.getText();<NEW_LINE>int numChildren = Random.nextInt(5) + 2;<NEW_LINE>for (int i = 0; i < numChildren; i++) {<NEW_LINE>TreeItem child = item.<MASK><NEW_LINE>child.addTextItem("");<NEW_LINE>}<NEW_LINE>// Remove the temporary item when we finish loading<NEW_LINE>item.getChild(0).remove();<NEW_LINE>// Reopen the item<NEW_LINE>item.setState(true, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Return the tree<NEW_LINE>return dynamicTree;<NEW_LINE>} | addTextItem(itemText + "." + i); |
233,425 | private void applyToolbarConfigurations(ConfigureViewHolder holder) {<NEW_LINE>configureViewData.titleText = holder.titleEditText.getText();<NEW_LINE>configureViewData.titleCentered = holder.titleCenteredCheckBox.isChecked();<NEW_LINE>configureViewData.subtitleText = holder.subtitleEditText.getText();<NEW_LINE>configureViewData.subtitleCentered = holder.subtitleCenteredCheckBox.isChecked();<NEW_LINE>configureViewData.navigationIcon = holder.navigationIconCheckBox.isChecked();<NEW_LINE>configureViewData.menuItems = holder.menuItemsCheckBox.isChecked();<NEW_LINE>List<MaterialToolbar> toolbars = DemoUtils.findViewsWithType(requireView(), MaterialToolbar.class);<NEW_LINE>for (MaterialToolbar toolbar : toolbars) {<NEW_LINE>if (!TextUtils.isEmpty(configureViewData.titleText)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>toolbar.setTitleCentered(configureViewData.titleCentered);<NEW_LINE>if (!TextUtils.isEmpty(configureViewData.subtitleText)) {<NEW_LINE>toolbar.setSubtitle(configureViewData.subtitleText);<NEW_LINE>}<NEW_LINE>toolbar.setSubtitleCentered(configureViewData.subtitleCentered);<NEW_LINE>if (configureViewData.navigationIcon) {<NEW_LINE>toolbar.setNavigationIcon(NAVIGATION_ICON_RES_ID);<NEW_LINE>} else {<NEW_LINE>toolbar.setNavigationIcon(null);<NEW_LINE>}<NEW_LINE>toolbar.getMenu().clear();<NEW_LINE>if (configureViewData.menuItems) {<NEW_LINE>toolbar.inflateMenu(MENU_RES_ID);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | toolbar.setTitle(configureViewData.titleText); |
849,349 | public static boolean deleteFile(@NonNull final File file, Context context) {<NEW_LINE>// First try the normal deletion.<NEW_LINE>if (file == null)<NEW_LINE>return true;<NEW_LINE>boolean fileDelete = false;<NEW_LINE>if (file.isDirectory()) {<NEW_LINE>fileDelete = rmdir(file, context);<NEW_LINE>}<NEW_LINE>if (file.delete() || fileDelete)<NEW_LINE>return true;<NEW_LINE>// Try with Storage Access Framework.<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && FileUtil.isOnExtSdCard(file, context)) {<NEW_LINE>DocumentFile document = getDocumentFile(file, false, context);<NEW_LINE>if (document == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return document.delete();<NEW_LINE>}<NEW_LINE>// Try the Kitkat workaround.<NEW_LINE>if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {<NEW_LINE>ContentResolver resolver = context.getContentResolver();<NEW_LINE>try {<NEW_LINE>Uri uri = MediaStoreHack.getUriFromFile(file.getAbsolutePath(), context);<NEW_LINE>resolver.<MASK><NEW_LINE>return !file.exists();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(LOG, "Error when deleting file " + file.getAbsolutePath(), e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return !file.exists();<NEW_LINE>} | delete(uri, null, null); |
810,471 | public Object apply(final ActionContext ctx, final Object caller, final Object[] sources) throws FrameworkException {<NEW_LINE>try {<NEW_LINE>assertArrayHasMinLengthAndTypes(sources, 3, String.class, <MASK><NEW_LINE>final String sourceCRS = (String) sources[0];<NEW_LINE>final String targetCRS = (String) sources[1];<NEW_LINE>final Geometry geometry = (Geometry) sources[2];<NEW_LINE>try {<NEW_LINE>final CoordinateReferenceSystem src = CRS.decode(sourceCRS);<NEW_LINE>final CoordinateReferenceSystem dst = CRS.decode(targetCRS);<NEW_LINE>final MathTransform transform = CRS.findMathTransform(src, dst, true);<NEW_LINE>return JTS.transform(geometry, transform);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.error(ExceptionUtils.getStackTrace(t));<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>boolean isJs = ctx != null ? ctx.isJavaScriptContext() : false;<NEW_LINE>logParameterError(caller, sources, e.getMessage(), isJs);<NEW_LINE>return usage(isJs);<NEW_LINE>}<NEW_LINE>return usage(ctx != null ? ctx.isJavaScriptContext() : false);<NEW_LINE>} | String.class, Geometry.class); |
448,050 | public JRPrintElement fill() {<NEW_LINE><MASK><NEW_LINE>JRTemplateImage templateImage = new JRTemplateImage(fillContext.getElementOrigin(), fillContext.getDefaultStyleProvider());<NEW_LINE>templateImage.setStyle(fillContext.getElementStyle());<NEW_LINE>templateImage.setLinkType(getLinkType());<NEW_LINE>templateImage.setLinkTarget(getLinkTarget());<NEW_LINE>templateImage.setUsingCache(false);<NEW_LINE>templateImage = deduplicate(templateImage);<NEW_LINE>JRTemplatePrintImage image = new JRTemplatePrintImage(templateImage, printElementOriginator);<NEW_LINE>image.setUUID(element.getUUID());<NEW_LINE>image.setX(element.getX());<NEW_LINE>image.setY(fillContext.getElementPrintY());<NEW_LINE>image.setWidth(element.getWidth());<NEW_LINE>image.setHeight(element.getHeight());<NEW_LINE>image.setBookmarkLevel(getBookmarkLevel());<NEW_LINE>if (isEvaluateNow()) {<NEW_LINE>copy(image);<NEW_LINE>} else {<NEW_LINE>fillContext.registerDelayedEvaluation(image, chartComponent.getEvaluationTime(), chartComponent.getEvaluationGroup());<NEW_LINE>}<NEW_LINE>return image;<NEW_LINE>} | JRComponentElement element = fillContext.getComponentElement(); |
167,585 | private ArrayList<TorrentFile> parseJsonFileList(JSONObject response, Torrent torrent) throws JSONException {<NEW_LINE>String absoluteDir = torrent.getLocationDir();<NEW_LINE>String relativeDir = settings.getDownloadDir();<NEW_LINE>if (relativeDir == null) {<NEW_LINE>// We can make no assumptions except the torrent's location is the main download dir<NEW_LINE>relativeDir = "";<NEW_LINE>} else if (absoluteDir.startsWith(relativeDir)) {<NEW_LINE>relativeDir = absoluteDir.substring(relativeDir.length());<NEW_LINE>if (relativeDir.startsWith("/")) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Parse response<NEW_LINE>ArrayList<TorrentFile> torrentfiles = new ArrayList<>();<NEW_LINE>JSONArray rarray = response.getJSONArray("torrents");<NEW_LINE>if (rarray.length() > 0) {<NEW_LINE>JSONArray files = rarray.getJSONObject(0).getJSONArray("files");<NEW_LINE>JSONArray fileStats = rarray.getJSONObject(0).getJSONArray("fileStats");<NEW_LINE>for (int i = 0; i < files.length(); i++) {<NEW_LINE>JSONObject file = files.getJSONObject(i);<NEW_LINE>JSONObject stat = fileStats.getJSONObject(i);<NEW_LINE>// @formatter:off<NEW_LINE>torrentfiles.add(new TorrentFile(String.valueOf(i), file.getString(RPC_FILE_NAME), relativeDir + file.getString(RPC_FILE_NAME), absoluteDir + file.getString(RPC_FILE_NAME), file.getLong(RPC_FILE_LENGTH), file.getLong(RPC_FILE_COMPLETED), convertTransmissionPriority(stat.getBoolean(RPC_FILESTAT_WANTED), stat.getInt(RPC_FILESTAT_PRIORITY))));<NEW_LINE>// @formatter:on<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Return the list<NEW_LINE>return torrentfiles;<NEW_LINE>} | relativeDir = relativeDir.substring(1); |
412,369 | public boolean onTouchActionUp(MotionEvent event) {<NEW_LINE>mReleaseEvent.posX = mWindowManagerParams.x;<NEW_LINE>mReleaseEvent.posY = mWindowManagerParams.y;<NEW_LINE>mReleaseEvent.vx = 0.0f;<NEW_LINE>mReleaseEvent.vy = 0.0f;<NEW_LINE>mReleaseEvent.rawX = event.getRawX();<NEW_LINE>mReleaseEvent<MASK><NEW_LINE>if (hasAtLeast2TouchEvents()) {<NEW_LINE>float touchTime = (mEndTouchRaw.mTime - mStartTouchRaw.mTime) / 1000.0f;<NEW_LINE>mReleaseEvent.vx = (mEndTouchRaw.mX - mStartTouchRaw.mX) / touchTime;<NEW_LINE>mReleaseEvent.vy = (mEndTouchRaw.mY - mStartTouchRaw.mY) / touchTime;<NEW_LINE>}<NEW_LINE>// *Should* always be true, but under certain circumstances, is not. #384<NEW_LINE>if (mFlingTracker != null) {<NEW_LINE>mFlingTracker.computeCurrentVelocity(1000);<NEW_LINE>float fvx = mFlingTracker.getXVelocity();<NEW_LINE>float fvy = mFlingTracker.getYVelocity();<NEW_LINE>mReleaseEvent.vx = fvx;<NEW_LINE>mReleaseEvent.vy = fvy;<NEW_LINE>mFlingTracker.recycle();<NEW_LINE>}<NEW_LINE>if (mOnTouchActionEventListener != null) {<NEW_LINE>mOnTouchActionEventListener.onActionUp(mReleaseEvent);<NEW_LINE>}<NEW_LINE>mStartTouchX = -1;<NEW_LINE>mStartTouchY = -1;<NEW_LINE>mStartTouchRaw.mTime = 0;<NEW_LINE>mEndTouchRaw.mTime = 0;<NEW_LINE>return true;<NEW_LINE>} | .rawY = event.getRawY(); |
54,475 | private static boolean collectItems(@NotNull List<String> levels, @NotNull YAMLKeyValue yamlKeyValue, @NotNull YamlTranslationCollector translationCollector) {<NEW_LINE>List<YAMLPsiElement> childElements = yamlKeyValue.getYAMLElements();<NEW_LINE><MASK><NEW_LINE>if (StringUtils.isBlank(keyText)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// we check again after cleanup<NEW_LINE>keyText = keyNormalizer(keyText);<NEW_LINE>if (StringUtils.isBlank(keyText)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// @TODO: use features of new yaml integration<NEW_LINE>// yaml key-value provide main psielement in last child element<NEW_LINE>// depending of what we get here we have another key-value inside, multiline or string value<NEW_LINE>if (childElements.size() == 1 && childElements.get(0) instanceof YAMLMapping) {<NEW_LINE>PsiElement lastChildElement = childElements.get(0);<NEW_LINE>// catch next level keys<NEW_LINE>if (lastChildElement instanceof YAMLMapping) {<NEW_LINE>// use copy of current level and pipe to children call<NEW_LINE>ArrayList<String> copyLevels = new ArrayList<>(levels);<NEW_LINE>copyLevels.add(keyText);<NEW_LINE>collectNextLevelElements((YAMLCompoundValue) childElements.get(0), copyLevels, translationCollector);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// check multiline is also an tree end indicator<NEW_LINE>// stats: |<NEW_LINE>// accomplishment: ><NEW_LINE>if ((lastChildElement instanceof YAMLScalarText || lastChildElement instanceof YAMLScalarList)) {<NEW_LINE>return callCollectCallback(levels, yamlKeyValue, translationCollector, keyText);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return callCollectCallback(levels, yamlKeyValue, translationCollector, keyText);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | String keyText = yamlKeyValue.getKeyText(); |
433,979 | final void ensureSubDecor() {<NEW_LINE>if (mHasActionBar && !mSubDecorInstalled) {<NEW_LINE>if (mOverlayActionBar) {<NEW_LINE>mActivity.superSetContentView(R.layout.abc_action_bar_decor_overlay);<NEW_LINE>} else {<NEW_LINE>mActivity.superSetContentView(R.layout.abc_action_bar_decor);<NEW_LINE>}<NEW_LINE>mActionBarView = (ActionBarView) mActivity.findViewById(R.id.action_bar);<NEW_LINE>mActionBarView.setWindowCallback(mActivity);<NEW_LINE>if (mFeatureProgress) {<NEW_LINE>mActionBarView.initProgress();<NEW_LINE>}<NEW_LINE>if (mFeatureIndeterminateProgress) {<NEW_LINE>mActionBarView.initIndeterminateProgress();<NEW_LINE>}<NEW_LINE>boolean splitWhenNarrow = <MASK><NEW_LINE>boolean splitActionBar;<NEW_LINE>if (splitWhenNarrow) {<NEW_LINE>splitActionBar = mActivity.getResources().getBoolean(R.bool.abc_split_action_bar_is_narrow);<NEW_LINE>} else {<NEW_LINE>TypedArray a = mActivity.obtainStyledAttributes(R.styleable.ActionBarWindow);<NEW_LINE>splitActionBar = a.getBoolean(R.styleable.ActionBarWindow_windowSplitActionBar, false);<NEW_LINE>a.recycle();<NEW_LINE>}<NEW_LINE>final ActionBarContainer splitView = (ActionBarContainer) mActivity.findViewById(R.id.split_action_bar);<NEW_LINE>if (splitView != null) {<NEW_LINE>mActionBarView.setSplitView(splitView);<NEW_LINE>mActionBarView.setSplitActionBar(splitActionBar);<NEW_LINE>mActionBarView.setSplitWhenNarrow(splitWhenNarrow);<NEW_LINE>final ActionBarContextView cab = (ActionBarContextView) mActivity.findViewById(R.id.action_context_bar);<NEW_LINE>cab.setSplitView(splitView);<NEW_LINE>cab.setSplitActionBar(splitActionBar);<NEW_LINE>cab.setSplitWhenNarrow(splitWhenNarrow);<NEW_LINE>}<NEW_LINE>mSubDecorInstalled = true;<NEW_LINE>supportInvalidateOptionsMenu();<NEW_LINE>}<NEW_LINE>} | UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW.equals(getUiOptionsFromMetadata()); |
486,356 | public void closeOpenWindows() {<NEW_LINE>if (infoWindow != null) {<NEW_LINE>if (infoWindow.isVisible()) {<NEW_LINE>infoWindow.setVisible(false);<NEW_LINE>add(panelInfos, infoTabIndex);<NEW_LINE>updateInfoTab();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (warningsWindow != null) {<NEW_LINE>if (warningsWindow.isVisible()) {<NEW_LINE>warningsWindow.setVisible(false);<NEW_LINE>add(panelWarnings, warningsTabIndex);<NEW_LINE>setTitleAt(warningsTabIndex, "Warnings (" + <MASK><NEW_LINE>clearDrcTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (errorsWindow != null)<NEW_LINE>if (errorsWindow.isVisible()) {<NEW_LINE>errorsWindow.setVisible(false);<NEW_LINE>add(panelErrors, errorsTabIndex);<NEW_LINE>setTitleAt(errorsTabIndex, "Errors (" + errorsList.getCountNr() + ")");<NEW_LINE>clearDrcTrace();<NEW_LINE>}<NEW_LINE>if (consoleWindow != null)<NEW_LINE>if (consoleWindow.isVisible()) {<NEW_LINE>consoleWindow.setVisible(false);<NEW_LINE>add(panelConsole, consoleTabIndex);<NEW_LINE>updateConsoleTab();<NEW_LINE>}<NEW_LINE>} | warningsList.getCountNr() + ")"); |
1,104,520 | private boolean createExistingProject(final File existingDotProjectFile, IProgressMonitor monitor) throws CoreException {<NEW_LINE>SubMonitor sub = SubMonitor.convert(monitor, 100);<NEW_LINE>try {<NEW_LINE>ProjectRecord record = new ProjectRecord(existingDotProjectFile);<NEW_LINE>String projectName = record.getProjectName();<NEW_LINE>final IWorkspace workspace = ResourcesPlugin.getWorkspace();<NEW_LINE>final IProject project = workspace.getRoot().getProject(projectName);<NEW_LINE>// createdProjects.add(project);<NEW_LINE>if (record.description == null) {<NEW_LINE>// error case<NEW_LINE>record.description = workspace.newProjectDescription(projectName);<NEW_LINE>IPath locationPath = new Path(record.projectSystemFile.getParent());<NEW_LINE>// If it is under the root use the default location<NEW_LINE>if (Platform.getLocation().isPrefixOf(locationPath)) {<NEW_LINE>record.description.setLocation(null);<NEW_LINE>} else {<NEW_LINE>record.description.setLocation(locationPath);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>record.description.setName(projectName);<NEW_LINE>}<NEW_LINE>sub.worked(5);<NEW_LINE>doCreateProject(project, record.description, sub.newChild(75));<NEW_LINE>if (!this.shallowClone) {<NEW_LINE>ConnectProviderOperation connectProviderOperation = new ConnectProviderOperation(project);<NEW_LINE>connectProviderOperation.run(sub.newChild(20));<NEW_LINE>} else {<NEW_LINE>// explicitly delete the .git folder<NEW_LINE>IFolder gitFolder = <MASK><NEW_LINE>if (gitFolder.exists()) {<NEW_LINE>try {<NEW_LINE>gitFolder.delete(true, sub.newChild(20));<NEW_LINE>} catch (CoreException e) {<NEW_LINE>IdeLog.logError(GitUIPlugin.getDefault(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>UIUtils.getDisplay().asyncExec(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>// Set the primary natures - Ideally this does not need to run in UI thread, however some nature<NEW_LINE>// contributors rely on UI calls to determine the nature of the project.<NEW_LINE>setNatureFromContributions(project);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} finally {<NEW_LINE>if (sub != null) {<NEW_LINE>sub.done();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | project.getFolder(GitRepository.GIT_DIR); |
580,020 | Trees.ValueDeclaration inferType(Trees.ValueDeclaration declaration, Trees.Expression expression, InferencePurpose inferenceKind) {<NEW_LINE>if (expression instanceof BoundAccessExpression) {<NEW_LINE>BoundAccessExpression scopeBoundAccess = (BoundAccessExpression) expression;<NEW_LINE>Accessors.BoundAccess lastAccess = Iterables.getLast(asBoundAccess(scopeBoundAccess.accessor()));<NEW_LINE>if (inferenceKind == InferencePurpose.ITERATE) {<NEW_LINE>if (!lastAccess.isContainer()) {<NEW_LINE>throw new TypingException(String.format("Not iterable type '%s'%n\tin expression '%s'", lastAccess.type, scopeBoundAccess.path()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (declaration.type().isPresent()) {<NEW_LINE>return declaration.withType(resolveDeclared(declaration.type().get(), declaration.name())).withContainedType(ResolvedType.of(resolveType(declaration.type().get(), false)));<NEW_LINE>}<NEW_LINE>if (inferenceKind == InferencePurpose.ITERATE) {<NEW_LINE>TypeMirror resolved = lastAccess.containedType;<NEW_LINE>return declaration.withType(declare(resolved, declaration.name())).withContainedType(ResolvedType.of(resolved));<NEW_LINE>} else if (inferenceKind == InferencePurpose.COLLECT) {<NEW_LINE>TypeMirror resolved = knife.accessors.wrapIterable(lastAccess.type);<NEW_LINE>return declaration.withType(declare(resolved, declaration.name())).withContainedType(ResolvedType.of(lastAccess.type));<NEW_LINE>} else {<NEW_LINE>return declaration.withType(declare(lastAccess.type, declaration.name())).withContainedType(ResolvedType<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (declaration.type().isPresent()) {<NEW_LINE>return declaration.withType(resolveDeclared(declaration.type().get(), declaration.name())).withContainedType(ResolvedType.of(resolveType(declaration.type().get(), false)));<NEW_LINE>}<NEW_LINE>throw new TypingException(String.format("Value should be typed %s%n\texpression '%s'", declaration.name(), expression));<NEW_LINE>} | .of(lastAccess.type)); |
896,568 | private void createNutchUrls() throws IOException, URISyntaxException {<NEW_LINE>log.info("Creating nutch urls ...");<NEW_LINE>JobConf job = new JobConf(NutchData.class);<NEW_LINE>Path urls = new Path(options.getWorkPath(), URLS_DIR_NAME);<NEW_LINE>Utils.checkHdfsPath(urls);<NEW_LINE>String jobname = "Create nutch urls";<NEW_LINE>job.setJobName(jobname);<NEW_LINE>setNutchOptions(job);<NEW_LINE>FileInputFormat.setInputPaths(job, dummy.getPath());<NEW_LINE>job.setInputFormat(NLineInputFormat.class);<NEW_LINE>job.setMapperClass(CreateUrlHash.class);<NEW_LINE>job.setNumReduceTasks(0);<NEW_LINE>job.setMapOutputKeyClass(LongWritable.class);<NEW_LINE>job.setMapOutputValueClass(Text.class);<NEW_LINE><MASK><NEW_LINE>job.setOutputKeyClass(LongWritable.class);<NEW_LINE>job.setOutputValueClass(Text.class);<NEW_LINE>MapFileOutputFormat.setOutputPath(job, urls);<NEW_LINE>// SequenceFileOutputFormat.setOutputPath(job, fout);<NEW_LINE>log.info("Running Job: " + jobname);<NEW_LINE>log.info("Pages file " + dummy.getPath() + " as input");<NEW_LINE>log.info("Rankings file " + urls + " as output");<NEW_LINE>JobClient.runJob(job);<NEW_LINE>log.info("Finished Running Job: " + jobname);<NEW_LINE>log.info("Cleaning temp files...");<NEW_LINE>Utils.cleanTempFiles(urls);<NEW_LINE>} | job.setOutputFormat(MapFileOutputFormat.class); |
1,412,181 | public Object handleResult(Object result) {<NEW_LINE>CompletionStage completionStageResult;<NEW_LINE>if (result instanceof CompletionStage) {<NEW_LINE>completionStageResult <MASK><NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Cannot convert " + result + " to 'java.util.concurrent.CompletionStage'");<NEW_LINE>}<NEW_LINE>completionStageResult.whenComplete((value, throwable) -> {<NEW_LINE>if (throwable == null) {<NEW_LINE>if (value == null && isUnitValueType) {<NEW_LINE>value = kotlin.Unit.INSTANCE;<NEW_LINE>}<NEW_LINE>CompletableFutureContinuation.Companion.completeSuccess(continuation, value);<NEW_LINE>} else {<NEW_LINE>if (throwable instanceof CompletionException) {<NEW_LINE>throwable = ((CompletionException) throwable).getCause();<NEW_LINE>}<NEW_LINE>CompletableFutureContinuation.Companion.completeExceptionally(continuation, (Throwable) throwable);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return KotlinUtils.COROUTINE_SUSPENDED;<NEW_LINE>} | = (CompletionStage<?>) result; |
199,086 | private void rendererComponentInner(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {<NEW_LINE>myTree = tree;<NEW_LINE>clear();<NEW_LINE>mySelected = selected;<NEW_LINE>myFocusedCalculated = false;<NEW_LINE>// We paint background if and only if tree path is selected and tree has focus.<NEW_LINE>// If path is selected and tree is not focused then we just paint focused border.<NEW_LINE>if (UIUtil.isFullRowSelectionLAF()) {<NEW_LINE>setBackground(selected ? UIUtil.getTreeSelectionBackground() : null);<NEW_LINE>} else if (WideSelectionTreeUI.isWideSelection(tree)) {<NEW_LINE>setPaintFocusBorder(false);<NEW_LINE>if (selected) {<NEW_LINE>setBackground(UIUtil.getTreeSelectionBackground(hasFocus));<NEW_LINE>} else {<NEW_LINE>setBackground(null);<NEW_LINE>}<NEW_LINE>} else if (selected) {<NEW_LINE>setPaintFocusBorder(true);<NEW_LINE>if (isFocused()) {<NEW_LINE>setBackground(UIUtil.getTreeSelectionBackground());<NEW_LINE>} else {<NEW_LINE>setBackground(null);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>setBackground(null);<NEW_LINE>}<NEW_LINE>if (value instanceof LoadingNode) {<NEW_LINE>setForeground(JBColor.GRAY);<NEW_LINE>setIcon(LOADING_NODE_ICON);<NEW_LINE>} else {<NEW_LINE>setForeground(RenderingUtil<MASK><NEW_LINE>setIcon(null);<NEW_LINE>}<NEW_LINE>if (WideSelectionTreeUI.isWideSelection(tree)) {<NEW_LINE>// avoid erasing Nimbus focus frame<NEW_LINE>super.setOpaque(false);<NEW_LINE>super.setIconOpaque(false);<NEW_LINE>} else {<NEW_LINE>// draw selection background even for non-opaque tree<NEW_LINE>super.setOpaque(myOpaque || selected && hasFocus || selected && isFocused());<NEW_LINE>}<NEW_LINE>customizeCellRenderer(tree, value, selected, expanded, leaf, row, hasFocus);<NEW_LINE>if (!myUsedCustomSpeedSearchHighlighting && !AbstractTreeUi.isLoadingNode(value)) {<NEW_LINE>SpeedSearchUtil.applySpeedSearchHighlightingFiltered(tree, value, this, true, selected);<NEW_LINE>}<NEW_LINE>} | .getForeground(tree, selected)); |
1,254,449 | public boolean contains(java.awt.Point p) {<NEW_LINE>// other relations which are selected are prioritized<NEW_LINE>for (GridElement other : HandlerElementMap.getHandlerForElement(this).getDrawPanel().getGridElements()) {<NEW_LINE>Selector s = HandlerElementMap.getHandlerForElement(other).getDrawPanel().getSelector();<NEW_LINE>if (other != this && other instanceof Relation && s.isSelected(other)) {<NEW_LINE>int xDist = getRectangle().x - other.getRectangle().x;<NEW_LINE>int yDist = getRectangle().y - other.getRectangle().y;<NEW_LINE>// the point must be modified, because the other relation has other coordinates<NEW_LINE>Point modifiedP = new Point(p.x + xDist, p.y + yDist);<NEW_LINE>boolean containsHelper = ((Relation<MASK><NEW_LINE>if (s.isSelected(other) && containsHelper) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return calcContains(Converter.convert(p));<NEW_LINE>} | ) other).calcContains(modifiedP); |
1,742,110 | public ListPackagingConfigurationsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListPackagingConfigurationsResult listPackagingConfigurationsResult = new ListPackagingConfigurationsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listPackagingConfigurationsResult;<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("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPackagingConfigurationsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("packagingConfigurations", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPackagingConfigurationsResult.setPackagingConfigurations(new ListUnmarshaller<PackagingConfiguration>(PackagingConfigurationJsonUnmarshaller.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 listPackagingConfigurationsResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,517,230 | public void delete(RangeRequest range) {<NEW_LINE>String shortTableName = getShortTableName();<NEW_LINE>switch(config.overflowMigrationState()) {<NEW_LINE>case UNSTARTED:<NEW_LINE>deleteOverflowRange(config.singleOverflowTable(), shortTableName, range);<NEW_LINE>break;<NEW_LINE>case IN_PROGRESS:<NEW_LINE>deleteOverflowRange(config.singleOverflowTable(), shortTableName, range);<NEW_LINE>deleteOverflowRange(getShortOverflowTableName(), shortTableName, range);<NEW_LINE>break;<NEW_LINE>case FINISHING:<NEW_LINE>case FINISHED:<NEW_LINE>deleteOverflowRange(getShortOverflowTableName(), shortTableName, range);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new EnumConstantNotPresentException(OverflowMigrationState.class, config.overflowMigrationState().name());<NEW_LINE>}<NEW_LINE>// delete from main table<NEW_LINE>StringBuilder query = new StringBuilder();<NEW_LINE>query.append(" /* DELETE_RANGE (").append(shortTableName).append(") */ ");<NEW_LINE>query.append(" DELETE /*+ INDEX(m pk_").append<MASK><NEW_LINE>query.append(" FROM ").append(shortTableName).append(" m ");<NEW_LINE>// add where clauses<NEW_LINE>WhereClauses whereClauses = WhereClauses.create("m", range);<NEW_LINE>List<Object> args = whereClauses.getArguments();<NEW_LINE>List<String> clauses = whereClauses.getClauses();<NEW_LINE>if (!clauses.isEmpty()) {<NEW_LINE>query.append(" WHERE ");<NEW_LINE>Joiner.on(" AND ").appendTo(query, clauses);<NEW_LINE>}<NEW_LINE>conns.get().updateUnregisteredQuery(query.toString(), args.toArray());<NEW_LINE>} | (shortTableName).append(") */ "); |
1,510,404 | public static void init(FMLClientSetupEvent event) {<NEW_LINE>// Block render layers<NEW_LINE>ClientRegistrationUtil.setRenderLayer(RenderType.translucent(), GeneratorsBlocks.LASER_FOCUS_MATRIX, GeneratorsBlocks.REACTOR_GLASS);<NEW_LINE>ClientRegistrationUtil.setRenderLayer(renderType -> renderType == RenderType.solid() || renderType == RenderType.translucent(), GeneratorsBlocks.BIO_GENERATOR, GeneratorsBlocks.HEAT_GENERATOR);<NEW_LINE>// Fluids (translucent)<NEW_LINE>for (FluidRegistryObject<?, ?, ?, ?> fluidRO : GeneratorsFluids.FLUIDS.getAllFluids()) {<NEW_LINE>ClientRegistrationUtil.setRenderLayer(RenderType.translucent(), fluidRO);<NEW_LINE>}<NEW_LINE>// adv solar gen requires to be translated up 1 block, so handle the model separately<NEW_LINE>ClientRegistration.addCustomModel(GeneratorsBlocks.ADVANCED_SOLAR_GENERATOR, (orig, evt) -> new TransformedBakedModel<Void>(orig, QuadTransformation.translate(new Vec3(0<MASK><NEW_LINE>IModuleHelper moduleHelper = MekanismAPI.getModuleHelper();<NEW_LINE>moduleHelper.addMekaSuitModuleModels(MekanismGenerators.rl("models/entity/mekasuit_modules.obj"));<NEW_LINE>moduleHelper.addMekaSuitModuleModelSpec("solar_helmet", GeneratorsModules.SOLAR_RECHARGING_UNIT, EquipmentSlot.HEAD);<NEW_LINE>} | , 1, 0)))); |
163,955 | public static GetCustomizationConfigListResponse unmarshall(GetCustomizationConfigListResponse getCustomizationConfigListResponse, UnmarshallerContext _ctx) {<NEW_LINE>getCustomizationConfigListResponse.setRequestId(_ctx.stringValue("GetCustomizationConfigListResponse.RequestId"));<NEW_LINE>getCustomizationConfigListResponse.setCode(_ctx.stringValue("GetCustomizationConfigListResponse.Code"));<NEW_LINE>getCustomizationConfigListResponse.setMessage<MASK><NEW_LINE>getCustomizationConfigListResponse.setSuccess(_ctx.booleanValue("GetCustomizationConfigListResponse.Success"));<NEW_LINE>List<ModelCustomizationDataSetPo> data = new ArrayList<ModelCustomizationDataSetPo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetCustomizationConfigListResponse.Data.Length"); i++) {<NEW_LINE>ModelCustomizationDataSetPo modelCustomizationDataSetPo = new ModelCustomizationDataSetPo();<NEW_LINE>modelCustomizationDataSetPo.setTaskType(_ctx.integerValue("GetCustomizationConfigListResponse.Data[" + i + "].TaskType"));<NEW_LINE>modelCustomizationDataSetPo.setCreateTime(_ctx.stringValue("GetCustomizationConfigListResponse.Data[" + i + "].CreateTime"));<NEW_LINE>modelCustomizationDataSetPo.setModelStatus(_ctx.integerValue("GetCustomizationConfigListResponse.Data[" + i + "].ModelStatus"));<NEW_LINE>modelCustomizationDataSetPo.setModelName(_ctx.stringValue("GetCustomizationConfigListResponse.Data[" + i + "].ModelName"));<NEW_LINE>modelCustomizationDataSetPo.setModelId(_ctx.longValue("GetCustomizationConfigListResponse.Data[" + i + "].ModelId"));<NEW_LINE>modelCustomizationDataSetPo.setModeCustomizationId(_ctx.stringValue("GetCustomizationConfigListResponse.Data[" + i + "].ModeCustomizationId"));<NEW_LINE>data.add(modelCustomizationDataSetPo);<NEW_LINE>}<NEW_LINE>getCustomizationConfigListResponse.setData(data);<NEW_LINE>return getCustomizationConfigListResponse;<NEW_LINE>} | (_ctx.stringValue("GetCustomizationConfigListResponse.Message")); |
1,568,409 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller != null) {<NEW_LINE>Target target1 = new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent(), true);<NEW_LINE>Target target2 = new TargetOpponent(true);<NEW_LINE>if (target1.canChoose(controller.getId(), source, game)) {<NEW_LINE>while (!target1.isChosen() && target1.canChoose(controller.getId(), source, game) && controller.canRespond()) {<NEW_LINE>controller.chooseTarget(outcome, target1, source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (target2.canChoose(controller.getId(), source, game)) {<NEW_LINE>while (!target2.isChosen() && target2.canChoose(controller.getId(), source, game) && controller.canRespond()) {<NEW_LINE>controller.chooseTarget(outcome, target2, source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Permanent permanent = game.<MASK><NEW_LINE>Player chosenOpponent = game.getPlayer(target2.getFirstTarget());<NEW_LINE>if (!controller.flipCoin(source, game, true)) {<NEW_LINE>if (permanent != null && chosenOpponent != null) {<NEW_LINE>ContinuousEffect effect = new RiskyMoveCreatureGainControlEffect(Duration.EndOfGame, chosenOpponent.getId());<NEW_LINE>effect.setTargetPointer(new FixedTarget(permanent, game));<NEW_LINE>game.addEffect(effect, source);<NEW_LINE>game.informPlayers(chosenOpponent.getLogName() + " has gained control of " + permanent.getLogName());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | getPermanent(target1.getFirstTarget()); |
1,321,173 | public KmsGrantConstraints unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>KmsGrantConstraints kmsGrantConstraints = new KmsGrantConstraints();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("encryptionContextEquals", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>kmsGrantConstraints.setEncryptionContextEquals(new MapUnmarshaller<String, String>(context.getUnmarshaller(String.class), context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("encryptionContextSubset", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>kmsGrantConstraints.setEncryptionContextSubset(new MapUnmarshaller<String, String>(context.getUnmarshaller(String.class), context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return kmsGrantConstraints;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
8,192 | public com.amazonaws.services.appstream.model.ResourceNotAvailableException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.appstream.model.ResourceNotAvailableException resourceNotAvailableException = new com.amazonaws.services.appstream.model.ResourceNotAvailableException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return resourceNotAvailableException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,388,832 | public Object toUserData(Long id, List<Integer> tags, List<String> keysList, List<VectorTile.Tile.Value> valuesList) {<NEW_LINE>// Guard: empty<NEW_LINE>if (nullIfEmpty && tags.size() < 1 && (!addId || id == null)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final Map<String, Object> userData = new HashMap<>(((tags.size() + 1) / 2));<NEW_LINE>// Add feature properties<NEW_LINE>int keyIndex;<NEW_LINE>int valIndex;<NEW_LINE>boolean valid;<NEW_LINE>for (int i = 0; i < tags.size() - 1; i += 2) {<NEW_LINE>keyIndex = tags.get(i);<NEW_LINE>valIndex = tags.get(i + 1);<NEW_LINE>valid = keyIndex >= 0 && keyIndex < keysList.size() && valIndex >= 0 && valIndex < valuesList.size();<NEW_LINE>if (valid) {<NEW_LINE>userData.put(keysList.get(keyIndex), MvtValue.toObject(valuesList.get(valIndex)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add ID, value may be null<NEW_LINE>if (addId) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return userData;<NEW_LINE>} | userData.put(idKey, id); |
1,391,032 | public static void launchBrowser(String url) throws IOException {<NEW_LINE>try {<NEW_LINE>if (isMac()) {<NEW_LINE>Class<?> <MASK><NEW_LINE>Method openURL = macUtils.getDeclaredMethod("openURL", String.class);<NEW_LINE>openURL.invoke(null, url);<NEW_LINE>} else if (isWindows())<NEW_LINE>Runtime.getRuntime().exec(createCommand("rundll32 url.dll,FileProtocolHandler ", url));<NEW_LINE>else {<NEW_LINE>// assume Unix or Linux<NEW_LINE>String[] browsers = { "firefox", "opera", "konqueror", "mozilla", "netscape" };<NEW_LINE>String browser = null;<NEW_LINE>for (int count = 0; count < browsers.length && browser == null; count++) if (Runtime.getRuntime().exec(new String[] { "which", browsers[count] }).waitFor() == 0)<NEW_LINE>browser = browsers[count];<NEW_LINE>if (browser == null)<NEW_LINE>throw new Exception(MessageLocalization.getComposedMessage("could.not.find.web.browser"));<NEW_LINE>else<NEW_LINE>Runtime.getRuntime().exec(new String[] { browser, url });<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IOException(MessageLocalization.getComposedMessage("error.attempting.to.launch.web.browser"));<NEW_LINE>}<NEW_LINE>} | macUtils = Class.forName("com.apple.mrj.MRJFileUtils"); |
65,442 | public void run(RegressionEnvironment env) {<NEW_LINE>env.advanceTime(0);<NEW_LINE>String[] fields = new String[] { "theString" };<NEW_LINE>String epl = "create variable long SIZE = 1000;\n" + "@name('s0') select irstream * from SupportBean#expr_batch(newest_timestamp - oldest_timestamp > SIZE);\n";<NEW_LINE>env.compileDeployAddListenerMileZero(epl, "s0");<NEW_LINE>env.advanceTime(1000);<NEW_LINE>env.sendEventBean(new SupportBean("E1", 0));<NEW_LINE>env.advanceTime(1900);<NEW_LINE>env.sendEventBean(new SupportBean("E2", 0));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.<MASK><NEW_LINE>env.advanceTime(1901);<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, new Object[][] { { "E1" }, { "E2" } }, null);<NEW_LINE>env.sendEventBean(new SupportBean("E3", 0));<NEW_LINE>env.advanceTime(2300);<NEW_LINE>env.sendEventBean(new SupportBean("E4", 0));<NEW_LINE>env.advanceTime(2500);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.sendEventBean(new SupportBean("E5", 0));<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, new Object[][] { { "E3" }, { "E4" }, { "E5" } }, new Object[][] { { "E1" }, { "E2" } });<NEW_LINE>env.advanceTime(3100);<NEW_LINE>env.sendEventBean(new SupportBean("E6", 0));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.runtimeSetVariable("s0", "SIZE", 999);<NEW_LINE>env.advanceTime(3700);<NEW_LINE>env.sendEventBean(new SupportBean("E7", 0));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.advanceTime(4100);<NEW_LINE>env.sendEventBean(new SupportBean("E8", 0));<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, new Object[][] { { "E6" }, { "E7" }, { "E8" } }, new Object[][] { { "E3" }, { "E4" }, { "E5" } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | runtimeSetVariable("s0", "SIZE", 500); |
691,538 | // DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static double value(com.sun.jdi.DoubleValue a) throws org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.DoubleValue", "value", "JDI CALL: com.sun.jdi.DoubleValue({0}).value()", new Object[] { a });<NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE>double ret;<NEW_LINE>ret = a.value();<NEW_LINE>retValue = ret;<NEW_LINE>return ret;<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>org.netbeans.modules.debugger.<MASK><NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper(ex);<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.Mirror) a).virtualMachine();<NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper(ex);<NEW_LINE>} catch (Error err) {<NEW_LINE>retValue = err;<NEW_LINE>throw err;<NEW_LINE>} catch (RuntimeException rex) {<NEW_LINE>retValue = rex;<NEW_LINE>throw rex;<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.DoubleValue", "value", retValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | jpda.JDIExceptionReporter.report(ex); |
24,405 | public CreateSoftwareUpdateJobResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateSoftwareUpdateJobResult createSoftwareUpdateJobResult = new CreateSoftwareUpdateJobResult();<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 createSoftwareUpdateJobResult;<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("IotJobArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createSoftwareUpdateJobResult.setIotJobArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("IotJobId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createSoftwareUpdateJobResult.setIotJobId(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("PlatformSoftwareVersion", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createSoftwareUpdateJobResult.setPlatformSoftwareVersion(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createSoftwareUpdateJobResult;<NEW_LINE>} | class).unmarshall(context)); |
1,346,912 | // B.3 pg 62<NEW_LINE>public ECPoint twice() {<NEW_LINE>if (this.isInfinity()) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>ECCurve curve = this.getCurve();<NEW_LINE>SecP224K1FieldElement Y1 = (SecP224K1FieldElement) this.y;<NEW_LINE>if (Y1.isZero()) {<NEW_LINE>return curve.getInfinity();<NEW_LINE>}<NEW_LINE>SecP224K1FieldElement X1 = (SecP224K1FieldElement) this.x, Z1 = (SecP224K1FieldElement) this.zs[0];<NEW_LINE>int c;<NEW_LINE>int[] Y1Squared = Nat224.create();<NEW_LINE>SecP224K1Field.square(Y1.x, Y1Squared);<NEW_LINE>int[] T = Nat224.create();<NEW_LINE>SecP224K1Field.square(Y1Squared, T);<NEW_LINE>int[] M = Nat224.create();<NEW_LINE>SecP224K1Field.square(X1.x, M);<NEW_LINE>c = Nat224.addBothTo(M, M, M);<NEW_LINE>SecP224K1Field.reduce32(c, M);<NEW_LINE>int[] S = Y1Squared;<NEW_LINE>SecP224K1Field.multiply(Y1Squared, X1.x, S);<NEW_LINE>c = Nat.shiftUpBits(7, S, 2, 0);<NEW_LINE>SecP224K1Field.reduce32(c, S);<NEW_LINE>int[<MASK><NEW_LINE>c = Nat.shiftUpBits(7, T, 3, 0, t1);<NEW_LINE>SecP224K1Field.reduce32(c, t1);<NEW_LINE>SecP224K1FieldElement X3 = new SecP224K1FieldElement(T);<NEW_LINE>SecP224K1Field.square(M, X3.x);<NEW_LINE>SecP224K1Field.subtract(X3.x, S, X3.x);<NEW_LINE>SecP224K1Field.subtract(X3.x, S, X3.x);<NEW_LINE>SecP224K1FieldElement Y3 = new SecP224K1FieldElement(S);<NEW_LINE>SecP224K1Field.subtract(S, X3.x, Y3.x);<NEW_LINE>SecP224K1Field.multiply(Y3.x, M, Y3.x);<NEW_LINE>SecP224K1Field.subtract(Y3.x, t1, Y3.x);<NEW_LINE>SecP224K1FieldElement Z3 = new SecP224K1FieldElement(M);<NEW_LINE>SecP224K1Field.twice(Y1.x, Z3.x);<NEW_LINE>if (!Z1.isOne()) {<NEW_LINE>SecP224K1Field.multiply(Z3.x, Z1.x, Z3.x);<NEW_LINE>}<NEW_LINE>return new SecP224K1Point(curve, X3, Y3, new ECFieldElement[] { Z3 });<NEW_LINE>} | ] t1 = Nat224.create(); |
969,418 | public Optional<Product> importProduct(@NonNull final SyncProduct syncProduct, @Nullable Product product) {<NEW_LINE>final String uuid = syncProduct.getUuid();<NEW_LINE>if (product != null && !Objects.equals(product.getUuid(), uuid)) {<NEW_LINE>product = null;<NEW_LINE>}<NEW_LINE>if (product == null) {<NEW_LINE>product = productsRepo.findByUuid(uuid);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Handle delete request<NEW_LINE>if (syncProduct.isDeleted()) {<NEW_LINE>if (product != null) {<NEW_LINE>deleteProduct(product);<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (product == null) {<NEW_LINE>product = new Product();<NEW_LINE>product.setUuid(uuid);<NEW_LINE>}<NEW_LINE>product.setDeleted(false);<NEW_LINE>product.<MASK><NEW_LINE>product.setPackingInfo(syncProduct.getPackingInfo());<NEW_LINE>product.setShared(syncProduct.isShared());<NEW_LINE>productsRepo.save(product);<NEW_LINE>logger.debug("Imported: {} -> {}", syncProduct, product);<NEW_LINE>//<NEW_LINE>// Import product translations<NEW_LINE>final Map<String, ProductTrl> productTrls = mapByLanguage(productTrlsRepo.findByRecord(product));<NEW_LINE>for (final Map.Entry<String, String> lang2nameTrl : syncProduct.getNameTrls().entrySet()) {<NEW_LINE>final String language = lang2nameTrl.getKey();<NEW_LINE>final String nameTrl = lang2nameTrl.getValue();<NEW_LINE>ProductTrl productTrl = productTrls.remove(language);<NEW_LINE>if (productTrl == null) {<NEW_LINE>productTrl = new ProductTrl();<NEW_LINE>productTrl.setLanguage(language);<NEW_LINE>productTrl.setRecord(product);<NEW_LINE>}<NEW_LINE>productTrl.setName(nameTrl);<NEW_LINE>productTrlsRepo.save(productTrl);<NEW_LINE>logger.debug("Imported: {}", productTrl);<NEW_LINE>}<NEW_LINE>for (final ProductTrl productTrl : productTrls.values()) {<NEW_LINE>productTrlsRepo.delete(productTrl);<NEW_LINE>}<NEW_LINE>return Optional.of(product);<NEW_LINE>} | setName(syncProduct.getName()); |
606,214 | private void processTaskCleanupsForRequest(String requestId, List<SingularityTaskCleanup> cleanupTasks, AtomicInteger killedTasks) {<NEW_LINE>final Multiset<SingularityDeployKey> incrementalCleaningTasks = HashMultiset.create(cleanupTasks.size());<NEW_LINE>final List<String> taskIdsForDeletedRequest = new ArrayList<>();<NEW_LINE>boolean isRequestDeleting = false;<NEW_LINE>// TODO - Better check for deleting request state<NEW_LINE>final Set<SingularityTaskId> cleaningTasks = new HashSet<>(cleanupTasks.size());<NEW_LINE>for (SingularityTaskCleanup cleanupTask : cleanupTasks) {<NEW_LINE>cleaningTasks.<MASK><NEW_LINE>if (isIncrementalDeployCleanup(cleanupTask) || cleanupTask.getCleanupType() == TaskCleanupType.INCREMENTAL_BOUNCE) {<NEW_LINE>incrementalCleaningTasks.add(SingularityDeployKey.fromTaskId(cleanupTask.getTaskId()));<NEW_LINE>}<NEW_LINE>if (cleanupTask.getCleanupType() == TaskCleanupType.REQUEST_DELETING) {<NEW_LINE>taskIdsForDeletedRequest.add(cleanupTask.getTaskId().getId());<NEW_LINE>isRequestDeleting = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.info("Cleaning up {} tasks for request {}", cleanupTasks.size(), requestId);<NEW_LINE>final List<SingularityTaskId> activeTaskIds = taskManager.getActiveTaskIds();<NEW_LINE>for (SingularityTaskCleanup cleanupTask : cleanupTasks) {<NEW_LINE>SingularityTaskId taskId = cleanupTask.getTaskId();<NEW_LINE>if (!isValidTask(cleanupTask)) {<NEW_LINE>LOG.info("Couldn't find a matching active task for cleanup task {}, deleting..", cleanupTask);<NEW_LINE>taskManager.deleteCleanupTask(taskId.getId());<NEW_LINE>} else if (shouldKillTask(cleanupTask, activeTaskIds, cleaningTasks, incrementalCleaningTasks) && checkLBStateAndShouldKillTask(cleanupTask)) {<NEW_LINE>scheduler.killAndRecord(taskId, cleanupTask.getCleanupType(), cleanupTask.getUser());<NEW_LINE>taskManager.deleteCleanupTask(taskId.getId());<NEW_LINE>killedTasks.getAndIncrement();<NEW_LINE>}<NEW_LINE>cleanupRequestIfNoRemainingTasks(cleanupTask, taskIdsForDeletedRequest, isRequestDeleting);<NEW_LINE>}<NEW_LINE>} | add(cleanupTask.getTaskId()); |
1,646,353 | public static void from_3BU8_to_3PU8(ByteBuffer src, int srcOffset, int srcStride, Planar<GrayU8> dst, DogArray_I8 work) {<NEW_LINE>work.resize(dst.width * 3);<NEW_LINE>GrayU8 r = dst.getBand(0);<NEW_LINE>GrayU8 g = dst.getBand(1);<NEW_LINE>GrayU8 b = dst.getBand(2);<NEW_LINE>int indexSrc = srcOffset;<NEW_LINE>for (int y = 0; y < dst.height; y++) {<NEW_LINE>src.position(indexSrc);<NEW_LINE>src.get(work.data, 0, work.size);<NEW_LINE>int indexDst = dst<MASK><NEW_LINE>for (int i = 0; i < work.size; indexDst++) {<NEW_LINE>r.data[indexDst] = work.data[i++];<NEW_LINE>g.data[indexDst] = work.data[i++];<NEW_LINE>b.data[indexDst] = work.data[i++];<NEW_LINE>}<NEW_LINE>indexSrc += srcStride;<NEW_LINE>}<NEW_LINE>} | .startIndex + dst.stride * y; |
435,675 | public ScheduledFuture<File> exportDatapoints(AttributeRef[] attributeRefs, long fromTimestamp, long toTimestamp) {<NEW_LINE>return executorService.schedule(() -> {<NEW_LINE>String fileName = UniqueIdentifierGenerator.generateId() + ".csv";<NEW_LINE>StringBuilder sb = new StringBuilder(String.format("copy (select ad.timestamp, a.name, ad.attribute_name, value from asset_datapoint ad, asset a where ad.entity_id = a.id and ad.timestamp >= to_timestamp(%d) and ad.timestamp <= to_timestamp(%d) and (", fromTimestamp / 1000, toTimestamp / 1000));<NEW_LINE>sb.append(Arrays.stream(attributeRefs).map(attributeRef -> String.format("(ad.entity_id = '%s' and ad.attribute_name = '%s')", attributeRef.getId(), attributeRef.getName())).collect(Collectors.joining(" or ")));<NEW_LINE>sb.append(String.format(")) to '/tmp/%s' delimiter ',' CSV HEADER;", fileName));<NEW_LINE>persistenceService.doTransaction(em -> em.createNativeQuery(sb.toString()).executeUpdate());<NEW_LINE>return exportPath.resolve(fileName).toFile();<NEW_LINE><MASK><NEW_LINE>} | }, 0, TimeUnit.MILLISECONDS); |
1,676,187 | public String dump(ASN1Primitive asn1Object) throws Asn1Exception, IOException {<NEW_LINE>// Get dump of the supplied ASN.1 object incrementing the indent level of the output<NEW_LINE>try {<NEW_LINE>indentLevel++;<NEW_LINE>if (asn1Object instanceof DERBitString) {<NEW_LINE>// special case of ASN1String<NEW_LINE>return dumpBitString((DERBitString) asn1Object);<NEW_LINE>} else if (asn1Object instanceof ASN1String) {<NEW_LINE>return dumpString((ASN1String) asn1Object);<NEW_LINE>} else if (asn1Object instanceof ASN1UTCTime) {<NEW_LINE>return dumpUTCTime((ASN1UTCTime) asn1Object);<NEW_LINE>} else if (asn1Object instanceof ASN1GeneralizedTime) {<NEW_LINE>return dumpGeneralizedTime((ASN1GeneralizedTime) asn1Object);<NEW_LINE>} else if (asn1Object instanceof ASN1Sequence || asn1Object instanceof ASN1Set) {<NEW_LINE>return dumpSetOrSequence(asn1Object);<NEW_LINE>} else if (asn1Object instanceof ASN1TaggedObject) {<NEW_LINE>return dumpTaggedObject((ASN1TaggedObject) asn1Object);<NEW_LINE>} else if (asn1Object instanceof ASN1Boolean) {<NEW_LINE>return dumpBoolean((ASN1Boolean) asn1Object);<NEW_LINE>} else if (asn1Object instanceof ASN1Enumerated) {<NEW_LINE><MASK><NEW_LINE>} else if (asn1Object instanceof ASN1Integer) {<NEW_LINE>return dumpInteger((ASN1Integer) asn1Object);<NEW_LINE>} else if (asn1Object instanceof ASN1Null) {<NEW_LINE>return dumpNull();<NEW_LINE>} else if (asn1Object instanceof ASN1ObjectIdentifier) {<NEW_LINE>return dumpObjectIdentifier((ASN1ObjectIdentifier) asn1Object);<NEW_LINE>} else if (asn1Object instanceof ASN1OctetString) {<NEW_LINE>return dumpOctetString((ASN1OctetString) asn1Object);<NEW_LINE>} else {<NEW_LINE>throw new Asn1Exception("Unknown ASN.1 object: " + asn1Object.toString());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>indentLevel--;<NEW_LINE>}<NEW_LINE>} | return dumpEnumerated((ASN1Enumerated) asn1Object); |
1,269,244 | final DescribeJobTemplateResult executeDescribeJobTemplate(DescribeJobTemplateRequest describeJobTemplateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeJobTemplateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeJobTemplateRequest> request = null;<NEW_LINE>Response<DescribeJobTemplateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeJobTemplateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeJobTemplateRequest));<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, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeJobTemplate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeJobTemplateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeJobTemplateResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
44,329 | private static String buildOS() {<NEW_LINE>final String name = System.getProperty("os.name");<NEW_LINE>final String <MASK><NEW_LINE>final String patchLevel = System.getProperty("sun.os.patch.level");<NEW_LINE>final String arch = System.getProperty("os.arch");<NEW_LINE>final String bits = System.getProperty("sun.arch.data.model");<NEW_LINE>final StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(name).append(", ");<NEW_LINE>if (!name.toLowerCase(Locale.ENGLISH).contains("windows")) {<NEW_LINE>// version is "6.1" and useless for os.name "Windows 7",<NEW_LINE>// and can be "2.6.32-358.23.2.el6.x86_64" for os.name "Linux"<NEW_LINE>sb.append(version).append(' ');<NEW_LINE>}<NEW_LINE>if (!"unknown".equals(patchLevel)) {<NEW_LINE>// patchLevel is "unknown" and useless on Linux,<NEW_LINE>// and can be "Service Pack 1" on Windows<NEW_LINE>sb.append(patchLevel);<NEW_LINE>}<NEW_LINE>sb.append(", ").append(arch).append('/').append(bits);<NEW_LINE>return sb.toString();<NEW_LINE>} | version = System.getProperty("os.version"); |
658,402 | public static Calendar readDateTime(@NonNull final Data data, final int offset) {<NEW_LINE>if (data.size() < offset + 7)<NEW_LINE>return null;<NEW_LINE>final Calendar calendar = Calendar.getInstance();<NEW_LINE>final int year = data.getIntValue(Data.FORMAT_UINT16_LE, offset);<NEW_LINE>final int month = data.getIntValue(Data.FORMAT_UINT8, offset + 2);<NEW_LINE>final int day = data.getIntValue(<MASK><NEW_LINE>if (year > 0)<NEW_LINE>calendar.set(Calendar.YEAR, year);<NEW_LINE>else<NEW_LINE>calendar.clear(Calendar.YEAR);<NEW_LINE>if (month > 0)<NEW_LINE>// months are 1-based in Date Time characteristic<NEW_LINE>calendar.set(Calendar.MONTH, month - 1);<NEW_LINE>else<NEW_LINE>calendar.clear(Calendar.MONTH);<NEW_LINE>if (day > 0)<NEW_LINE>calendar.set(Calendar.DATE, day);<NEW_LINE>else<NEW_LINE>calendar.clear(Calendar.DATE);<NEW_LINE>calendar.set(Calendar.HOUR_OF_DAY, data.getIntValue(Data.FORMAT_UINT8, offset + 4));<NEW_LINE>calendar.set(Calendar.MINUTE, data.getIntValue(Data.FORMAT_UINT8, offset + 5));<NEW_LINE>calendar.set(Calendar.SECOND, data.getIntValue(Data.FORMAT_UINT8, offset + 6));<NEW_LINE>calendar.set(Calendar.MILLISECOND, 0);<NEW_LINE>return calendar;<NEW_LINE>} | Data.FORMAT_UINT8, offset + 3); |
284,779 | public void updateRoomUsers(RoomUsersAddBatchRequest body, Long roomId, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling updateRoomUsers");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'roomId' is set<NEW_LINE>if (roomId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'roomId' when calling updateRoomUsers");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/nodes/rooms/{room_id}/users".replaceAll("\\{" + "room_id" + "\\}", apiClient.escapeString(roomId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final <MASK><NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>} | String[] localVarContentTypes = { "application/json" }; |
1,206,997 | public void applySpecialCrafting(ItemStack stack, SpecialRevolver r) {<NEW_LINE>if (r == null) {<NEW_LINE>ItemNBTHelper.remove(stack, "elite");<NEW_LINE>ItemNBTHelper.remove(stack, "flavour");<NEW_LINE>ItemNBTHelper.remove(stack, "baseUpgrades");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (r.tag != null && !r.tag.isEmpty())<NEW_LINE>ItemNBTHelper.putString(stack, "elite", r.tag);<NEW_LINE>if (r.flavour != null && !r.flavour.isEmpty())<NEW_LINE>ItemNBTHelper.putString(<MASK><NEW_LINE>CompoundTag baseUpgrades = new CompoundTag();<NEW_LINE>for (Map.Entry<String, Object> e : r.baseUpgrades.entrySet()) {<NEW_LINE>if (e.getValue() instanceof Boolean)<NEW_LINE>baseUpgrades.putBoolean(e.getKey(), (Boolean) e.getValue());<NEW_LINE>else if (e.getValue() instanceof Integer)<NEW_LINE>baseUpgrades.putInt(e.getKey(), (Integer) e.getValue());<NEW_LINE>else if (e.getValue() instanceof Float)<NEW_LINE>baseUpgrades.putDouble(e.getKey(), (Float) e.getValue());<NEW_LINE>else if (e.getValue() instanceof Double)<NEW_LINE>baseUpgrades.putDouble(e.getKey(), (Double) e.getValue());<NEW_LINE>else if (e.getValue() instanceof String)<NEW_LINE>baseUpgrades.putString(e.getKey(), (String) e.getValue());<NEW_LINE>}<NEW_LINE>ItemNBTHelper.setTagCompound(stack, "baseUpgrades", baseUpgrades);<NEW_LINE>} | stack, "flavour", r.flavour); |
609,221 | private void updateCameraDriverSettings() {<NEW_LINE>Log.i(TAG, String.format("updateCameraDriverSettings() mCameraDriver=%d RTABMapLib.isBuiltWith(%d)=%d", mCameraDriver, mCameraDriver, RTABMapLib.isBuiltWith(nativeApplication, mCameraDriver) ? 1 : 0));<NEW_LINE>SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);<NEW_LINE>String cameraDriverStr = sharedPref.getString(getString(R.string.pref_key_camera_driver), getString(R.string.pref_default_camera_driver));<NEW_LINE>mCameraDriver = Integer.parseInt(cameraDriverStr);<NEW_LINE>if (mCameraDriver == -1) {<NEW_LINE>// Prioritize tango if available<NEW_LINE>mCameraDriver = 0;<NEW_LINE>SharedPreferences.Editor editor = sharedPref.edit();<NEW_LINE>editor.putString(getString(R.string.pref_key_camera_driver), "0");<NEW_LINE>editor.commit();<NEW_LINE>}<NEW_LINE>if (mCameraDriver == 0 && (!CheckTangoCoreVersion(MIN_TANGO_CORE_VERSION) || !RTABMapLib.isBuiltWith(nativeApplication, 0))) {<NEW_LINE>if (mIsAREngineAvailable && RTABMapLib.isBuiltWith(nativeApplication, 2)) {<NEW_LINE>SharedPreferences.Editor editor = sharedPref.edit();<NEW_LINE>editor.putString(getString(R.string.pref_key_camera_driver), "2");<NEW_LINE>editor.commit();<NEW_LINE>} else if (mIsARCoreAvailable) {<NEW_LINE>SharedPreferences.Editor editor = sharedPref.edit();<NEW_LINE>editor.putString(getString(R.string.pref_key_camera_driver), "3");<NEW_LINE>editor.commit();<NEW_LINE>}<NEW_LINE>} else if (((mCameraDriver == 1 && (!RTABMapLib.isBuiltWith(nativeApplication, 0) || !mIsARCoreAvailable)) || (mCameraDriver == 3 && !mIsARCoreAvailable))) {<NEW_LINE>if (CheckTangoCoreVersion(MIN_TANGO_CORE_VERSION) && RTABMapLib.isBuiltWith(nativeApplication, 0)) {<NEW_LINE>SharedPreferences.Editor editor = sharedPref.edit();<NEW_LINE>editor.putString(getString(R.string.pref_key_camera_driver), "0");<NEW_LINE>editor.commit();<NEW_LINE>} else if (mIsAREngineAvailable && RTABMapLib.isBuiltWith(nativeApplication, 2)) {<NEW_LINE>SharedPreferences.Editor editor = sharedPref.edit();<NEW_LINE>editor.putString(getString(R.string.pref_key_camera_driver), "2");<NEW_LINE>editor.commit();<NEW_LINE>}<NEW_LINE>} else if (mCameraDriver == 2 && (!mIsAREngineAvailable || !RTABMapLib.isBuiltWith(nativeApplication, 2))) {<NEW_LINE>if (CheckTangoCoreVersion(MIN_TANGO_CORE_VERSION) && RTABMapLib.isBuiltWith(nativeApplication, 0)) {<NEW_LINE>SharedPreferences.<MASK><NEW_LINE>editor.putString(getString(R.string.pref_key_camera_driver), "0");<NEW_LINE>editor.commit();<NEW_LINE>} else if (mIsARCoreAvailable) {<NEW_LINE>SharedPreferences.Editor editor = sharedPref.edit();<NEW_LINE>editor.putString(getString(R.string.pref_key_camera_driver), "3");<NEW_LINE>editor.commit();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Editor editor = sharedPref.edit(); |
1,019,621 | public void onReceive(FlipperObject params, FlipperResponder responder) {<NEW_LINE>GetTableStructureRequest getTableStructureRequest = ObjectMapper.flipperObjectToGetTableStructureRequest(params);<NEW_LINE>if (getTableStructureRequest == null) {<NEW_LINE>responder.error(ObjectMapper.toErrorFlipperObject(DatabasesErrorCodes.ERROR_INVALID_REQUEST, DatabasesErrorCodes.ERROR_INVALID_REQUEST_MESSAGE));<NEW_LINE>} else {<NEW_LINE>DatabaseDescriptorHolder databaseDescriptorHolder = mDatabaseDescriptorHolderSparseArray.get(getTableStructureRequest.databaseId);<NEW_LINE>if (databaseDescriptorHolder == null) {<NEW_LINE>responder.error(ObjectMapper.toErrorFlipperObject(DatabasesErrorCodes<MASK><NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>DatabaseGetTableStructureResponse databaseGetTableStructureResponse = databaseDescriptorHolder.databaseDriver.getTableStructure(databaseDescriptorHolder.databaseDescriptor, getTableStructureRequest.table);<NEW_LINE>responder.success(ObjectMapper.databaseGetTableStructureResponseToFlipperObject(databaseGetTableStructureResponse));<NEW_LINE>} catch (Exception e) {<NEW_LINE>responder.error(ObjectMapper.toErrorFlipperObject(DatabasesErrorCodes.ERROR_SQL_EXECUTION_EXCEPTION, e.getMessage()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .ERROR_DATABASE_INVALID, DatabasesErrorCodes.ERROR_DATABASE_INVALID_MESSAGE)); |
941,493 | public void removeInactiveAgents(int durationDays) {<NEW_LINE>if (durationDays < MIN_DURATION_DAYS_FOR_INACTIVITY) {<NEW_LINE>throw new IllegalArgumentException("duration may not be less than " + MIN_DURATION_DAYS_FOR_INACTIVITY + " days");<NEW_LINE>}<NEW_LINE>Map<String, List<String>> inactiveAgentMap = new TreeMap<>(String::compareTo);<NEW_LINE>List<Application> applications = this.applicationIndexDao.selectAllApplicationNames();<NEW_LINE>Set<String> applicationNames = new TreeSet<>(String::compareTo);<NEW_LINE>// remove duplicates (same application name but different service type)<NEW_LINE>for (Application application : applications) {<NEW_LINE>applicationNames.add(application.getName());<NEW_LINE>}<NEW_LINE>for (String applicationName : applicationNames) {<NEW_LINE>List<String> agentIds = <MASK><NEW_LINE>Collections.sort(agentIds);<NEW_LINE>List<String> inactiveAgentIds = filterInactiveAgents(agentIds, durationDays);<NEW_LINE>if (CollectionUtils.hasLength(inactiveAgentIds)) {<NEW_LINE>inactiveAgentMap.put(applicationName, inactiveAgentIds);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// map may become big, but realistically won't cause OOM<NEW_LINE>// if it becomes an issue, consider deleting inside the loop above<NEW_LINE>logger.info("deleting {}", inactiveAgentMap);<NEW_LINE>this.applicationIndexDao.deleteAgentIds(inactiveAgentMap);<NEW_LINE>} | this.applicationIndexDao.selectAgentIds(applicationName); |
817,250 | private static String addNamespaceDeclIfNeeded(XmlDocument doc, String tags) {<NEW_LINE>if (doc.getDocument() == null) {<NEW_LINE>return tags;<NEW_LINE>}<NEW_LINE>if (doc.getDocument().getDocumentElement() == null) {<NEW_LINE>return tags;<NEW_LINE>}<NEW_LINE>Matcher matcher = START_TAG_RE.matcher(tags);<NEW_LINE>Map<CharSequence, CharSequence> rewriteTable = null;<NEW_LINE>while (matcher.find()) {<NEW_LINE>String start_tag = matcher.group();<NEW_LINE>Matcher matcher2 = QNAME_RE.matcher(start_tag);<NEW_LINE>while (matcher2.find()) {<NEW_LINE>String qName = matcher2.group();<NEW_LINE>NamedNodeMap nodeMap = doc.getDocument().getDocumentElement().getAttributes();<NEW_LINE>if (isNamespaceDefined(qName, nodeMap)) {<NEW_LINE>CharSequence namespaceDecl = getNamespaceDecl(getPrefix(qName), nodeMap);<NEW_LINE>if (namespaceDecl != null) {<NEW_LINE>if (rewriteTable == null) {<NEW_LINE>rewriteTable = new HashMap<CharSequence, CharSequence>(8, 1);<NEW_LINE>}<NEW_LINE>StringBuilder str = new StringBuilder(qName.length() + namespaceDecl.length() + 3);<NEW_LINE>String key = str.append('<').append(qName).append('>').toString();<NEW_LINE>// (last) '>' -> ' '<NEW_LINE>str.setCharAt(key.length() - 1, ' ');<NEW_LINE>rewriteTable.put(key, str.append(namespaceDecl).append('>'));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (rewriteTable != null) {<NEW_LINE>for (Map.Entry<CharSequence, CharSequence> e : rewriteTable.entrySet()) {<NEW_LINE>tags = tags.replace(e.getKey(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return tags;<NEW_LINE>} | ), e.getValue()); |
460,071 | public void init(ServletConfig config) {<NEW_LINE>ServletContext context = config.getServletContext();<NEW_LINE>shouldForwardToFilesContext = getFileContextForwardingFlagFrom(config);<NEW_LINE>if (context.getInitParameter("WireMockFileSourceRoot") != null) {<NEW_LINE>wiremockFileSourceRoot = context.getInitParameter("WireMockFileSourceRoot");<NEW_LINE>}<NEW_LINE>scheduledExecutorService = (ScheduledExecutorService) context.getAttribute(ASYNCHRONOUS_RESPONSE_EXECUTOR);<NEW_LINE>String handlerClassName = config.getInitParameter(RequestHandler.HANDLER_CLASS_KEY);<NEW_LINE>String faultInjectorFactoryClassName = config.getInitParameter(FaultInjectorFactory.INJECTOR_CLASS_KEY);<NEW_LINE>mappedUnder = getNormalizedMappedUnder(config);<NEW_LINE>context.log(RequestHandler.HANDLER_CLASS_KEY + " from context returned " + handlerClassName + ". Normalized mapped under returned '" + mappedUnder + "'");<NEW_LINE>requestHandler = (RequestHandler) context.getAttribute(handlerClassName);<NEW_LINE>faultHandlerFactory = faultInjectorFactoryClassName != null ? (FaultInjectorFactory) context.getAttribute(faultInjectorFactoryClassName) : new NoFaultInjectorFactory();<NEW_LINE>notifier = (Notifier) context.getAttribute(Notifier.KEY);<NEW_LINE>multipartRequestConfigurer = (MultipartRequestConfigurer) context.getAttribute(MultipartRequestConfigurer.KEY);<NEW_LINE>Object chunkedEncodingPolicyAttr = context.getAttribute(Options.<MASK><NEW_LINE>chunkedEncodingPolicy = chunkedEncodingPolicyAttr != null ? (Options.ChunkedEncodingPolicy) chunkedEncodingPolicyAttr : Options.ChunkedEncodingPolicy.ALWAYS;<NEW_LINE>browserProxyingEnabled = Boolean.parseBoolean(firstNonNull(context.getAttribute("browserProxyingEnabled"), "false").toString());<NEW_LINE>} | ChunkedEncodingPolicy.class.getName()); |
46,452 | public static void main(String[] args) {<NEW_LINE>// Queue for incoming messages represented as Flux<NEW_LINE>// Imagine that every fireAndForget that is pushed is processed by a worker<NEW_LINE>BlockingQueue<Runnable> tasksQueue = new ArrayBlockingQueue<>(QUEUE_CAPACITY);<NEW_LINE>ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, CONCURRENT_WORKERS_COUNT, 1, TimeUnit.MINUTES, tasksQueue);<NEW_LINE>Scheduler workScheduler = Schedulers.fromExecutorService(threadPoolExecutor);<NEW_LINE>LeaseManager leaseManager = new LeaseManager(CONCURRENT_WORKERS_COUNT, TASK_PROCESSING_TIME);<NEW_LINE>Disposable.Composite disposable = Disposables.composite();<NEW_LINE>CloseableChannel server = RSocketServer.create(SocketAcceptor.with(new TasksHandlingRSocket(disposable, workScheduler, TASK_PROCESSING_TIME))).lease((config) -> config.sender(new LimitBasedLeaseSender(UUID.randomUUID().toString(), leaseManager, VegasLimit.newBuilder().initialLimit(CONCURRENT_WORKERS_COUNT).maxConcurrency(QUEUE_CAPACITY).build()))).bindNow(TcpServerTransport.create("localhost", 7000));<NEW_LINE>disposable.add(server);<NEW_LINE>logger.info("Server started on port {}", server.address().getPort());<NEW_LINE>server<MASK><NEW_LINE>} | .onClose().block(); |
1,825,650 | private static FullRowType apply(RelDataTypeFactory typeFactory, RelDataType bottomRowType, List<Label> inputs) {<NEW_LINE>final ImmutableMap.Builder<Integer, Integer> newFullColumnIndexMap = ImmutableMap.builder();<NEW_LINE>final ImmutableBitSet.Builder newColumnInputSet = ImmutableBitSet.builder();<NEW_LINE>// build full row type<NEW_LINE>final RelDataType newFullRowType = LabelUtil.concatApplyRowTypes(inputs, typeFactory, bottomRowType.getFieldList().get(bottomRowType.getFieldCount() - 1));<NEW_LINE>// build fullColumnIndexMap & columnInputSet<NEW_LINE>int topShift = 0;<NEW_LINE>int bottomShift = 0;<NEW_LINE>int index = 0;<NEW_LINE>for (final Label rightInput : inputs) {<NEW_LINE>// if (index++ == 1) {<NEW_LINE>// topShift += 1;<NEW_LINE>// bottomShift += 1;<NEW_LINE>// }<NEW_LINE>final Mapping currentColumnIndex = rightInput.getColumnMapping();<NEW_LINE>final Mapping currentFullColumnIndex <MASK><NEW_LINE>LabelUtil.multiplyAndShiftMap(newFullColumnIndexMap, newColumnInputSet, currentColumnIndex, currentFullColumnIndex, topShift, bottomShift);<NEW_LINE>topShift += currentColumnIndex.getSourceCount();<NEW_LINE>bottomShift += rightInput.getFullRowType().fullRowType.getFieldCount();<NEW_LINE>}<NEW_LINE>// end of for<NEW_LINE>final Mapping newFullColumnMapping = LabelUtil.columnMapping(newFullColumnIndexMap.build(), topShift, bottomShift);<NEW_LINE>return new FullRowType(newFullRowType, newFullColumnMapping, newColumnInputSet.build(), new HashMap<>());<NEW_LINE>} | = rightInput.getFullRowType().fullColumnMapping; |
120,322 | private void processDeferredConcepts() {<NEW_LINE>int codeCount = 0, relCount = 0;<NEW_LINE>StopWatch stopwatch = new StopWatch();<NEW_LINE>int count = Math.min(1000, myDeferredConcepts.size());<NEW_LINE>ourLog.debug("Saving {} deferred concepts...", count);<NEW_LINE>while (codeCount < count && myDeferredConcepts.size() > 0) {<NEW_LINE>TermConcept next = myDeferredConcepts.remove(0);<NEW_LINE>if (myCodeSystemVersionDao.findById(next.getCodeSystemVersion().getPid()).isPresent()) {<NEW_LINE>try {<NEW_LINE>codeCount += myTermConceptDaoSvc.saveConcept(next);<NEW_LINE>} catch (Exception theE) {<NEW_LINE>ourLog.error("Exception thrown when attempting to save TermConcept {} in Code System {}", next.getCode(), next.getCodeSystemVersion().getCodeSystemDisplayName(), theE);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ourLog.warn("Unable to save deferred TermConcept {} because Code System {} version PID {} is no longer valid. Code system may have since been replaced.", next.getCode(), next.getCodeSystemVersion().getCodeSystemDisplayName(), next.getCodeSystemVersion().getPid());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (codeCount > 0) {<NEW_LINE>ourLog.info("Saved {} deferred concepts ({} codes remain and {} relationships remain) in {}ms ({} codes/sec)", codeCount, myDeferredConcepts.size(), myConceptLinksToSaveLater.size(), stopwatch.getMillis(), stopwatch.formatThroughput(codeCount, TimeUnit.SECONDS));<NEW_LINE>}<NEW_LINE>if (codeCount == 0) {<NEW_LINE>count = Math.min(1000, myConceptLinksToSaveLater.size());<NEW_LINE>ourLog.info("Saving {} deferred concept relationships...", count);<NEW_LINE>while (relCount < count && myConceptLinksToSaveLater.size() > 0) {<NEW_LINE>TermConceptParentChildLink next = myConceptLinksToSaveLater.remove(0);<NEW_LINE>assert next.getChild() != null;<NEW_LINE><MASK><NEW_LINE>if ((next.getChild().getId() == null || !myConceptDao.findById(next.getChild().getId()).isPresent()) || (next.getParent().getId() == null || !myConceptDao.findById(next.getParent().getId()).isPresent())) {<NEW_LINE>ourLog.warn("Not inserting link from child {} to parent {} because it appears to have been deleted", next.getParent().getCode(), next.getChild().getCode());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>saveConceptLink(next);<NEW_LINE>relCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (relCount > 0) {<NEW_LINE>ourLog.info("Saved {} deferred relationships ({} remain) in {}ms ({} entries/sec)", relCount, myConceptLinksToSaveLater.size(), stopwatch.getMillis(), stopwatch.formatThroughput(relCount, TimeUnit.SECONDS));<NEW_LINE>}<NEW_LINE>if ((myDeferredConcepts.size() + myConceptLinksToSaveLater.size()) == 0) {<NEW_LINE>ourLog.info("All deferred concepts and relationships have now been synchronized to the database");<NEW_LINE>}<NEW_LINE>} | assert next.getParent() != null; |
518,494 | public static Perfetto.Data.Builder enumerate(Perfetto.Data.Builder data) {<NEW_LINE>ImmutableListMultimap<String, CounterInfo> counters = data.getCounters(CounterInfo.Type.Global);<NEW_LINE>CounterInfo battCap = onlyOne(counters.get("batt.capacity_pct"));<NEW_LINE>CounterInfo battCharge = onlyOne(counters.get("batt.charge_uah"));<NEW_LINE>CounterInfo battCurrent = onlyOne<MASK><NEW_LINE>if ((battCap == null) || (battCharge == null) || (battCurrent == null)) {<NEW_LINE>return data;<NEW_LINE>}<NEW_LINE>BatterySummaryTrack track = new BatterySummaryTrack(data.qe, battCap, battCharge, battCurrent);<NEW_LINE>data.tracks.addTrack(null, track.getId(), "Battery Usage", single(state -> new BatterySummaryPanel(state, track), true, false));<NEW_LINE>return data;<NEW_LINE>} | (counters.get("batt.current_ua")); |
689,177 | private I_C_Invoice_Candidate createCandidateForOrderLine(final I_C_OrderLine orderLine) {<NEW_LINE>final Properties ctx = InterfaceWrapperHelper.getCtx(orderLine);<NEW_LINE>final String trxName = InterfaceWrapperHelper.getTrxName(orderLine);<NEW_LINE>Check.assume(Env.getAD_Client_ID(ctx) == orderLine.getAD_Client_ID(), "AD_Client_ID of " + orderLine + " and of its Ctx are the same");<NEW_LINE>final I_C_Invoice_Candidate icRecord = InterfaceWrapperHelper.create(ctx, I_C_Invoice_Candidate.class, trxName);<NEW_LINE>icRecord.setAD_Org_ID(orderLine.getAD_Org_ID());<NEW_LINE>icRecord.setC_ILCandHandler(getHandlerRecord());<NEW_LINE>icRecord.setAD_Table_ID(tableDAO.retrieveTableId(org.compiere.model.I_C_OrderLine.Table_Name));<NEW_LINE>icRecord.setRecord_ID(orderLine.getC_OrderLine_ID());<NEW_LINE>icRecord.setC_OrderLine(orderLine);<NEW_LINE>final int productRecordId = orderLine.getM_Product_ID();<NEW_LINE>icRecord.setM_Product_ID(productRecordId);<NEW_LINE>final boolean isFreightCostProduct = productBL.getProductType(ProductId.ofRepoId(productRecordId)).isFreightCost();<NEW_LINE>icRecord.setIsFreightCost(isFreightCostProduct);<NEW_LINE>icRecord.setIsPackagingMaterial(orderLine.isPackagingMaterial());<NEW_LINE>icRecord.setC_Charge_ID(orderLine.getC_Charge_ID());<NEW_LINE>setOrderedData(icRecord, orderLine);<NEW_LINE>// to be computed<NEW_LINE>icRecord.setQtyToInvoice(BigDecimal.ZERO);<NEW_LINE>// 03439<NEW_LINE>icRecord.setDescription(orderLine.getDescription());<NEW_LINE>final I_C_Order order = InterfaceWrapperHelper.create(orderLine.getC_Order(), I_C_Order.class);<NEW_LINE>setBPartnerData(icRecord, orderLine);<NEW_LINE>setGroupCompensationData(icRecord, orderLine);<NEW_LINE>//<NEW_LINE>// Invoice Rule(s)<NEW_LINE>icRecord.setInvoiceRule(order.getInvoiceRule());<NEW_LINE>// If we are dealing with a non-receivable service set the InvoiceRule_Override to Immediate<NEW_LINE>// because we want to invoice those right away (08408)<NEW_LINE>if (isNotReceivebleService(icRecord)) {<NEW_LINE>// immediate<NEW_LINE>icRecord.setInvoiceRule_Override(X_C_Invoice_Candidate.INVOICERULE_OVERRIDE_Immediate);<NEW_LINE>}<NEW_LINE>// 05265<NEW_LINE>icRecord.setIsSOTrx(orderLine.getC_Order().isSOTrx());<NEW_LINE>icRecord.setQtyOrderedOverUnder(orderLine.getQtyOrderedOverUnder());<NEW_LINE>// prices and tax<NEW_LINE>final PriceAndTax priceAndTax = calculatePriceAndTax(icRecord);<NEW_LINE>IInvoiceCandInvalidUpdater.updatePriceAndTax(icRecord, priceAndTax);<NEW_LINE>//<NEW_LINE>// Dimension<NEW_LINE>final Dimension orderLineDimension = extractDimension(orderLine);<NEW_LINE>dimensionService.updateRecord(icRecord, orderLineDimension);<NEW_LINE>// DocType<NEW_LINE>final DocTypeId orderDocTypeId = CoalesceUtil.coalesceSuppliersNotNull(() -> DocTypeId.ofRepoIdOrNull(order.getC_DocType_ID()), () -> DocTypeId.ofRepoId(order.getC_DocTypeTarget_ID()));<NEW_LINE>final I_C_DocType orderDocType = docTypeBL.getById(orderDocTypeId);<NEW_LINE>final DocTypeId invoiceDocTypeId = DocTypeId.ofRepoIdOrNull(orderDocType.getC_DocTypeInvoice_ID());<NEW_LINE>if (invoiceDocTypeId != null) {<NEW_LINE>icRecord.setC_DocTypeInvoice_ID(invoiceDocTypeId.getRepoId());<NEW_LINE>}<NEW_LINE>final AttributeSetInstanceId asiId = AttributeSetInstanceId.<MASK><NEW_LINE>final ImmutableAttributeSet attributes = Services.get(IAttributeDAO.class).getImmutableAttributeSetById(asiId);<NEW_LINE>invoiceCandBL.setQualityDiscountPercent_Override(icRecord, attributes);<NEW_LINE>icRecord.setEMail(order.getEMail());<NEW_LINE>icRecord.setC_Async_Batch_ID(order.getC_Async_Batch_ID());<NEW_LINE>// external identifiers<NEW_LINE>icRecord.setExternalLineId(orderLine.getExternalId());<NEW_LINE>icRecord.setExternalHeaderId(order.getExternalId());<NEW_LINE>// Don't save.<NEW_LINE>// That's done by the invoking API-impl, because we want to avoid C_Invoice_Candidate.invalidateCandidates() from being called on every single IC that is created here.<NEW_LINE>// Because it's a performance nightmare for orders with a lot of lines<NEW_LINE>// InterfaceWrapperHelper.save(ic);<NEW_LINE>return icRecord;<NEW_LINE>} | ofRepoIdOrNone(orderLine.getM_AttributeSetInstance_ID()); |
1,704,732 | public void unarchive(final List<Path> selected) {<NEW_LINE>final List<Path> expanded = new ArrayList<Path>();<NEW_LINE>for (final Path s : selected) {<NEW_LINE>final Archive archive = Archive.forName(s.getName());<NEW_LINE>if (null == archive) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>new OverwriteController(parent).overwrite(archive.getExpanded(Collections.singletonList(s)), new DefaultMainAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>parent.background(new RegistryBackgroundAction<Boolean>(parent, parent.getSession()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean run(final Session<?> session) throws BackgroundException {<NEW_LINE>final Compress feature = session.getFeature(Compress.class);<NEW_LINE>feature.unarchive(archive, s, parent, parent);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void cleanup() {<NEW_LINE>super.cleanup();<NEW_LINE>expanded.addAll(archive.getExpanded(Collections.singletonList(s)));<NEW_LINE>// Update Selection<NEW_LINE>parent.reload(parent.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getActivity() {<NEW_LINE>return archive.getDecompressCommand(s);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | workdir(), selected, expanded); |
1,586,026 | public UserDetails mapUserFromContext(DirContextOperations ctx, String username, Collection<? extends GrantedAuthority> authorities) {<NEW_LINE>String dn = ctx.getNameInNamespace();<NEW_LINE>this.logger.debug(LogMessage.format("Mapping user details from context with DN %s", dn));<NEW_LINE>LdapUserDetailsImpl.Essence essence = new LdapUserDetailsImpl.Essence();<NEW_LINE>essence.setDn(dn);<NEW_LINE>Object passwordValue = <MASK><NEW_LINE>if (passwordValue != null) {<NEW_LINE>essence.setPassword(mapPassword(passwordValue));<NEW_LINE>}<NEW_LINE>essence.setUsername(username);<NEW_LINE>// Map the roles<NEW_LINE>for (int i = 0; (this.roleAttributes != null) && (i < this.roleAttributes.length); i++) {<NEW_LINE>String[] rolesForAttribute = ctx.getStringAttributes(this.roleAttributes[i]);<NEW_LINE>if (rolesForAttribute == null) {<NEW_LINE>this.logger.debug(LogMessage.format("Couldn't read role attribute %s for user %s", this.roleAttributes[i], dn));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (String role : rolesForAttribute) {<NEW_LINE>GrantedAuthority authority = createAuthority(role);<NEW_LINE>if (authority != null) {<NEW_LINE>essence.addAuthority(authority);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add the supplied authorities<NEW_LINE>for (GrantedAuthority authority : authorities) {<NEW_LINE>essence.addAuthority(authority);<NEW_LINE>}<NEW_LINE>// Check for PPolicy data<NEW_LINE>PasswordPolicyResponseControl ppolicy = (PasswordPolicyResponseControl) ctx.getObjectAttribute(PasswordPolicyControl.OID);<NEW_LINE>if (ppolicy != null) {<NEW_LINE>essence.setTimeBeforeExpiration(ppolicy.getTimeBeforeExpiration());<NEW_LINE>essence.setGraceLoginsRemaining(ppolicy.getGraceLoginsRemaining());<NEW_LINE>}<NEW_LINE>return essence.createUserDetails();<NEW_LINE>} | ctx.getObjectAttribute(this.passwordAttributeName); |
338,734 | public static ListCompanyRegOrdersResponse unmarshall(ListCompanyRegOrdersResponse listCompanyRegOrdersResponse, UnmarshallerContext _ctx) {<NEW_LINE>listCompanyRegOrdersResponse.setRequestId(_ctx.stringValue("ListCompanyRegOrdersResponse.RequestId"));<NEW_LINE>listCompanyRegOrdersResponse.setNextPage(_ctx.booleanValue("ListCompanyRegOrdersResponse.NextPage"));<NEW_LINE>listCompanyRegOrdersResponse.setTotalItemNum(_ctx.integerValue("ListCompanyRegOrdersResponse.TotalItemNum"));<NEW_LINE>listCompanyRegOrdersResponse.setPrePage<MASK><NEW_LINE>listCompanyRegOrdersResponse.setCurrentPageNum(_ctx.integerValue("ListCompanyRegOrdersResponse.CurrentPageNum"));<NEW_LINE>listCompanyRegOrdersResponse.setPageSize(_ctx.integerValue("ListCompanyRegOrdersResponse.PageSize"));<NEW_LINE>listCompanyRegOrdersResponse.setTotalPageNum(_ctx.integerValue("ListCompanyRegOrdersResponse.TotalPageNum"));<NEW_LINE>List<CompanyRegOrder> data = new ArrayList<CompanyRegOrder>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListCompanyRegOrdersResponse.Data.Length"); i++) {<NEW_LINE>CompanyRegOrder companyRegOrder = new CompanyRegOrder();<NEW_LINE>companyRegOrder.setExtend(_ctx.stringValue("ListCompanyRegOrdersResponse.Data[" + i + "].Extend"));<NEW_LINE>companyRegOrder.setBizInfo(_ctx.stringValue("ListCompanyRegOrdersResponse.Data[" + i + "].BizInfo"));<NEW_LINE>companyRegOrder.setAliyunOrderId(_ctx.stringValue("ListCompanyRegOrdersResponse.Data[" + i + "].AliyunOrderId"));<NEW_LINE>companyRegOrder.setSupplementBizInfo(_ctx.stringValue("ListCompanyRegOrdersResponse.Data[" + i + "].SupplementBizInfo"));<NEW_LINE>companyRegOrder.setBizId(_ctx.stringValue("ListCompanyRegOrdersResponse.Data[" + i + "].BizId"));<NEW_LINE>companyRegOrder.setBizSubCode(_ctx.stringValue("ListCompanyRegOrdersResponse.Data[" + i + "].BizSubCode"));<NEW_LINE>companyRegOrder.setGmtModified(_ctx.longValue("ListCompanyRegOrdersResponse.Data[" + i + "].GmtModified"));<NEW_LINE>companyRegOrder.setBizStatus(_ctx.stringValue("ListCompanyRegOrdersResponse.Data[" + i + "].BizStatus"));<NEW_LINE>companyRegOrder.setCompanyName(_ctx.stringValue("ListCompanyRegOrdersResponse.Data[" + i + "].CompanyName"));<NEW_LINE>data.add(companyRegOrder);<NEW_LINE>}<NEW_LINE>listCompanyRegOrdersResponse.setData(data);<NEW_LINE>return listCompanyRegOrdersResponse;<NEW_LINE>} | (_ctx.booleanValue("ListCompanyRegOrdersResponse.PrePage")); |
348,367 | private void throwInvalidSubModuleError(Toml toml, Module module) {<NEW_LINE>String moduleName = module.getName();<NEW_LINE>TomlNode errorNode = null;<NEW_LINE>Optional<TomlValueNode> valueNode = toml.get(moduleName);<NEW_LINE>List<Toml> tomlTables = toml.getTables(moduleName);<NEW_LINE>if (valueNode.isEmpty()) {<NEW_LINE>valueNode = toml.get(getModuleKey(module));<NEW_LINE>}<NEW_LINE>if (tomlTables.isEmpty()) {<NEW_LINE>tomlTables = toml.getTables(getModuleKey(module));<NEW_LINE>}<NEW_LINE>if (valueNode.isPresent()) {<NEW_LINE>errorNode = valueNode.get();<NEW_LINE>} else if (!tomlTables.isEmpty()) {<NEW_LINE>errorNode = tomlTables.<MASK><NEW_LINE>} else {<NEW_LINE>Optional<Toml> tomlValueNode = toml.getTable(moduleName.replaceFirst(rootModule.getName() + ".", ""));<NEW_LINE>if (tomlValueNode.isPresent()) {<NEW_LINE>errorNode = tomlValueNode.get().rootNode();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (errorNode != null) {<NEW_LINE>invalidRequiredModuleSet.add(module.toString());<NEW_LINE>invalidTomlLines.add(errorNode.location().lineRange());<NEW_LINE>throw new ConfigException(CONFIG_TOML_INVALID_MODULE_STRUCTURE, getLineRange(errorNode), moduleName, moduleName);<NEW_LINE>}<NEW_LINE>} | get(0).rootNode(); |
1,047,301 | SyncItems fetchSyncItems() {<NEW_LINE>assert !SwingUtilities.isEventDispatchThread();<NEW_LINE>SyncItems items = null;<NEW_LINE>String displayName;<NEW_LINE>if (sourceFiles == SourceFiles.PROJECT) {<NEW_LINE>displayName = Bundle.SyncController_fetching_project(phpProject.getName());<NEW_LINE>} else {<NEW_LINE>displayName = Bundle.SyncController_fetching_files(files.length);<NEW_LINE>}<NEW_LINE>final ProgressHandle progressHandle = ProgressHandle.createHandle(displayName, this);<NEW_LINE>try {<NEW_LINE>progressHandle.start();<NEW_LINE>FileObject sources = ProjectPropertiesSupport.getSourcesDirectory(phpProject);<NEW_LINE>assert sources != null;<NEW_LINE>Set<<MASK><NEW_LINE>Set<TransferFile> localFiles = getLocalFiles(sources);<NEW_LINE>items = pairItems(remoteFiles, localFiles);<NEW_LINE>} catch (RemoteException ex) {<NEW_LINE>disconnect();<NEW_LINE>RemoteUtils.processRemoteException(ex);<NEW_LINE>} finally {<NEW_LINE>progressHandle.finish();<NEW_LINE>}<NEW_LINE>return items;<NEW_LINE>} | TransferFile> remoteFiles = getRemoteFiles(sources); |
1,470,251 | public void loadFrom(@Nonnull DirectoryStorageData data, @Nullable File dir, @Nullable TrackingPathMacroSubstitutor pathMacroSubstitutor) {<NEW_LINE>if (dir == null || !dir.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Interner<String> interner = Interner.createStringInterner();<NEW_LINE>File[] files = dir.listFiles();<NEW_LINE>if (files == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (File file : files) {<NEW_LINE>if (!isStorageFile(file)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Element element = JDOMUtil.loadDocument(file).getRootElement();<NEW_LINE>String name = StorageData.getComponentNameIfValid(element);<NEW_LINE>if (name == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!element.getName().equals(StorageData.COMPONENT)) {<NEW_LINE>LOG.error("Incorrect root tag name (" + element.getName() + <MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<Element> elementChildren = element.getChildren();<NEW_LINE>if (elementChildren.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Element state = (Element) elementChildren.get(0).detach();<NEW_LINE>JDOMUtil.internStringsInElement(state, interner);<NEW_LINE>if (pathMacroSubstitutor != null) {<NEW_LINE>pathMacroSubstitutor.expandPaths(state);<NEW_LINE>pathMacroSubstitutor.addUnknownMacros(name, PathMacrosService.getInstance().getMacroNames(state));<NEW_LINE>}<NEW_LINE>data.setState(name, file.getName(), state);<NEW_LINE>} catch (IOException | JDOMException e) {<NEW_LINE>LOG.info("Unable to load state", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ") in " + file.getPath()); |
1,512,941 | public ClassifyResult classify(BiPredicate<Writer, Pair<List<Object>, Map<Integer, ParameterContext>>> identicalSk, SourceRows sourceRows, ExecutionContext ec, ClassifyResult result) {<NEW_LINE>final List<DuplicateCheckResult> classifiedRows = sourceRows.valueRows;<NEW_LINE>classifiedRows.stream().filter(r -> !r.skipUpdate()).forEach(row -> {<NEW_LINE>final boolean insertThenUpdate = row.insertThenUpdate();<NEW_LINE>final boolean updateOnly = row.updateOnly();<NEW_LINE>// If partition key is not modified do UPDATE, or else do DELETE + INSERT<NEW_LINE>final boolean doUpdate = updateOnly && identicalSk.test(this, Pair.of(row.updateSource, null));<NEW_LINE>addResult(row.before, row.after, row.updateSource, row.insertParam, row.duplicated, <MASK><NEW_LINE>});<NEW_LINE>return result;<NEW_LINE>} | insertThenUpdate, doUpdate, ec, result); |
853,322 | private static ScalarValue[] parseTRBLValue(String val) {<NEW_LINE>ScalarValue[] out = new ScalarValue[4];<NEW_LINE>String[] parts = Util.split(val, " ");<NEW_LINE>int len = parts.length;<NEW_LINE>switch(len) {<NEW_LINE>case 1:<NEW_LINE>ScalarValue v = parseSingleTRBLValue(parts[0]);<NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>out[i] = v;<NEW_LINE>}<NEW_LINE>return out;<NEW_LINE>case 2:<NEW_LINE>{<NEW_LINE>ScalarValue v1 = parseSingleTRBLValue(parts[0]);<NEW_LINE>ScalarValue v2 = parseSingleTRBLValue(parts[1]);<NEW_LINE>out[Component.TOP] = out[Component.BOTTOM] = v1;<NEW_LINE>out[Component.LEFT] = out[Component.RIGHT] = v2;<NEW_LINE>return out;<NEW_LINE>}<NEW_LINE>case 3:<NEW_LINE>{<NEW_LINE>ScalarValue v1 = parseSingleTRBLValue(parts[0]);<NEW_LINE>ScalarValue v2 = parseSingleTRBLValue(parts[1]);<NEW_LINE>ScalarValue v3 = parseSingleTRBLValue(parts[2]);<NEW_LINE>out[Component.TOP] = v1;<NEW_LINE>out[Component.LEFT] = <MASK><NEW_LINE>out[Component.BOTTOM] = v3;<NEW_LINE>return out;<NEW_LINE>}<NEW_LINE>case 4:<NEW_LINE>{<NEW_LINE>ScalarValue v1 = parseSingleTRBLValue(parts[0]);<NEW_LINE>ScalarValue v2 = parseSingleTRBLValue(parts[1]);<NEW_LINE>ScalarValue v3 = parseSingleTRBLValue(parts[2]);<NEW_LINE>ScalarValue v4 = parseSingleTRBLValue(parts[3]);<NEW_LINE>out[Component.TOP] = v1;<NEW_LINE>out[Component.RIGHT] = v2;<NEW_LINE>out[Component.BOTTOM] = v3;<NEW_LINE>out[Component.LEFT] = v4;<NEW_LINE>return out;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | out[Component.RIGHT] = v2; |
302,146 | public void send(EmailDetails theDetails) {<NEW_LINE>StopWatch stopWatch = new StopWatch();<NEW_LINE>ourLog.info("Sending email for subscription {} from [{}] to recipients: [{}]", theDetails.getSubscriptionId(), theDetails.getFrom(<MASK><NEW_LINE>Email email = theDetails.toEmail();<NEW_LINE>myMailSvc.sendMail(email, () -> ourLog.info("Done sending email for subscription {} from [{}] to recipients: [{}] (took {}ms)", theDetails.getSubscriptionId(), theDetails.getFrom(), theDetails.getTo(), stopWatch.getMillis()), (e) -> {<NEW_LINE>ourLog.error("Error sending email for subscription {} from [{}] to recipients: [{}] (took {}ms)", theDetails.getSubscriptionId(), theDetails.getFrom(), theDetails.getTo(), stopWatch.getMillis());<NEW_LINE>ourLog.error("Error sending email", e);<NEW_LINE>});<NEW_LINE>} | ), theDetails.getTo()); |
394,634 | public Category read(JsonReader in) throws IOException {<NEW_LINE>JsonObject jsonObj = elementAdapter.<MASK><NEW_LINE>validateJsonObject(jsonObj);<NEW_LINE>// store additional fields in the deserialized instance<NEW_LINE>Category instance = thisAdapter.fromJsonTree(jsonObj);<NEW_LINE>for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) {<NEW_LINE>if (!openapiFields.contains(entry.getKey())) {<NEW_LINE>if (entry.getValue().isJsonPrimitive()) {<NEW_LINE>// primitive type<NEW_LINE>if (entry.getValue().getAsJsonPrimitive().isString())<NEW_LINE>instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());<NEW_LINE>else if (entry.getValue().getAsJsonPrimitive().isNumber())<NEW_LINE>instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());<NEW_LINE>else if (entry.getValue().getAsJsonPrimitive().isBoolean())<NEW_LINE>instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());<NEW_LINE>else<NEW_LINE>throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));<NEW_LINE>} else {<NEW_LINE>// non-primitive type<NEW_LINE>instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return instance;<NEW_LINE>} | read(in).getAsJsonObject(); |
661,524 | public void replayDropDb(String dbName, boolean isForceDrop) throws DdlException {<NEW_LINE>tryLock(true);<NEW_LINE>try {<NEW_LINE>Database db = fullNameToDb.get(dbName);<NEW_LINE>db.writeLock();<NEW_LINE>try {<NEW_LINE>Set<String> tableNames = db.getTableNamesWithLock();<NEW_LINE>unprotectDropDb(db, isForceDrop, true);<NEW_LINE>if (!isForceDrop) {<NEW_LINE>Catalog.getCurrentRecycleBin().recycleDatabase(db, tableNames);<NEW_LINE>} else {<NEW_LINE>Catalog.getCurrentCatalog().onEraseDatabase(db.getId());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>db.writeUnlock();<NEW_LINE>}<NEW_LINE>fullNameToDb.remove(dbName);<NEW_LINE>idToDb.<MASK><NEW_LINE>final Cluster cluster = nameToCluster.get(db.getClusterName());<NEW_LINE>cluster.removeDb(dbName, db.getId());<NEW_LINE>LOG.info("finish replay drop db, name: {}, id: {}", dbName, db.getId());<NEW_LINE>} finally {<NEW_LINE>unlock();<NEW_LINE>}<NEW_LINE>} | remove(db.getId()); |
701,180 | private void locateKitsInRegistry(String baseKey) {<NEW_LINE>String[] versions = { VERSION_KIT_8, VERSION_KIT_81 };<NEW_LINE>String[] keys = { REGISTRY_KIT_8, REGISTRY_KIT_81 };<NEW_LINE>for (int i = 0; i != keys.length; ++i) {<NEW_LINE>try {<NEW_LINE>File kitDir = FileUtils.canonicalize(new File(windowsRegistry.getStringValue(WindowsRegistry.Key.HKEY_LOCAL_MACHINE, baseKey + REGISTRY_ROOTPATH_KIT, keys[i])));<NEW_LINE>if (isWindowsSdk(kitDir)) {<NEW_LINE>LOGGER.debug("Found Windows Kit {} at {}"<MASK><NEW_LINE>addSdk(kitDir, versions[i], NAME_KIT + " " + versions[i]);<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("Ignoring candidate Windows Kit directory {} as it does not look like a Windows Kit installation.", kitDir);<NEW_LINE>}<NEW_LINE>} catch (MissingRegistryEntryException e) {<NEW_LINE>// Ignore the version if the string cannot be read<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , versions[i], kitDir); |
1,050,949 | public AnalysisResult execute(File baseDir, ReportOptions data, SettingsFactory settings, Map<String, String> environmentVariables) {<NEW_LINE>if (data.getVerbosity() == VERBOSE) {<NEW_LINE>Log.getLogger().info("Project base directory is " + data.getProjectBase());<NEW_LINE>Log.getLogger().info("---------------------------------------------------------------------------");<NEW_LINE>Log.getLogger().info("Enabled (+) and disabled (-) features.");<NEW_LINE>Log.getLogger().info("-----------------------------------------");<NEW_LINE>settings.describeFeatures(asInfo("+"), asInfo("-"));<NEW_LINE>Log.getLogger().info("---------------------------------------------------------------------------");<NEW_LINE>}<NEW_LINE>settings.checkRequestedFeatures();<NEW_LINE>checkMatrixMode(data);<NEW_LINE>final ClassPath cp = data.getClassPath();<NEW_LINE>// workaround for apparent java 1.5 JVM bug . . . might not play nicely<NEW_LINE>// with distributed testing<NEW_LINE>final JavaAgent jac = new JarCreatingJarFinder(new ClassPathByteArraySource(cp));<NEW_LINE>final KnownLocationJavaAgentFinder ja = new KnownLocationJavaAgentFinder(jac.getJarLocation().get());<NEW_LINE>final ResultOutputStrategy reportOutput = settings.getOutputStrategy();<NEW_LINE>final MutationResultListenerFactory reportFactory = settings.createListener();<NEW_LINE>final CoverageOptions coverageOptions = settings.createCoverageOptions();<NEW_LINE>final LaunchOptions launchOptions = new LaunchOptions(ja, settings.getJavaExecutable(), data.getJvmArgs(), environmentVariables).usingClassPathJar(data.useClasspathJar());<NEW_LINE>final ProjectClassPaths cps = data.getMutationClassPaths();<NEW_LINE>final CodeSource code = new CodeSource(cps);<NEW_LINE>final Timings timings = new Timings();<NEW_LINE>final CoverageGenerator coverageDatabase = new DefaultCoverageGenerator(baseDir, coverageOptions, launchOptions, code, settings.createCoverageExporter(), <MASK><NEW_LINE>final Optional<WriterFactory> maybeWriter = data.createHistoryWriter();<NEW_LINE>WriterFactory historyWriter = maybeWriter.orElse(new NullWriterFactory());<NEW_LINE>final HistoryStore history = makeHistoryStore(data, maybeWriter);<NEW_LINE>final MutationStrategies strategies = new MutationStrategies(settings.createEngine(), history, coverageDatabase, reportFactory, reportOutput);<NEW_LINE>final MutationCoverage report = new MutationCoverage(strategies, baseDir, code, data, settings, timings);<NEW_LINE>try {<NEW_LINE>return AnalysisResult.success(report.runReport());<NEW_LINE>} catch (final IOException e) {<NEW_LINE>return AnalysisResult.fail(e);<NEW_LINE>} finally {<NEW_LINE>jac.close();<NEW_LINE>ja.close();<NEW_LINE>historyWriter.close();<NEW_LINE>}<NEW_LINE>} | timings, data.getVerbosity()); |
286,881 | public void renderJSON(PrintWriter writer, Map<String, String> params) {<NEW_LINE>JsonArray json = new JsonArray();<NEW_LINE>for (ConsumerRecord<byte[], byte[]> record : Lists.reverse(retrieveActionReportMessages())) {<NEW_LINE>try {<NEW_LINE>JsonObject jsonRecord = new JsonObject();<NEW_LINE>BinaryDecoder binaryDecoder = avroDecoderFactory.binaryDecoder(record.value(), null);<NEW_LINE>SpecificDatumReader<OperatorAction> reader = new SpecificDatumReader<>(operatorActionSchema);<NEW_LINE>OperatorAction result = new OperatorAction();<NEW_LINE>reader.read(result, binaryDecoder);<NEW_LINE>jsonRecord.add("date", gson.toJsonTree(new Date(result.getTimestamp())));<NEW_LINE>jsonRecord.add("clusterName", gson.toJsonTree(result.getClusterName()));<NEW_LINE>jsonRecord.add("description", gson.toJsonTree<MASK><NEW_LINE>json.add(jsonRecord);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.info("Fail to decode an message", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.print(json);<NEW_LINE>} | (result.getDescription())); |
1,301,355 | public void uploadFromFile3() throws IOException {<NEW_LINE>// BEGIN: com.azure.storage.blob.BlobClient.uploadFromFileWithResponse#BlobUploadFromFileOptions-Duration-Context<NEW_LINE>BlobHttpHeaders headers = new BlobHttpHeaders().setContentMd5("data".getBytes(StandardCharsets.UTF_8)).setContentLanguage("en-US").setContentType("binary");<NEW_LINE>Map<String, String> metadata = Collections.singletonMap("metadata", "value");<NEW_LINE>Map<String, String> tags = Collections.singletonMap("tag", "value");<NEW_LINE>BlobRequestConditions requestConditions = new BlobRequestConditions().setLeaseId(leaseId).setIfUnmodifiedSince(OffsetDateTime.now().minusDays(3));<NEW_LINE>// 100 MB;<NEW_LINE>Long blockSize = 100 * 1024 * 1024L;<NEW_LINE>ParallelTransferOptions parallelTransferOptions = new <MASK><NEW_LINE>try {<NEW_LINE>client.uploadFromFileWithResponse(new BlobUploadFromFileOptions(filePath).setParallelTransferOptions(parallelTransferOptions).setHeaders(headers).setMetadata(metadata).setTags(tags).setTier(AccessTier.HOT).setRequestConditions(requestConditions), timeout, new Context(key2, value2));<NEW_LINE>System.out.println("Upload from file succeeded");<NEW_LINE>} catch (UncheckedIOException ex) {<NEW_LINE>System.err.printf("Failed to upload from file %s%n", ex.getMessage());<NEW_LINE>}<NEW_LINE>// END: com.azure.storage.blob.BlobClient.uploadFromFileWithResponse#BlobUploadFromFileOptions-Duration-Context<NEW_LINE>} | ParallelTransferOptions().setBlockSizeLong(blockSize); |
1,521,069 | private boolean migrate(Collection<ProtectedRegion> regions) throws MigrationException {<NEW_LINE>// Name scan pass<NEW_LINE>Set<String> names = getNames(regions);<NEW_LINE>if (!names.isEmpty()) {<NEW_LINE>// This task logs the progress of conversion (% converted...)<NEW_LINE>// periodically<NEW_LINE>TimerTask task = new ResolvedNamesTimerTask();<NEW_LINE>try {<NEW_LINE>timer.schedule(task, LOG_DELAY, LOG_DELAY);<NEW_LINE>log.log(Level.INFO, "Resolving " + names.size() + " name(s) into UUIDs... this may take a while.");<NEW_LINE>// Don't lookup names that we already looked up for previous<NEW_LINE>// worlds -- note: all names are lowercase in these collections<NEW_LINE>Set<String> lookupNames = new HashSet<>(names);<NEW_LINE>lookupNames.removeAll(resolvedNames.keySet());<NEW_LINE>// Ask Mojang for names<NEW_LINE>profileService.findAllByName(lookupNames, new Predicate<Profile>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean apply(Profile profile) {<NEW_LINE>resolvedNames.put(profile.getName().toLowerCase(), profile.getUniqueId());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (IOException e) {<NEW_LINE><MASK><NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>throw new MigrationException("The migration was interrupted");<NEW_LINE>} finally {<NEW_LINE>// Stop showing the % converted messages<NEW_LINE>task.cancel();<NEW_LINE>}<NEW_LINE>// Name -> UUID in all regions<NEW_LINE>log.log(Level.INFO, "UUIDs resolved... now migrating all regions to UUIDs where possible...");<NEW_LINE>convert(regions);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | throw new MigrationException("The name -> UUID service failed", e); |
813,020 | // This is for error reporting for bad targets at annotation type declaration site (as opposed to the repeat site)<NEW_LINE>private static void checkContainerAnnotationTypeTarget(ASTNode culpritNode, Scope scope, ReferenceBinding containerType, ReferenceBinding repeatableAnnotationType) {<NEW_LINE>long tagBits = repeatableAnnotationType.getAnnotationTagBits();<NEW_LINE>if ((tagBits & TagBits.AnnotationTargetMASK) == 0)<NEW_LINE>// absence of @Target meta-annotation implies all SE7 targets not all targets.<NEW_LINE>tagBits = TagBits.SE7AnnotationTargetMASK;<NEW_LINE>long containerAnnotationTypeTypeTagBits = containerType.getAnnotationTagBits();<NEW_LINE>if ((containerAnnotationTypeTypeTagBits & TagBits.AnnotationTargetMASK) == 0)<NEW_LINE>containerAnnotationTypeTypeTagBits = TagBits.SE7AnnotationTargetMASK;<NEW_LINE>final long targets = tagBits & TagBits.AnnotationTargetMASK;<NEW_LINE>final long containerAnnotationTypeTargets = containerAnnotationTypeTypeTagBits & TagBits.AnnotationTargetMASK;<NEW_LINE>if ((containerAnnotationTypeTargets & ~targets) != 0) {<NEW_LINE>class MissingTargetBuilder {<NEW_LINE><NEW_LINE>StringBuffer targetBuffer = new StringBuffer();<NEW_LINE><NEW_LINE>void check(long targetMask, char[] targetName) {<NEW_LINE>if ((containerAnnotationTypeTargets & targetMask & ~targets) != 0) {<NEW_LINE>// if targetMask equals TagBits.AnnotationForType implies<NEW_LINE>// TagBits.AnnotationForType is part of containerAnnotationTypeTargets<NEW_LINE>if (targetMask == TagBits.AnnotationForType && (targets & TagBits.AnnotationForTypeUse) != 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>add(targetName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>void checkAnnotationType(char[] targetName) {<NEW_LINE>if ((containerAnnotationTypeTargets & TagBits.AnnotationForAnnotationType) != 0 && ((targets & (TagBits.AnnotationForAnnotationType | TagBits.AnnotationForType))) == 0) {<NEW_LINE>add(targetName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>private void add(char[] targetName) {<NEW_LINE>if (this.targetBuffer.length() != 0) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.targetBuffer.append(", ");<NEW_LINE>}<NEW_LINE>this.targetBuffer.append(targetName);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String toString() {<NEW_LINE>return this.targetBuffer.toString();<NEW_LINE>}<NEW_LINE><NEW_LINE>public boolean hasError() {<NEW_LINE>return this.targetBuffer.length() != 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MissingTargetBuilder builder = new MissingTargetBuilder();<NEW_LINE>builder.check(TagBits.AnnotationForType, TypeConstants.TYPE);<NEW_LINE>builder.check(<MASK><NEW_LINE>builder.check(TagBits.AnnotationForMethod, TypeConstants.UPPER_METHOD);<NEW_LINE>builder.check(TagBits.AnnotationForParameter, TypeConstants.UPPER_PARAMETER);<NEW_LINE>builder.check(TagBits.AnnotationForConstructor, TypeConstants.UPPER_CONSTRUCTOR);<NEW_LINE>builder.check(TagBits.AnnotationForLocalVariable, TypeConstants.UPPER_LOCAL_VARIABLE);<NEW_LINE>builder.checkAnnotationType(TypeConstants.UPPER_ANNOTATION_TYPE);<NEW_LINE>builder.check(TagBits.AnnotationForPackage, TypeConstants.UPPER_PACKAGE);<NEW_LINE>builder.check(TagBits.AnnotationForTypeParameter, TypeConstants.TYPE_PARAMETER_TARGET);<NEW_LINE>builder.check(TagBits.AnnotationForTypeUse, TypeConstants.TYPE_USE_TARGET);<NEW_LINE>builder.check(TagBits.AnnotationForModule, TypeConstants.UPPER_MODULE);<NEW_LINE>if (builder.hasError()) {<NEW_LINE>repeatableAnnotationType.tagAsHavingDefectiveContainerType();<NEW_LINE>scope.problemReporter().repeatableAnnotationTypeTargetMismatch(culpritNode, repeatableAnnotationType, containerType, builder.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | TagBits.AnnotationForField, TypeConstants.UPPER_FIELD); |
275,633 | public byte[] decode(String attr, Hashtable<String, Integer> labelToPc) {<NEW_LINE>if (Options.v().verbose()) {<NEW_LINE>logger.debug("[] JasminAttribute decode...");<NEW_LINE>}<NEW_LINE>List<byte[]> attributeHunks = new LinkedList<byte[]>();<NEW_LINE>int attributeSize = 0, tablesize = 0;<NEW_LINE>boolean isLabel = attr.startsWith("%");<NEW_LINE>StringTokenizer st = new StringTokenizer(attr, "%");<NEW_LINE>while (st.hasMoreTokens()) {<NEW_LINE>String token = st.nextToken();<NEW_LINE>if (isLabel) {<NEW_LINE>Integer pc = labelToPc.get(token);<NEW_LINE>if (pc == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>int pcvalue = pc;<NEW_LINE>if (pcvalue > 65535) {<NEW_LINE>throw new RuntimeException("PC great than 65535, the token is " + token + " : " + pcvalue);<NEW_LINE>}<NEW_LINE>attributeHunks.add(new byte[] { (byte) (pcvalue & 0x0FF), (byte) ((pcvalue >> 8) & 0x0FF) });<NEW_LINE>attributeSize += 2;<NEW_LINE>tablesize++;<NEW_LINE>} else {<NEW_LINE>byte[] hunk = Base64.decode(token.toCharArray());<NEW_LINE>attributeSize += hunk.length;<NEW_LINE>attributeHunks.add(hunk);<NEW_LINE>}<NEW_LINE>isLabel = !isLabel;<NEW_LINE>} | throw new RuntimeException("PC is null, the token is " + token); |
387,903 | void closeInternals(boolean waitForCloseCompletion) {<NEW_LINE>if (!this.getIsClosed()) {<NEW_LINE>if (this.receiveLink != null && this.receiveLink.getLocalState() != EndpointState.CLOSED) {<NEW_LINE>try {<NEW_LINE>this.parent.underlyingFactory.scheduleOnReactorThread(new DispatchHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onEvent() {<NEW_LINE>if (InternalReceiver.this.receiveLink != null && InternalReceiver.this.receiveLink.getLocalState() != EndpointState.CLOSED) {<NEW_LINE>TRACE_LOGGER.debug("Closing internal receive link of requestresponselink to {}", RequestResponseLink.this.linkPath);<NEW_LINE>InternalReceiver.this.receiveLink.close();<NEW_LINE>InternalReceiver.this.parent.underlyingFactory.deregisterForConnectionError(InternalReceiver.this.receiveLink);<NEW_LINE>if (waitForCloseCompletion) {<NEW_LINE>RequestResponseLink.scheduleLinkCloseTimeout(InternalReceiver.this.closeFuture, InternalReceiver.this.parent.underlyingFactory.getOperationTimeout(), InternalReceiver.this.receiveLink.getName());<NEW_LINE>} else {<NEW_LINE>AsyncUtil.completeFuture(InternalReceiver.this.closeFuture, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (IOException e) {<NEW_LINE>AsyncUtil.completeFutureExceptionally(this.closeFuture, e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>AsyncUtil.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | completeFuture(this.closeFuture, null); |
748,832 | private void discoverAction(JSONArray args, CallbackContext callbackContext) {<NEW_LINE>if (isNotInitialized(callbackContext, true)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JSONObject obj = getArgsObject(args);<NEW_LINE>if (isNotArgsObject(obj, callbackContext)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String address = getAddress(obj);<NEW_LINE>if (isNotAddress(address, callbackContext)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HashMap<Object, Object> connection = wasNeverConnected(address, callbackContext);<NEW_LINE>if (connection == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BluetoothGatt bluetoothGatt = (BluetoothGatt) connection.get(keyPeripheral);<NEW_LINE>BluetoothDevice device = bluetoothGatt.getDevice();<NEW_LINE>if (isNotConnected(connection, device, callbackContext)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JSONObject returnObj = new JSONObject();<NEW_LINE>addDevice(returnObj, device);<NEW_LINE>if (obj == null || !obj.optBoolean("clearCache", false)) {<NEW_LINE>int discoveredState = Integer.valueOf(connection.get<MASK><NEW_LINE>// Already initiated discovery<NEW_LINE>if (discoveredState == STATE_DISCOVERING) {<NEW_LINE>addProperty(returnObj, keyError, errorDiscover);<NEW_LINE>addProperty(returnObj, keyMessage, logAlreadyDiscovering);<NEW_LINE>callbackContext.error(returnObj);<NEW_LINE>return;<NEW_LINE>} else if (discoveredState == STATE_DISCOVERED) {<NEW_LINE>// Already discovered<NEW_LINE>returnObj = getDiscovery(bluetoothGatt);<NEW_LINE>callbackContext.success(returnObj);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Else undiscovered, so start discovery<NEW_LINE>connection.put(keyDiscoveredState, STATE_DISCOVERING);<NEW_LINE>connection.put(operationDiscover, callbackContext);<NEW_LINE>if (obj != null && obj.optBoolean("clearCache", false)) {<NEW_LINE>refreshDeviceCache(bluetoothGatt);<NEW_LINE>}<NEW_LINE>bluetoothGatt.discoverServices();<NEW_LINE>} | (keyDiscoveredState).toString()); |
69,158 | private void init() {<NEW_LINE>exceptionUnmarshallers.add(new SubscriptionLimitExceededExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidParameterExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new BatchEntryIdsNotDistinctExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidParameterValueExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new EndpointDisabledExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new FilterPolicyLimitExceededExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new UserErrorExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new KMSAccessDeniedExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new KMSInvalidStateExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new StaleTagExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new NotFoundExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new KMSDisabledExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new VerificationExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new ThrottledExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InternalErrorExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new EmptyBatchRequestExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidSecurityExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new OptedOutExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new KMSOptInRequiredExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new TooManyEntriesInBatchRequestExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new ResourceNotFoundExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new BatchRequestTooLongExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new ValidationExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new KMSNotFoundExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new TopicLimitExceededExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers<MASK><NEW_LINE>exceptionUnmarshallers.add(new TagLimitExceededExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new PlatformApplicationDisabledExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new KMSThrottlingExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new AuthorizationErrorExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new ConcurrentAccessExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidBatchEntryIdExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new StandardErrorUnmarshaller(com.amazonaws.services.sns.model.AmazonSNSException.class));<NEW_LINE>setServiceNameIntern(DEFAULT_SIGNING_NAME);<NEW_LINE>setEndpointPrefix(ENDPOINT_PREFIX);<NEW_LINE>// calling this.setEndPoint(...) will also modify the signer accordingly<NEW_LINE>this.setEndpoint("https://sns.us-east-1.amazonaws.com");<NEW_LINE>HandlerChainFactory chainFactory = new HandlerChainFactory();<NEW_LINE>requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/sns/request.handlers"));<NEW_LINE>requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/sns/request.handler2s"));<NEW_LINE>requestHandler2s.addAll(chainFactory.getGlobalHandlers());<NEW_LINE>} | .add(new TagPolicyExceptionUnmarshaller()); |
360,426 | private Response deleteRemovedProperties(Collection<String> newProps) {<NEW_LINE>List<String> existingList = new ArrayList<>();<NEW_LINE>Dom parent = getEntity();<NEW_LINE>if (parent == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<Dom> existingProps;<NEW_LINE>synchronized (parent) {<NEW_LINE>existingProps = parent.nodeElements(TAG_SYSTEM_PROPERTY);<NEW_LINE>}<NEW_LINE>for (Dom existingProp : existingProps) {<NEW_LINE>existingList.add(existingProp.attribute("name"));<NEW_LINE>}<NEW_LINE>// no existing properites,return null<NEW_LINE>if (existingList.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// delete the props thats no longer in the new list.<NEW_LINE>for (String onePropName : existingList) {<NEW_LINE>if (!newProps.contains(onePropName)) {<NEW_LINE>Response <MASK><NEW_LINE>if (resp.getStatus() != HttpURLConnection.HTTP_OK) {<NEW_LINE>return resp;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | resp = deleteProperty(null, onePropName); |
1,486,396 | public void onInitializeClient() {<NEW_LINE>FabricLoader.getInstance().getModContainer("sodium").ifPresent(modContainer -> {<NEW_LINE>sodiumInstalled = true;<NEW_LINE>String versionString = modContainer.getMetadata().getVersion().getFriendlyString();<NEW_LINE>// This makes it so that if we don't have the right version of Sodium, it will show the user a<NEW_LINE>// nice warning, and prevent them from playing the game with a wrong version of Sodium.<NEW_LINE>if (!SodiumVersionCheck.isAllowedVersion(versionString)) {<NEW_LINE>sodiumInvalid = true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ModContainer iris = FabricLoader.getInstance().getModContainer(MODID).orElseThrow(() -> new IllegalStateException("Couldn't find the mod container for Iris"));<NEW_LINE>IRIS_VERSION = iris.getMetadata().getVersion().getFriendlyString();<NEW_LINE>try {<NEW_LINE>if (!Files.exists(getShaderpacksDirectory())) {<NEW_LINE>Files.createDirectories(getShaderpacksDirectory());<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.warn("Failed to create the shaderpacks directory!");<NEW_LINE>logger.warn("", e);<NEW_LINE>}<NEW_LINE>irisConfig = new IrisConfig(FabricLoader.getInstance().getConfigDir().resolve("iris.properties"));<NEW_LINE>try {<NEW_LINE>irisConfig.initialize();<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("Failed to initialize Iris configuration, default values will be used instead");<NEW_LINE>logger.error("", e);<NEW_LINE>}<NEW_LINE>reloadKeybind = KeyBindingHelper.registerKeyBinding(new KeyMapping("iris.keybind.reload", InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_R, "iris.keybinds"));<NEW_LINE>toggleShadersKeybind = KeyBindingHelper.registerKeyBinding(new KeyMapping("iris.keybind.toggleShaders", InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_K, "iris.keybinds"));<NEW_LINE>shaderpackScreenKeybind = KeyBindingHelper.registerKeyBinding(new KeyMapping("iris.keybind.shaderPackSelection", InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_O, "iris.keybinds"));<NEW_LINE><MASK><NEW_LINE>initialized = true;<NEW_LINE>} | setupCommands(Minecraft.getInstance()); |
1,718,383 | protected void receiveAnswer(Response.Answer fromDownstream, int iteration) {<NEW_LINE>LOG.trace(<MASK><NEW_LINE>if (isTerminated())<NEW_LINE>return;<NEW_LINE>Request toDownstream = fromDownstream.sourceRequest();<NEW_LINE>Request fromUpstream = fromUpstream(toDownstream);<NEW_LINE>ConclusionRequestState<? extends Partial.Concludable<?>> requestState = this.requestStates.get(fromUpstream);<NEW_LINE>if (!requestState.isComplete()) {<NEW_LINE>FunctionalIterator<Map<Identifier.Variable, Concept>> materialisations = conclusion.materialise(fromDownstream.answer().conceptMap(), traversalEngine, conceptMgr);<NEW_LINE>if (!materialisations.hasNext())<NEW_LINE>throw TypeDBException.of(ILLEGAL_STATE);<NEW_LINE>requestState.newMaterialisedAnswers(fromDownstream.answer(), materialisations);<NEW_LINE>}<NEW_LINE>nextAnswer(fromUpstream, requestState, iteration);<NEW_LINE>} | "{}: received Answer: {}", name(), fromDownstream); |
500,956 | public static I_C_Invoice_Candidate createIcAndSetCommonFields(@NonNull final I_C_Flatrate_Term term) {<NEW_LINE>// Services<NEW_LINE>final DimensionService dimensionService = SpringContextHolder.instance.getBean(DimensionService.class);<NEW_LINE>final IOrderDAO orderDAO = Services.get(IOrderDAO.class);<NEW_LINE>final IDocTypeBL docTypeBL = Services.get(IDocTypeBL.class);<NEW_LINE>final I_C_Invoice_Candidate ic = newInstance(I_C_Invoice_Candidate.class);<NEW_LINE>ic.setAD_Org_ID(term.getAD_Org_ID());<NEW_LINE>ic.setAD_Table_ID(InterfaceWrapperHelper.getTableId(I_C_Flatrate_Term.class));<NEW_LINE>ic.setRecord_ID(term.getC_Flatrate_Term_ID());<NEW_LINE>ic.setC_Async_Batch_ID(term.getC_Async_Batch_ID());<NEW_LINE>ic.setM_Product_ID(term.getM_Product_ID());<NEW_LINE>ic.<MASK><NEW_LINE>// to be computed<NEW_LINE>ic.setQtyToInvoice(BigDecimal.ZERO);<NEW_LINE>InvoiceCandidateLocationAdapterFactory.billLocationAdapter(ic).setFrom(ContractLocationHelper.extractBillLocation(term));<NEW_LINE>ic.setM_PricingSystem_ID(term.getM_PricingSystem_ID());<NEW_LINE>// 07442 activity and tax<NEW_LINE>final ActivityId activityId = Services.get(IProductAcctDAO.class).retrieveActivityForAcct(ClientId.ofRepoId(term.getAD_Client_ID()), OrgId.ofRepoId(term.getAD_Org_ID()), ProductId.ofRepoId(term.getM_Product_ID()));<NEW_LINE>ic.setIsTaxIncluded(term.isTaxIncluded());<NEW_LINE>if (term.getC_OrderLine_Term_ID() > 0) {<NEW_LINE>final I_C_OrderLine orderLine = orderDAO.getOrderLineById(OrderLineId.ofRepoId(term.getC_OrderLine_Term_ID()));<NEW_LINE>ic.setC_OrderLine_ID(orderLine.getC_OrderLine_ID());<NEW_LINE>final I_C_Order order = orderDAO.getById(OrderId.ofRepoId(orderLine.getC_Order_ID()));<NEW_LINE>ic.setC_Order_ID(orderLine.getC_Order_ID());<NEW_LINE>ic.setC_Incoterms_ID(order.getC_Incoterms_ID());<NEW_LINE>ic.setIncotermLocation(order.getIncotermLocation());<NEW_LINE>// DocType<NEW_LINE>final DocTypeId orderDocTypeId = CoalesceUtil.coalesceSuppliers(() -> DocTypeId.ofRepoIdOrNull(order.getC_DocType_ID()), () -> DocTypeId.ofRepoIdOrNull(order.getC_DocTypeTarget_ID()));<NEW_LINE>if (orderDocTypeId != null) {<NEW_LINE>final I_C_DocType orderDocType = docTypeBL.getById(orderDocTypeId);<NEW_LINE>final DocTypeId invoiceDocTypeId = DocTypeId.ofRepoIdOrNull(orderDocType.getC_DocTypeInvoice_ID());<NEW_LINE>if (invoiceDocTypeId != null) {<NEW_LINE>ic.setC_DocTypeInvoice_ID(invoiceDocTypeId.getRepoId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Dimension orderLineDimension = dimensionService.getFromRecord(orderLine);<NEW_LINE>if (orderLineDimension.getActivityId() == null) {<NEW_LINE>dimensionService.updateRecord(ic, orderLineDimension.withActivityId(activityId));<NEW_LINE>} else {<NEW_LINE>dimensionService.updateRecord(ic, orderLineDimension);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ic;<NEW_LINE>} | setC_Currency_ID(term.getC_Currency_ID()); |
789,312 | public void actionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>org.openide.DialogDescriptor desc = new ConfirmDialog(NbBundle.getMessage<MASK><NEW_LINE>java.awt.Dialog dialog = org.openide.DialogDisplayer.getDefault().createDialog(desc);<NEW_LINE>dialog.setVisible(true);<NEW_LINE>if (org.openide.DialogDescriptor.OK_OPTION.equals(desc.getValue())) {<NEW_LINE>SectionPanel sectionPanel = ((SectionPanel.HeaderButton) evt.getSource()).getSectionPanel();<NEW_LINE>SecurityConstraint constraint = (SecurityConstraint) sectionPanel.getKey();<NEW_LINE>// updating data model<NEW_LINE>dObj.modelUpdatedFromUI();<NEW_LINE>dObj.setChangedFromUI(true);<NEW_LINE>try {<NEW_LINE>webApp.removeSecurityConstraint(constraint);<NEW_LINE>// removing section<NEW_LINE>sectionPanel.getSectionView().removeSection(sectionPanel.getNode());<NEW_LINE>} finally {<NEW_LINE>dObj.setChangedFromUI(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (SecurityMultiViewElement.class, "TXT_RemoveSecurityConstraintConfirm")); |
682,677 | private Pair<String, String> queryGroupInfo() {<NEW_LINE>Pair<String, String> pair = null;<NEW_LINE>final HANDLE pHandle = Kernel32.INSTANCE.OpenProcess(WinNT.PROCESS_QUERY_INFORMATION, false, getProcessID());<NEW_LINE>if (pHandle != null) {<NEW_LINE>final HANDLEByReference phToken = new HANDLEByReference();<NEW_LINE>if (Advapi32.INSTANCE.OpenProcessToken(pHandle, WinNT.TOKEN_DUPLICATE | WinNT.TOKEN_QUERY, phToken)) {<NEW_LINE>Account account = Advapi32Util.getTokenPrimaryGroup(phToken.getValue());<NEW_LINE>pair = new Pair<>(account.name, account.sidString);<NEW_LINE>} else {<NEW_LINE>int error = Kernel32.INSTANCE.GetLastError();<NEW_LINE>// Access denied errors are common. Fail silently.<NEW_LINE>if (error != WinError.ERROR_ACCESS_DENIED) {<NEW_LINE>LOG.error("Failed to get process token for process {}: {}", getProcessID(), Kernel32.INSTANCE.GetLastError());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final HANDLE token = phToken.getValue();<NEW_LINE>if (token != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Kernel32.INSTANCE.CloseHandle(pHandle);<NEW_LINE>}<NEW_LINE>if (pair == null) {<NEW_LINE>return new Pair<>(Constants.UNKNOWN, Constants.UNKNOWN);<NEW_LINE>}<NEW_LINE>return pair;<NEW_LINE>} | Kernel32.INSTANCE.CloseHandle(token); |
407,932 | private void replaceNull(LocalValue<?> key, Object value, int index) {<NEW_LINE>Entry[] tab = table;<NEW_LINE>int len = tab.length;<NEW_LINE>Entry e;<NEW_LINE>int slotToExpunge = index;<NEW_LINE>for (int i = prevIndex(index, len); (e = tab[i]) != null; i = prevIndex(i, len)) if (e.k == null) {<NEW_LINE>slotToExpunge = i;<NEW_LINE>}<NEW_LINE>for (int i = nextIndex(index, len); (e = tab[i]) != null; i = nextIndex(i, len)) {<NEW_LINE>LocalValue<?> k = e.k;<NEW_LINE>if (k == key) {<NEW_LINE>Misc.free(e.value);<NEW_LINE>e.value = value;<NEW_LINE>tab[i] = tab[index];<NEW_LINE>tab[index] = e;<NEW_LINE>if (slotToExpunge == index) {<NEW_LINE>slotToExpunge = i;<NEW_LINE>}<NEW_LINE>removeNullKeys(removeNull(slotToExpunge), len);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (k == null && slotToExpunge == index) {<NEW_LINE>slotToExpunge = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tab[index].value = Misc.free(tab[index].value);<NEW_LINE>tab[index] = new Entry(key, value);<NEW_LINE>if (slotToExpunge != index) {<NEW_LINE>removeNullKeys<MASK><NEW_LINE>}<NEW_LINE>} | (removeNull(slotToExpunge), len); |
1,818,606 | public void actionPerformed(final ActionEvent evt, final JTextComponent component) {<NEW_LINE>if (component == null || !component.isEditable() || !component.isEnabled()) {<NEW_LINE>Toolkit.getDefaultToolkit().beep();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final BaseDocument doc = (BaseDocument) component.getDocument();<NEW_LINE>final Source <MASK><NEW_LINE>if (source != null) {<NEW_LINE>final AtomicBoolean cancel = new AtomicBoolean();<NEW_LINE>ProgressUtils.runOffEventDispatchThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>ModificationResult.runModificationTask(Collections.singleton(source), new UserTask() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(ResultIterator resultIterator) throws Exception {<NEW_LINE>WorkingCopy copy = WorkingCopy.get(resultIterator.getParserResult());<NEW_LINE>copy.toPhase(Phase.RESOLVED);<NEW_LINE>doOrganizeImports(copy, false);<NEW_LINE>}<NEW_LINE>}).commit();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Toolkit.getDefaultToolkit().beep();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, // NOI18N<NEW_LINE>NbBundle.getMessage(OrganizeImports.class, "MSG_OragnizeImports"), // NOI18N<NEW_LINE>cancel, false);<NEW_LINE>}<NEW_LINE>} | source = Source.create(doc); |
766,360 | public final GopListContext gopList() throws RecognitionException {<NEW_LINE>GopListContext _localctx = new GopListContext(_ctx, getState());<NEW_LINE><MASK><NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(1184);<NEW_LINE>gop();<NEW_LINE>setState(1188);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>while (_la == CREATE || _la == SELECT || _la == ATCHAR || _la == IDENT) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(1185);<NEW_LINE>gop();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(1190);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | enterRule(_localctx, 118, RULE_gopList); |
1,669,362 | private Coordinate[] cubicBezier(final Coordinate start, final Coordinate end, final Coordinate ctrl1, final Coordinate ctrl2, final int nv) {<NEW_LINE>final Coordinate[] curve = new Coordinate[nv];<NEW_LINE>final Coordinate[] buf = new Coordinate[3];<NEW_LINE>for (int i = 0; i < buf.length; i++) {<NEW_LINE>buf[i] = new Coordinate();<NEW_LINE>}<NEW_LINE>curve[0] = new Coordinate(start);<NEW_LINE>curve[nv - <MASK><NEW_LINE>InterpPoint[] ip = getInterpPoints(nv);<NEW_LINE>for (int i = 1; i < nv - 1; i++) {<NEW_LINE>Coordinate c = new Coordinate();<NEW_LINE>c.x = ip[i].t[0] * start.x + ip[i].t[1] * ctrl1.x + ip[i].t[2] * ctrl2.x + ip[i].t[3] * end.x;<NEW_LINE>c.x /= ip[i].tsum;<NEW_LINE>c.y = ip[i].t[0] * start.y + ip[i].t[1] * ctrl1.y + ip[i].t[2] * ctrl2.y + ip[i].t[3] * end.y;<NEW_LINE>c.y /= ip[i].tsum;<NEW_LINE>curve[i] = c;<NEW_LINE>}<NEW_LINE>return curve;<NEW_LINE>} | 1] = new Coordinate(end); |
988,681 | private DetailedExitCode checkCwdInWorkspace(EventHandler eventHandler) {<NEW_LINE>if (!commandAnnotation.mustRunInWorkspace()) {<NEW_LINE>return DetailedExitCode.success();<NEW_LINE>}<NEW_LINE>if (!workspace.getDirectories().inWorkspace()) {<NEW_LINE>String message = "The '" + commandAnnotation.name() + "' command is only supported from within a workspace" + " (below a directory having a WORKSPACE file).\n" + "See documentation at" + " https://bazel.build/concepts/build-ref#workspace";<NEW_LINE>eventHandler.handle(Event.error(message));<NEW_LINE>return createDetailedExitCode(message, Code.NOT_IN_WORKSPACE);<NEW_LINE>}<NEW_LINE>Path workspacePath = workspace.getWorkspace();<NEW_LINE>// TODO(kchodorow): Remove this once spaces are supported.<NEW_LINE>if (workspacePath.getPathString().contains(" ")) {<NEW_LINE>String message = runtime.getProductName() + " does not currently work properly from paths " + "containing spaces (" + workspacePath + ").";<NEW_LINE>eventHandler.handle(Event.error(message));<NEW_LINE>return createDetailedExitCode(message, Code.SPACES_IN_WORKSPACE_PATH);<NEW_LINE>}<NEW_LINE>if (workspacePath.getParentDirectory() != null) {<NEW_LINE>Path doNotBuild = workspacePath.getParentDirectory().getRelative(BlazeWorkspace.DO_NOT_BUILD_FILE_NAME);<NEW_LINE>if (doNotBuild.exists()) {<NEW_LINE>if (!commandAnnotation.canRunInOutputDirectory()) {<NEW_LINE>String message = getNotInRealWorkspaceError(doNotBuild);<NEW_LINE>eventHandler.handle(Event.error(message));<NEW_LINE>return <MASK><NEW_LINE>} else {<NEW_LINE>eventHandler.handle(Event.warn(runtime.getProductName() + " is run from output directory. This is unsound."));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return DetailedExitCode.success();<NEW_LINE>} | createDetailedExitCode(message, Code.IN_OUTPUT_DIRECTORY); |
1,805,133 | static ExecutorService buildExecutorService(Configuration configuration) {<NEW_LINE>Integer corePoolSize = configuration.getOrDefault(PARALLEL_BACKEND_EXECUTOR_SERVICE_CORE_POOL_SIZE);<NEW_LINE>Integer maxPoolSize = configuration.getOrDefault(PARALLEL_BACKEND_EXECUTOR_SERVICE_MAX_POOL_SIZE);<NEW_LINE>Long keepAliveTime = configuration.getOrDefault(PARALLEL_BACKEND_EXECUTOR_SERVICE_KEEP_ALIVE_TIME);<NEW_LINE>String executorServiceClass = configuration.getOrDefault(PARALLEL_BACKEND_EXECUTOR_SERVICE_CLASS);<NEW_LINE>ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("Backend[%02d]").build();<NEW_LINE>if (configuration.get(BASIC_METRICS)) {<NEW_LINE>threadFactory = ExecutorServiceInstrumentation.instrument(configuration.get(METRICS_PREFIX), "backend", threadFactory);<NEW_LINE>}<NEW_LINE>ExecutorServiceConfiguration executorServiceConfiguration = new ExecutorServiceConfiguration(executorServiceClass, <MASK><NEW_LINE>ExecutorService executorService = ExecutorServiceBuilder.build(executorServiceConfiguration);<NEW_LINE>if (configuration.get(BASIC_METRICS)) {<NEW_LINE>executorService = ExecutorServiceInstrumentation.instrument(configuration.get(METRICS_PREFIX), "backend", executorService);<NEW_LINE>}<NEW_LINE>return executorService;<NEW_LINE>} | corePoolSize, maxPoolSize, keepAliveTime, threadFactory); |
333,510 | private int markIntersectionEdge(Object g, int idx, int[] yPoints, int[] xPoints, int nPoints, int[] intersections, int intersectionsCount) {<NEW_LINE>intersections<MASK><NEW_LINE>if ((yPoints[idx] - yPoints[(idx + 1) % nPoints]) * (yPoints[idx] - yPoints[(idx + nPoints - 1) % nPoints]) > 0) {<NEW_LINE>intersections[intersectionsCount + 1] = xPoints[idx];<NEW_LINE>return 2;<NEW_LINE>}<NEW_LINE>// Check for special case horizontal line<NEW_LINE>if (yPoints[idx] == yPoints[(idx + 1) % nPoints]) {<NEW_LINE>drawLine(g, xPoints[idx], yPoints[idx], xPoints[(idx + 1) % nPoints], yPoints[(idx + 1) % nPoints]);<NEW_LINE>if ((yPoints[(idx + 1) % nPoints] - yPoints[(idx + 2) % nPoints]) * (yPoints[idx] - yPoints[(idx + nPoints - 1) % nPoints]) > 0) {<NEW_LINE>return 1;<NEW_LINE>} else {<NEW_LINE>intersections[intersectionsCount + 1] = xPoints[idx];<NEW_LINE>return 2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>} | [intersectionsCount] = xPoints[idx]; |
1,328,008 | public void traverse(ASTVisitor visitor, BlockScope scope) {<NEW_LINE>if (visitor.visit(this, scope)) {<NEW_LINE>if (this.annotations != null) {<NEW_LINE>int annotationsLevels = this.annotations.length;<NEW_LINE>for (int i = 0; i < annotationsLevels; i++) {<NEW_LINE>int annotationsLength = this.annotations[i] == null ? 0 : this.annotations[i].length;<NEW_LINE>for (int j = 0; j < annotationsLength; j++) this.annotations[i][j].traverse(visitor, scope);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.annotationsOnDimensions != null) {<NEW_LINE>for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {<NEW_LINE>Annotation[] annotations2 = this.annotationsOnDimensions[i];<NEW_LINE>for (int j = 0, max2 = annotations2 == null ? 0 : annotations2.length; j < max2; j++) {<NEW_LINE>Annotation annotation = annotations2[j];<NEW_LINE>annotation.traverse(visitor, scope);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | visitor.endVisit(this, scope); |
449,817 | private static List<SQLAlterTableItem> reverse(SQLAlterTableAddConstraint addConstraint) {<NEW_LINE>List<SQLAlterTableItem> reversedItems = new ArrayList<>();<NEW_LINE>SQLConstraint constraint = addConstraint.getConstraint();<NEW_LINE>if (constraint instanceof MySqlPrimaryKey) {<NEW_LINE>SQLAlterTableDropPrimaryKey dropPrimaryKey = new SQLAlterTableDropPrimaryKey();<NEW_LINE>reversedItems.add(dropPrimaryKey);<NEW_LINE>} else if (constraint instanceof MySqlUnique) {<NEW_LINE>SQLAlterTableDropIndex dropIndex = new SQLAlterTableDropIndex();<NEW_LINE><MASK><NEW_LINE>if (indexName == null) {<NEW_LINE>// If user doesn't specify a unique index name, then the first column name<NEW_LINE>// is used as the index name.<NEW_LINE>indexName = (SQLIdentifierExpr) ((MySqlUnique) constraint).getColumns().get(0).getExpr();<NEW_LINE>}<NEW_LINE>dropIndex.setIndexName(indexName);<NEW_LINE>reversedItems.add(dropIndex);<NEW_LINE>}<NEW_LINE>return reversedItems;<NEW_LINE>} | SQLName indexName = constraint.getName(); |
1,605,626 | public void removeNodeComment(Long commentId, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'commentId' is set<NEW_LINE>if (commentId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'commentId' when calling removeNodeComment");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/nodes/comments/{comment_id}".replaceAll("\\{" + "comment_id" + "\\}", apiClient.escapeString(commentId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new <MASK><NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>} | HashMap<String, String>(); |
1,657,944 | public List<StringMetaDataBo> mapRow(Result result, int rowNum) throws Exception {<NEW_LINE>if (result.isEmpty()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>final byte[] rowKey = getOriginalKey(result.getRow());<NEW_LINE>final MetaDataRowKey key = decoder.decodeRowKey(rowKey);<NEW_LINE>List<StringMetaDataBo> stringMetaDataList = new ArrayList<>();<NEW_LINE>for (Cell cell : result.rawCells()) {<NEW_LINE>String stringValue = Bytes.toString(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength());<NEW_LINE>if (STRING_METADATA_CF_STR_QUALI_STRING.equals(stringValue)) {<NEW_LINE>stringValue = Bytes.toString(cell.getValueArray(), cell.getValueOffset(<MASK><NEW_LINE>}<NEW_LINE>StringMetaDataBo stringMetaDataBo = new StringMetaDataBo(key.getAgentId(), key.getAgentStartTime(), key.getId(), stringValue);<NEW_LINE>stringMetaDataList.add(stringMetaDataBo);<NEW_LINE>}<NEW_LINE>return stringMetaDataList;<NEW_LINE>} | ), cell.getValueLength()); |
1,550,950 | public void readSettings(Properties p, String propertyPrefix) {<NEW_LINE>ETableColumnModel <MASK><NEW_LINE>etcm.readSettings(p, propertyPrefix, this);<NEW_LINE>setColumnModel(etcm);<NEW_LINE>String scs = p.getProperty(propertyPrefix + SEARCH_COLUMN);<NEW_LINE>if (scs != null) {<NEW_LINE>try {<NEW_LINE>int index = Integer.parseInt(scs);<NEW_LINE>for (int i = 0; i < etcm.getColumnCount(); i++) {<NEW_LINE>TableColumn tc = etcm.getColumn(i);<NEW_LINE>if (tc.getModelIndex() == index) {<NEW_LINE>searchColumn = (ETableColumn) tc;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>nfe.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>filteredRowCount = -1;<NEW_LINE>resetPermutation();<NEW_LINE>super.tableChanged(new TableModelEvent(getModel()));<NEW_LINE>} | etcm = (ETableColumnModel) createDefaultColumnModel(); |
560,538 | final DeleteLicenseResult executeDeleteLicense(DeleteLicenseRequest deleteLicenseRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteLicenseRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteLicenseRequest> request = null;<NEW_LINE>Response<DeleteLicenseResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteLicenseRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteLicenseRequest));<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, "License Manager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteLicense");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteLicenseResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteLicenseResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
1,538,996 | public static void forwardBackWardDemo() {<NEW_LINE>System.out.println("DEMO: Forward-BackWard");<NEW_LINE>System.out.println("======================");<NEW_LINE>System.out.println("Umbrella World");<NEW_LINE>System.out.println("--------------");<NEW_LINE>ForwardBackward uw = new ForwardBackward(GenericTemporalModelFactory.getUmbrellaWorldTransitionModel(), GenericTemporalModelFactory.getUmbrellaWorld_Xt_to_Xtm1_Map(), GenericTemporalModelFactory.getUmbrellaWorldSensorModel());<NEW_LINE>CategoricalDistribution prior = new ProbabilityTable(new double[] { 0.5, 0.5 }, ExampleRV.RAIN_t_RV);<NEW_LINE>// Day 1<NEW_LINE>List<List<AssignmentProposition>> evidence = new ArrayList<List<AssignmentProposition>>();<NEW_LINE>List<AssignmentProposition> e1 = new ArrayList<AssignmentProposition>();<NEW_LINE>e1.add(new AssignmentProposition(ExampleRV.UMBREALLA_t_RV, Boolean.TRUE));<NEW_LINE>evidence.add(e1);<NEW_LINE>List<CategoricalDistribution> smoothed = <MASK><NEW_LINE>System.out.println("Day 1 (Umbrealla_t=true) smoothed:\nday 1 = " + smoothed.get(0));<NEW_LINE>// Day 2<NEW_LINE>List<AssignmentProposition> e2 = new ArrayList<AssignmentProposition>();<NEW_LINE>e2.add(new AssignmentProposition(ExampleRV.UMBREALLA_t_RV, Boolean.TRUE));<NEW_LINE>evidence.add(e2);<NEW_LINE>smoothed = uw.forwardBackward(evidence, prior);<NEW_LINE>System.out.println("Day 2 (Umbrealla_t=true) smoothed:\nday 1 = " + smoothed.get(0) + "\nday 2 = " + smoothed.get(1));<NEW_LINE>// Day 3<NEW_LINE>List<AssignmentProposition> e3 = new ArrayList<AssignmentProposition>();<NEW_LINE>e3.add(new AssignmentProposition(ExampleRV.UMBREALLA_t_RV, Boolean.FALSE));<NEW_LINE>evidence.add(e3);<NEW_LINE>smoothed = uw.forwardBackward(evidence, prior);<NEW_LINE>System.out.println("Day 3 (Umbrealla_t=false) smoothed:\nday 1 = " + smoothed.get(0) + "\nday 2 = " + smoothed.get(1) + "\nday 3 = " + smoothed.get(2));<NEW_LINE>System.out.println("======================");<NEW_LINE>} | uw.forwardBackward(evidence, prior); |
701,690 | void createBuildContent(String groupId, String version) throws IOException {<NEW_LINE>final String buildContent = getModel().getBuildContent();<NEW_LINE>StringBuilder res = new StringBuilder(buildContent);<NEW_LINE>if (!buildContent.contains("id(\"io.quarkus\")")) {<NEW_LINE>res.append("plugins {");<NEW_LINE>res.append(System.lineSeparator()).append(" java").append(System.lineSeparator());<NEW_LINE>res.append(System.lineSeparator()).append(" id(\"io.quarkus\")").append(System.lineSeparator());<NEW_LINE>res.append("}");<NEW_LINE>}<NEW_LINE>final ArtifactCoords bom = getQuarkusProject().getExtensionsCatalog().getBom();<NEW_LINE>if (!containsBOM(bom.getGroupId(), bom.getArtifactId())) {<NEW_LINE>res.append(System.lineSeparator());<NEW_LINE>res.append("dependencies {").append(System.lineSeparator());<NEW_LINE>res.append(" implementation(enforcedPlatform(\"${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}\"))").append(System.lineSeparator());<NEW_LINE>res.append(" implementation(\"io.quarkus:quarkus-resteasy\")").append(System.lineSeparator());<NEW_LINE>res.append(" testImplementation(\"io.quarkus:quarkus-junit5\")").append(System.lineSeparator());<NEW_LINE>res.append(" testImplementation(\"io.rest-assured:rest-assured\")").append(System.lineSeparator());<NEW_LINE>res.append("}").append(System.lineSeparator());<NEW_LINE>}<NEW_LINE>String groupLine = "group = \"" + groupId + "\"";<NEW_LINE>if (!buildContent.contains(groupLine)) {<NEW_LINE>res.append(System.lineSeparator()).append(groupLine).append(System.lineSeparator());<NEW_LINE>}<NEW_LINE>String versionLine = "version = \"" + version + "\"";<NEW_LINE>if (!buildContent.contains(versionLine)) {<NEW_LINE>res.append(System.lineSeparator()).append(versionLine).append(System.lineSeparator());<NEW_LINE>}<NEW_LINE>res.append(System.lineSeparator()).append("tasks.withType<Test> {").append(System.lineSeparator()).append(" systemProperty(\"java.util.logging.manager\", \"org.jboss.logmanager.LogManager\")").append(System.lineSeparator()).append("}");<NEW_LINE>getModel().<MASK><NEW_LINE>} | setBuildContent(res.toString()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.