idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,622,795 | private static boolean uninstallAddOnActiveScanRules(AddOn addOn, AddOnUninstallationProgressCallback callback) {<NEW_LINE>boolean uninstalledWithoutErrors = true;<NEW_LINE>List<AbstractPlugin> loadedAscanrules = addOn.getLoadedAscanrules();<NEW_LINE>if (!loadedAscanrules.isEmpty()) {<NEW_LINE>logger.debug("Uninstall ascanrules: " + addOn.getAscanrules());<NEW_LINE>callback.<MASK><NEW_LINE>for (AbstractPlugin ascanrule : loadedAscanrules) {<NEW_LINE>String name = ascanrule.getClass().getCanonicalName();<NEW_LINE>logger.debug("Uninstall ascanrule: " + name);<NEW_LINE>PluginFactory.unloadedPlugin(ascanrule);<NEW_LINE>if (PluginFactory.isPluginLoaded(ascanrule)) {<NEW_LINE>logger.error("Failed to uninstall ascanrule: " + name);<NEW_LINE>uninstalledWithoutErrors = false;<NEW_LINE>}<NEW_LINE>callback.activeScanRuleRemoved(name);<NEW_LINE>}<NEW_LINE>addOn.setLoadedAscanrules(Collections.<AbstractPlugin>emptyList());<NEW_LINE>addOn.setLoadedAscanrulesSet(false);<NEW_LINE>}<NEW_LINE>return uninstalledWithoutErrors;<NEW_LINE>} | activeScanRulesWillBeRemoved(loadedAscanrules.size()); |
1,613,173 | public Composite createTab(Composite parent) {<NEW_LINE>Composite container = new Composite(parent, SWT.NONE);<NEW_LINE>TableColumnLayout layout = new TableColumnLayout();<NEW_LINE>container.setLayout(layout);<NEW_LINE>tableViewer = new TableViewer(container, SWT.FULL_SELECTION | SWT.MULTI);<NEW_LINE>CopyPasteSupport.enableFor(tableViewer);<NEW_LINE>ColumnEditingSupport.prepare(tableViewer);<NEW_LINE>ShowHideColumnHelper support = new // $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>ShowHideColumnHelper(AttributeListTab.class.getSimpleName() + <MASK><NEW_LINE>addColumns(support);<NEW_LINE>support.createColumns();<NEW_LINE>tableViewer.getTable().setHeaderVisible(true);<NEW_LINE>tableViewer.getTable().setLinesVisible(true);<NEW_LINE>tableViewer.setContentProvider(new ArrayContentProvider());<NEW_LINE>tableViewer.setInput(client.getSettings().getAttributeTypes().filter(t -> t.getTarget() == mode.getType()).toArray());<NEW_LINE>tableViewer.addSelectionChangedListener(event -> {<NEW_LINE>Object selectedElement = event.getStructuredSelection().getFirstElement();<NEW_LINE>view.setInformationPaneInput(selectedElement);<NEW_LINE>// when selected element provides additional information (e.g. settings)<NEW_LINE>// in information pane: display it automatically<NEW_LINE>if (selectedElement instanceof AttributeType && ((AttributeType) selectedElement).getType() == LimitPrice.class && view.isPaneHidden()) {<NEW_LINE>view.flipPane();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>new ContextMenu(tableViewer.getTable(), this::fillContextMenu).hook();<NEW_LINE>return container;<NEW_LINE>} | "@v2", preferences, tableViewer, layout); |
930,130 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE><MASK><NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = null;<NEW_LINE>CacheKey cacheKey = new CacheKey(id);<NEW_LINE>Optional<?> optional = CacheManager.get(cache, cacheKey);<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>wo = (Wo) optional.get();<NEW_LINE>} else {<NEW_LINE>Portal o = emc.find(id, Portal.class);<NEW_LINE>if (null == o) {<NEW_LINE>throw new PortalNotExistedException(id);<NEW_LINE>}<NEW_LINE>if (!effectivePerson.isSecurityManager() && !business.editable(effectivePerson, o)) {<NEW_LINE>throw new InvisibleException(effectivePerson.getDistinguishedName(), o.getName(), o.getId());<NEW_LINE>}<NEW_LINE>wo = Wo.copier.copy(o);<NEW_LINE>CacheManager.put(cache, cacheKey, wo);<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | Business business = new Business(emc); |
510,638 | public int calculateMinimumHP(int[][] dungeon) {<NEW_LINE>if (dungeon == null || dungeon.length == 0) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>int height = dungeon.length;<NEW_LINE>int width = dungeon[0].length;<NEW_LINE>int[][] dp = new int[height][width];<NEW_LINE>dp[height - 1][width - 1] = (dungeon[height - 1][width - 1] > 0) ? 1 : 1 - dungeon[height - 1][width - 1];<NEW_LINE>// fill the last column<NEW_LINE>for (int i = height - 2; i >= 0; i--) {<NEW_LINE>int temp = dp[i + 1][width - 1] - dungeon[i][width - 1];<NEW_LINE>dp[i][width - 1] = Math.max(1, temp);<NEW_LINE>}<NEW_LINE>// fill the last row<NEW_LINE>for (int j = width - 2; j >= 0; j--) {<NEW_LINE>int temp = dp[height - 1][j + 1] - dungeon<MASK><NEW_LINE>dp[height - 1][j] = Math.max(temp, 1);<NEW_LINE>}<NEW_LINE>for (int i = height - 2; i >= 0; i--) {<NEW_LINE>for (int j = width - 2; j >= 0; j--) {<NEW_LINE>int down = Math.max(1, dp[i + 1][j] - dungeon[i][j]);<NEW_LINE>int right = Math.max(1, dp[i][j + 1] - dungeon[i][j]);<NEW_LINE>dp[i][j] = Math.min(down, right);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CommonUtils.printMatrix(dp);<NEW_LINE>return dp[0][0];<NEW_LINE>} | [height - 1][j]; |
426,193 | public int read(byte[] buf, int off, int len) throws TTransportException {<NEW_LINE>if (!responseBufferTransport.isReadable()) {<NEW_LINE>try {<NEW_LINE>// If our existing response transport doesn't have any bytes remaining to read,<NEW_LINE>// wait for the next queued response to arrive, and point our response transport<NEW_LINE>// to that.<NEW_LINE>ResponseListener listener = queuedResponses.take();<NEW_LINE>ChannelBuffer response = listener.getResponse().get();<NEW_LINE>// Ensure the response buffer is not zero-sized<NEW_LINE>checkState(response.readable(), "Received an empty response");<NEW_LINE>responseBufferTransport.setInputBuffer(response);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// Waiting for response was interrupted<NEW_LINE>Thread<MASK><NEW_LINE>throw new TTransportException(e);<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>// Error while waiting for response<NEW_LINE>Throwables.propagateIfInstanceOf(e, TTransportException.class);<NEW_LINE>throw new TTransportException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Read as many bytes as we can (up to the amount requested) from the response<NEW_LINE>return responseBufferTransport.read(buf, off, len);<NEW_LINE>} | .currentThread().interrupt(); |
581,833 | public com.amazonaws.services.directory.model.InvalidParameterException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.directory.model.InvalidParameterException invalidParameterException = new com.amazonaws.services.directory.model.InvalidParameterException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("RequestId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>invalidParameterException.setRequestId(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 invalidParameterException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
485,188 | public void run() {<NEW_LINE>ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();<NEW_LINE>final ArrayList<PsiFile> filesList = new ArrayList<PsiFile>();<NEW_LINE>final boolean isRecursive = myExportToHTMLSettings.isIncludeSubdirectories();<NEW_LINE>try {<NEW_LINE>ApplicationManager.getApplication().runReadAction(new ThrowableComputable<Void, FileNotFoundException>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void compute() throws FileNotFoundException {<NEW_LINE>addToPsiFileList(myPsiDirectory, filesList, isRecursive, myOutputDirectoryName);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>myLastException = e;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HashMap<PsiFile, PsiFile> filesMap = new HashMap<PsiFile, PsiFile>();<NEW_LINE>for (PsiFile psiFile : filesList) {<NEW_LINE>filesMap.put(psiFile, psiFile);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < filesList.size(); i++) {<NEW_LINE>PsiFile psiFile = filesList.get(i);<NEW_LINE>if (progressIndicator.isCanceled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>progressIndicator.setText(CodeEditorBundle.message("export.to.html.generating.file.progress", getHTMLFileName(psiFile)));<NEW_LINE>progressIndicator.setFraction(((double) i<MASK><NEW_LINE>if (!exportPsiFile(psiFile, myOutputDirectoryName, myProject, filesMap)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (myExportToHTMLSettings.OPEN_IN_BROWSER) {<NEW_LINE>String dirToShow = myExportToHTMLSettings.OUTPUT_DIRECTORY;<NEW_LINE>if (!dirToShow.endsWith(File.separator)) {<NEW_LINE>dirToShow += File.separatorChar;<NEW_LINE>}<NEW_LINE>dirToShow += PsiPackageHelper.getInstance(myProject).getQualifiedName(myPsiDirectory, false).replace('.', File.separatorChar);<NEW_LINE>BrowserUtil.browse(dirToShow);<NEW_LINE>}<NEW_LINE>} | ) / filesList.size()); |
406,000 | public Map<String, Double> calculateSpellColorPercentages() {<NEW_LINE>final Map<String, Integer> colorCount = new HashMap<>();<NEW_LINE>for (final ColoredManaSymbol color : ColoredManaSymbol.values()) {<NEW_LINE>colorCount.put(color.toString(), 0);<NEW_LINE>}<NEW_LINE>// Counts how many colored mana symbols we've seen in total so we can get the percentage of each color<NEW_LINE>int totalCount = 0;<NEW_LINE>List<Card> fixedSpells = getFixedSpells();<NEW_LINE>for (Card spell : fixedSpells) {<NEW_LINE>for (String symbol : spell.getManaCostSymbols()) {<NEW_LINE>symbol = symbol.replace("{", "").replace("}", "");<NEW_LINE>if (isColoredManaSymbol(symbol)) {<NEW_LINE>for (ColoredManaSymbol allowed : allowedColors) {<NEW_LINE>if (symbol.contains(allowed.toString())) {<NEW_LINE>int cnt = colorCount.get(allowed.toString());<NEW_LINE>colorCount.put(allowed.toString(), cnt + 1);<NEW_LINE>totalCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Map<String, Double> percentages = new HashMap<>();<NEW_LINE>for (Map.Entry<String, Integer> singleCount : colorCount.entrySet()) {<NEW_LINE>String color = singleCount.getKey();<NEW_LINE><MASK><NEW_LINE>// Calculate the percentage this color has out of the total color counts<NEW_LINE>double percentage = (count / (double) totalCount) * 100;<NEW_LINE>percentages.put(color, percentage);<NEW_LINE>}<NEW_LINE>return percentages;<NEW_LINE>} | int count = singleCount.getValue(); |
536,057 | public static boolean intersects(final RoaringBitmap x1, final RoaringBitmap x2) {<NEW_LINE>final int length1 = x1.highLowContainer.size(), length2 <MASK><NEW_LINE>int pos1 = 0, pos2 = 0;<NEW_LINE>while (pos1 < length1 && pos2 < length2) {<NEW_LINE>final char s1 = x1.highLowContainer.getKeyAtIndex(pos1);<NEW_LINE>final char s2 = x2.highLowContainer.getKeyAtIndex(pos2);<NEW_LINE>if (s1 == s2) {<NEW_LINE>final Container c1 = x1.highLowContainer.getContainerAtIndex(pos1);<NEW_LINE>final Container c2 = x2.highLowContainer.getContainerAtIndex(pos2);<NEW_LINE>if (c1.intersects(c2)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>++pos1;<NEW_LINE>++pos2;<NEW_LINE>} else if (s1 < s2) {<NEW_LINE>pos1 = x1.highLowContainer.advanceUntil(s2, pos1);<NEW_LINE>} else {<NEW_LINE>pos2 = x2.highLowContainer.advanceUntil(s1, pos2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | = x2.highLowContainer.size(); |
955,643 | public ModelAndView profile(ModelMap map, HttpServletRequest request, @Valid String snsid) {<NEW_LINE>CousultInvite coultInvite = OnlineUserProxy.consult(snsid, super.getOrgi(request));<NEW_LINE>logger.info("[profile] snsaccount Id {}, Ai {}, Aifirst {}, Ainame {}, Aisuccess {}, Aiid {}", coultInvite.getSnsaccountid(), coultInvite.isAi(), coultInvite.isAifirst(), coultInvite.getAiname(), coultInvite.getAisuccesstip(), coultInvite.getAiid());<NEW_LINE>if (coultInvite != null) {<NEW_LINE>map.addAttribute("inviteData", coultInvite);<NEW_LINE>map.addAttribute("skillGroups", getSkillGroups(request));<NEW_LINE>}<NEW_LINE>map.addAttribute("import", request.getServerPort());<NEW_LINE>map.addAttribute("snsAccount", snsAccountRes.findBySnsidAndOrgi(snsid, super.getOrgi(request)));<NEW_LINE>map.put("serviceAiList", serviceAiRes.findByOrgi(super.getOrgi(request)));<NEW_LINE>return request<MASK><NEW_LINE>} | (super.createView("/admin/webim/profile")); |
1,375,296 | public void onRename(String name) {<NEW_LINE>_item.setLabel(name);<NEW_LINE>Setup.<MASK><NEW_LINE>Point point = new Point(_item._x, _item._y);<NEW_LINE>if (_item._location.equals(ItemPosition.Group)) {<NEW_LINE>return;<NEW_LINE>} else if (_item._location.equals(ItemPosition.Desktop)) {<NEW_LINE>Desktop desktop = _homeActivity.getDesktop();<NEW_LINE>desktop.removeItem(desktop.getCurrentPage().coordinateToChildView(point), false);<NEW_LINE>desktop.addItemToCell(_item, _item._x, _item._y);<NEW_LINE>} else {<NEW_LINE>Dock dock = _homeActivity.getDock();<NEW_LINE>_homeActivity.getDock().removeItem(dock.coordinateToChildView(point), false);<NEW_LINE>dock.addItemToCell(_item, _item._x, _item._y);<NEW_LINE>}<NEW_LINE>} | dataManager().saveItem(_item); |
1,507,402 | public void updateComponent() {<NEW_LINE>if (!myKeepOnHintHidden && !myHint.isVisible() && !ApplicationManager.getApplication().isHeadlessEnvironment() || myEditor instanceof EditorWindow && !((EditorWindow) myEditor).isValid()) {<NEW_LINE>Disposer.dispose(this);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final PsiFile file = PsiUtilBase.getPsiFileInEditor(myEditor, myProject);<NEW_LINE>int caretOffset = myEditor.getCaretModel().getOffset();<NEW_LINE>final int offset = getCurrentOffset();<NEW_LINE>final MyUpdateParameterInfoContext context <MASK><NEW_LINE>executeFindElementForUpdatingParameterInfo(context, elementForUpdating -> {<NEW_LINE>myHandler.processFoundElementForUpdatingParameterInfo(elementForUpdating, context);<NEW_LINE>if (elementForUpdating != null) {<NEW_LINE>executeUpdateParameterInfo(elementForUpdating, context, () -> {<NEW_LINE>boolean knownParameter = (myComponent.getObjects().length == 1 || myComponent.getHighlighted() != null) && myComponent.getCurrentParameterIndex() != -1;<NEW_LINE>if (mySingleParameterInfo && !knownParameter && myHint.isVisible()) {<NEW_LINE>hideHint();<NEW_LINE>}<NEW_LINE>if (myKeepOnHintHidden && knownParameter && !myHint.isVisible()) {<NEW_LINE>AutoPopupController.getInstance(myProject).autoPopupParameterInfo(myEditor, null);<NEW_LINE>}<NEW_LINE>if (!myDisposed && (myHint.isVisible() && !myEditor.isDisposed() && (myEditor.getComponent().getRootPane() != null || ApplicationManager.getApplication().isUnitTestMode()) || ApplicationManager.getApplication().isHeadlessEnvironment())) {<NEW_LINE>Model result = myComponent.update(mySingleParameterInfo);<NEW_LINE>result.project = myProject;<NEW_LINE>result.range = myComponent.getParameterOwner().getTextRange();<NEW_LINE>result.editor = myEditor;<NEW_LINE>// for (ParameterInfoListener listener : ParameterInfoListener.EP_NAME.getExtensionList()) {<NEW_LINE>// listener.hintUpdated(result);<NEW_LINE>// }<NEW_LINE>if (ApplicationManager.getApplication().isHeadlessEnvironment())<NEW_LINE>return;<NEW_LINE>IdeTooltip tooltip = myHint.getCurrentIdeTooltip();<NEW_LINE>short position = tooltip != null ? toShort(tooltip.getPreferredPosition()) : HintManager.ABOVE;<NEW_LINE>Pair<Point, Short> pos = myProvider.getBestPointPosition(myHint, elementForUpdating, caretOffset, myEditor.getCaretModel().getVisualPosition(), position);<NEW_LINE>HintManagerImpl.adjustEditorHintPosition(myHint, myEditor, pos.getFirst(), pos.getSecond());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>hideHint();<NEW_LINE>if (!myKeepOnHintHidden) {<NEW_LINE>Disposer.dispose(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | = new MyUpdateParameterInfoContext(offset, file); |
521,148 | public boolean apply(Game game, Ability source) {<NEW_LINE>int discardCount = source.isControlledBy(game.getMonarchId()) ? 2 : 1;<NEW_LINE>String message = "Discard " + CardUtil.numberToText(discardCount, "a") + " card" + (discardCount > 1 ? 's' : "") + "? If not you lose " + (discardCount * 3) + " life";<NEW_LINE>Map<UUID, Cards> discardMap = new HashMap<>();<NEW_LINE>for (UUID playerId : game.getOpponents(source.getControllerId())) {<NEW_LINE>Player player = game.getPlayer(playerId);<NEW_LINE>if (player == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (player.getHand().size() < discardCount || !player.chooseUse(Outcome.LoseLife, message, source, game)) {<NEW_LINE>player.loseLife(discardCount * 3, game, source, false);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>TargetDiscard target = new TargetDiscard(discardCount, StaticFilters.FILTER_CARD, playerId);<NEW_LINE>player.choose(Outcome.Discard, target, source, game);<NEW_LINE>discardMap.put(playerId, new CardsImpl<MASK><NEW_LINE>}<NEW_LINE>for (Map.Entry<UUID, Cards> entry : discardMap.entrySet()) {<NEW_LINE>Player player = game.getPlayer(entry.getKey());<NEW_LINE>if (player != null) {<NEW_LINE>player.discard(entry.getValue(), false, source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | (target.getTargets())); |
1,442,391 | public String boldWords(String[] words, String S) {<NEW_LINE>boolean[] shouldBold = new boolean[S.length()];<NEW_LINE>for (int i = 0, end = 0; i < S.length(); i++) {<NEW_LINE>for (String word : words) {<NEW_LINE>if (S.startsWith(word, i)) {<NEW_LINE>end = Math.max(end, i + word.length());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>shouldBold[i] = end > i;<NEW_LINE>}<NEW_LINE>StringBuilder stringBuilder = new StringBuilder();<NEW_LINE>for (int i = 0; i < S.length(); i++) {<NEW_LINE>if (!shouldBold[i]) {<NEW_LINE>stringBuilder.append<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int j = i;<NEW_LINE>while (j < S.length() && shouldBold[j]) {<NEW_LINE>j++;<NEW_LINE>}<NEW_LINE>stringBuilder.append("<b>" + S.substring(i, j) + "</b>");<NEW_LINE>i = j - 1;<NEW_LINE>}<NEW_LINE>return stringBuilder.toString();<NEW_LINE>} | (S.charAt(i)); |
698,078 | public SQLName nameRest(SQLName name) {<NEW_LINE>if (lexer.token == Token.DOT) {<NEW_LINE>lexer.nextToken();<NEW_LINE>if (lexer.token == Token.KEY) {<NEW_LINE>name = new SQLPropertyExpr(name, "KEY");<NEW_LINE>lexer.nextToken();<NEW_LINE>return name;<NEW_LINE>}<NEW_LINE>if (lexer.token != Token.LITERAL_ALIAS && lexer.token != Token.IDENTIFIER && (!lexer.getKeywods().containsValue(lexer.token))) {<NEW_LINE>throw new ParserException("error, " + lexer.info());<NEW_LINE>}<NEW_LINE>String propertyName;<NEW_LINE>propertyName = lexer.stringVal();<NEW_LINE>if (lexer.isEnabled(SQLParserFeature.IgnoreNameQuotes)) {<NEW_LINE>propertyName = <MASK><NEW_LINE>}<NEW_LINE>name = new SQLPropertyExpr(name, propertyName);<NEW_LINE>lexer.nextToken();<NEW_LINE>name = nameRest(name);<NEW_LINE>}<NEW_LINE>return name;<NEW_LINE>} | SQLUtils.forcedNormalize(propertyName, dbType); |
1,751,974 | private void addCompoundTypeSubstitutionToTree(final INaviOperandTreeNode operandNode, final INaviInstruction instruction, final TypeSubstitution typeSubstitution) {<NEW_LINE>final long completeOffset = operandNode.hasAddendSibling() ? (operandNode.determineAddendValue() * 8 + typeSubstitution.getOffset()) : typeSubstitution.getOffset();<NEW_LINE>final WalkResult walkResult = BaseTypeHelpers.findMember(typeSubstitution.getBaseType(), completeOffset);<NEW_LINE>if (!walkResult.isValid()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>DefaultMutableTreeNode currentNode = baseTypeToTreeNode.get(typeSubstitution.getBaseType());<NEW_LINE>for (TypeMember typeMember : walkResult.getPath()) {<NEW_LINE>TypeMemberTreeNode nextNode = checkTypeMemberNodeExists(typeMember, currentNode);<NEW_LINE>if (nextNode == null) {<NEW_LINE>nextNode = new TypeMemberTreeNode(typeMember);<NEW_LINE>typeMemberToTreeNode.put(typeMember, nextNode);<NEW_LINE>insertNodeInto(nextNode, currentNode, currentNode.getChildCount());<NEW_LINE>}<NEW_LINE>currentNode = nextNode;<NEW_LINE>}<NEW_LINE>insertNodeInto(multiIndex.putTypeSubstitution(typeSubstitution, instruction), currentNode, currentNode.getChildCount());<NEW_LINE>} | addBaseType(typeSubstitution.getBaseType()); |
897,855 | public boolean authenticate(LDAPConnection connection, String bindDn, EncryptedValue password) throws LDAPException {<NEW_LINE>checkArgument(!isNullOrEmpty(bindDn), "Binding with empty principal is forbidden.");<NEW_LINE>checkArgument(password != null, "Binding with null credentials is forbidden.");<NEW_LINE>checkArgument(password.isSet(), "Binding with empty credentials is forbidden.");<NEW_LINE>final SimpleBindRequest bindRequest = new SimpleBindRequest(bindDn, encryptedValueService.decrypt(password));<NEW_LINE>LOG.trace("Re-binding with DN <{}> using password", bindDn);<NEW_LINE>try {<NEW_LINE>final BindResult bind = connection.bind(bindRequest);<NEW_LINE>if (!bind.getResultCode().equals(ResultCode.SUCCESS)) {<NEW_LINE>LOG.trace("Re-binding DN <{}> failed", bindDn);<NEW_LINE>throw new RuntimeException(bind.toString());<NEW_LINE>}<NEW_LINE>final boolean authenticated = connection.getLastBindRequest().equals(bindRequest);<NEW_LINE>LOG.trace("Binding DN <{}> did not throw, connection authenticated: {}", bindDn, authenticated);<NEW_LINE>return authenticated;<NEW_LINE>} catch (LDAPBindException e) {<NEW_LINE><MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | LOG.trace("Re-binding DN <{}> failed", bindDn); |
626,596 | protected void computeWeightedScore(int c_x, int c_y) {<NEW_LINE>// compute the score for each angle in the histogram<NEW_LINE>for (int y = rect.y0; y < rect.y1; y++) {<NEW_LINE>int indexX = derivX.startIndex + derivX<MASK><NEW_LINE>int indexY = derivY.startIndex + derivY.stride * y + rect.x0;<NEW_LINE>int indexW = (y - c_y + radiusScale) * weights.width + rect.x0 - c_x + radiusScale;<NEW_LINE>for (int x = rect.x0; x < rect.x1; x++, indexX++, indexY++, indexW++) {<NEW_LINE>float w = weights.data[indexW];<NEW_LINE>short dx = derivX.data[indexX];<NEW_LINE>short dy = derivY.data[indexY];<NEW_LINE>double angle = Math.atan2(dy, dx);<NEW_LINE>// compute which discretized angle it is<NEW_LINE>int discreteAngle = (int) ((angle + angleRound) / angleDiv) % numAngles;<NEW_LINE>// sum up the "score" for this angle<NEW_LINE>sumDerivX[discreteAngle] += w * dx;<NEW_LINE>sumDerivY[discreteAngle] += w * dy;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .stride * y + rect.x0; |
1,813,286 | final DescribeAutoScalingGroupsResult executeDescribeAutoScalingGroups(DescribeAutoScalingGroupsRequest describeAutoScalingGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAutoScalingGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeAutoScalingGroupsRequest> request = null;<NEW_LINE>Response<DescribeAutoScalingGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAutoScalingGroupsRequestMarshaller().marshall(super.beforeMarshalling(describeAutoScalingGroupsRequest));<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, "Auto Scaling");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAutoScalingGroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeAutoScalingGroupsResult> responseHandler = new StaxResponseHandler<DescribeAutoScalingGroupsResult>(new DescribeAutoScalingGroupsResultStaxUnmarshaller());<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); |
1,057,149 | private NavigatableContextAction breakPointActionFactory(String name, String cmd, boolean oneshot, KeyBindingData keyBinding) {<NEW_LINE>NavigatableContextAction breakpoint_action;<NEW_LINE>breakpoint_action = new NavigatableContextAction(name, getName()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(NavigatableActionContext context) {<NEW_LINE>rsplugin.cs.println(String.format("[>] %s", this.getName()));<NEW_LINE>if (rsplugin.syncEnabled) {<NEW_LINE>ProgramLocation loc = rsplugin.cvs.getCurrentLocation();<NEW_LINE>Program pgm = loc.getProgram();<NEW_LINE>if (rsplugin.isRemoteBaseKnown()) {<NEW_LINE>Address dest = rsplugin.rebaseRemote(loc.getAddress());<NEW_LINE>rsplugin.reqHandler.curClient.sendCmd(cmd, String.format("0x%x", dest.getOffset()), oneshot);<NEW_LINE>rsplugin.cs.println(String.format(" local addr: %s, remote: 0x%x", loc.getAddress().toString(), dest.getOffset()));<NEW_LINE>} else {<NEW_LINE>rsplugin.cs.println(String.format("[x] %s failed, remote base of %s program unknown", cmd, pgm.getName()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>breakpoint_action.setEnabled(true);<NEW_LINE>breakpoint_action.setKeyBindingData(keyBinding);<NEW_LINE>breakpoint_action.setHelpLocation(new HelpLocation(HelpTopics.NAVIGATION<MASK><NEW_LINE>return breakpoint_action;<NEW_LINE>} | , breakpoint_action.getName())); |
950,137 | public static XComponentContext createInitialComponentContext(Map<String, Object> context_entries) throws Exception {<NEW_LINE>ServiceManager xSMgr = new ServiceManager();<NEW_LINE>XImplementationLoader xImpLoader = UnoRuntime.queryInterface(XImplementationLoader.class, new JavaLoader());<NEW_LINE>XInitialization xInit = UnoRuntime.queryInterface(XInitialization.class, xImpLoader);<NEW_LINE>Object[] args <MASK><NEW_LINE>xInit.initialize(args);<NEW_LINE>// initial component context<NEW_LINE>if (context_entries == null) {<NEW_LINE>context_entries = new HashMap<>(1);<NEW_LINE>}<NEW_LINE>// add smgr<NEW_LINE>context_entries.put("/singletons/com.sun.star.lang.theServiceManager", new ComponentContextEntry(null, xSMgr));<NEW_LINE>// ... xxx todo: add standard entries<NEW_LINE>XComponentContext xContext = new ComponentContext(context_entries, null);<NEW_LINE>xSMgr.setDefaultContext(xContext);<NEW_LINE>XSet xSet = UnoRuntime.queryInterface(XSet.class, xSMgr);<NEW_LINE>// insert basic jurt factories<NEW_LINE>insertBasicFactories(xSet, xImpLoader);<NEW_LINE>return xContext;<NEW_LINE>} | = new Object[] { xSMgr }; |
941,034 | public boolean tryReadElementFromXml(EwsServiceXmlReader reader) throws Exception {<NEW_LINE>if (reader.getLocalName().equalsIgnoreCase(XmlElementNames.UserId)) {<NEW_LINE>this.userId = new UserId();<NEW_LINE>this.userId.loadFromXml(reader, reader.getLocalName());<NEW_LINE>return true;<NEW_LINE>} else if (reader.getLocalName().equalsIgnoreCase(XmlElementNames.CanCreateItems)) {<NEW_LINE>this.canCreateItems = reader.readValue(Boolean.class);<NEW_LINE>return true;<NEW_LINE>} else if (reader.getLocalName().equalsIgnoreCase(XmlElementNames.CanCreateSubFolders)) {<NEW_LINE>this.canCreateSubFolders = reader.readValue(Boolean.class);<NEW_LINE>return true;<NEW_LINE>} else if (reader.getLocalName().equalsIgnoreCase(XmlElementNames.IsFolderOwner)) {<NEW_LINE>this.isFolderOwner = reader.readValue(Boolean.class);<NEW_LINE>return true;<NEW_LINE>} else if (reader.getLocalName().equalsIgnoreCase(XmlElementNames.IsFolderVisible)) {<NEW_LINE>this.isFolderVisible = reader.readValue(Boolean.class);<NEW_LINE>return true;<NEW_LINE>} else if (reader.getLocalName().equalsIgnoreCase(XmlElementNames.IsFolderContact)) {<NEW_LINE>this.isFolderContact = reader.readValue(Boolean.class);<NEW_LINE>return true;<NEW_LINE>} else if (reader.getLocalName().equalsIgnoreCase(XmlElementNames.EditItems)) {<NEW_LINE>this.editItems = reader.readValue(PermissionScope.class);<NEW_LINE>return true;<NEW_LINE>} else if (reader.getLocalName().equalsIgnoreCase(XmlElementNames.DeleteItems)) {<NEW_LINE>this.deleteItems = <MASK><NEW_LINE>return true;<NEW_LINE>} else if (reader.getLocalName().equalsIgnoreCase(XmlElementNames.ReadItems)) {<NEW_LINE>this.readItems = reader.readValue(FolderPermissionReadAccess.class);<NEW_LINE>return true;<NEW_LINE>} else if (reader.getLocalName().equalsIgnoreCase(XmlElementNames.PermissionLevel) || reader.getLocalName().equalsIgnoreCase(XmlElementNames.CalendarPermissionLevel)) {<NEW_LINE>this.permissionLevel = reader.readValue(FolderPermissionLevel.class);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | reader.readValue(PermissionScope.class); |
1,093,203 | protected ChainProcessor<TorrentContext> createTorrentProcessor() {<NEW_LINE>ProcessingStage<TorrentContext> stage5 = new SeedStage<>(null, torrentRegistry);<NEW_LINE>ProcessingStage<TorrentContext> stage4 = new ProcessTorrentStage<>(stage5, torrentRegistry, peerRegistry, trackerService, eventSink);<NEW_LINE>ProcessingStage<TorrentContext> stage3 = new ChooseFilesStage<>(stage4, torrentRegistry, config);<NEW_LINE>ProcessingStage<TorrentContext> stage2 = new InitializeTorrentProcessingStage<>(stage3, connectionPool, torrentRegistry, <MASK><NEW_LINE>ProcessingStage<TorrentContext> stage1 = new CreateSessionStage<>(stage2, torrentRegistry, eventSource, connectionSource, messageDispatcher, messagingAgents, config);<NEW_LINE>ProcessingStage<TorrentContext> stage0 = new FetchTorrentStage(stage1, eventSink);<NEW_LINE>return new ChainProcessor<>(stage0, executor, new TorrentContextFinalizer<>(torrentRegistry, eventSink));<NEW_LINE>} | dataWorker, bufferedPieceRegistry, eventSink, config); |
378,642 | public UserCredentials obtainCredentials(String realm, UserCredentials userCredentials, int reasonCode) {<NEW_LINE>String errorMessage = null;<NEW_LINE>if (reasonCode == WRONG_PASSWORD || reasonCode == WRONG_USERNAME) {<NEW_LINE>errorMessage = GuiActivator.getResources().getI18NString("service.gui.AUTHENTICATION_FAILED", new String[] { realm });<NEW_LINE>}<NEW_LINE>AuthenticationWindow loginWindow = null;<NEW_LINE>String userName = userCredentials.getUserName();<NEW_LINE>char[] password = userCredentials.getPassword();<NEW_LINE>ImageIcon icon = AuthenticationWindow.getAuthenticationWindowIcon(protocolProvider);<NEW_LINE>if (errorMessage == null)<NEW_LINE>loginWindow = new AuthenticationWindow(userName, password, realm, isUserNameEditable, icon);<NEW_LINE>else<NEW_LINE>loginWindow = new AuthenticationWindow(userName, password, realm, isUserNameEditable, icon, errorMessage);<NEW_LINE>loginWindow.setVisible(true);<NEW_LINE>if (!loginWindow.isCanceled()) {<NEW_LINE>userCredentials.setUserName(loginWindow.getUserName());<NEW_LINE>userCredentials.setPassword(loginWindow.getPassword());<NEW_LINE>userCredentials.<MASK><NEW_LINE>} else {<NEW_LINE>userCredentials.setUserName(null);<NEW_LINE>userCredentials = null;<NEW_LINE>}<NEW_LINE>return userCredentials;<NEW_LINE>} | setPasswordPersistent(loginWindow.isRememberPassword()); |
1,378,652 | public static HttpHandler addServletDeployment(Container container, DeploymentInfo deploymentInfo, boolean secure) {<NEW_LINE>IdentityService identityService = container.getService(IdentityService.class);<NEW_LINE>boolean devMode = container.isDevMode();<NEW_LINE>try {<NEW_LINE>if (secure) {<NEW_LINE>if (identityService == null)<NEW_LINE>throw new IllegalStateException("No identity service found, make sure " + IdentityService.<MASK><NEW_LINE>identityService.secureDeployment(deploymentInfo);<NEW_LINE>} else {<NEW_LINE>LOG.info("Deploying insecure web context: " + deploymentInfo.getContextPath());<NEW_LINE>}<NEW_LINE>// This will catch anything not handled by Resteasy/Servlets, such as IOExceptions "at the wrong time"<NEW_LINE>deploymentInfo.setExceptionHandler(new WebServiceExceptions.ServletUndertowExceptionHandler(devMode));<NEW_LINE>// Add CORS filter that works for any servlet deployment<NEW_LINE>FilterInfo corsFilterInfo = getCorsFilterInfo(container);<NEW_LINE>if (corsFilterInfo != null) {<NEW_LINE>deploymentInfo.addFilter(corsFilterInfo);<NEW_LINE>deploymentInfo.addFilterUrlMapping(corsFilterInfo.getName(), "*", DispatcherType.REQUEST);<NEW_LINE>deploymentInfo.addFilterUrlMapping(corsFilterInfo.getName(), "*", DispatcherType.FORWARD);<NEW_LINE>}<NEW_LINE>DeploymentManager manager = Servlets.defaultContainer().addDeployment(deploymentInfo);<NEW_LINE>manager.deploy();<NEW_LINE>return manager.start();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>} | class.getName() + " is added before this service"); |
703,886 | public Flux<CommandResponse<ZDiffCommand, Flux<Tuple>>> zDiffWithScores(Publisher<? extends ZDiffCommand> commands) {<NEW_LINE>return execute(commands, command -> {<NEW_LINE>Assert.notNull(command.getKey(), "Key must not be null!");<NEW_LINE>List<Object> args = new ArrayList<>(command.getKeys().size() + 2);<NEW_LINE>args.add(command.getKeys().size());<NEW_LINE>for (ByteBuffer key : command.getKeys()) {<NEW_LINE>args<MASK><NEW_LINE>}<NEW_LINE>args.add("WITHSCORES");<NEW_LINE>Mono<Set<Tuple>> m = write(toByteArray(command.getKeys().get(0)), ByteArrayCodec.INSTANCE, ZDIFF_SCORE, args.toArray());<NEW_LINE>Flux<Tuple> flux = m.flatMapMany(e -> Flux.fromIterable(e));<NEW_LINE>return Mono.just(new CommandResponse<>(command, flux));<NEW_LINE>});<NEW_LINE>} | .add(toByteArray(key)); |
907,930 | public void addAttachments(BlackboardArtifact message, MessageAttachments attachments) throws TskCoreException {<NEW_LINE>// Create attribute<NEW_LINE>BlackboardAttribute blackboardAttribute = BlackboardJsonAttrUtil.toAttribute(ATTACHMENTS_ATTR_TYPE, getModuleName(), attachments);<NEW_LINE>message.addAttribute(blackboardAttribute);<NEW_LINE>// Associate each attachment file with the message.<NEW_LINE>List<BlackboardArtifact> assocObjectArtifacts = new ArrayList<>();<NEW_LINE>Collection<FileAttachment> fileAttachments = attachments.getFileAttachments();<NEW_LINE>for (FileAttachment fileAttachment : fileAttachments) {<NEW_LINE><MASK><NEW_LINE>if (attachedFileObjId >= 0) {<NEW_LINE>AbstractFile attachedFile = message.getSleuthkitCase().getAbstractFileById(attachedFileObjId);<NEW_LINE>DataArtifact artifact = associateAttachmentWithMessage(message, attachedFile);<NEW_LINE>assocObjectArtifacts.add(artifact);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Optional<Long> ingestJobId = getIngestJobId();<NEW_LINE>getSleuthkitCase().getBlackboard().postArtifacts(assocObjectArtifacts, getModuleName(), ingestJobId.orElse(null));<NEW_LINE>} catch (BlackboardException ex) {<NEW_LINE>throw new TskCoreException("Error posting TSK_ASSOCIATED_ARTIFACT artifacts for attachments", ex);<NEW_LINE>}<NEW_LINE>} | long attachedFileObjId = fileAttachment.getObjectId(); |
1,594,331 | private void initCommandBehaviorConstant(String c, boolean complete) {<NEW_LINE>if (c != null) {<NEW_LINE>if (c.equalsIgnoreCase("SoftKey")) {<NEW_LINE>Display.getInstance().setCommandBehavior(Display.COMMAND_BEHAVIOR_SOFTKEY);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (c.equalsIgnoreCase("Touch")) {<NEW_LINE>Display.getInstance().setCommandBehavior(Display.COMMAND_BEHAVIOR_TOUCH_MENU);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (c.equalsIgnoreCase("Bar")) {<NEW_LINE>Display.getInstance().setCommandBehavior(Display.COMMAND_BEHAVIOR_BUTTON_BAR);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (c.equalsIgnoreCase("Title")) {<NEW_LINE>Display.getInstance(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (c.equalsIgnoreCase("Right")) {<NEW_LINE>Display.getInstance().setCommandBehavior(Display.COMMAND_BEHAVIOR_BUTTON_BAR_TITLE_RIGHT);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (c.equalsIgnoreCase("Native")) {<NEW_LINE>Display.getInstance().setCommandBehavior(Display.COMMAND_BEHAVIOR_NATIVE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (c.equalsIgnoreCase("ICS")) {<NEW_LINE>Display.getInstance().setCommandBehavior(Display.COMMAND_BEHAVIOR_ICS);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (c.equalsIgnoreCase("SIDE")) {<NEW_LINE>Log.p("WARNING: Theme sets the commandBehavior constant which is deprecated. Please update the theme to NOT include this theme constant. Using commandBehavior may cause your app to perform in unexpected ways. In particular, using SIDE command behavior in conjunction with Toolbar.setOnTopSideMenu(true) may result in runtime exceptions.", Log.WARNING);<NEW_LINE>Display.getInstance().setCommandBehavior(Display.COMMAND_BEHAVIOR_SIDE_NAVIGATION);<NEW_LINE>setMenuBarClass(SideMenuBar.class);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (complete) {<NEW_LINE>Display.getInstance().setCommandBehavior(Display.COMMAND_BEHAVIOR_DEFAULT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).setCommandBehavior(Display.COMMAND_BEHAVIOR_BUTTON_BAR_TITLE_BACK); |
958,337 | public static void customize(Breakpoint b) {<NEW_LINE>JComponent c = getCustomizerComponent(b);<NEW_LINE>HelpCtx helpCtx = HelpCtx.findHelp(c);<NEW_LINE>if (helpCtx == null) {<NEW_LINE>// NOI18N<NEW_LINE>helpCtx = new HelpCtx("debug.add.breakpoint");<NEW_LINE>}<NEW_LINE>Controller cc;<NEW_LINE>if (c instanceof ControllerProvider) {<NEW_LINE>cc = ((ControllerProvider) c).getController();<NEW_LINE>} else {<NEW_LINE>cc = (Controller) c;<NEW_LINE>}<NEW_LINE>final Controller[] cPtr = new Controller[] { cc };<NEW_LINE>final DialogDescriptor[] descriptorPtr = new DialogDescriptor[1];<NEW_LINE>final Dialog[] dialogPtr = new Dialog[1];<NEW_LINE>ActionListener buttonsActionListener = new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent ev) {<NEW_LINE>if (descriptorPtr[0].getValue() == DialogDescriptor.OK_OPTION) {<NEW_LINE>boolean ok = cPtr[0].ok();<NEW_LINE>if (ok) {<NEW_LINE>dialogPtr[0].setVisible(false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dialogPtr[0].setVisible(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>DialogDescriptor descriptor = new DialogDescriptor(c, // NOI18N<NEW_LINE>NbBundle.// NOI18N<NEW_LINE>getMessage(// NOI18N<NEW_LINE>BreakpointsActionsProvider.class, "CTL_Breakpoint_Customizer_Title"), true, DialogDescriptor.OK_CANCEL_OPTION, DialogDescriptor.OK_OPTION, DialogDescriptor.DEFAULT_ALIGN, helpCtx, buttonsActionListener);<NEW_LINE>descriptor.setClosingOptions<MASK><NEW_LINE>Dialog d = DialogDisplayer.getDefault().createDialog(descriptor);<NEW_LINE>d.pack();<NEW_LINE>descriptorPtr[0] = descriptor;<NEW_LINE>dialogPtr[0] = d;<NEW_LINE>d.setVisible(true);<NEW_LINE>} | (new Object[] {}); |
948,989 | // @Override<NEW_LINE>public void start(final Stage primaryStage) {<NEW_LINE>Screen screen = Screen.getPrimary();<NEW_LINE>Rectangle2D bounds = screen.getVisualBounds();<NEW_LINE>primaryStage.setX(0);<NEW_LINE>primaryStage.setY(0);<NEW_LINE>final VBox mainBox = new VBox(30);<NEW_LINE><MASK><NEW_LINE>final Scene globalScene = new Scene(new Group(), bounds.getWidth(), bounds.getHeight());<NEW_LINE>final TestBuilder builder = TestBuilder.getInstance();<NEW_LINE>Label welcome = new Label("Welcome to Hello Sanity");<NEW_LINE>Button bControls = new Button("Controls");<NEW_LINE>bControls.setOnAction(e -> builder.controlTest(globalScene, mainBox));<NEW_LINE>Button bTabs = new Button("Tabs and Menus");<NEW_LINE>bTabs.setOnAction(e -> builder.menusTest(globalScene, mainBox, primaryStage));<NEW_LINE>Button bWins = new Button("Windows");<NEW_LINE>bWins.setOnAction(e -> builder.windowsTest(globalScene, mainBox, primaryStage));<NEW_LINE>Button bAnim = new Button("Animation");<NEW_LINE>bAnim.setOnAction(e -> builder.animationTest(globalScene, mainBox));<NEW_LINE>Button bEffs = new Button("Effects");<NEW_LINE>bEffs.setOnAction(e -> builder.effectsTest(globalScene, mainBox));<NEW_LINE>Button bgestures = new Button("Gesture Actions");<NEW_LINE>bgestures.setOnAction(e -> builder.GestureTest(globalScene, mainBox));<NEW_LINE>Button bquit = new Button("Quit");<NEW_LINE>bquit.setOnAction(e -> primaryStage.close());<NEW_LINE>mainBox.getChildren().addAll(welcome, bControls, bTabs, bWins, bAnim, bEffs, bgestures, bquit);<NEW_LINE>globalScene.setRoot(mainBox);<NEW_LINE>globalScene.getStylesheets().add("hello/HelloSanityStyles.css");<NEW_LINE>primaryStage.setScene(globalScene);<NEW_LINE>primaryStage.show();<NEW_LINE>} | mainBox.setAlignment(Pos.CENTER); |
1,756,362 | public static RequestMapping convertRequestMappingToAnnotation(org.springframework.integration.http.inbound.RequestMapping requestMapping) {<NEW_LINE>if (ObjectUtils.isEmpty(requestMapping.getPathPatterns())) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Map<String, Object> requestMappingAttributes = new HashMap<>();<NEW_LINE>requestMappingAttributes.put("name", requestMapping.getName());<NEW_LINE>requestMappingAttributes.put("value", requestMapping.getPathPatterns());<NEW_LINE>requestMappingAttributes.put("path", requestMapping.getPathPatterns());<NEW_LINE>requestMappingAttributes.put("method", requestMapping.getRequestMethods());<NEW_LINE>requestMappingAttributes.put("params", requestMapping.getParams());<NEW_LINE>requestMappingAttributes.put(<MASK><NEW_LINE>requestMappingAttributes.put("consumes", requestMapping.getConsumes());<NEW_LINE>requestMappingAttributes.put("produces", requestMapping.getProduces());<NEW_LINE>return AnnotationUtils.synthesizeAnnotation(requestMappingAttributes, RequestMapping.class, null);<NEW_LINE>} | "headers", requestMapping.getHeaders()); |
872,913 | private void importProject(final Uri projectUri) {<NEW_LINE>String PROJECT_EXTENSION = getApplicationContext().getString(R.string.share_extension_filter);<NEW_LINE>String scheme = projectUri.getScheme();<NEW_LINE>Log.<MASK><NEW_LINE>Log.i(LOG_TAG, "receiveProject(path): " + projectUri.getPath());<NEW_LINE>// if scheme isn't file or content, skip import<NEW_LINE>if (scheme == null || !(scheme.equals(ContentResolver.SCHEME_FILE) || scheme.equals(ContentResolver.SCHEME_CONTENT))) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// if scheme is file, then skip if filename doesn't have scratchjr project extension<NEW_LINE>if (scheme.equals(ContentResolver.SCHEME_FILE) && !projectUri.getPath().matches(PROJECT_EXTENSION)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>_ioManager.receiveProject(ScratchJrActivity.this, projectUri);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | i(LOG_TAG, "receiveProject(scheme): " + scheme); |
656,671 | Optional<MesosSchedulerDriver> initMesosSchedulerDriverWithTimeout(MesosSchedulerCallbackHandler mesosSchedulerCallbackHandler, Protos.FrameworkInfo framework) {<NEW_LINE>ExecutorService executorService = Executors.newSingleThreadExecutor();<NEW_LINE>int mesosSchedulerDriverInitTimeoutSec = masterConfig.getMesosSchedulerDriverInitTimeoutSec();<NEW_LINE>logger.info("initializing mesos scheduler driver with timeout of {} sec", mesosSchedulerDriverInitTimeoutSec);<NEW_LINE>Optional<MesosSchedulerDriver> mesosSchedulerDriverO = Optional.empty();<NEW_LINE>try {<NEW_LINE>Future<MesosSchedulerDriver> driverF = executorService.submit(() -> new MesosSchedulerDriver(mesosSchedulerCallbackHandler, framework, masterConfig.getMasterLocation()));<NEW_LINE>MesosSchedulerDriver mesosSchedulerDriver = driverF.get(mesosSchedulerDriverInitTimeoutSec, TimeUnit.SECONDS);<NEW_LINE>mesosSchedulerDriverO = Optional.ofNullable(mesosSchedulerDriver);<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>executorService.shutdown();<NEW_LINE>}<NEW_LINE>return mesosSchedulerDriverO;<NEW_LINE>} | logger.info("failed to initialize MesosSchedulerDriver", e); |
955,191 | private void writeModelContent(final String string) throws IOException {<NEW_LINE>if (string.matches(" +")) {<NEW_LINE>writer.write(" ");<NEW_LINE>} else if (string.startsWith("<html")) {<NEW_LINE>String output = string.substring(6);<NEW_LINE>int start = output.indexOf("<body");<NEW_LINE>if (start == -1) {<NEW_LINE>start = output.indexOf('>') + 1;<NEW_LINE>} else {<NEW_LINE>start = output.indexOf('>', start + 5) + 1;<NEW_LINE>}<NEW_LINE>int end = output.indexOf("</body>");<NEW_LINE>if (end == -1) {<NEW_LINE>end = output.indexOf("</html>");<NEW_LINE>}<NEW_LINE>if (end == -1) {<NEW_LINE>end = output.length();<NEW_LINE>}<NEW_LINE>output = output.substring(start, end);<NEW_LINE>boolean startsWithParagraph = PARAGRAPH_PATTERN.matcher(output).find();<NEW_LINE>if (!startsWithParagraph)<NEW_LINE>writer.write("<p>");<NEW_LINE>writer.write(output);<NEW_LINE>} else {<NEW_LINE>writer.write<MASK><NEW_LINE>}<NEW_LINE>} | (HtmlUtils.unicodeToHTMLUnicodeEntity(string)); |
433,911 | protected BlockWriteRequestContext createRequestContext(alluxio.grpc.WriteRequest msg) throws Exception {<NEW_LINE>long bytesToReserve = FILE_BUFFER_SIZE;<NEW_LINE>if (msg.getCommand().hasSpaceToReserve()) {<NEW_LINE>bytesToReserve = msg.getCommand().getSpaceToReserve();<NEW_LINE>}<NEW_LINE>BlockWriteRequestContext context <MASK><NEW_LINE>BlockWriteRequest request = context.getRequest();<NEW_LINE>mWorker.createBlock(request.getSessionId(), request.getId(), request.getTier(), request.getMediumType(), bytesToReserve);<NEW_LINE>if (mDomainSocketEnabled) {<NEW_LINE>context.setCounter(MetricsSystem.counter(MetricKey.WORKER_BYTES_WRITTEN_DOMAIN.getName()));<NEW_LINE>context.setMeter(MetricsSystem.meter(MetricKey.WORKER_BYTES_WRITTEN_DOMAIN_THROUGHPUT.getName()));<NEW_LINE>} else {<NEW_LINE>context.setCounter(MetricsSystem.counter(MetricKey.WORKER_BYTES_WRITTEN_REMOTE.getName()));<NEW_LINE>context.setMeter(MetricsSystem.meter(MetricKey.WORKER_BYTES_WRITTEN_REMOTE_THROUGHPUT.getName()));<NEW_LINE>}<NEW_LINE>RPC_WRITE_COUNT.inc();<NEW_LINE>return context;<NEW_LINE>} | = new BlockWriteRequestContext(msg, bytesToReserve); |
1,487,383 | public String invoke(ObjectName bean, String operation, String... params) throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException, MBeanException {<NEW_LINE>MBeanInfo mbinfo = mserver.getMBeanInfo(bean);<NEW_LINE>MBeanOperationInfo op = null;<NEW_LINE>for (MBeanOperationInfo oi : mbinfo.getOperations()) {<NEW_LINE>if (oi.getName().equalsIgnoreCase(operation) && oi.getSignature().length == params.length) {<NEW_LINE>if (op != null) {<NEW_LINE>throw new IllegalArgumentException("Ambiguous " + operation + "/" + params.length + " operatition signature for " + bean);<NEW_LINE>}<NEW_LINE>op = oi;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (op == null) {<NEW_LINE>throw new IllegalArgumentException("Operation " + operation + "/" + params.length + " not found for " + bean);<NEW_LINE>}<NEW_LINE>Object[] args = new Object[params.length];<NEW_LINE>String[] sig = new String[params.length];<NEW_LINE>for (int i = 0; i != params.length; ++i) {<NEW_LINE>args[i] = convert(params[i], op.getSignature()[i].getType());<NEW_LINE>sig[i] = op.getSignature()[i].getType();<NEW_LINE>}<NEW_LINE>return format(mserver.invoke(bean, op.getName(), args, sig<MASK><NEW_LINE>} | ), op.getReturnType()); |
958,636 | public void deleteProcessRule(HttpServletRequest request, RuleEngineEntity engineEntity) throws GovernanceException {<NEW_LINE>try {<NEW_LINE>if (!this.checkProcessorExist(request)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String deleteUrl = new StringBuffer(this.getProcessorUrl()).append(ConstantProperties.PROCESSOR_DELETE_CEP_RULE).append(ConstantProperties.QUESTION_MARK).append("id=").append(engineEntity.getId()).toString();<NEW_LINE>log.info(<MASK><NEW_LINE>CloseableHttpResponse closeResponse = commonService.getCloseResponse(request, deleteUrl);<NEW_LINE>String mes = EntityUtils.toString(closeResponse.getEntity());<NEW_LINE>log.info("delete rule result:{}", mes);<NEW_LINE>// deal processor result<NEW_LINE>int statusCode = closeResponse.getStatusLine().getStatusCode();<NEW_LINE>if (200 != statusCode) {<NEW_LINE>log.error(ErrorCode.PROCESS_CONNECT_ERROR.getCodeDesc());<NEW_LINE>throw new GovernanceException(ErrorCode.PROCESS_CONNECT_ERROR);<NEW_LINE>}<NEW_LINE>Map jsonObject = JsonHelper.json2Object(mes, Map.class);<NEW_LINE>Integer code = Integer.valueOf(jsonObject.get("errorCode").toString());<NEW_LINE>if (PROCESSOR_SUCCESS_CODE != code) {<NEW_LINE>String msg = jsonObject.get("errorMsg").toString();<NEW_LINE>throw new GovernanceException(msg);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("processor delete ruleEngine fail ! {}", e.getMessage());<NEW_LINE>throw new GovernanceException("processor delete ruleEngine fail ", e);<NEW_LINE>}<NEW_LINE>} | "processor delete begin,id:{}", engineEntity.getId()); |
285,625 | protected final void updateTags(String fqn, String fieldName, List<TagLabel> origTags, List<TagLabel> updatedTags) throws IOException {<NEW_LINE>// Remove current entity tags in the database. It will be added back later from the merged tag list.<NEW_LINE>origTags = listOrEmpty(origTags);<NEW_LINE>// updatedTags cannot be immutable list, as we are adding the origTags to updatedTags even if its empty.<NEW_LINE>updatedTags = Optional.ofNullable(updatedTags).orElse(new ArrayList<>());<NEW_LINE>if (origTags.isEmpty() && updatedTags.isEmpty()) {<NEW_LINE>// Nothing to update<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Remove current entity tags in the database. It will be added back later from the merged tag list.<NEW_LINE>daoCollection.tagDAO().deleteTags(fqn);<NEW_LINE>if (operation.isPut()) {<NEW_LINE>// PUT operation merges tags in the request with what already exists<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>List<TagLabel> addedTags = new ArrayList<>();<NEW_LINE>List<TagLabel> deletedTags = new ArrayList<>();<NEW_LINE>recordListChange(fieldName, origTags, updatedTags, addedTags, deletedTags, EntityUtil.tagLabelMatch);<NEW_LINE>updatedTags.sort(compareTagLabel);<NEW_LINE>applyTags(updatedTags, fqn);<NEW_LINE>} | EntityUtil.mergeTags(updatedTags, origTags); |
1,165,717 | private List<Token> commentToLines(Token commentToken, int commentStartPositionInLine) {<NEW_LINE>List<Token> lines = new ArrayList<>();<NEW_LINE>int tab = this.options.tab_size;<NEW_LINE>String commentText = this.tm.toString(commentToken);<NEW_LINE>int commentStartPosition = commentStartPositionInLine;<NEW_LINE>if (commentStartPosition < 0)<NEW_LINE>commentStartPosition = this.tm.findSourcePositionInLine(commentToken.originalStart);<NEW_LINE>int positionInLine = commentStartPosition;<NEW_LINE>int lineStart = 0;<NEW_LINE>int breaksBeforeFirstLine = 0;<NEW_LINE>// all lines except first will be NotAToken to disable asterisk adding<NEW_LINE>boolean firstLine = true;<NEW_LINE>boolean emptyLine = true;<NEW_LINE>for (int i = 0; i < commentText.length(); i++) {<NEW_LINE>char c = commentText.charAt(i);<NEW_LINE>switch(c) {<NEW_LINE>case ' ':<NEW_LINE>if ((lineStart == i && positionInLine < commentStartPosition) || (emptyLine && positionInLine == commentToken.getIndent() - 1))<NEW_LINE>lineStart = i + 1;<NEW_LINE>positionInLine++;<NEW_LINE>break;<NEW_LINE>case '\t':<NEW_LINE>if ((lineStart == i && positionInLine < commentStartPosition) || (emptyLine && positionInLine == commentToken.getIndent() - 1))<NEW_LINE>lineStart = i + 1;<NEW_LINE>if (tab > 0)<NEW_LINE>positionInLine += tab - positionInLine % tab;<NEW_LINE>break;<NEW_LINE>case '\r':<NEW_LINE>case '\n':<NEW_LINE>if (lineStart < i) {<NEW_LINE>Token line = new Token(commentToken.originalStart + lineStart, commentToken.originalStart + i - 1, firstLine ? commentToken.tokenType : TokenNameNotAToken);<NEW_LINE>line.breakAfter();<NEW_LINE>if (lines.isEmpty())<NEW_LINE>line.putLineBreaksBefore(breaksBeforeFirstLine);<NEW_LINE>lines.add(line);<NEW_LINE>} else if (!lines.isEmpty()) {<NEW_LINE>Token previousLine = lines.get(lines.size() - 1);<NEW_LINE>previousLine.putLineBreaksAfter(previousLine.getLineBreaksAfter() + 1);<NEW_LINE>} else {<NEW_LINE>breaksBeforeFirstLine++;<NEW_LINE>}<NEW_LINE>if (i + 1 < commentText.length() && commentText.charAt(i + 1) == (c == '\r' ? '\n' : '\r'))<NEW_LINE>i++;<NEW_LINE>lineStart = i + 1;<NEW_LINE>positionInLine = 0;<NEW_LINE>firstLine = false;<NEW_LINE>emptyLine = true;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>positionInLine++;<NEW_LINE>emptyLine = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (lineStart < commentText.length()) {<NEW_LINE>Token line = new Token(commentToken.originalStart + lineStart, commentToken.originalEnd, firstLine ? commentToken.tokenType : TokenNameNotAToken);<NEW_LINE><MASK><NEW_LINE>lines.add(line);<NEW_LINE>}<NEW_LINE>return lines;<NEW_LINE>} | line.setWrapPolicy(WrapPolicy.DISABLE_WRAP); |
628,285 | static ByteBuf inflateWithByteArray(ByteBufAllocator alloc, ByteBuf in, Inflater inflater) {<NEW_LINE>ByteBuf out = null;<NEW_LINE>ByteBuf buf = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>int len = in.readableBytes();<NEW_LINE>final byte[] input = ByteBufUtil.getBytes(in, readerIndex, len, false);<NEW_LINE>inflater.setInput(input);<NEW_LINE>out = alloc.buffer();<NEW_LINE>buf = alloc.heapBuffer(ZLIB_BUFFER_SIZE, ZLIB_BUFFER_SIZE);<NEW_LINE>int offset = buf.arrayOffset();<NEW_LINE>byte[] buffer = buf.array();<NEW_LINE>while (!inflater.finished()) {<NEW_LINE>int read = inflater.inflate(buffer, offset, ZLIB_BUFFER_SIZE);<NEW_LINE>buf.writerIndex(read);<NEW_LINE>out.writeBytes(buf);<NEW_LINE>buf.clear();<NEW_LINE>}<NEW_LINE>return out;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (out != null) {<NEW_LINE>ReferenceCountUtil.safeRelease(out);<NEW_LINE>}<NEW_LINE>throw Exceptions.propagate(e);<NEW_LINE>} finally {<NEW_LINE>if (buf != null && buf.refCnt() > 0) {<NEW_LINE>buf.release();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int readerIndex = in.readerIndex(); |
334,674 | public void addAdvancedMsgListener(MethodCall call, final MethodChannel.Result result) {<NEW_LINE>final String listenerUuid = CommonUtil.getParam(call, result, "listenerUuid");<NEW_LINE>listenerUuidList.add(listenerUuid);<NEW_LINE>final V2TIMAdvancedMsgListener advacedMessageListener = new V2TIMAdvancedMsgListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRecvNewMessage(V2TIMMessage msg) {<NEW_LINE>makeAddAdvancedMsgListenerEventData("onRecvNewMessage", CommonUtil.convertV2TIMMessageToMap(msg), listenerUuid);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRecvC2CReadReceipt(List<V2TIMMessageReceipt> receiptList) {<NEW_LINE>List<Object> list = new LinkedList<Object>();<NEW_LINE>for (int i = 0; i < receiptList.size(); i++) {<NEW_LINE>list.add(CommonUtil.convertV2TIMMessageReceiptToMap(receiptList.get(i)));<NEW_LINE>}<NEW_LINE>makeAddAdvancedMsgListenerEventData("onRecvC2CReadReceipt", list, listenerUuid);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRecvMessageRevoked(String msgID) {<NEW_LINE>makeAddAdvancedMsgListenerEventData("onRecvMessageRevoked", msgID, listenerUuid);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRecvMessageModified(V2TIMMessage msg) {<NEW_LINE>makeAddAdvancedMsgListenerEventData("onRecvMessageModified", CommonUtil<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>advancedMessageListenerList.put(listenerUuid, advacedMessageListener);<NEW_LINE>V2TIMManager.getMessageManager().addAdvancedMsgListener(advacedMessageListener);<NEW_LINE>result.success("add advance msg listener success");<NEW_LINE>} | .convertV2TIMMessageToMap(msg), listenerUuid); |
373,408 | public void marshall(CreateKeyRequest createKeyRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createKeyRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getPolicy(), POLICY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getKeyUsage(), KEYUSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getCustomerMasterKeySpec(), CUSTOMERMASTERKEYSPEC_BINDING);<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getKeySpec(), KEYSPEC_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getCustomKeyStoreId(), CUSTOMKEYSTOREID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getBypassPolicyLockoutSafetyCheck(), BYPASSPOLICYLOCKOUTSAFETYCHECK_BINDING);<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getMultiRegion(), MULTIREGION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createKeyRequest.getOrigin(), ORIGIN_BINDING); |
1,291,737 | private void editItem(final int position) {<NEW_LINE>final KeyValue keyValue = filteredItems.get(position);<NEW_LINE>final String key = keyValue.key;<NEW_LINE>final SettingsUtils.SettingsType type = keyValue.type;<NEW_LINE>int inputType = 0;<NEW_LINE>switch(type) {<NEW_LINE>case TYPE_INTEGER:<NEW_LINE>case TYPE_LONG:<NEW_LINE>inputType = InputType.TYPE_CLASS_NUMBER <MASK><NEW_LINE>break;<NEW_LINE>case TYPE_FLOAT:<NEW_LINE>inputType = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_NORMAL | InputType.TYPE_NUMBER_FLAG_DECIMAL;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_NORMAL;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Dialogs.input(this, String.format(getString(R.string.edit_setting), key), keyValue.value, null, inputType, 1, 1, newValue -> {<NEW_LINE>final SharedPreferences.Editor editor = prefs.edit();<NEW_LINE>try {<NEW_LINE>SettingsUtils.putValue(editor, type, key, newValue);<NEW_LINE>editor.apply();<NEW_LINE>debugAdapter.remove(keyValue);<NEW_LINE>debugAdapter.insert(new KeyValue(key, newValue, type), position);<NEW_LINE>} catch (XmlPullParserException e) {<NEW_LINE>showToast(R.string.edit_setting_error_unknown_type);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>showToast(String.format(getString(R.string.edit_setting_error_invalid_data), newValue));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | | InputType.TYPE_NUMBER_VARIATION_NORMAL | InputType.TYPE_NUMBER_FLAG_SIGNED; |
911,150 | protected void acceptLoop(ServerSocketChannel ssc) {<NEW_LINE>long successfull_accepts = 0;<NEW_LINE>long failed_accepts = 0;<NEW_LINE>while (!destroyed) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>successfull_accepts++;<NEW_LINE>if (!(allow_external_access || socket_channel.socket().getInetAddress().isLoopbackAddress())) {<NEW_LINE>if (Logger.isEnabled())<NEW_LINE>Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, "AEProxy: incoming connection from '" + socket_channel.socket().getInetAddress() + "' - closed as not local"));<NEW_LINE>socket_channel.close();<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>socket_channel.configureBlocking(false);<NEW_LINE>socket_channel.socket().setTcpNoDelay(true);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>socket_channel.close();<NEW_LINE>throw (e);<NEW_LINE>}<NEW_LINE>AEProxyConnectionImpl processor = new AEProxyConnectionImpl(this, socket_channel, proxy_handler);<NEW_LINE>if (!processor.isClosed()) {<NEW_LINE>boolean added = false;<NEW_LINE>try {<NEW_LINE>this_mon.enter();<NEW_LINE>if (!destroyed) {<NEW_LINE>added = true;<NEW_LINE>processors.add(processor);<NEW_LINE>if (Logger.isEnabled())<NEW_LINE>Logger.log(new LogEvent(LOGID, "AEProxy: active processors = " + processors.size()));<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>this_mon.exit();<NEW_LINE>}<NEW_LINE>if (!added) {<NEW_LINE>processor.close();<NEW_LINE>} else {<NEW_LINE>read_selector.register(socket_channel, this, processor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (!destroyed) {<NEW_LINE>failed_accepts++;<NEW_LINE>if (Logger.isEnabled())<NEW_LINE>Logger.log(new LogEvent(LOGID, "AEProxy: listener failed on port " + port, e));<NEW_LINE>if (failed_accepts > 100 && successfull_accepts == 0) {<NEW_LINE>// looks like its not going to work...<NEW_LINE>// some kind of socket problem<NEW_LINE>Logger.logTextResource(new LogAlert(LogAlert.UNREPEATABLE, LogAlert.AT_ERROR, "Network.alert.acceptfail"), new String[] { "" + port, "TCP" });<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | SocketChannel socket_channel = ssc.accept(); |
389,922 | private void liftOverToTargetBuild(final Build37ExtendedIlluminaManifestRecord build37ExtendedIlluminaManifestRecord, final IlluminaManifestRecord illuminaManifestRecord) {<NEW_LINE>final String supportedBuildNumber = illuminaManifestRecord.getMajorGenomeBuild();<NEW_LINE>final File chainFileToTargetBuild = chainFilesMap.get(supportedBuildNumber);<NEW_LINE>final LiftOver liftOver = new LiftOver(chainFileToTargetBuild);<NEW_LINE>final Interval interval = new Interval(illuminaManifestRecord.getChr(), illuminaManifestRecord.getPosition(), illuminaManifestRecord.getPosition());<NEW_LINE>final Interval targetBuildInterval = liftOver.liftOver(interval);<NEW_LINE>if (targetBuildInterval != null) {<NEW_LINE>build37ExtendedIlluminaManifestRecord.b37Chr = targetBuildInterval.getContig();<NEW_LINE>build37ExtendedIlluminaManifestRecord.b37Pos = targetBuildInterval.getStart();<NEW_LINE>// Validate that the reference allele at the lifted over coordinates matches that of the original.<NEW_LINE>String originalRefAllele = getSequenceAt(referenceFilesMap.get(supportedBuildNumber), illuminaManifestRecord.getChr(), illuminaManifestRecord.getPosition(), illuminaManifestRecord.getPosition());<NEW_LINE>String newRefAllele = getSequenceAt(referenceFilesMap.get(targetBuild), build37ExtendedIlluminaManifestRecord.b37Chr, build37ExtendedIlluminaManifestRecord.b37Pos, build37ExtendedIlluminaManifestRecord.b37Pos);<NEW_LINE>if (originalRefAllele.equals(newRefAllele)) {<NEW_LINE>log.debug("Lifted over record " + build37ExtendedIlluminaManifestRecord);<NEW_LINE>log.debug(" From build " + supportedBuildNumber + " chr=" + illuminaManifestRecord.getChr() + ", position=" + illuminaManifestRecord.getPosition() + " To build " + targetBuild + " chr=" + build37ExtendedIlluminaManifestRecord.<MASK><NEW_LINE>} else {<NEW_LINE>build37ExtendedIlluminaManifestRecord.flag = Build37ExtendedIlluminaManifestRecord.Flag.LIFTOVER_FAILED;<NEW_LINE>log.error("Liftover failed for record: " + build37ExtendedIlluminaManifestRecord);<NEW_LINE>log.error(" Sequence at lifted over position does not match that at original position");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>build37ExtendedIlluminaManifestRecord.flag = Build37ExtendedIlluminaManifestRecord.Flag.LIFTOVER_FAILED;<NEW_LINE>log.error("Liftover failed for record: " + build37ExtendedIlluminaManifestRecord);<NEW_LINE>}<NEW_LINE>} | b37Chr + ", position=" + build37ExtendedIlluminaManifestRecord.b37Pos); |
142,406 | protected Map<String, JsonRpcMethod> create(final PrivacyController privacyController, final PrivacyIdProvider privacyIdProvider, final PrivateMarkerTransactionFactory privateMarkerTransactionFactory) {<NEW_LINE>if (privacyParameters.isPrivacyPluginEnabled()) {<NEW_LINE>return mapOf(new PluginEeaSendRawTransaction(transactionPool, privacyIdProvider, privateMarkerTransactionFactory, nonceProvider, privacyController, getGasCalculator()), <MASK><NEW_LINE>} else if (getPrivacyParameters().isFlexiblePrivacyGroupsEnabled()) {<NEW_LINE>return mapOf(new RestrictedFlexibleEeaSendRawTransaction(transactionPool, privacyIdProvider, privateMarkerTransactionFactory, nonceProvider, privacyController), new PrivGetEeaTransactionCount(privacyController, privacyIdProvider));<NEW_LINE>} else {<NEW_LINE>// off chain privacy<NEW_LINE>return mapOf(new RestrictedOffchainEeaSendRawTransaction(transactionPool, privacyIdProvider, privateMarkerTransactionFactory, nonceProvider, privacyController), new PrivGetEeaTransactionCount(privacyController, privacyIdProvider));<NEW_LINE>}<NEW_LINE>} | new PrivGetEeaTransactionCount(privacyController, privacyIdProvider)); |
307,018 | public Concrete.Expression visitLet(Concrete.LetExpression expr, Void params) {<NEW_LINE>try (Utils.ContextSaver ignored = new Utils.ContextSaver(myContext)) {<NEW_LINE>for (Concrete.LetClause clause : expr.getClauses()) {<NEW_LINE>try (Utils.ContextSaver ignored1 = new Utils.ContextSaver(myContext)) {<NEW_LINE>visitParameters(clause.getParameters(), null);<NEW_LINE>if (clause.resultType != null) {<NEW_LINE>clause.resultType = clause.resultType.accept(this, null);<NEW_LINE>}<NEW_LINE>clause.term = clause.term.accept(this, null);<NEW_LINE>}<NEW_LINE>Concrete.Pattern pattern = clause.getPattern();<NEW_LINE>if (pattern instanceof Concrete.NamePattern && ((Concrete.NamePattern) pattern).getRef() != null) {<NEW_LINE>ClassReferable classRef = clause.resultType != null ? new TypeClassReferenceExtractVisitor().getTypeClassReference(clause.resultType) : clause.term instanceof Concrete.NewExpression ? new TypeClassReferenceExtractVisitor().getTypeClassReference(((Concrete.NewExpression) clause.term).expression) : null;<NEW_LINE>addLocalRef(((Concrete.NamePattern) pattern).getRef(), classRef);<NEW_LINE>} else {<NEW_LINE>visitPatterns(Collections.singletonList(pattern), null, new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>expr.expression = expr.expression.accept(this, null);<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>} | HashMap<>(), true); |
1,501,097 | private static void storeReleaseNotes(String releaseNotes, String templateFilePath, String releaseVersion, String releaseDate, String releaseNotesFilePath, Boolean dryRun, Log log) throws IOException {<NEW_LINE>if (Files.notExists(Paths.get(templateFilePath))) {<NEW_LINE>log.warn(String.format("There is no source template file at the given location:%s", templateFilePath));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<String> notesLines = new ArrayList<>();<NEW_LINE>final List<String> lines = Files.readAllLines(Paths.get(templateFilePath), Charset.defaultCharset());<NEW_LINE>for (final String line : lines) {<NEW_LINE>if (line.contains(RELEASE_DATE_PATTERN)) {<NEW_LINE>notesLines.add(line.replace(RELEASE_DATE_PATTERN, releaseDate));<NEW_LINE>} else if (line.contains(LATEST_VERSION_PATTERN)) {<NEW_LINE>notesLines.add(line.replace(LATEST_VERSION_PATTERN, releaseVersion));<NEW_LINE>} else if (line.contains("<h2>Previous releases</h2>")) {<NEW_LINE>notesLines.add("<h2>Pull requests and issues</h2>\n<ul>");<NEW_LINE>notesLines.add(releaseNotes);<NEW_LINE>notesLines.add("</ul>");<NEW_LINE>notesLines.add(line);<NEW_LINE>} else if (line.contains("<ul>")) {<NEW_LINE>notesLines.add(line);<NEW_LINE>notesLines.add(String.format<MASK><NEW_LINE>} else {<NEW_LINE>notesLines.add(line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (Boolean.FALSE.equals(dryRun)) {<NEW_LINE>log.info(String.format("Storing release notes to file %s/%s.html", releaseNotesFilePath, releaseVersion));<NEW_LINE>Files.createDirectories(Paths.get(releaseNotesFilePath));<NEW_LINE>Files.write(Paths.get(String.format("%s/%s.html", releaseNotesFilePath, releaseVersion)), notesLines, Charset.defaultCharset());<NEW_LINE>} else {<NEW_LINE>log.info("Prepared release notes are not stored to file due to dryRun mode");<NEW_LINE>log.info(String.format("File path to store release notes is: %s/%s.html", releaseNotesFilePath, releaseVersion));<NEW_LINE>}<NEW_LINE>} | (" <li><a href=\"%s.html\">Jersey %s Release Notes</a></li>", releaseVersion, releaseVersion)); |
1,565,227 | /*<NEW_LINE>* @see com.sitewhere.microservice.api.event.IDeviceEventManagement#<NEW_LINE>* addDeviceLocations(com.sitewhere.spi.device.event.IDeviceEventContext,<NEW_LINE>* com.sitewhere.spi.device.event.request.IDeviceLocationCreateRequest[])<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public List<IDeviceLocation> addDeviceLocations(IDeviceEventContext context, IDeviceLocationCreateRequest... requests) throws SiteWhereException {<NEW_LINE>List<IDeviceLocation> result = new ArrayList<>();<NEW_LINE>for (IDeviceLocationCreateRequest request : requests) {<NEW_LINE>DeviceLocation location = DeviceEventManagementPersistence.deviceLocationCreateLogic(context, request);<NEW_LINE>Point.Builder builder = InfluxDbDeviceEvent.createBuilder();<NEW_LINE><MASK><NEW_LINE>addUserDefinedTags(context, builder);<NEW_LINE>getClient().getInflux().write(getClient().getConfiguration().getDatabase(), getAssignmentSpecificRetentionPolicy(context), builder.build());<NEW_LINE>result.add(location);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | InfluxDbDeviceLocation.saveToBuilder(location, builder); |
1,326,341 | protected void buildCoordinate(GraphPayload payload, XmlBuilder b) {<NEW_LINE>int width = payload.getWidth();<NEW_LINE>int height = payload.getHeight();<NEW_LINE>int top = payload.getMarginTop();<NEW_LINE>int left = payload.getMarginLeft();<NEW_LINE>int bottom = payload.getMarginBottom();<NEW_LINE>int right = payload.getMarginRight();<NEW_LINE>int h = height - top - bottom;<NEW_LINE>int w = width - left - right;<NEW_LINE><MASK><NEW_LINE>int cols = payload.getColumns();<NEW_LINE>int ystep = h / rows;<NEW_LINE>int xstep = w / cols;<NEW_LINE>PathBuilder p = new PathBuilder();<NEW_LINE>b.tag1("g", "id", "coordinate", "stroke", "#003f7f", "fill", "white");<NEW_LINE>b.tag("path", "id", "xy", "d", p.moveTo(left, top + h).h(w).m(-w, 0).v(-h).build());<NEW_LINE>b.tag("path", "id", "xy-2", "d", p.moveTo(left, top).m(w, 0).v(h).build(), "stroke-dasharray", "1,5");<NEW_LINE>b.tag("path", "id", "lines", "d", p.moveTo(left, top).mark().h(w).m(-w, ystep).repeat(rows - 1).build(), "stroke-dasharray", "1,5");<NEW_LINE>if (rows >= 8) {<NEW_LINE>p.moveTo(left, top).mark().h(-9).m(9, ystep).h(-5).m(5, ystep).repeat(rows / 2 - 1);<NEW_LINE>if (rows % 2 == 0) {<NEW_LINE>p.h(-9).m(9, ystep);<NEW_LINE>}<NEW_LINE>b.tag("path", "id", "ys", "d", p.build());<NEW_LINE>} else {<NEW_LINE>p.moveTo(left, top).mark().h(-7).m(7, ystep).repeat(rows);<NEW_LINE>b.tag("path", "id", "ys", "d", p.build());<NEW_LINE>}<NEW_LINE>if (payload.isAxisXLabelSkipped()) {<NEW_LINE>p.moveTo(left, top + h).mark().v(9).m(xstep, -9).v(5).m(xstep, -5).repeat(cols / 2 - 1);<NEW_LINE>if (cols % 2 == 0) {<NEW_LINE>p.v(9).m(xstep, -9);<NEW_LINE>}<NEW_LINE>b.tag("path", "id", "xs", "d", p.build());<NEW_LINE>} else {<NEW_LINE>p.moveTo(left, top + h).mark().v(7).m(xstep, -7).repeat(cols);<NEW_LINE>b.tag("path", "id", "xs", "d", p.build());<NEW_LINE>}<NEW_LINE>b.tag2("g");<NEW_LINE>} | int rows = payload.getRows(); |
892,959 | private static Artifact createSharedArchive(RuleContext ruleContext, JavaCompilationArtifacts javaArtifacts, JavaTargetAttributes attributes) throws InterruptedException {<NEW_LINE>if (!ruleContext.getRule().isAttrDefined("classlist", BuildType.LABEL)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Artifact classlist = ruleContext.getPrerequisiteArtifact("classlist");<NEW_LINE>if (classlist == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>NestedSet<Artifact> classpath = NestedSetBuilder.<Artifact>stableOrder().addAll(javaArtifacts.getRuntimeJars()).addTransitive(attributes.getRuntimeClassPathForArchive()).build();<NEW_LINE>Artifact jsa = ruleContext.getImplicitOutputArtifact(JavaSemantics.SHARED_ARCHIVE_ARTIFACT);<NEW_LINE>Artifact merged = ruleContext.getDerivedArtifact(jsa.getOutputDirRelativePath(ruleContext.getConfiguration().isSiblingRepositoryLayout()).replaceName(FileSystemUtils.removeExtension(jsa.getRootRelativePath().getBaseName()) + "-merged.jar"), jsa.getRoot());<NEW_LINE>SingleJarActionBuilder.createSingleJarAction(ruleContext, classpath, merged);<NEW_LINE>JavaRuntimeInfo javaRuntime = JavaRuntimeInfo.from(ruleContext);<NEW_LINE>Artifact configFile = ruleContext.getPrerequisiteArtifact("cds_config_file");<NEW_LINE>CustomCommandLine.Builder commandLine = CustomCommandLine.builder().add("-Xshare:dump").addFormatted("-XX:SharedArchiveFile=%s", jsa.getExecPath()).addFormatted(<MASK><NEW_LINE>if (configFile != null) {<NEW_LINE>commandLine.addFormatted("-XX:SharedArchiveConfigFile=%s", configFile.getExecPath());<NEW_LINE>}<NEW_LINE>commandLine.add("-cp").addExecPath(merged);<NEW_LINE>SpawnAction.Builder spawnAction = new SpawnAction.Builder();<NEW_LINE>if (ruleContext.getRule().isAttrDefined("jvm_flags_for_cds_image_creation", Type.STRING_LIST)) {<NEW_LINE>commandLine.addAll(ruleContext.getExpander().withDataExecLocations().list("jvm_flags_for_cds_image_creation"));<NEW_LINE>spawnAction.addTransitiveInputs(PrerequisiteArtifacts.nestedSet(ruleContext, "data"));<NEW_LINE>}<NEW_LINE>spawnAction.setExecutable(javaRuntime.javaBinaryExecPathFragment()).addCommandLine(commandLine.build()).setMnemonic("JavaJSA").setProgressMessage("Dumping Java Shared Archive %s", jsa.prettyPrint()).addOutput(jsa).addInput(classlist).addInput(merged).addTransitiveInputs(javaRuntime.javaBaseInputs());<NEW_LINE>if (configFile != null) {<NEW_LINE>spawnAction.addInput(configFile);<NEW_LINE>}<NEW_LINE>ruleContext.registerAction(spawnAction.build(ruleContext));<NEW_LINE>return jsa;<NEW_LINE>} | "-XX:SharedClassListFile=%s", classlist.getExecPath()); |
649,268 | private static Collection<String> createPluginClassPath(IJavaProject javaProject, Set<IProject> projectOnCp) throws CoreException {<NEW_LINE>Set<String> javaClassPath = createJavaClasspath(javaProject, projectOnCp);<NEW_LINE>IPluginModelBase model = PluginRegistry.<MASK><NEW_LINE>if (model == null || model.getPluginBase().getId() == null) {<NEW_LINE>return javaClassPath;<NEW_LINE>}<NEW_LINE>ArrayList<String> pdeClassPath = new ArrayList<>();<NEW_LINE>pdeClassPath.addAll(javaClassPath);<NEW_LINE>BundleDescription target = model.getBundleDescription();<NEW_LINE>Set<BundleDescription> bundles = new HashSet<>();<NEW_LINE>// target is null if plugin uses non OSGI format<NEW_LINE>if (target != null) {<NEW_LINE>addDependentBundles(target, bundles);<NEW_LINE>}<NEW_LINE>// convert default location (relative to wsp) to absolute path<NEW_LINE>IPath defaultOutputLocation = ResourceUtils.relativeToAbsolute(javaProject.getOutputLocation());<NEW_LINE>for (BundleDescription bd : bundles) {<NEW_LINE>appendBundleToClasspath(bd, pdeClassPath, defaultOutputLocation);<NEW_LINE>}<NEW_LINE>if (defaultOutputLocation != null) {<NEW_LINE>String defaultOutput = defaultOutputLocation.toOSString();<NEW_LINE>if (pdeClassPath.indexOf(defaultOutput) > 0) {<NEW_LINE>pdeClassPath.remove(defaultOutput);<NEW_LINE>pdeClassPath.add(0, defaultOutput);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return pdeClassPath;<NEW_LINE>} | findModel(javaProject.getProject()); |
603,239 | final GetCelebrityRecognitionResult executeGetCelebrityRecognition(GetCelebrityRecognitionRequest getCelebrityRecognitionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getCelebrityRecognitionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetCelebrityRecognitionRequest> request = null;<NEW_LINE>Response<GetCelebrityRecognitionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetCelebrityRecognitionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getCelebrityRecognitionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Rekognition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetCelebrityRecognition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetCelebrityRecognitionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetCelebrityRecognitionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,286,563 | public void traceExecution(final MessageFrame frame, final ExecuteOperation executeOperation) {<NEW_LINE>final Operation currentOperation = frame.getCurrentOperation();<NEW_LINE>final int depth = frame.getMessageStackDepth();<NEW_LINE>final String opcode = currentOperation.getName();<NEW_LINE>final int pc = frame.getPC();<NEW_LINE>final Gas gasRemaining = frame.getRemainingGas();<NEW_LINE>final Bytes inputData = frame.getInputData();<NEW_LINE>final Optional<Bytes32[]> stack = captureStack(frame);<NEW_LINE>final WorldUpdater worldUpdater = frame.getWorldUpdater();<NEW_LINE>final Optional<Bytes32[]> stackPostExecution;<NEW_LINE>final Operation.OperationResult operationResult = executeOperation.execute();<NEW_LINE>final Bytes outputData = frame.getOutputData();<NEW_LINE>final Optional<Bytes[]> memory = captureMemory(frame);<NEW_LINE>stackPostExecution = captureStack(frame);<NEW_LINE>if (lastFrame != null) {<NEW_LINE>lastFrame.setGasRemainingPostExecution(gasRemaining);<NEW_LINE>}<NEW_LINE>final Optional<Map<UInt256, UInt256>> storage = captureStorage(frame);<NEW_LINE>final Optional<Map<Address, Wei>> maybeRefunds = frame.getRefunds().isEmpty() ? Optional.empty() : Optional.of(frame.getRefunds());<NEW_LINE>lastFrame = new TraceFrame(pc, Optional.of(opcode), gasRemaining, operationResult.getGasCost(), frame.getGasRefund(), depth, operationResult.getHaltReason(), frame.getRecipientAddress(), frame.getApparentValue(), pc == 0 ? inputData.copy() : inputData, outputData, stack, memory, storage, worldUpdater, frame.getRevertReason(), maybeRefunds, Optional.ofNullable(frame.getMessageFrameStack().peek()).map(MessageFrame::getCode), frame.getCurrentOperation().getStackItemsProduced(), stackPostExecution, currentOperation.isVirtualOperation(), frame.getMaybeUpdatedMemory(<MASK><NEW_LINE>traceFrames.add(lastFrame);<NEW_LINE>frame.reset();<NEW_LINE>} | ), frame.getMaybeUpdatedStorage()); |
1,681,078 | public static DescribeAntChainCertificateApplicationsV2Response unmarshall(DescribeAntChainCertificateApplicationsV2Response describeAntChainCertificateApplicationsV2Response, UnmarshallerContext _ctx) {<NEW_LINE>describeAntChainCertificateApplicationsV2Response.setRequestId(_ctx.stringValue("DescribeAntChainCertificateApplicationsV2Response.RequestId"));<NEW_LINE>describeAntChainCertificateApplicationsV2Response.setHttpStatusCode(_ctx.stringValue("DescribeAntChainCertificateApplicationsV2Response.HttpStatusCode"));<NEW_LINE>describeAntChainCertificateApplicationsV2Response.setSuccess(_ctx.booleanValue("DescribeAntChainCertificateApplicationsV2Response.Success"));<NEW_LINE>describeAntChainCertificateApplicationsV2Response.setResultMessage(_ctx.stringValue("DescribeAntChainCertificateApplicationsV2Response.ResultMessage"));<NEW_LINE>describeAntChainCertificateApplicationsV2Response.setCode(_ctx.stringValue("DescribeAntChainCertificateApplicationsV2Response.Code"));<NEW_LINE>describeAntChainCertificateApplicationsV2Response.setMessage(_ctx.stringValue("DescribeAntChainCertificateApplicationsV2Response.Message"));<NEW_LINE>describeAntChainCertificateApplicationsV2Response.setResultCode(_ctx.stringValue("DescribeAntChainCertificateApplicationsV2Response.ResultCode"));<NEW_LINE>Result result = new Result();<NEW_LINE>Pagination pagination = new Pagination();<NEW_LINE>pagination.setPageSize(_ctx.integerValue("DescribeAntChainCertificateApplicationsV2Response.Result.Pagination.PageSize"));<NEW_LINE>pagination.setPageNumber<MASK><NEW_LINE>pagination.setTotalCount(_ctx.integerValue("DescribeAntChainCertificateApplicationsV2Response.Result.Pagination.TotalCount"));<NEW_LINE>result.setPagination(pagination);<NEW_LINE>List<CertificateApplicationsItem> certificateApplications = new ArrayList<CertificateApplicationsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAntChainCertificateApplicationsV2Response.Result.CertificateApplications.Length"); i++) {<NEW_LINE>CertificateApplicationsItem certificateApplicationsItem = new CertificateApplicationsItem();<NEW_LINE>certificateApplicationsItem.setStatus(_ctx.stringValue("DescribeAntChainCertificateApplicationsV2Response.Result.CertificateApplications[" + i + "].Status"));<NEW_LINE>certificateApplicationsItem.setUpdatetime(_ctx.longValue("DescribeAntChainCertificateApplicationsV2Response.Result.CertificateApplications[" + i + "].Updatetime"));<NEW_LINE>certificateApplicationsItem.setCreatetime(_ctx.longValue("DescribeAntChainCertificateApplicationsV2Response.Result.CertificateApplications[" + i + "].Createtime"));<NEW_LINE>certificateApplicationsItem.setBid(_ctx.stringValue("DescribeAntChainCertificateApplicationsV2Response.Result.CertificateApplications[" + i + "].Bid"));<NEW_LINE>certificateApplicationsItem.setAntChainId(_ctx.stringValue("DescribeAntChainCertificateApplicationsV2Response.Result.CertificateApplications[" + i + "].AntChainId"));<NEW_LINE>certificateApplicationsItem.setUsername(_ctx.stringValue("DescribeAntChainCertificateApplicationsV2Response.Result.CertificateApplications[" + i + "].Username"));<NEW_LINE>certificateApplications.add(certificateApplicationsItem);<NEW_LINE>}<NEW_LINE>result.setCertificateApplications(certificateApplications);<NEW_LINE>describeAntChainCertificateApplicationsV2Response.setResult(result);<NEW_LINE>return describeAntChainCertificateApplicationsV2Response;<NEW_LINE>} | (_ctx.integerValue("DescribeAntChainCertificateApplicationsV2Response.Result.Pagination.PageNumber")); |
1,507,174 | static String process(String html) {<NEW_LINE>Matcher m = FIELD.matcher(html);<NEW_LINE>List<Match> matches = new ArrayList<>(64);<NEW_LINE>Match lastMatch = null;<NEW_LINE>boolean foundSame = false;<NEW_LINE>StringBuilder out = new StringBuilder(html.length());<NEW_LINE>boolean altColor = false;<NEW_LINE>while (m.find()) {<NEW_LINE>if (lastMatch == null) {<NEW_LINE>out.append(html, 0, m.start());<NEW_LINE>matches.add(lastMatch = new Match(m));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (match.isSameBlock(lastMatch)) {<NEW_LINE>foundSame = true;<NEW_LINE>matches.add(lastMatch = match);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>flush(out, matches, altColor = !altColor);<NEW_LINE>matches.clear();<NEW_LINE>matches.add(lastMatch = match);<NEW_LINE>}<NEW_LINE>if (foundSame) {<NEW_LINE>flush(out, matches, !altColor);<NEW_LINE>out.append(html.substring(matches.get(matches.size() - 1).end));<NEW_LINE>return out.toString();<NEW_LINE>}<NEW_LINE>return html;<NEW_LINE>} | Match match = new Match(m); |
1,074,653 | private void refreshInstallServiceButtonState() {<NEW_LINE>if (System.getProperty(LooksFrame.START_SERVICE) != null || !Platform.isWindows()) {<NEW_LINE>installService.setEnabled(false);<NEW_LINE>installService.setText(Messages.getString("NetworkTab.4"));<NEW_LINE>} else {<NEW_LINE>installService.setEnabled(true);<NEW_LINE>boolean isUmsServiceInstalled = WindowsUtil.isUmsServiceInstalled();<NEW_LINE>if (isUmsServiceInstalled) {<NEW_LINE>// Update button text and tooltip<NEW_LINE>installService.setText(Messages.getString("GeneralTab.2"));<NEW_LINE>installService.setToolTipText(null);<NEW_LINE>// Remove all attached action listeners<NEW_LINE>for (ActionListener al : installService.getActionListeners()) {<NEW_LINE>installService.removeActionListener(al);<NEW_LINE>}<NEW_LINE>// Attach the button clicked action listener<NEW_LINE>installService.addActionListener((ActionEvent e) -> {<NEW_LINE>WindowsUtil.uninstallWin32Service();<NEW_LINE>LOGGER.info("Uninstalled UMS Windows service");<NEW_LINE>// Refresh the button state after it has been clicked<NEW_LINE>refreshInstallServiceButtonState();<NEW_LINE>JOptionPane.showMessageDialog(looksFrame, Messages.getString("GeneralTab.3"), Messages.getString("Dialog.Information"), JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>// Update button text and tooltip<NEW_LINE>installService.setText<MASK><NEW_LINE>installService.setToolTipText(Messages.getString("NetworkTab.63"));<NEW_LINE>// Remove all attached action listeners<NEW_LINE>for (ActionListener al : installService.getActionListeners()) {<NEW_LINE>installService.removeActionListener(al);<NEW_LINE>}<NEW_LINE>// Attach the button clicked action listener<NEW_LINE>installService.addActionListener((ActionEvent e) -> {<NEW_LINE>if (WindowsUtil.installWin32Service()) {<NEW_LINE>LOGGER.info("Installed UMS Windows service");<NEW_LINE>// Refresh the button state after it has been clicked<NEW_LINE>refreshInstallServiceButtonState();<NEW_LINE>JOptionPane.showMessageDialog(looksFrame, Messages.getString("NetworkTab.11") + Messages.getString("NetworkTab.12"), Messages.getString("Dialog.Information"), JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>} else {<NEW_LINE>JOptionPane.showMessageDialog(looksFrame, Messages.getString("NetworkTab.14"), Messages.getString("Dialog.Error"), JOptionPane.ERROR_MESSAGE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (Messages.getString("NetworkTab.4")); |
356,703 | private static void createExtensionDocAndAddToFolderAndImports(final CdmCorpusContext ctx, final List<CdmTraitDefinition> extensionTraitDefList, final CdmFolderDefinition folder) {<NEW_LINE>if (extensionTraitDefList.size() > 0) {<NEW_LINE>final CdmDocumentDefinition extensionDoc = ctx.getCorpus().makeObject(CdmObjectType.DocumentDef, ExtensionHelper.EXTENSION_DOC_NAME);<NEW_LINE>extensionTraitDefList.parallelStream().map((CdmTraitDefinition cdmTraitDef) -> (CdmObjectDefinition) cdmTraitDef).collect(Collectors.toList()).forEach(cdmObjectDef -> extensionDoc.getDefinitions().add(cdmObjectDef));<NEW_LINE>extensionDoc.getImports().add("cdm:/extensions/base.extension.cdm.json");<NEW_LINE>extensionDoc.setFolderPath(folder.getFolderPath());<NEW_LINE>extensionDoc.<MASK><NEW_LINE>// Add the extension doc to the folder, will wire everything together as needed.<NEW_LINE>folder.getDocuments().add(extensionDoc);<NEW_LINE>}<NEW_LINE>} | setNamespace(folder.getNamespace()); |
1,226,897 | private void updateBind(Node n) {<NEW_LINE>CodingConvention.Bind bind = compiler.getCodingConvention().describeFunctionBind(n, false, true);<NEW_LINE>if (bind == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Node target = bind.target;<NEW_LINE>FunctionType callTargetFn = getJSType(target).restrictByNotNullOrUndefined().toMaybeFunctionType();<NEW_LINE>if (callTargetFn == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (bind.thisValue != null && target.isFunction()) {<NEW_LINE>JSType thisType = getJSType(bind.thisValue);<NEW_LINE>if (thisType.toObjectType() != null && !thisType.isUnknownType() && callTargetFn.getTypeOfThis().isUnknownType()) {<NEW_LINE>callTargetFn = callTargetFn.toBuilder().withTypeOfThis(thisType.toObjectType()).withSourceNode(null).buildAndResolve();<NEW_LINE>target.setJSType(callTargetFn);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JSType returnType = // getBindReturnType expects the 'this' argument to be included.<NEW_LINE>callTargetFn.// getBindReturnType expects the 'this' argument to be included.<NEW_LINE>getBindReturnType(bind.getBoundParameterCount() + 1);<NEW_LINE>FunctionType bindType = getJSType(n.getFirstChild()).toMaybeFunctionType();<NEW_LINE>if (bindType != null && n.getFirstChild() != target) {<NEW_LINE>// Update the type of the<NEW_LINE>bindType = bindType.toBuilder().withReturnType(returnType).withSourceNode(null).buildAndResolve();<NEW_LINE>n.<MASK><NEW_LINE>}<NEW_LINE>n.setJSType(returnType);<NEW_LINE>} | getFirstChild().setJSType(bindType); |
426,819 | private Mono<PagedResponse<AutoApprovedPrivateLinkServiceInner>> listAutoApprovedPrivateLinkServicesSinglePageAsync(String location, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (location == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listAutoApprovedPrivateLinkServices(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
1,659,590 | public void updateTitle(Contact contact, Channel channel) {<NEW_LINE>StringBuilder titleBuilder = new StringBuilder();<NEW_LINE>if (contact != null) {<NEW_LINE>titleBuilder.append(contact.getDisplayName());<NEW_LINE>if (appContactService != null && this.contact != null) {<NEW_LINE>updateLastSeenStatus();<NEW_LINE>}<NEW_LINE>} else if (channel != null) {<NEW_LINE>if (Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType())) {<NEW_LINE>String userId = ChannelService.getInstance(getActivity()).getGroupOfTwoReceiverUserId(channel.getKey());<NEW_LINE>if (!TextUtils.isEmpty(userId)) {<NEW_LINE>Contact <MASK><NEW_LINE>titleBuilder.append(withUserContact.getDisplayName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>titleBuilder.append(ChannelUtils.getChannelTitleName(channel, loggedInUserId));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (getActivity() != null) {<NEW_LINE>setToolbarTitle(titleBuilder.toString());<NEW_LINE>}<NEW_LINE>} | withUserContact = appContactService.getContactById(userId); |
1,531,944 | public boolean testConnection() {<NEW_LINE>String dbUrl = // adempiere may not be defined yet<NEW_LINE>m_dbTarget.// adempiere may not be defined yet<NEW_LINE>getConnectionURL(// adempiere may not be defined yet<NEW_LINE>m_databaseHost, // adempiere may not be defined yet<NEW_LINE>m_databasePort, // adempiere may not be defined yet<NEW_LINE>m_databaseName, m_dbTarget.getSystemUser());<NEW_LINE>log.info(dbUrl + " - " + m_dbTarget.getSystemUser() + "/" + m_systemPassword);<NEW_LINE>try {<NEW_LINE>Connection conn = m_dbTarget.getDriverConnection(dbUrl, m_dbTarget.getSystemUser(), m_systemPassword);<NEW_LINE>//<NEW_LINE><MASK><NEW_LINE>if (CLogMgt.isLevelFinest()) {<NEW_LINE>info.listCatalogs();<NEW_LINE>info.listSchemas();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.SEVERE, "test", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | JDBCInfo info = new JDBCInfo(conn); |
867,325 | protected void doRenderCalendar(boolean updateDate) {<NEW_LINE>super.setStylePrimaryName(getDateField().getStylePrimaryName() + "-calendarpanel");<NEW_LINE>if (focusedDate == null) {<NEW_LINE>Date date = getDate();<NEW_LINE>if (date == null) {<NEW_LINE>date = new Date();<NEW_LINE>}<NEW_LINE>// focusedDate must have zero hours, mins, secs, millisecs<NEW_LINE>focusedDate = new FocusedDate(date.getYear(), date.getMonth(), date.getDate());<NEW_LINE>displayedMonth = new FocusedDate(date.getYear(), <MASK><NEW_LINE>}<NEW_LINE>if (updateDate && !isDay(getResolution()) && focusChangeListener != null) {<NEW_LINE>focusChangeListener.focusChanged(new Date(focusedDate.getTime()));<NEW_LINE>}<NEW_LINE>final boolean needsMonth = !isYear(getResolution());<NEW_LINE>boolean needsBody = isBelowMonth(resolution);<NEW_LINE>buildCalendarHeader(needsMonth, needsBody);<NEW_LINE>clearCalendarBody(!needsBody);<NEW_LINE>if (needsBody) {<NEW_LINE>buildCalendarBody();<NEW_LINE>}<NEW_LINE>} | date.getMonth(), 1); |
142,414 | public TimeSeriesDatabaseConnection deleteById(String id) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String resourceName = <MASK><NEW_LINE>if (resourceName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'digitalTwinsInstances'.", id)));<NEW_LINE>}<NEW_LINE>String timeSeriesDatabaseConnectionName = Utils.getValueFromIdByName(id, "timeSeriesDatabaseConnections");<NEW_LINE>if (timeSeriesDatabaseConnectionName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment" + " 'timeSeriesDatabaseConnections'.", id)));<NEW_LINE>}<NEW_LINE>return this.delete(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, Context.NONE);<NEW_LINE>} | Utils.getValueFromIdByName(id, "digitalTwinsInstances"); |
1,237,502 | static BeanDefinitionBuilder buildWebFluxRequestExecutingMessageHandler(Element element, ParserContext parserContext) {<NEW_LINE>BeanDefinitionBuilder builder = <MASK><NEW_LINE>String webClientRef = element.getAttribute("web-client");<NEW_LINE>if (StringUtils.hasText(webClientRef)) {<NEW_LINE>builder.getBeanDefinition().getConstructorArgumentValues().addIndexedArgumentValue(1, new RuntimeBeanReference(webClientRef));<NEW_LINE>} else {<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "encoding-mode");<NEW_LINE>}<NEW_LINE>String type = element.getAttribute("publisher-element-type");<NEW_LINE>String typeExpression = element.getAttribute("publisher-element-type-expression");<NEW_LINE>boolean hasType = StringUtils.hasText(type);<NEW_LINE>boolean hasTypeExpression = StringUtils.hasText(typeExpression);<NEW_LINE>if (hasType && hasTypeExpression) {<NEW_LINE>parserContext.getReaderContext().error("The 'publisher-element-type' and 'publisher-element-type-expression' " + "are mutually exclusive. You can only have one or the other", element);<NEW_LINE>}<NEW_LINE>if (hasType) {<NEW_LINE>builder.addPropertyValue("publisherElementType", type);<NEW_LINE>} else if (hasTypeExpression) {<NEW_LINE>builder.addPropertyValue("publisherElementTypeExpression", BeanDefinitionBuilder.rootBeanDefinition(ExpressionFactoryBean.class).addConstructorArgValue(typeExpression).getBeanDefinition());<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>} | BeanDefinitionBuilder.genericBeanDefinition(WebFluxRequestExecutingMessageHandler.class); |
1,708,064 | public void execute() {<NEW_LINE>if (!blank(apiLocation) && !new File(apiLocation).exists()) {<NEW_LINE>getLog().error("The directory: " + apiLocation + " does not exist");<NEW_LINE>}<NEW_LINE>Format localFormat = null;<NEW_LINE>if (Format.JSON.matches(format)) {<NEW_LINE>localFormat = Format.JSON;<NEW_LINE>} else if (Format.YAML.matches(format)) {<NEW_LINE>throw new IllegalArgumentException("Yaml is not supported yet. Use JSON.");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Generator generator = new Generator();<NEW_LINE>EndpointFinder endpointFinder = <MASK><NEW_LINE>endpointFinder.setApiLocation(apiLocation);<NEW_LINE>String mergedContent = generator.generate(templateFile, endpointFinder, localFormat);<NEW_LINE>Files.writeString(Paths.get(targetFile), mergedContent);<NEW_LINE>getLog().info("Output saved to: " + targetFile);<NEW_LINE>} catch (Exception e) {<NEW_LINE>getLog().error("Failed to generate OpenAPI", e);<NEW_LINE>}<NEW_LINE>} | new EndpointFinder(getCombinedClassLoader(project)); |
1,532,276 | final DescribeDRTAccessResult executeDescribeDRTAccess(DescribeDRTAccessRequest describeDRTAccessRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDRTAccessRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDRTAccessRequest> request = null;<NEW_LINE>Response<DescribeDRTAccessResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDRTAccessRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDRTAccessRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Shield");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDRTAccess");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDRTAccessResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDRTAccessResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
701,843 | final UpdateRegionSettingsResult executeUpdateRegionSettings(UpdateRegionSettingsRequest updateRegionSettingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateRegionSettingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UpdateRegionSettingsRequest> request = null;<NEW_LINE>Response<UpdateRegionSettingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateRegionSettingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateRegionSettingsRequest));<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, "Backup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateRegionSettings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateRegionSettingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateRegionSettingsResultJsonUnmarshaller());<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); |
464,220 | private void debugDrawPoints(final Canvas canvas, final int startIndex, final int endIndex, final Paint paint) {<NEW_LINE>final int[] xCoords = mXCoordinates.getPrimitiveArray();<NEW_LINE>final int[] yCoords = mYCoordinates.getPrimitiveArray();<NEW_LINE>final int[<MASK><NEW_LINE>// {@link Paint} that is zero width stroke and anti alias off draws exactly 1 pixel.<NEW_LINE>paint.setAntiAlias(false);<NEW_LINE>paint.setStrokeWidth(0);<NEW_LINE>for (int i = startIndex; i < endIndex; i++) {<NEW_LINE>final int pointType = pointTypes[i];<NEW_LINE>if (pointType == POINT_TYPE_INTERPOLATED) {<NEW_LINE>paint.setColor(Color.RED);<NEW_LINE>} else if (pointType == POINT_TYPE_SAMPLED) {<NEW_LINE>paint.setColor(0xFFA000FF);<NEW_LINE>} else {<NEW_LINE>paint.setColor(Color.GREEN);<NEW_LINE>}<NEW_LINE>canvas.drawPoint(getXCoordValue(xCoords[i]), yCoords[i], paint);<NEW_LINE>}<NEW_LINE>paint.setAntiAlias(true);<NEW_LINE>} | ] pointTypes = mPointTypes.getPrimitiveArray(); |
1,809,100 | public static void gatherData(GatherDataEvent event) {<NEW_LINE>// Capabilities are not registered yet, but cap references throw on null caps<NEW_LINE>CapabilityItemHandler.register();<NEW_LINE>CapabilityFluidHandler.register();<NEW_LINE>CapabilityEnergy.register();<NEW_LINE>CapabilityRedstoneNetwork.register();<NEW_LINE>ExistingFileHelper exHelper = event.getExistingFileHelper();<NEW_LINE>StaticTemplateManager.EXISTING_HELPER = exHelper;<NEW_LINE>DataGenerator gen = event.getGenerator();<NEW_LINE>if (event.includeServer()) {<NEW_LINE>BlockTagsProvider blockTags = new IEBlockTags(gen, exHelper);<NEW_LINE>gen.addProvider(blockTags);<NEW_LINE>gen.addProvider(new ItemTags(gen, blockTags, exHelper));<NEW_LINE>gen.addProvider(new FluidTags(gen, exHelper));<NEW_LINE>gen.addProvider(new TileTags(gen, exHelper));<NEW_LINE>gen.addProvider(new Recipes(gen));<NEW_LINE>gen.addProvider(new BlockLoot(gen));<NEW_LINE>gen.addProvider(new GeneralLoot(gen));<NEW_LINE>gen.addProvider(new BlockStates(gen, exHelper));<NEW_LINE>MultiblockStates blockStates = new MultiblockStates(gen, exHelper);<NEW_LINE>gen.addProvider(blockStates);<NEW_LINE>gen.addProvider(<MASK><NEW_LINE>gen.addProvider(new ItemModels(gen, exHelper, blockStates));<NEW_LINE>gen.addProvider(new Advancements(gen));<NEW_LINE>gen.addProvider(new StructureUpdater("structures/multiblocks", Lib.MODID, exHelper, gen));<NEW_LINE>gen.addProvider(new StructureUpdater("structures/village", Lib.MODID, exHelper, gen));<NEW_LINE>// Always keep this as the last provider!<NEW_LINE>gen.addProvider(new RunCompleteHelper());<NEW_LINE>}<NEW_LINE>} | new ConnectorBlockStates(gen, exHelper)); |
1,484,496 | public void remap(CustomRemapper remapper) {<NEW_LINE>Set<String> mappedNames = new HashSet<>();<NEW_LINE>remapper.setIgnorePackages(true);<NEW_LINE>classNodes().forEach(classNode -> {<NEW_LINE>int matches = StringUtils.countMatches(classNode.name, "/");<NEW_LINE>if (matches > getConfig().getPackageLayers()) {<NEW_LINE>int lastIndex = <MASK><NEW_LINE>String packages = classNode.name.substring(0, lastIndex);<NEW_LINE>String name = classNode.name.substring(lastIndex, classNode.name.length());<NEW_LINE>int indexFromStart = StringUtils.ordinalIndexOf(packages, "/", getConfig().getPackageLayers()) + 1;<NEW_LINE>int indexFromEnd = StringUtils.lastOrdinalIndexOf(packages, "/", getConfig().getPackageLayers());<NEW_LINE>String newName = indexFromStart > packages.length() - indexFromEnd ? packages.substring(0, indexFromStart) : packages.substring(indexFromEnd + 1, packages.length());<NEW_LINE>newName += name;<NEW_LINE>int counter = 1;<NEW_LINE>boolean useCounter = false;<NEW_LINE>if (classes.containsKey(newName) || mappedNames.contains(newName)) {<NEW_LINE>useCounter = true;<NEW_LINE>while (classes.containsKey(newName + "_" + counter) || mappedNames.contains(newName + "_" + counter)) counter++;<NEW_LINE>}<NEW_LINE>remapper.map(classNode.name, useCounter ? newName + "_" + counter : newName);<NEW_LINE>mappedNames.add(newName);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | classNode.name.lastIndexOf("/"); |
285,553 | public void createRunMethod(ClassVisitor cv, Class hostClass, Class castClass, String name, boolean staticMethod, boolean block) {<NEW_LINE>Class[] <MASK><NEW_LINE>Class returnClass;<NEW_LINE>try {<NEW_LINE>returnClass = hostClass.getMethod(name, params).getReturnType();<NEW_LINE>} catch (NoSuchMethodException nsme) {<NEW_LINE>throw new IllegalArgumentException("no such method: " + CgUtil.getMethod(name, RubyValue.class, params).getDescriptor());<NEW_LINE>}<NEW_LINE>GeneratorAdapter mg = startRun(getRunMethod(), cv);<NEW_LINE>Type type = Type.getType(castClass);<NEW_LINE>loadReceiver(mg, type, staticMethod);<NEW_LINE>loadArgs(mg);<NEW_LINE>if (block) {<NEW_LINE>this.loadBlock(mg);<NEW_LINE>}<NEW_LINE>Method method = CgUtil.getMethod(name, returnClass, params);<NEW_LINE>if (staticMethod) {<NEW_LINE>mg.invokeStatic(type, method);<NEW_LINE>} else {<NEW_LINE>mg.invokeVirtual(type, method);<NEW_LINE>}<NEW_LINE>endRun(mg);<NEW_LINE>} | params = getParamType(staticMethod, block); |
1,124,282 | protected void activate() {<NEW_LINE>long ts = System.currentTimeMillis();<NEW_LINE>deactivateCalled = false;<NEW_LINE>tradeStatisticsManager.<MASK><NEW_LINE>if (!fillTradeCurrenciesOnActivateCalled) {<NEW_LINE>fillTradeCurrencies();<NEW_LINE>fillTradeCurrenciesOnActivateCalled = true;<NEW_LINE>}<NEW_LINE>syncPriceFeedCurrency();<NEW_LINE>setMarketPriceFeedCurrency();<NEW_LINE>List<CompletableFuture<Boolean>> allFutures = new ArrayList<>();<NEW_LINE>CompletableFuture<Boolean> task1Done = new CompletableFuture<>();<NEW_LINE>allFutures.add(task1Done);<NEW_LINE>CompletableFuture<Boolean> task2Done = new CompletableFuture<>();<NEW_LINE>allFutures.add(task2Done);<NEW_LINE>CompletableFutureUtils.allOf(allFutures).whenComplete((res, throwable) -> {<NEW_LINE>if (deactivateCalled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (throwable != null) {<NEW_LINE>log.error(throwable.toString());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Once applyAsyncUsdAveragePriceMapsPerTickUnit and applyAsyncTradeStatisticsForCurrency are<NEW_LINE>// both completed we call applyAsyncChartData<NEW_LINE>UserThread.execute(this::applyAsyncChartData);<NEW_LINE>});<NEW_LINE>// We call applyAsyncUsdAveragePriceMapsPerTickUnit and applyAsyncTradeStatisticsForCurrency<NEW_LINE>// in parallel for better performance<NEW_LINE>applyAsyncUsdAveragePriceMapsPerTickUnit(task1Done);<NEW_LINE>applyAsyncTradeStatisticsForCurrency(getCurrencyCode(), task2Done);<NEW_LINE>log.debug("activate took {}", System.currentTimeMillis() - ts);<NEW_LINE>} | getObservableTradeStatisticsSet().addListener(setChangeListener); |
64,770 | private void invokeRefreshInstance(String instanceId, WXRefreshData refreshData) {<NEW_LINE>try {<NEW_LINE>WXSDKInstance instance = WXSDKManager.getInstance().getSDKInstance(instanceId);<NEW_LINE>if (!isSkipFrameworkInit(instanceId) && !isJSFrameworkInit()) {<NEW_LINE>if (instance != null) {<NEW_LINE>instance.onRenderError(WXErrorCode.WX_DEGRAD_ERR_INSTANCE_CREATE_FAILED.getErrorCode(), WXErrorCode.WX_DEGRAD_ERR_INSTANCE_CREATE_FAILED.getErrorMsg() + "invokeRefreshInstance FAILED for JSFrameworkInit FAILED, intance will invoke instance.onRenderError");<NEW_LINE>}<NEW_LINE>String err = "[WXBridgeManager] invokeRefreshInstance: framework.js uninitialized.";<NEW_LINE>WXLogUtils.e(err);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>if (WXEnvironment.isApkDebugable()) {<NEW_LINE>WXLogUtils.d("refreshInstance >>>> instanceId:" + instanceId + ", data:" + refreshData.<MASK><NEW_LINE>}<NEW_LINE>if (refreshData.isDirty) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>WXJSObject instanceIdObj = new WXJSObject(WXJSObject.String, instanceId);<NEW_LINE>WXJSObject dataObj = new WXJSObject(WXJSObject.JSON, refreshData.data == null ? "{}" : refreshData.data);<NEW_LINE>WXJSObject[] args = { instanceIdObj, dataObj };<NEW_LINE>mWXBridge.refreshInstance(instanceId, null, METHOD_REFRESH_INSTANCE, args);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>String err = "[WXBridgeManager] invokeRefreshInstance " + WXLogUtils.getStackTrace(e);<NEW_LINE>WXExceptionUtils.commitCriticalExceptionRT(instanceId, WXErrorCode.WX_KEY_EXCEPTION_INVOKE_BRIDGE, "invokeRefreshInstance", err, null);<NEW_LINE>WXLogUtils.e(err);<NEW_LINE>}<NEW_LINE>} | data + ", isDirty:" + refreshData.isDirty); |
942,682 | // Arbitrators sign with EC key<NEW_LINE>private String signAndPublishAccountAgeWitness(Coin tradeAmount, AccountAgeWitness accountAgeWitness, ECKey key, byte[] peersPubKey, long time) {<NEW_LINE>if (isSignedAccountAgeWitness(accountAgeWitness)) {<NEW_LINE>var err = "Arbitrator trying to sign already signed accountagewitness " + accountAgeWitness.toString();<NEW_LINE>log.warn(err);<NEW_LINE>return err;<NEW_LINE>}<NEW_LINE>if (peersPubKey == null) {<NEW_LINE>var err = "Trying to sign accountAgeWitness " + accountAgeWitness.toString() + "\nwith owner pubkey=null";<NEW_LINE>log.warn(err);<NEW_LINE>return err;<NEW_LINE>}<NEW_LINE>String accountAgeWitnessHashAsHex = Utilities.encodeToHex(accountAgeWitness.getHash());<NEW_LINE>String <MASK><NEW_LINE>SignedWitness signedWitness = new SignedWitness(SignedWitness.VerificationMethod.ARBITRATOR, accountAgeWitness.getHash(), signatureBase64.getBytes(Charsets.UTF_8), key.getPubKey(), peersPubKey, time, tradeAmount.value);<NEW_LINE>publishSignedWitness(signedWitness);<NEW_LINE>log.info("Arbitrator signed witness {}", signedWitness.toString());<NEW_LINE>return "";<NEW_LINE>} | signatureBase64 = key.signMessage(accountAgeWitnessHashAsHex); |
1,180,567 | private void processConfigProps(Map<String, Object> props) {<NEW_LINE>controlFlag = setControlFlag(moduleConfig.controlFlag());<NEW_LINE>Map<String, Object> options = extractOptions(props);<NEW_LINE>String originalLoginModuleClassName = moduleConfig.className();<NEW_LINE>if (isDefaultLoginModule()) {<NEW_LINE>String target = getTargetClassName(originalLoginModuleClassName, options);<NEW_LINE>Class<?> cl = getTargetClassForName(target);<NEW_LINE>trackDelegateBundle(cl);<NEW_LINE>options.put(LoginModuleProxy.KERNEL_DELEGATE, cl);<NEW_LINE>} else {<NEW_LINE>if (// nowhere to load the login module class from<NEW_LINE>sharedLibrary == null && classProviderAppInfo == null)<NEW_LINE>throw new IllegalArgumentException(Tr.formatMessage(tc, "CWWKS1147_JAAS_CUSTOM_LOGIN_MODULE_CP_LIB_MISSING", originalLoginModuleClassName, props.get("config.displayId")));<NEW_LINE>else if (// conflicting locations to load from<NEW_LINE>sharedLibrary != null && classProviderAppInfo != null)<NEW_LINE>throw new IllegalArgumentException(Tr.formatMessage(tc, "CWWKS1146_JAAS_CUSTOM_LOGIN_MODULE_CP_LIB_CONFLICT", originalLoginModuleClassName, <MASK><NEW_LINE>options = processDelegateOptions(options, originalLoginModuleClassName, classProviderAppInfo, classLoadingService, sharedLibrary, false);<NEW_LINE>}<NEW_LINE>this.options = options;<NEW_LINE>} | props.get("config.displayId"))); |
1,456,378 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>View view = inflater.inflate(R.layout.date_picker_dialog, container, false);<NEW_LINE>Button doneButton = (Button) view.findViewById(R.id.done_button);<NEW_LINE>Button cancelButton = (Button) view.findViewById(R.id.cancel_button);<NEW_LINE>cancelButton.setTextColor(mTextColor);<NEW_LINE>cancelButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>doneButton.setTextColor(mTextColor);<NEW_LINE>doneButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>for (DatePickerDialogHandler handler : mDatePickerDialogHandlers) {<NEW_LINE>handler.onDialogDateSet(mReference, mPicker.getYear(), mPicker.getMonthOfYear(), mPicker.getDayOfMonth());<NEW_LINE>}<NEW_LINE>final Activity activity = getActivity();<NEW_LINE>final Fragment fragment = getTargetFragment();<NEW_LINE>if (activity instanceof DatePickerDialogHandler) {<NEW_LINE>final DatePickerDialogHandler act = (DatePickerDialogHandler) activity;<NEW_LINE>act.onDialogDateSet(mReference, mPicker.getYear(), mPicker.getMonthOfYear(<MASK><NEW_LINE>} else if (fragment instanceof DatePickerDialogHandler) {<NEW_LINE>final DatePickerDialogHandler frag = (DatePickerDialogHandler) fragment;<NEW_LINE>frag.onDialogDateSet(mReference, mPicker.getYear(), mPicker.getMonthOfYear(), mPicker.getDayOfMonth());<NEW_LINE>}<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mPicker = (DatePicker) view.findViewById(R.id.date_picker);<NEW_LINE>mPicker.setSetButton(doneButton);<NEW_LINE>mPicker.setDate(mYear, mMonthOfYear, mDayOfMonth);<NEW_LINE>mPicker.setYearOptional(mYearOptional);<NEW_LINE>mPicker.setTheme(mTheme);<NEW_LINE>getDialog().getWindow().setBackgroundDrawableResource(mDialogBackgroundResId);<NEW_LINE>return view;<NEW_LINE>} | ), mPicker.getDayOfMonth()); |
1,728,947 | public static void main(String[] args) {<NEW_LINE>Jsonb jsonb = JsonbBuilder.create();<NEW_LINE>Model instance = new Model();<NEW_LINE>instance.string = "Hello World!";<NEW_LINE>instance.number = 42;<NEW_LINE>instance.integers = Arrays.asList(1, 2, 3);<NEW_LINE>instance.decimals = new HashSet<>(Arrays.asList(BigDecimal.ONE, BigDecimal.ZERO));<NEW_LINE>instance.uuids = new UUID[] { new UUID(1L, 2L), new UUID(3L, 4L) };<NEW_LINE>instance.longs = new Vector<>(Arrays.asList(1L, 2L));<NEW_LINE>instance.nested = Arrays.asList(new <MASK><NEW_LINE>instance.inheritance = new Model.ParentClass();<NEW_LINE>instance.inheritance.a = 5;<NEW_LINE>instance.inheritance.b = 6;<NEW_LINE>instance.iface = new Model.WithCustomCtor(5, 6);<NEW_LINE>instance.person = new ImmutablePerson("first name", "last name", 35);<NEW_LINE>instance.states = Arrays.asList(Model.State.HI, Model.State.LOW);<NEW_LINE>instance.intList = new ArrayList<>(Arrays.asList(123, 456));<NEW_LINE>instance.map = new HashMap<>();<NEW_LINE>instance.map.put("abc", 678);<NEW_LINE>instance.map.put("array", new int[] { 2, 4, 8 });<NEW_LINE>instance.factories = Arrays.asList(null, Model.ViaFactory.create("me", 2), Model.ViaFactory.create("you", 3), null);<NEW_LINE>instance.builder = PersonBuilder.builder().firstName("first").lastName("last").age(42).build();<NEW_LINE>// TODO while string API is supported, it should be avoided in favor of stream API<NEW_LINE>String result = jsonb.toJson(instance);<NEW_LINE>System.out.println(result);<NEW_LINE>// TODO while string API is supported, it should be avoided in favor of stream API<NEW_LINE>Model deser = jsonb.fromJson(result, Model.class);<NEW_LINE>System.out.println(deser.string);<NEW_LINE>} | Model.Nested(), null); |
288,923 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String workId, String flag, boolean stream) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Work work = emc.find(workId, Work.class);<NEW_LINE>if (work == null) {<NEW_LINE>WorkCompleted workCompleted = emc.find(workId, WorkCompleted.class);<NEW_LINE>if (null == workCompleted) {<NEW_LINE>throw new Exception("workId: " + workId + " not exist in work or workCompleted");<NEW_LINE>}<NEW_LINE>if (!business.readable(effectivePerson, workCompleted)) {<NEW_LINE>throw new ExceptionWorkCompletedAccessDenied(effectivePerson.getDistinguishedName(), workCompleted.getTitle(), workCompleted.getId());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!business.readable(effectivePerson, work)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, work);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Wo wo = null;<NEW_LINE>GeneralFile generalFile = emc.find(flag, GeneralFile.class);<NEW_LINE>if (generalFile != null) {<NEW_LINE>StorageMapping gfMapping = ThisApplication.context().storageMappings().get(GeneralFile.<MASK><NEW_LINE>wo = new Wo(generalFile.readContent(gfMapping), this.contentType(stream, generalFile.getName()), this.contentDisposition(stream, generalFile.getName()));<NEW_LINE>generalFile.deleteContent(gfMapping);<NEW_LINE>emc.beginTransaction(GeneralFile.class);<NEW_LINE>emc.delete(GeneralFile.class, generalFile.getId());<NEW_LINE>emc.commit();<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | class, generalFile.getStorage()); |
1,283,403 | public Release deployStream(StreamDeploymentRequest streamDeploymentRequest) {<NEW_LINE>validateStreamDeploymentRequest(streamDeploymentRequest);<NEW_LINE>Map<String, String> streamDeployerProperties = streamDeploymentRequest.getStreamDeployerProperties();<NEW_LINE>String packageVersion = streamDeployerProperties.get(SkipperStream.SKIPPER_PACKAGE_VERSION);<NEW_LINE>Assert.isTrue(StringUtils.hasText(packageVersion), "Package Version must be set");<NEW_LINE>logger.info("Deploying Stream " + streamDeploymentRequest.getStreamName() + " using skipper.");<NEW_LINE>String repoName = streamDeployerProperties.get(SkipperStream.SKIPPER_REPO_NAME);<NEW_LINE>repoName = (StringUtils.hasText(repoName)) ? (repoName) : "local";<NEW_LINE>String platformName = streamDeployerProperties.get(SkipperStream.SKIPPER_PLATFORM_NAME);<NEW_LINE>platformName = determinePlatformName(platformName);<NEW_LINE>String packageName = streamDeployerProperties.get(SkipperStream.SKIPPER_PACKAGE_NAME);<NEW_LINE>packageName = (StringUtils.hasText(packageName)) <MASK><NEW_LINE>// Create the package .zip file to upload<NEW_LINE>File packageFile = createPackageForStream(packageName, packageVersion, streamDeploymentRequest);<NEW_LINE>// Upload the package<NEW_LINE>UploadRequest uploadRequest = new UploadRequest();<NEW_LINE>uploadRequest.setName(packageName);<NEW_LINE>uploadRequest.setVersion(packageVersion);<NEW_LINE>uploadRequest.setExtension("zip");<NEW_LINE>// TODO use from skipperDeploymentProperties if set.<NEW_LINE>uploadRequest.setRepoName(repoName);<NEW_LINE>try {<NEW_LINE>uploadRequest.setPackageFileAsBytes(Files.readAllBytes(packageFile.toPath()));<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalArgumentException("Can't read packageFile " + packageFile, e);<NEW_LINE>}<NEW_LINE>skipperClient.upload(uploadRequest);<NEW_LINE>// Install the package<NEW_LINE>String streamName = streamDeploymentRequest.getStreamName();<NEW_LINE>InstallRequest installRequest = new InstallRequest();<NEW_LINE>PackageIdentifier packageIdentifier = new PackageIdentifier();<NEW_LINE>packageIdentifier.setPackageName(packageName);<NEW_LINE>packageIdentifier.setPackageVersion(packageVersion);<NEW_LINE>packageIdentifier.setRepositoryName(repoName);<NEW_LINE>installRequest.setPackageIdentifier(packageIdentifier);<NEW_LINE>InstallProperties installProperties = new InstallProperties();<NEW_LINE>installProperties.setPlatformName(platformName);<NEW_LINE>installProperties.setReleaseName(streamName);<NEW_LINE>installProperties.setConfigValues(new ConfigValues());<NEW_LINE>installRequest.setInstallProperties(installProperties);<NEW_LINE>Release release = null;<NEW_LINE>try {<NEW_LINE>release = this.skipperClient.install(installRequest);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Skipper install failed. Deleting the package: " + packageName);<NEW_LINE>try {<NEW_LINE>this.skipperClient.packageDelete(packageName);<NEW_LINE>} catch (Exception e1) {<NEW_LINE>logger.error("Package delete threw exception: " + e1.getMessage());<NEW_LINE>}<NEW_LINE>throw new SkipperException(e.getMessage());<NEW_LINE>}<NEW_LINE>// TODO store releasename in deploymentIdRepository...<NEW_LINE>return release;<NEW_LINE>} | ? packageName : streamDeploymentRequest.getStreamName(); |
337,438 | private void buildFragmentPlans() {<NEW_LINE>int i = 0;<NEW_LINE>for (PlanFragment fragment : fragments) {<NEW_LINE>DataSink sink = fragment.getSink();<NEW_LINE>PlanTreeNode sinkNode = null;<NEW_LINE>if (sink != null) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>if (sink.getExchNodeId() != null) {<NEW_LINE>sb.append("[").append(sink.getExchNodeId().asInt()).append(": ").append(sink.getClass().getSimpleName()).append("]");<NEW_LINE>} else {<NEW_LINE>sb.append("[").append(sink.getClass().getSimpleName<MASK><NEW_LINE>}<NEW_LINE>sb.append("\n[Fragment: ").append(fragment.getId().asInt()).append("]");<NEW_LINE>sb.append("\n").append(sink.getExplainString("", TExplainLevel.BRIEF));<NEW_LINE>sinkNode = new PlanTreeNode(sink.getExchNodeId(), sb.toString());<NEW_LINE>if (i == 0) {<NEW_LINE>// sink of first fragment, set it as tree root<NEW_LINE>treeRoot = sinkNode;<NEW_LINE>} else {<NEW_LINE>sinkNodes.add(sinkNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PlanNode planRoot = fragment.getPlanRoot();<NEW_LINE>if (planRoot != null) {<NEW_LINE>buildForPlanNode(planRoot, sinkNode);<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>} | ()).append("]"); |
1,447,384 | private static Unbinder parseOnLongClick(final Object target, final Method method, View source) {<NEW_LINE>OnLongClick onLongClick = method.getAnnotation(OnLongClick.class);<NEW_LINE>if (onLongClick == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>validateMember(method);<NEW_LINE>final boolean propagateReturn = validateReturnType(method, boolean.class);<NEW_LINE>final ArgumentTransformer argumentTransformer = createArgumentTransformer(method, ON_LONG_CLICK_TYPES);<NEW_LINE>List<View> views = findViews(source, onLongClick.value(), isRequired(method), method.getName(), View.class);<NEW_LINE>ViewCollections.set(views, ON_LONG_CLICK, v -> {<NEW_LINE>Object returnValue = tryInvoke(method, target<MASK><NEW_LINE>// noinspection SimplifiableConditionalExpression<NEW_LINE>return propagateReturn ? (boolean) returnValue : true;<NEW_LINE>});<NEW_LINE>return new ListenerUnbinder<>(views, ON_LONG_CLICK);<NEW_LINE>} | , argumentTransformer.transform(v)); |
4,416 | public static ListFunctionMetasResponse unmarshall(ListFunctionMetasResponse listFunctionMetasResponse, UnmarshallerContext context) {<NEW_LINE>listFunctionMetasResponse.setRequestId(context.stringValue("ListFunctionMetasResponse.RequestId"));<NEW_LINE>listFunctionMetasResponse.setSuccess(context.booleanValue("ListFunctionMetasResponse.Success"));<NEW_LINE>listFunctionMetasResponse.setCode(context.stringValue("ListFunctionMetasResponse.Code"));<NEW_LINE>listFunctionMetasResponse.setMessage(context.stringValue("ListFunctionMetasResponse.Message"));<NEW_LINE>listFunctionMetasResponse.setHttpStatusCode(context.integerValue("ListFunctionMetasResponse.HttpStatusCode"));<NEW_LINE>List<FunctionMeta> functionMetas = new ArrayList<FunctionMeta>();<NEW_LINE>for (int i = 0; i < context.lengthValue("ListFunctionMetasResponse.FunctionMetas.Length"); i++) {<NEW_LINE>FunctionMeta functionMeta = new FunctionMeta();<NEW_LINE>functionMeta.setFunctionId(context.stringValue("ListFunctionMetasResponse.FunctionMetas[" + i + "].FunctionId"));<NEW_LINE>functionMeta.setInstance(context.stringValue("ListFunctionMetasResponse.FunctionMetas[" + i + "].Instance"));<NEW_LINE>functionMeta.setAlipkUserId(context.stringValue<MASK><NEW_LINE>functionMeta.setRegion(context.stringValue("ListFunctionMetasResponse.FunctionMetas[" + i + "].Region"));<NEW_LINE>functionMeta.setService(context.stringValue("ListFunctionMetasResponse.FunctionMetas[" + i + "].Service"));<NEW_LINE>functionMeta.setFunctionName(context.stringValue("ListFunctionMetasResponse.FunctionMetas[" + i + "].FunctionName"));<NEW_LINE>functionMeta.setRole(context.stringValue("ListFunctionMetasResponse.FunctionMetas[" + i + "].Role"));<NEW_LINE>functionMeta.setDescription(context.stringValue("ListFunctionMetasResponse.FunctionMetas[" + i + "].Description"));<NEW_LINE>functionMetas.add(functionMeta);<NEW_LINE>}<NEW_LINE>listFunctionMetasResponse.setFunctionMetas(functionMetas);<NEW_LINE>return listFunctionMetasResponse;<NEW_LINE>} | ("ListFunctionMetasResponse.FunctionMetas[" + i + "].AlipkUserId")); |
981,785 | private void dumpRelationships(List<AbstractChordInter> stdChords) {<NEW_LINE>// List BeamGroups<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>for (BeamGroupInter group : measure.getBeamGroups()) {<NEW_LINE>logger.info(" {}", group);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// List chords relationships<NEW_LINE>StringBuilder sb = new StringBuilder(" ");<NEW_LINE>int length = stdChords.size();<NEW_LINE>for (int ix = 0; ix < length; ix++) {<NEW_LINE>sb.append(String.format(" %5s", stdChords.get(<MASK><NEW_LINE>}<NEW_LINE>for (int iy = 0; iy < length; iy++) {<NEW_LINE>AbstractChordInter chy = stdChords.get(iy);<NEW_LINE>sb.append("\n");<NEW_LINE>sb.append(String.format("%5s", chy.getId()));<NEW_LINE>for (int ix = 0; ix < length; ix++) {<NEW_LINE>sb.append(" ");<NEW_LINE>AbstractChordInter chx = stdChords.get(ix);<NEW_LINE>Rel rel = getRel(chy, chx);<NEW_LINE>if (rel != null) {<NEW_LINE>sb.append(" ").append(rel).append(" ");<NEW_LINE>} else {<NEW_LINE>sb.append(" . ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Append chord description<NEW_LINE>sb.append(" ").append(chy);<NEW_LINE>}<NEW_LINE>logger.info("\nwide:{}\n{}", useWideSlots, sb);<NEW_LINE>} | ix).getId())); |
456,287 | public void onNonNullFieldAssignment(Symbol field, AccessPathNullnessAnalysis analysis, VisitorState state) {<NEW_LINE>// Traversing AST is costly, therefore we access the initializer method through the leaf node in<NEW_LINE>// state parameter<NEW_LINE>TreePath pathToMethod = NullabilityUtil.<MASK><NEW_LINE>if (pathToMethod == null || pathToMethod.getLeaf().getKind() != Tree.Kind.METHOD) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Symbol.MethodSymbol methodSymbol = (Symbol.MethodSymbol) ASTHelpers.getSymbol(pathToMethod.getLeaf());<NEW_LINE>// Check if the method and the field are in the same class.<NEW_LINE>if (!field.enclClass().equals(methodSymbol.enclClass())) {<NEW_LINE>// We don't want m in A.m() to be a candidate initializer for B.f unless A == B<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// We are only looking for non-constructor methods that initialize a class field.<NEW_LINE>if (methodSymbol.getKind() == ElementKind.CONSTRUCTOR) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String fieldName = field.getSimpleName().toString();<NEW_LINE>boolean leavesNonNullAtExitPoint = analysis.getNonnullFieldsOfReceiverAtExit(pathToMethod, state.context).stream().anyMatch(element -> element.getSimpleName().toString().equals(fieldName));<NEW_LINE>if (!leavesNonNullAtExitPoint) {<NEW_LINE>// Method does not keep the field @NonNull at exit point and fails the post condition to be an<NEW_LINE>// Initializer.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>NullabilityUtil.castToNonNull(config.getSerializer()).serializeFieldInitializationInfo(new FieldInitializationInfo(methodSymbol, field));<NEW_LINE>} | findEnclosingMethodOrLambdaOrInitializer(state.getPath()); |
1,792,786 | public ConstantPropagationStore leastUpperBound(ConstantPropagationStore other) {<NEW_LINE>Map<Node, Constant> newContents = new LinkedHashMap<>(contents.size() + other.contents.size());<NEW_LINE>// go through all of the information of the other class<NEW_LINE>for (Map.Entry<Node, Constant> e : other.contents.entrySet()) {<NEW_LINE>Node n = e.getKey();<NEW_LINE>Constant otherVal = e.getValue();<NEW_LINE>if (contents.containsKey(n)) {<NEW_LINE>// merge if both contain information about a variable<NEW_LINE>newContents.put(n, otherVal.leastUpperBound(contents.get(n)));<NEW_LINE>} else {<NEW_LINE>// add new information<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<Node, Constant> e : contents.entrySet()) {<NEW_LINE>Node n = e.getKey();<NEW_LINE>Constant thisVal = e.getValue();<NEW_LINE>if (!other.contents.containsKey(n)) {<NEW_LINE>// add new information<NEW_LINE>newContents.put(n, thisVal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ConstantPropagationStore(newContents);<NEW_LINE>} | newContents.put(n, otherVal); |
540,043 | public void draw(@NonNull Canvas canvas) {<NEW_LINE>if (colorItem == null) {<NEW_LINE>// should not happen, but do not crash.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int size = Math.min(getBounds().height(), getBounds().width());<NEW_LINE>// Assume height and width are the same after onMeasure.<NEW_LINE>float radius = size / 2f;<NEW_LINE>// Painting a circle is fun! If filled, the circle reaches exactly to radius, but if using a<NEW_LINE>// stroke then the stroke is half inside of the radius and half outside, hence the funny<NEW_LINE>// calculations.<NEW_LINE>// Paint a black outline.<NEW_LINE>canvas.drawCircle(radius, radius, radius - borderWidth / 2f, paintBorder);<NEW_LINE>// Paint the colored circle.<NEW_LINE>paintFill.setColor(colorItem.getColor());<NEW_LINE>canvas.drawCircle(radius, radius, radius - borderWidth / 2f, paintFill);<NEW_LINE>if (colorItem.isSelected()) {<NEW_LINE>int iconHeight = checkMark.getIntrinsicHeight();<NEW_LINE>int iconWidth = checkMark.getIntrinsicWidth();<NEW_LINE>// Assume that size is bigger than the checkmark, I'm guaranteeing that by using 24dp icons<NEW_LINE>// and making the minimum size 40dp.<NEW_LINE>int x <MASK><NEW_LINE>int y = (size - iconHeight) / 2;<NEW_LINE>checkMark.setBounds(x, y, x + iconWidth, y + iconHeight);<NEW_LINE>checkMark.draw(canvas);<NEW_LINE>}<NEW_LINE>} | = (size - iconWidth) / 2; |
86,381 | public static ListK8sConfigMapsResponse unmarshall(ListK8sConfigMapsResponse listK8sConfigMapsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listK8sConfigMapsResponse.setRequestId(_ctx.stringValue("ListK8sConfigMapsResponse.RequestId"));<NEW_LINE>listK8sConfigMapsResponse.setCode(_ctx.integerValue("ListK8sConfigMapsResponse.Code"));<NEW_LINE>listK8sConfigMapsResponse.setMessage(_ctx.stringValue("ListK8sConfigMapsResponse.Message"));<NEW_LINE>List<ResultItem> result = new ArrayList<ResultItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListK8sConfigMapsResponse.Result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>resultItem.setTotal(_ctx.integerValue("ListK8sConfigMapsResponse.Result[" + i + "].Total"));<NEW_LINE>List<ConfigMapsItem> configMaps = new ArrayList<ConfigMapsItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListK8sConfigMapsResponse.Result[" + i + "].ConfigMaps.Length"); j++) {<NEW_LINE>ConfigMapsItem configMapsItem = new ConfigMapsItem();<NEW_LINE>configMapsItem.setName(_ctx.stringValue("ListK8sConfigMapsResponse.Result[" + i + "].ConfigMaps[" + j + "].Name"));<NEW_LINE>configMapsItem.setNamespace(_ctx.stringValue("ListK8sConfigMapsResponse.Result[" + i + "].ConfigMaps[" + j + "].Namespace"));<NEW_LINE>configMapsItem.setClusterId(_ctx.stringValue("ListK8sConfigMapsResponse.Result[" + i + "].ConfigMaps[" + j + "].ClusterId"));<NEW_LINE>configMapsItem.setClusterName(_ctx.stringValue("ListK8sConfigMapsResponse.Result[" + i + "].ConfigMaps[" + j + "].ClusterName"));<NEW_LINE>configMapsItem.setCreationTime(_ctx.stringValue("ListK8sConfigMapsResponse.Result[" + i + "].ConfigMaps[" + j + "].CreationTime"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("ListK8sConfigMapsResponse.Result[" + i + "].ConfigMaps[" + j + "].Data.Length"); k++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setKey(_ctx.stringValue("ListK8sConfigMapsResponse.Result[" + i + "].ConfigMaps[" + j <MASK><NEW_LINE>dataItem.setValue(_ctx.stringValue("ListK8sConfigMapsResponse.Result[" + i + "].ConfigMaps[" + j + "].Data[" + k + "].Value"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>configMapsItem.setData(data);<NEW_LINE>List<RelatedAppsItem> relatedApps = new ArrayList<RelatedAppsItem>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("ListK8sConfigMapsResponse.Result[" + i + "].ConfigMaps[" + j + "].RelatedApps.Length"); k++) {<NEW_LINE>RelatedAppsItem relatedAppsItem = new RelatedAppsItem();<NEW_LINE>relatedAppsItem.setAppName(_ctx.stringValue("ListK8sConfigMapsResponse.Result[" + i + "].ConfigMaps[" + j + "].RelatedApps[" + k + "].AppName"));<NEW_LINE>relatedAppsItem.setAppId(_ctx.stringValue("ListK8sConfigMapsResponse.Result[" + i + "].ConfigMaps[" + j + "].RelatedApps[" + k + "].AppId"));<NEW_LINE>relatedApps.add(relatedAppsItem);<NEW_LINE>}<NEW_LINE>configMapsItem.setRelatedApps(relatedApps);<NEW_LINE>configMaps.add(configMapsItem);<NEW_LINE>}<NEW_LINE>resultItem.setConfigMaps(configMaps);<NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>listK8sConfigMapsResponse.setResult(result);<NEW_LINE>return listK8sConfigMapsResponse;<NEW_LINE>} | + "].Data[" + k + "].Key")); |
963,130 | public static void average(Planar<GrayF32> from, GrayF32 to) {<NEW_LINE>int numBands = from.getNumBands();<NEW_LINE>if (numBands == 1) {<NEW_LINE>to.setTo(from.getBand(0));<NEW_LINE>} else if (numBands == 3) {<NEW_LINE>GrayF32 band0 = from.getBand(0);<NEW_LINE>GrayF32 band1 = from.getBand(1);<NEW_LINE>GrayF32 band2 = from.getBand(2);<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, from.height, y -> {<NEW_LINE>for (int y = 0; y < from.height; y++) {<NEW_LINE>int indexFrom = from.getIndex(0, y);<NEW_LINE>int indexTo = to.getIndex(0, y);<NEW_LINE>for (int x = 0; x < from.width; x++, indexFrom++) {<NEW_LINE>float sum = band0.data[indexFrom];<NEW_LINE><MASK><NEW_LINE>sum += band2.data[indexFrom];<NEW_LINE>to.data[indexTo++] = (sum / 3);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, from.height, y -> {<NEW_LINE>for (int y = 0; y < from.height; y++) {<NEW_LINE>int indexFrom = from.getIndex(0, y);<NEW_LINE>int indexTo = to.getIndex(0, y);<NEW_LINE>for (int x = 0; x < from.width; x++, indexFrom++) {<NEW_LINE>float sum = 0;<NEW_LINE>for (int b = 0; b < numBands; b++) {<NEW_LINE>sum += from.bands[b].data[indexFrom];<NEW_LINE>}<NEW_LINE>to.data[indexTo++] = (sum / numBands);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}<NEW_LINE>} | sum += band1.data[indexFrom]; |
143,066 | final GetModelPackageGroupPolicyResult executeGetModelPackageGroupPolicy(GetModelPackageGroupPolicyRequest getModelPackageGroupPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getModelPackageGroupPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetModelPackageGroupPolicyRequest> request = null;<NEW_LINE>Response<GetModelPackageGroupPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetModelPackageGroupPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getModelPackageGroupPolicyRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetModelPackageGroupPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetModelPackageGroupPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetModelPackageGroupPolicyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,463,681 | static void normalMenuStartUp(MainActivity mainActivity, Class[] activitiesDemo) {<NEW_LINE>String[] layouts = getLayouts(s <MASK><NEW_LINE>ScrollView sv = new ScrollView(mainActivity);<NEW_LINE>LinearLayout linearLayout = new LinearLayout(mainActivity);<NEW_LINE>linearLayout.setOrientation(LinearLayout.VERTICAL);<NEW_LINE>for (int i = 0; i < layouts.length; i++) {<NEW_LINE>Button button = new Button(mainActivity);<NEW_LINE>button.setText(layouts[i]);<NEW_LINE>button.setTag(layouts[i]);<NEW_LINE>linearLayout.addView(button);<NEW_LINE>button.setOnClickListener(view -> launch(mainActivity, (String) view.getTag()));<NEW_LINE>}<NEW_LINE>for (Class aClass : activitiesDemo) {<NEW_LINE>Button button = new Button(mainActivity);<NEW_LINE>button.setText("Demo from " + aClass.getSimpleName());<NEW_LINE>linearLayout.addView(button);<NEW_LINE>button.setOnClickListener(v -> {<NEW_LINE>Intent intent = new Intent(mainActivity, aClass);<NEW_LINE>mainActivity.startActivity(intent);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>sv.addView(linearLayout);<NEW_LINE>mainActivity.setContentView(sv);<NEW_LINE>} | -> s.matches(LAYOUTS_MATCHES)); |
554,756 | protected void renderConduitDynamic(@Nonnull IConduitTexture tex, @Nonnull IClientConduit.WithDefaultRendering conduit, @Nonnull CollidableComponent component, float brightness) {<NEW_LINE>GlStateManager.color(1, 1, 1);<NEW_LINE>if (component.isDirectional() && component.data == null) {<NEW_LINE>final EnumFacing componentDirection = component.getDirection();<NEW_LINE>float scaleFactor = 0.75f;<NEW_LINE>float xLen = Math.abs(componentDirection.getFrontOffsetX()) == 1 ? 1 : scaleFactor;<NEW_LINE>float yLen = Math.abs(componentDirection.getFrontOffsetY()) == 1 ? 1 : scaleFactor;<NEW_LINE>float zLen = Math.abs(componentDirection.getFrontOffsetZ()) == 1 ? 1 : scaleFactor;<NEW_LINE>BoundingBox cube = component.bound;<NEW_LINE>BoundingBox bb = cube.scale(xLen, yLen, zLen);<NEW_LINE>TextureAtlasSprite sprite = tex.getSprite();<NEW_LINE>drawDynamicSection(bb, sprite.getInterpolatedU(tex.getUv().x * 16), sprite.getInterpolatedU(tex.getUv().z * 16), sprite.getInterpolatedV(tex.getUv().y * 16), sprite.getInterpolatedV(tex.getUv().w * 16), componentDirection, <MASK><NEW_LINE>if (conduit.getConnectionMode(componentDirection) == ConnectionMode.DISABLED) {<NEW_LINE>TextureAtlasSprite tex2 = ConduitBundleRenderManager.instance.getConnectorIcon(component.data);<NEW_LINE>List<Vertex> corners = component.bound.getCornersWithUvForFace(componentDirection, tex2.getMinU(), tex2.getMaxU(), tex2.getMinV(), tex2.getMaxV());<NEW_LINE>RenderUtil.addVerticesToTessellator(corners, DefaultVertexFormats.POSITION_TEX, false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// TODO: HL: I commented this out because component.getDirection() (the second to last parameter) is always null in<NEW_LINE>// this else branch and drawDynamicSection() with isTransmission=true (last parameter) would NPE on it. (Not a<NEW_LINE>// mistake in the component.dir encapsulation, this was that way before.)<NEW_LINE>// drawDynamicSection(component.bound, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV(), dir, true);<NEW_LINE>}<NEW_LINE>} | false, conduit.shouldMirrorTexture()); |
5,582 | private void initData() {<NEW_LINE>fragments = new ArrayList<>(4);<NEW_LINE>items = new SparseIntArray(4);<NEW_LINE>Fragment_1_Base basicsFragment = new Fragment_1_Base();<NEW_LINE>Fragment_2_Custom customFragment = new Fragment_2_Custom();<NEW_LINE>Fragment_3_List complexFragment = new Fragment_3_List();<NEW_LINE>Fragment_4_More otherFragment = new Fragment_4_More();<NEW_LINE>fragments.add(basicsFragment);<NEW_LINE>fragments.add(customFragment);<NEW_LINE>fragments.add(complexFragment);<NEW_LINE>fragments.add(otherFragment);<NEW_LINE>items.put(R.id.i_base, 0);<NEW_LINE>items.put(<MASK><NEW_LINE>items.put(R.id.i_complex, 2);<NEW_LINE>items.put(R.id.i_other, 3);<NEW_LINE>adapter = new VpAdapter(getSupportFragmentManager(), fragments);<NEW_LINE>viewPager.setAdapter(adapter);<NEW_LINE>viewPager.setOffscreenPageLimit(items.size());<NEW_LINE>} | R.id.i_custom, 1); |
1,015,741 | public <T0, T1, T2, T3, T4, T5, T6, T> Join<T> createJoin(final List<Stage<?>> stages, final Function7<T0, T1, T2, T3, T4, T5, T6, T> constructor, final TableIdentifier<T0> t0, final TableIdentifier<T1> t1, final TableIdentifier<T2> t2, final TableIdentifier<T3> t3, final TableIdentifier<T4> t4, final TableIdentifier<T5> t5, final TableIdentifier<T6> t6) {<NEW_LINE>final SqlFunction<ResultSet, T0> rsMapper0 = rsMapper(stages, 0, t0);<NEW_LINE>final SqlFunction<ResultSet, T1> rsMapper1 = rsMapper(stages, 1, t1);<NEW_LINE>final SqlFunction<ResultSet, T2> rsMapper2 = <MASK><NEW_LINE>final SqlFunction<ResultSet, T3> rsMapper3 = rsMapper(stages, 3, t3);<NEW_LINE>final SqlFunction<ResultSet, T4> rsMapper4 = rsMapper(stages, 4, t4);<NEW_LINE>final SqlFunction<ResultSet, T5> rsMapper5 = rsMapper(stages, 5, t5);<NEW_LINE>final SqlFunction<ResultSet, T6> rsMapper6 = rsMapper(stages, 6, t6);<NEW_LINE>final SqlFunction<ResultSet, T> rsMapper = rs -> constructor.apply(rsMapper0.apply(rs), rsMapper1.apply(rs), rsMapper2.apply(rs), rsMapper3.apply(rs), rsMapper4.apply(rs), rsMapper5.apply(rs), rsMapper6.apply(rs));<NEW_LINE>return newJoin(stages, rsMapper);<NEW_LINE>} | rsMapper(stages, 2, t2); |
1,803,917 | final GetIntentResult executeGetIntent(GetIntentRequest getIntentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getIntentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetIntentRequest> request = null;<NEW_LINE>Response<GetIntentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetIntentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getIntentRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lex Model Building Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetIntent");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetIntentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetIntentResultJsonUnmarshaller());<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); |
1,141,234 | final AssociateInstanceEventWindowResult executeAssociateInstanceEventWindow(AssociateInstanceEventWindowRequest associateInstanceEventWindowRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateInstanceEventWindowRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateInstanceEventWindowRequest> request = null;<NEW_LINE>Response<AssociateInstanceEventWindowResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateInstanceEventWindowRequestMarshaller().marshall(super.beforeMarshalling(associateInstanceEventWindowRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateInstanceEventWindow");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<AssociateInstanceEventWindowResult> responseHandler = new StaxResponseHandler<AssociateInstanceEventWindowResult>(new AssociateInstanceEventWindowResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2"); |
67,425 | public static void partialReduceDoubleMin(double[] inputArray, double[] outputArray, int gidx) {<NEW_LINE>int localIdx = OpenCLIntrinsics.get_local_id(0);<NEW_LINE>int localGroupSize = OpenCLIntrinsics.get_local_size(0);<NEW_LINE>int groupID = OpenCLIntrinsics.get_group_id(0);<NEW_LINE>double[] localArray = (double[]) NewArrayNode.<MASK><NEW_LINE>localArray[localIdx] = inputArray[gidx];<NEW_LINE>for (int stride = (localGroupSize / 2); stride > 0; stride /= 2) {<NEW_LINE>OpenCLIntrinsics.localBarrier();<NEW_LINE>if (localIdx < stride) {<NEW_LINE>localArray[localIdx] = TornadoMath.min(localArray[localIdx], localArray[localIdx + stride]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OpenCLIntrinsics.globalBarrier();<NEW_LINE>if (localIdx == 0) {<NEW_LINE>outputArray[groupID + 1] = localArray[0];<NEW_LINE>}<NEW_LINE>} | newUninitializedArray(double.class, LOCAL_WORK_GROUP_SIZE); |
749,437 | public static DecoupledTemplateLogic computeDecoupledTemplateLogic(final IEngineConfiguration configuration, final String ownerTemplate, final String template, final Set<String> templateSelectors, final ITemplateResource resource, final TemplateMode templateMode, final IMarkupParser parser) throws IOException, ParseException {<NEW_LINE>Validate.notNull(configuration, "Engine Configuration cannot be null");<NEW_LINE>Validate.notNull(template, "Template cannot be null");<NEW_LINE>Validate.notNull(resource, "Template Resource cannot be null");<NEW_LINE>Validate.notNull(templateMode, "Template Mode cannot be null");<NEW_LINE>final IDecoupledTemplateLogicResolver decoupledTemplateLogicResolver = configuration.getDecoupledTemplateLogicResolver();<NEW_LINE>final ITemplateResource decoupledResource = decoupledTemplateLogicResolver.resolveDecoupledTemplateLogic(configuration, ownerTemplate, template, templateSelectors, resource, templateMode);<NEW_LINE>if (!decoupledResource.exists()) {<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("[THYMELEAF][{}] Decoupled logic for template \"{}\" could not be resolved as relative resource \"{}\". " + "This does not need to be an error, as templates may lack a corresponding decoupled logic file.", new Object[] { TemplateEngine.threadIndex(), LoggingUtils.loggifyTemplateName(template), decoupledResource.getDescription() });<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("[THYMELEAF][{}] Decoupled logic for template \"{}\" has been resolved as relative resource \"{}\"", new Object[] { TemplateEngine.threadIndex(), LoggingUtils.loggifyTemplateName(template)<MASK><NEW_LINE>}<NEW_LINE>final DecoupledTemplateLogicBuilderMarkupHandler decoupledMarkupHandler = new DecoupledTemplateLogicBuilderMarkupHandler(template, templateMode);<NEW_LINE>parser.parse(decoupledResource.reader(), decoupledMarkupHandler);<NEW_LINE>return decoupledMarkupHandler.getDecoupledTemplateLogic();<NEW_LINE>} | , decoupledResource.getDescription() }); |
373,523 | private boolean isMatch(String str, int i, String pattern, int j, Map<Character, String> map, Set<String> set) {<NEW_LINE>// base case<NEW_LINE>if (i == str.length() && j == pattern.length()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (i == str.length() || j == pattern.length()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>char c = pattern.charAt(j);<NEW_LINE>if (map.containsKey(c)) {<NEW_LINE>String s = map.get(c);<NEW_LINE>// check to see if we can use s to match str.substring(i, i + s.length())<NEW_LINE>if (!str.startsWith(s, i)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// if it's match, great, then let's check the rest<NEW_LINE>return isMatch(str, i + s.length(), pattern, <MASK><NEW_LINE>}<NEW_LINE>for (int k = i; k < str.length(); k++) {<NEW_LINE>String p = str.substring(i, k + 1);<NEW_LINE>if (set.contains(p)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>map.put(c, p);<NEW_LINE>set.add(p);<NEW_LINE>// continue to match the rest<NEW_LINE>if (isMatch(str, k + 1, pattern, j + 1, map, set)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// backtracking<NEW_LINE>map.remove(c);<NEW_LINE>set.remove(p);<NEW_LINE>}<NEW_LINE>// we've tried everything, but still no luck<NEW_LINE>return false;<NEW_LINE>} | j + 1, map, set); |
1,563,332 | void updateUrlTitleAndText(String urlAsString) {<NEW_LINE>String title = MainApplication.sTitleHashMap != null ? MainApplication.sTitleHashMap.get(urlAsString) : null;<NEW_LINE>boolean showTitleUrl = !urlAsString.equals(getContext().getString<MASK><NEW_LINE>if (title == null) {<NEW_LINE>title = mLoadingString;<NEW_LINE>} else if (!showTitleUrl) {<NEW_LINE>mTitleTextView.setTextColor(0xFFFFFFFF);<NEW_LINE>}<NEW_LINE>mTitleTextView.setText(title);<NEW_LINE>if (urlAsString.equals(Constant.NEW_TAB_URL)) {<NEW_LINE>mUrlTextView.setText(null);<NEW_LINE>} else if (urlAsString.equals(Constant.WELCOME_MESSAGE_URL)) {<NEW_LINE>mUrlTextView.setText(Constant.WELCOME_MESSAGE_DISPLAY_URL);<NEW_LINE>} else {<NEW_LINE>mUrlTextView.setText(urlAsString.replace("http://", ""));<NEW_LINE>if (!showTitleUrl) {<NEW_LINE>mUrlTextView.setTextColor(0xFFFFFFFF);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (R.string.empty_bubble_page)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.