idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
826,855 | public void testSessionInfoCache(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>String sessionId = request.getParameter("sessionId");<NEW_LINE>String expectedAttributes = request.getParameter("attributes");<NEW_LINE>boolean allowOtherAttributes = Boolean.parseBoolean(request.getParameter("allowOtherAttributes"));<NEW_LINE>List<String> expected = expectedAttributes == null ? Collections.emptyList() : Arrays.asList(expectedAttributes.split(","));<NEW_LINE>Cache<String, ArrayList> cache = getMetaCache();<NEW_LINE>ArrayList<?> <MASK><NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>TreeSet<String> // last entry is the session attribute names<NEW_LINE>attributeNames = (TreeSet<String>) values.get(values.size() - 1);<NEW_LINE>assertTrue(expected + " not found in " + attributeNames, attributeNames.containsAll(expected));<NEW_LINE>if (!allowOtherAttributes)<NEW_LINE>assertTrue("Some extra attributes found within " + attributeNames, expected.containsAll(attributeNames));<NEW_LINE>} | values = cache.get(sessionId); |
113,435 | private Modifier[] checkModifiers(Modifier[] modifiers, String... allowedKeywords) throws CompileException {<NEW_LINE>// Check for duplicate annotations is not possible at parse-time because the annotations' types must be<NEW_LINE>// *resolved* before we can check for duplicates. See "UnitCompiler.compileAnnotations()".<NEW_LINE>Set<String> keywords = new HashSet<>();<NEW_LINE>for (Modifier m : modifiers) {<NEW_LINE>if (!(m instanceof Java.AccessModifier))<NEW_LINE>continue;<NEW_LINE>AccessModifier am = (Java.AccessModifier) m;<NEW_LINE>// Duplicate access modifier?<NEW_LINE>if (!keywords.add(am.keyword)) {<NEW_LINE>throw Parser.compileException("Duplication access modifier \"" + am.keyword + "\"", am.getLocation());<NEW_LINE>}<NEW_LINE>// Mutually exclusive access modifier keywords?<NEW_LINE>for (Set<String> meams : Parser.MUTUALLY_EXCLUSIVE_ACCESS_MODIFIERS) {<NEW_LINE>Set<String> tmp <MASK><NEW_LINE>tmp.retainAll(meams);<NEW_LINE>if (tmp.size() > 1) {<NEW_LINE>String[] a = (String[]) tmp.toArray(new String[tmp.size()]);<NEW_LINE>Arrays.sort(a);<NEW_LINE>throw Parser.compileException("Only one of " + Parser.join(a, " ") + " is allowed", am.getLocation());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Disallowed access modifiers?<NEW_LINE>for (String kw : allowedKeywords) keywords.remove(kw);<NEW_LINE>if (!keywords.isEmpty()) {<NEW_LINE>String[] a = (String[]) keywords.toArray(new String[keywords.size()]);<NEW_LINE>Arrays.sort(a);<NEW_LINE>throw this.compileException("Access modifier(s) " + Parser.join(a, " ") + " not allowed in this context");<NEW_LINE>}<NEW_LINE>return modifiers;<NEW_LINE>} | = new HashSet<>(keywords); |
149,895 | public void draw(Canvas canvas) {<NEW_LINE>super.draw(canvas);<NEW_LINE>if (mEdgeGlowTop != null) {<NEW_LINE>final int scrollY = getScrollY();<NEW_LINE>final int scrollX = getScrollX();<NEW_LINE>if (!mEdgeGlowTop.isFinished() && isVerticalScrollBarEnabled()) {<NEW_LINE>final int restoreCount = canvas.save();<NEW_LINE>final int width;<NEW_LINE>final int height;<NEW_LINE>final float translateX;<NEW_LINE>final float translateY;<NEW_LINE>width = getWidth();<NEW_LINE>height = getHeight();<NEW_LINE>translateX = 0;<NEW_LINE>translateY = 0;<NEW_LINE>canvas.translate(scrollX + translateX, Math.min(0, scrollY) + translateY);<NEW_LINE><MASK><NEW_LINE>// Log.w(this.toString(),"mEdgeGlowTop.draw(): scrollX="+String.valueOf(scrollX)+", scrollY="+String.valueOf(scrollY)+", translateX="+String.valueOf(translateX)+", translateY="+String.valueOf(translateY));<NEW_LINE>if (mEdgeGlowTop.draw(canvas)) {<NEW_LINE>postInvalidateOnAnimation();<NEW_LINE>}<NEW_LINE>canvas.restoreToCount(restoreCount);<NEW_LINE>}<NEW_LINE>if (!mEdgeGlowBottom.isFinished() && isVerticalScrollBarEnabled()) {<NEW_LINE>final int restoreCount = canvas.save();<NEW_LINE>final int width;<NEW_LINE>final int height;<NEW_LINE>final float translateX;<NEW_LINE>final float translateY;<NEW_LINE>width = getWidth();<NEW_LINE>height = getHeight();<NEW_LINE>translateX = 0;<NEW_LINE>translateY = 0;<NEW_LINE>canvas.translate(scrollX - width + translateX, Math.max(getVerticalScrollRange(), scrollY) + height + translateY);<NEW_LINE>canvas.rotate(180, width, 0);<NEW_LINE>mEdgeGlowBottom.setSize(width, height);<NEW_LINE>if (mEdgeGlowBottom.draw(canvas)) {<NEW_LINE>postInvalidateOnAnimation();<NEW_LINE>}<NEW_LINE>canvas.restoreToCount(restoreCount);<NEW_LINE>}<NEW_LINE>if (!mEdgeGlowLeft.isFinished() && isHorizontalScrollBarEnabled()) {<NEW_LINE>final int restoreCount = canvas.save();<NEW_LINE>final int height = getHeight() - getPaddingTop() - getPaddingBottom();<NEW_LINE>canvas.rotate(270);<NEW_LINE>canvas.translate(-scrollY - height + getPaddingTop(), Math.min(0, scrollX));<NEW_LINE>mEdgeGlowLeft.setSize(height, getWidth());<NEW_LINE>// Log.w(this.toString(),"mEdgeGlowLeft.draw()");<NEW_LINE>if (mEdgeGlowLeft.draw(canvas)) {<NEW_LINE>postInvalidateOnAnimation();<NEW_LINE>}<NEW_LINE>canvas.restoreToCount(restoreCount);<NEW_LINE>}<NEW_LINE>if (!mEdgeGlowRight.isFinished() && isHorizontalScrollBarEnabled()) {<NEW_LINE>final int restoreCount = canvas.save();<NEW_LINE>final int width = getWidth();<NEW_LINE>final int height = getHeight() - getPaddingTop() - getPaddingBottom();<NEW_LINE>canvas.rotate(90);<NEW_LINE>canvas.translate(scrollY - getPaddingTop(), -(Math.max(getHorizontalScrollRange(), scrollX) + width));<NEW_LINE>mEdgeGlowRight.setSize(height, width);<NEW_LINE>// Log.w(this.toString(),"mEdgeGlowRight.draw()");<NEW_LINE>if (mEdgeGlowRight.draw(canvas)) {<NEW_LINE>postInvalidateOnAnimation();<NEW_LINE>}<NEW_LINE>canvas.restoreToCount(restoreCount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | mEdgeGlowTop.setSize(width, height); |
1,357,715 | private ConnectionConfig promptAndChangePassword(ConnectionConfig connectionConfig, String message) throws Exception {<NEW_LINE>if (message != null) {<NEW_LINE>terminal.write().println(message);<NEW_LINE>}<NEW_LINE>if (connectionConfig.username().isEmpty()) {<NEW_LINE>String username = isOutputInteractive ? promptForNonEmptyText("username", null) : promptForText("username", null);<NEW_LINE>connectionConfig.setUsername(username);<NEW_LINE>}<NEW_LINE>if (connectionConfig.password().isEmpty()) {<NEW_LINE>connectionConfig.setPassword(promptForText("password", '*'));<NEW_LINE>}<NEW_LINE>String newPassword = isOutputInteractive ? promptForNonEmptyText("new password", '*'<MASK><NEW_LINE>String reenteredNewPassword = promptForText("confirm password", '*');<NEW_LINE>if (!reenteredNewPassword.equals(newPassword)) {<NEW_LINE>throw new CommandException("Passwords are not matching.");<NEW_LINE>}<NEW_LINE>shell.changePassword(connectionConfig, newPassword);<NEW_LINE>connectionConfig.setPassword(newPassword);<NEW_LINE>return connectionConfig;<NEW_LINE>} | ) : promptForText("new password", '*'); |
1,192,765 | public void listSecretsCodeSnippets() {<NEW_LINE>SecretClient secretClient = getSecretClient();<NEW_LINE>// BEGIN: com.azure.security.keyvault.secretclient.listSecrets<NEW_LINE>for (SecretProperties secret : secretClient.listPropertiesOfSecrets()) {<NEW_LINE>KeyVaultSecret secretWithValue = secretClient.getSecret(secret.getName(), secret.getVersion());<NEW_LINE>System.out.printf("Received secret with name %s and value %s", secretWithValue.getName(), secretWithValue.getValue());<NEW_LINE>}<NEW_LINE>// END: com.azure.security.keyvault.secretclient.listSecrets<NEW_LINE>// BEGIN: com.azure.security.keyvault.secretclient.listSecrets#Context<NEW_LINE>for (SecretProperties secret : secretClient.listPropertiesOfSecrets(new Context(key1, value2))) {<NEW_LINE>KeyVaultSecret secretWithValue = secretClient.getSecret(secret.getName(), secret.getVersion());<NEW_LINE>System.out.printf("Received secret with name %s and value %s", secretWithValue.getName(<MASK><NEW_LINE>}<NEW_LINE>// END: com.azure.security.keyvault.secretclient.listSecrets#Context<NEW_LINE>// BEGIN: com.azure.security.keyvault.secretclient.listSecrets.iterableByPage<NEW_LINE>secretClient.listPropertiesOfSecrets().iterableByPage().forEach(resp -> {<NEW_LINE>System.out.printf("Response headers are %s. Url %s and status code %d %n", resp.getHeaders(), resp.getRequest().getUrl(), resp.getStatusCode());<NEW_LINE>resp.getItems().forEach(value -> {<NEW_LINE>KeyVaultSecret secretWithValue = secretClient.getSecret(value.getName(), value.getVersion());<NEW_LINE>System.out.printf("Received secret with name %s and value %s", secretWithValue.getName(), secretWithValue.getValue());<NEW_LINE>});<NEW_LINE>});<NEW_LINE>// END: com.azure.security.keyvault.secretclient.listSecrets.iterableByPage<NEW_LINE>} | ), secretWithValue.getValue()); |
319,479 | private Concrete.Expression simplifyLetClause(Expression expr) {<NEW_LINE>List<Object> list = new ArrayList<>();<NEW_LINE>while (true) {<NEW_LINE>expr = expr.getUnderlyingExpression();<NEW_LINE>if (expr instanceof ProjExpression) {<NEW_LINE>list.add(((ProjExpression) expr).getField());<NEW_LINE>expr = ((ProjExpression) expr).getExpression();<NEW_LINE>} else if (expr instanceof FieldCallExpression) {<NEW_LINE>list.add(((FieldCallExpression) expr).getDefinition());<NEW_LINE>expr = ((FieldCallExpression) expr).getArgument();<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (expr instanceof ReferenceExpression && ((ReferenceExpression) expr).getBinding() instanceof HaveClause) {<NEW_LINE>LetClausePattern pattern = ((HaveClause) ((ReferenceExpression) expr).getBinding()).getPattern();<NEW_LINE>for (int i = list.size() - 1; i >= 0; i--) {<NEW_LINE>if (pattern == null)<NEW_LINE>return null;<NEW_LINE>int index;<NEW_LINE>if (list.get(i) instanceof Integer) {<NEW_LINE>index = (<MASK><NEW_LINE>} else if (list.get(i) instanceof ClassField) {<NEW_LINE>ClassField field = (ClassField) list.get(i);<NEW_LINE>if (pattern.getFields() == null)<NEW_LINE>return null;<NEW_LINE>index = pattern.getFields().indexOf(field);<NEW_LINE>} else<NEW_LINE>return null;<NEW_LINE>List<? extends LetClausePattern> patterns = pattern.getPatterns();<NEW_LINE>if (patterns == null || index < 0 || index >= patterns.size())<NEW_LINE>return null;<NEW_LINE>pattern = patterns.get(index);<NEW_LINE>}<NEW_LINE>if (pattern.getName() != null) {<NEW_LINE>return new Concrete.ReferenceExpression(null, new LocalReferable(pattern.getName()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | int) list.get(i); |
898,322 | public WorkspaceItem createWorkspaceItem(Context context, Request request) throws SQLException, AuthorizeException {<NEW_LINE>WorkspaceItem wsi = null;<NEW_LINE>Collection collection = null;<NEW_LINE>String collectionUUID = request.getHttpServletRequest().getParameter("owningCollection");<NEW_LINE>if (StringUtils.isBlank(collectionUUID)) {<NEW_LINE>collectionUUID = configurationService.getProperty("submission.default.collection");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (StringUtils.isNotBlank(collectionUUID)) {<NEW_LINE>collection = collectionService.find(context, UUID.fromString(collectionUUID));<NEW_LINE>} else {<NEW_LINE>final List<Collection> findAuthorizedOptimized = collectionService.findAuthorizedOptimized(context, Constants.ADD);<NEW_LINE>if (findAuthorizedOptimized != null && findAuthorizedOptimized.size() > 0) {<NEW_LINE>collection = findAuthorizedOptimized.get(0);<NEW_LINE>} else {<NEW_LINE>throw new RESTAuthorizationException("No collection suitable for submission for the current user");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (collection == null) {<NEW_LINE>throw new RESTAuthorizationException("collectionUUID=" + collectionUUID + " not found");<NEW_LINE>}<NEW_LINE>wsi = workspaceItemService.<MASK><NEW_LINE>} catch (SQLException e) {<NEW_LINE>// wrap in a runtime exception as we cannot change the method signature<NEW_LINE>throw new UncategorizedScriptException(e.getMessage(), e);<NEW_LINE>} catch (AuthorizeException ae) {<NEW_LINE>throw new RESTAuthorizationException(ae);<NEW_LINE>}<NEW_LINE>return wsi;<NEW_LINE>} | create(context, collection, true); |
1,368,743 | private Mono<Response<Void>> resendEmailWithResponseAsync(String resourceGroupName, String certificateOrderName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (certificateOrderName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.resendEmail(this.client.getEndpoint(), resourceGroupName, certificateOrderName, this.client.getSubscriptionId(), this.client.getApiVersion(), context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
201,907 | public DruidExpression toDruidExpression(final PlannerContext plannerContext, final RowSignature rowSignature, final RexNode rexNode) {<NEW_LINE>return OperatorConversions.convertCall(plannerContext, rowSignature, rexNode, inputExpressions -> {<NEW_LINE>final DruidExpression arg = inputExpressions.get(1);<NEW_LINE>final Expr truncTypeExpr = Parser.parse(inputExpressions.get(0).getExpression(), plannerContext.getExprMacroTable());<NEW_LINE>if (!truncTypeExpr.isLiteral()) {<NEW_LINE>throw new IAE("Operator[%s] truncType must be a literal", calciteOperator().getName());<NEW_LINE>}<NEW_LINE>final String truncType = <MASK><NEW_LINE>final Period truncPeriod = TRUNC_PERIOD_MAP.get(StringUtils.toLowerCase(truncType));<NEW_LINE>if (truncPeriod == null) {<NEW_LINE>throw new IAE("Operator[%s] cannot truncate to[%s]", calciteOperator().getName(), truncType);<NEW_LINE>}<NEW_LINE>return DruidExpression.ofFunctionCall(Calcites.getColumnTypeForRelDataType(rexNode.getType()), "timestamp_floor", ImmutableList.of(arg, DruidExpression.ofStringLiteral(truncPeriod.toString()), DruidExpression.ofStringLiteral(null), DruidExpression.ofStringLiteral(plannerContext.getTimeZone().getID())));<NEW_LINE>});<NEW_LINE>} | (String) truncTypeExpr.getLiteralValue(); |
751,707 | public static void customizePrefernces() {<NEW_LINE>final IMsgBL msgBL = Services.get(IMsgBL.class);<NEW_LINE>final Border insetBorder = BorderFactory.createEmptyBorder(2, 2, 2, 0);<NEW_LINE>final FlowLayout flowLayout = new FlowLayout(FlowLayout.LEFT);<NEW_LINE>final CPanel dlmPanel = new CPanel();<NEW_LINE>dlmPanel.setLayout(flowLayout);<NEW_LINE>dlmPanel.setBorder(insetBorder);<NEW_LINE>final CLabel dlmLevelLabel = new CLabel();<NEW_LINE>dlmLevelLabel.setText(msgBL.getMsg(Env.getCtx(), DLMPermanentIniCustomizer.INI_P_DLM_DLM_LEVEL));<NEW_LINE>final Map<Integer<MASK><NEW_LINE>final CComboBox<ValueNamePair> dlmLevelField = new CComboBox<>(ImmutableList.of(values.get(IMigratorService.DLM_Level_TEST), values.get(IMigratorService.DLM_Level_ARCHIVE)));<NEW_LINE>dlmPanel.add(dlmLevelLabel);<NEW_LINE>dlmPanel.add(dlmLevelField);<NEW_LINE>Preference.addSettingsPanel(dlmPanel, preference -> {<NEW_LINE>// do this on load<NEW_LINE>final int dlmLevel = DLMPermanentIniCustomizer.INSTANCE.getDlmLevel();<NEW_LINE>dlmLevelField.setSelectedItem(values.get(dlmLevel));<NEW_LINE>}, preference -> {<NEW_LINE>// do this on store<NEW_LINE>final ValueNamePair selectedItem = dlmLevelField.getSelectedItem();<NEW_LINE>if (selectedItem != null) {<NEW_LINE>Ini.setProperty(DLMPermanentIniCustomizer.INI_P_DLM_DLM_LEVEL, selectedItem.getValue());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | , ValueNamePair> values = getValues(); |
895,386 | public static MxNDArray[] cachedOpInvoke(MxNDManager manager, Pointer cachedOpHandle, MxNDArray[] inputs) {<NEW_LINE>IntBuffer buf = IntBuffer.allocate(1);<NEW_LINE>PointerArray array = toPointerArray(inputs);<NEW_LINE>PointerByReference ref = REFS.acquire();<NEW_LINE>PointerByReference outSTypeRef = REFS.acquire();<NEW_LINE>checkCall(LIB.MXInvokeCachedOpEx(cachedOpHandle, inputs.length, array, buf, ref, outSTypeRef));<NEW_LINE>int numOutputs = buf.get();<NEW_LINE>Pointer[] ptrArray = ref.getValue().getPointerArray(0, numOutputs);<NEW_LINE>int[] sTypes = outSTypeRef.getValue().getIntArray(0, numOutputs);<NEW_LINE>MxNDArray[] output = new MxNDArray[numOutputs];<NEW_LINE>for (int i = 0; i < numOutputs; i++) {<NEW_LINE>if (sTypes[i] != 0) {<NEW_LINE>output[i] = manager.create(ptrArray[i], SparseFormat.fromValue(sTypes[i]));<NEW_LINE>} else {<NEW_LINE>output[i] = manager<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>REFS.recycle(ref);<NEW_LINE>REFS.recycle(outSTypeRef);<NEW_LINE>array.recycle();<NEW_LINE>return output;<NEW_LINE>} | .create(ptrArray[i]); |
209,780 | protected void writeMimeFile(CrawlURI curi) throws IOException {<NEW_LINE>ReplayInputStream ris = null;<NEW_LINE>OutputStream out = null;<NEW_LINE>try {<NEW_LINE>String boundary = BOUNDARY_START + stringToMD5(curi.toString());<NEW_LINE>ris = curi.getRecorder().getRecordedInput().getReplayInputStream();<NEW_LINE>out = initOutputStream(curi);<NEW_LINE>// Part 1: Archive info<NEW_LINE>writeArchiveInfoPart(boundary, curi, ris, out);<NEW_LINE>// Part 2: Header info + HTTP header<NEW_LINE>writeHeaderPart(boundary, ris, out);<NEW_LINE>// Part 3: Content info + HTTP content<NEW_LINE>writeContentPart(<MASK><NEW_LINE>// And finally the terminator string<NEW_LINE>String terminator = "\n--" + boundary + "--\n";<NEW_LINE>out.write(terminator.getBytes());<NEW_LINE>} finally {<NEW_LINE>if (ris != null)<NEW_LINE>ris.close();<NEW_LINE>if (out != null)<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>} | boundary, curi, ris, out); |
890,609 | public // : 2368K->319K(2368K), 0.0063634 secs]5.353: [Tenured: 5443K->5196K(5504K), 0.0830293 secs] 7325K->5196K(7872K), [Perm : 10606K->10606K(21248K)], 0.0895957 secs]<NEW_LINE>void parNewDetailsWithConcurrentModeFailure(GCLogTrace trace, String line) {<NEW_LINE>ParNewPromotionFailed collection = new ParNewPromotionFailed(scavengeTimeStamp, gcCauseForwardReference, trace.getDoubleGroup(7));<NEW_LINE>MemoryPoolSummary young = trace.getOccupancyBeforeAfterWithMemoryPoolSizeSummary(1);<NEW_LINE>MemoryPoolSummary heap = new MemoryPoolSummary(trace.getMemoryInKBytes(17), trace.getMemoryInKBytes(21), trace.getMemoryInKBytes(17), trace.getMemoryInKBytes(21));<NEW_LINE>MemoryPoolSummary tenured = heap.minus(young);<NEW_LINE>collection.<MASK><NEW_LINE>collection.add(extractCPUSummary(line));<NEW_LINE>record(collection, false);<NEW_LINE>ConcurrentModeFailure fullCollection = new ConcurrentModeFailure(getClock(), gcCauseForwardReference, trace.getDoubleGroup(trace.groupCount()));<NEW_LINE>tenured = trace.getOccupancyBeforeAfterWithMemoryPoolSizeSummary(10);<NEW_LINE>heap = getTotalOccupancyBeforeAfterWithTotalHeapPoolSizeSummary(trace, 17);<NEW_LINE>young = heap.minus(tenured);<NEW_LINE>fullCollection.add(young, tenured, heap);<NEW_LINE>fullCollection.addPermOrMetaSpaceRecord(extractPermOrMetaspaceRecord(line));<NEW_LINE>fullCollection.add(extractCPUSummary(line));<NEW_LINE>record(fullCollection);<NEW_LINE>} | add(young, tenured, heap); |
1,212,208 | public com.amazonaws.services.kinesisanalytics.model.UnableToDetectSchemaException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.kinesisanalytics.model.UnableToDetectSchemaException unableToDetectSchemaException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("RawInputRecords", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>unableToDetectSchemaException.setRawInputRecords(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ProcessedInputRecords", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>unableToDetectSchemaException.setProcessedInputRecords(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return unableToDetectSchemaException;<NEW_LINE>} | kinesisanalytics.model.UnableToDetectSchemaException(null); |
1,531,585 | public final DayPartContext dayPart() throws RecognitionException {<NEW_LINE>DayPartContext _localctx = new DayPartContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 490, RULE_dayPart);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(3269);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case PLUS:<NEW_LINE>case MINUS:<NEW_LINE>case IntegerLiteral:<NEW_LINE>case FloatingPointLiteral:<NEW_LINE>{<NEW_LINE>setState(3266);<NEW_LINE>numberconstant();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case IDENT:<NEW_LINE>{<NEW_LINE>setState(3267);<NEW_LINE>((DayPartContext) _localctx).i = match(IDENT);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case QUESTION:<NEW_LINE>{<NEW_LINE>setState(3268);<NEW_LINE>substitution();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new NoViableAltException(this);<NEW_LINE>}<NEW_LINE>setState(3271);<NEW_LINE><MASK><NEW_LINE>if (!(_la == TIMEPERIOD_DAY || _la == TIMEPERIOD_DAYS)) {<NEW_LINE>_errHandler.recoverInline(this);<NEW_LINE>} else {<NEW_LINE>if (_input.LA(1) == Token.EOF)<NEW_LINE>matchedEOF = true;<NEW_LINE>_errHandler.reportMatch(this);<NEW_LINE>consume();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | _la = _input.LA(1); |
1,493,064 | public CompletableFuture<Void> subscribed(Subscribed subscribed) {<NEW_LINE>return CompletableFuture.runAsync(() -> callWithStateLock(() -> {<NEW_LINE>MasterInfo newMasterInfo = subscribed.getMasterInfo();<NEW_LINE>masterInfo.set(newMasterInfo);<NEW_LINE>Preconditions.checkState(state.getMesosSchedulerState() != MesosSchedulerState.SUBSCRIBED, <MASK><NEW_LINE>double advertisedHeartbeatIntervalSeconds = subscribed.getHeartbeatIntervalSeconds();<NEW_LINE>if (advertisedHeartbeatIntervalSeconds > 0) {<NEW_LINE>heartbeatIntervalSeconds = Optional.of(advertisedHeartbeatIntervalSeconds);<NEW_LINE>}<NEW_LINE>if (state.getMesosSchedulerState() != MesosSchedulerState.PAUSED_FOR_MESOS_RECONNECT) {<NEW_LINE>// Should be called before activation of leader cache or cache could be left empty<NEW_LINE>startup.checkMigrations();<NEW_LINE>leaderCacheCoordinator.activateLeaderCache();<NEW_LINE>}<NEW_LINE>startup.startup(newMasterInfo);<NEW_LINE>state.setMesosSchedulerState(MesosSchedulerState.SUBSCRIBED);<NEW_LINE>restartInProgress.set(false);<NEW_LINE>handleQueuedStatusUpdates();<NEW_LINE>}, "subscribed", false), subscribeExecutor);<NEW_LINE>} | "Asked to startup - but in invalid state: %s", state.getMesosSchedulerState()); |
181,630 | public ListenerResult listen(WorkflowContext context) throws WorkflowListenerException {<NEW_LINE>GroupResourceProcessForm form = (GroupResourceProcessForm) context.getProcessForm();<NEW_LINE>String groupId = form.getInlongGroupId();<NEW_LINE>log.info("try to create consumer group for groupId {}", groupId);<NEW_LINE>InlongGroupInfo groupInfo = groupService.get(groupId);<NEW_LINE>String topicName = groupInfo.getMqResourceObj();<NEW_LINE>int clusterId = Integer.parseInt(commonOperateService.getSpecifiedParam(Constant.CLUSTER_TUBE_CLUSTER_ID));<NEW_LINE>QueryTubeTopicRequest queryTubeTopicRequest = QueryTubeTopicRequest.builder().topicName(topicName).clusterId(clusterId).user(groupInfo.getCreator()).build();<NEW_LINE>// Query whether the tube topic exists<NEW_LINE>boolean topicExist = tubeMqOptService.queryTopicIsExist(queryTubeTopicRequest);<NEW_LINE>Integer tryNumber = reTryConfigBean.getMaxAttempts();<NEW_LINE>Long delay = reTryConfigBean.getDelay();<NEW_LINE>while (!topicExist && --tryNumber > 0) {<NEW_LINE>log.info("check whether the tube topic exists, try count={}", tryNumber);<NEW_LINE>try {<NEW_LINE>Thread.sleep(delay);<NEW_LINE>delay *= reTryConfigBean.getMultiplier();<NEW_LINE>topicExist = tubeMqOptService.queryTopicIsExist(queryTubeTopicRequest);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.error("check the tube topic exists error", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AddTubeConsumeGroupRequest addTubeConsumeGroupRequest = new AddTubeConsumeGroupRequest();<NEW_LINE>addTubeConsumeGroupRequest.setClusterId(clusterId);<NEW_LINE>addTubeConsumeGroupRequest.<MASK><NEW_LINE>GroupNameJsonSetBean groupNameJsonSetBean = new GroupNameJsonSetBean();<NEW_LINE>groupNameJsonSetBean.setTopicName(topicName);<NEW_LINE>String consumeGroupName = "sort_" + topicName + "_group";<NEW_LINE>groupNameJsonSetBean.setGroupName(consumeGroupName);<NEW_LINE>addTubeConsumeGroupRequest.setGroupNameJsonSet(Collections.singletonList(groupNameJsonSetBean));<NEW_LINE>try {<NEW_LINE>tubeMqOptService.createNewConsumerGroup(addTubeConsumeGroupRequest);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new WorkflowListenerException("create tube consumer group for groupId=" + groupId + " error", e);<NEW_LINE>}<NEW_LINE>log.info("finish to create consumer group for {}", groupId);<NEW_LINE>return ListenerResult.success();<NEW_LINE>} | setCreateUser(groupInfo.getCreator()); |
312,651 | public Process start() throws Exception {<NEW_LINE>ProcessBuilder processBuilder = new ProcessBuilder();<NEW_LINE>processBuilder.command(getBallerinaCommand(null));<NEW_LINE>processBuilder.directory(Paths.get<MASK><NEW_LINE>Map<String, String> env = processBuilder.environment();<NEW_LINE>// Need to ignore the "BAL_JAVA_DEBUG" env variable, as otherwise the program compiler will also run in debug<NEW_LINE>// mode by honoring inherited environment variables.<NEW_LINE>env.remove(ENV_OPTION_BAL_JAVA_DEBUG);<NEW_LINE>// Adds environment variables configured by the user.<NEW_LINE>if (configHolder.getEnv().isPresent()) {<NEW_LINE>configHolder.getEnv().get().forEach(env::put);<NEW_LINE>}<NEW_LINE>// If the debugger is running on test mode, modifies jacoco agent args to instrument debugger runtime classes.<NEW_LINE>if (env.containsKey(ENV_DEBUGGER_TEST_MODE) && env.containsKey(ENV_JAVA_OPTS)) {<NEW_LINE>String javaOpts = env.get(ENV_JAVA_OPTS);<NEW_LINE>if (javaOpts.contains(DEBUGGER_CORE_TEST_FILE)) {<NEW_LINE>javaOpts = javaOpts.replace(DEBUGGER_CORE_TEST_FILE, DEBUGGER_RUNTIME_TEST_FILE);<NEW_LINE>}<NEW_LINE>env.put(ENV_JAVA_OPTS, javaOpts);<NEW_LINE>}<NEW_LINE>return processBuilder.start();<NEW_LINE>} | (projectRoot).toFile()); |
107,740 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>final ComponentContext componentContext = new ComponentContext(this);<NEW_LINE>final LinearLayout container = new LinearLayout(this);<NEW_LINE>container.setOrientation(LinearLayout.VERTICAL);<NEW_LINE>final ExternalEventObserver observer1 = new ExternalEventObserver();<NEW_LINE>// start_external_observer<NEW_LINE>container.addView(LithoView.create(componentContext, StateUpdateFromOutsideTreeWithListenerComponent.create(componentContext).eventObserver(observer1).build()));<NEW_LINE>final Button button1 = new Button(this);<NEW_LINE>button1.setText("Dispatch Event 1");<NEW_LINE>button1.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>observer1.notifyExternalEventOccurred();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// end_external_observer<NEW_LINE>container.addView(button1);<NEW_LINE>// start_external_handle<NEW_LINE>final Handle componentHandle = new Handle();<NEW_LINE>final LithoView lithoViewWithTrigger = LithoView.create(componentContext, StateUpdateFromOutsideTreeWithTriggerComponent.create(componentContext).handle(componentHandle).build());<NEW_LINE>final <MASK><NEW_LINE>button2.setText("Dispatch Event 2");<NEW_LINE>button2.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>// This is a bit of a gotcha right now: you need to use the ComponentContext from<NEW_LINE>StateUpdateFromOutsideTreeWithTriggerComponent.// This is a bit of a gotcha right now: you need to use the ComponentContext from<NEW_LINE>notifyExternalEvent(// the ComponentTree to dispatch the trigger from outside a Component.<NEW_LINE>lithoViewWithTrigger.getComponentTree().getContext(), componentHandle, 1);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// end_external_handle<NEW_LINE>container.addView(lithoViewWithTrigger);<NEW_LINE>container.addView(button2);<NEW_LINE>setContentView(container);<NEW_LINE>} | Button button2 = new Button(this); |
1,673,744 | private static void runAssertion(RegressionEnvironment env, String eventTypeName, RegressionPath path) {<NEW_LINE>String stmtText = "@name('s0') select type?,dyn[1]?,nested.nes2?,map('a')? from " + eventTypeName;<NEW_LINE>env.compileDeploy(stmtText, path).addListener("s0");<NEW_LINE>env.assertStatement("s0", statement -> {<NEW_LINE>SupportEventPropUtil.assertPropsEquals(statement.getEventType().getPropertyDescriptors(), new SupportEventPropDesc("type?", Node.class), new SupportEventPropDesc("dyn[1]?", Node.class), new SupportEventPropDesc("nested.nes2?", Node.class), new SupportEventPropDesc<MASK><NEW_LINE>SupportEventTypeAssertionUtil.assertConsistency(statement.getEventType());<NEW_LINE>});<NEW_LINE>Document root = SupportXML.getDocument(SCHEMA_XML);<NEW_LINE>env.sendEventXMLDOM(root, eventTypeName);<NEW_LINE>env.assertEventNew("s0", theEvent -> {<NEW_LINE>assertSame(root.getDocumentElement().getChildNodes().item(0), theEvent.get("type?"));<NEW_LINE>assertSame(root.getDocumentElement().getChildNodes().item(4), theEvent.get("dyn[1]?"));<NEW_LINE>assertSame(root.getDocumentElement().getChildNodes().item(6).getChildNodes().item(1), theEvent.get("nested.nes2?"));<NEW_LINE>assertSame(root.getDocumentElement().getChildNodes().item(8), theEvent.get("map('a')?"));<NEW_LINE>SupportEventTypeAssertionUtil.assertConsistency(theEvent);<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>} | ("map('a')?", Node.class)); |
829,739 | protected ActionResult<List<Wo>> execute(HttpServletRequest request, EffectivePerson effectivePerson, String id) throws Exception {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<List<Wo>>();<NEW_LINE>List<Wo> wrapOutSubjectAttachmentList = null;<NEW_LINE>List<BBSSubjectAttachment> fileInfoList = null;<NEW_LINE>BBSSubjectInfo subjectInfo = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (subjectInfo != null) {<NEW_LINE>if (subjectInfo.getAttachmentList() != null && subjectInfo.getAttachmentList().size() > 0) {<NEW_LINE>fileInfoList = subjectInfoServiceAdv.listAttachmentByIds(subjectInfo.getAttachmentList());<NEW_LINE>} else {<NEW_LINE>fileInfoList = new ArrayList<BBSSubjectAttachment>();<NEW_LINE>}<NEW_LINE>wrapOutSubjectAttachmentList = Wo.copier.copy(fileInfoList);<NEW_LINE>} else {<NEW_LINE>Exception exception = new ExceptionSubjectNotExists(id);<NEW_LINE>result.error(exception);<NEW_LINE>logger.error(exception, effectivePerson, request, null);<NEW_LINE>}<NEW_LINE>if (wrapOutSubjectAttachmentList == null) {<NEW_LINE>wrapOutSubjectAttachmentList = new ArrayList<Wo>();<NEW_LINE>}<NEW_LINE>result.setData(wrapOutSubjectAttachmentList);<NEW_LINE>} catch (Throwable th) {<NEW_LINE>Exception exception = new ExceptionSubjectQueryById(th, id);<NEW_LINE>result.error(exception);<NEW_LINE>logger.error(exception, effectivePerson, request, null);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | subjectInfo = subjectInfoServiceAdv.get(id); |
1,075,130 | private void updateMovedFolderAssets(Folder oldFolder, Folder newFolder, List<Link> links) throws DotDataException, DotStateException, DotSecurityException {<NEW_LINE>User systemUser;<NEW_LINE>try {<NEW_LINE>systemUser = APILocator.getUserAPI().getSystemUser();<NEW_LINE>} catch (DotDataException e) {<NEW_LINE>Logger.error(FolderFactoryImpl.class, e.getMessage(), e);<NEW_LINE>throw new DotRuntimeException(<MASK><NEW_LINE>}<NEW_LINE>for (Link link : links) {<NEW_LINE>if (link.isWorking()) {<NEW_LINE>LinkFactory.moveLink(link, newFolder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<FileAsset> fileAssets = APILocator.getFileAssetAPI().findFileAssetsByFolder(oldFolder, APILocator.getUserAPI().getSystemUser(), false);<NEW_LINE>for (FileAsset fa : fileAssets) {<NEW_LINE>boolean appendCopyToFileName = false;<NEW_LINE>Contentlet newFileAsset = APILocator.getContentletAPI().copyContentlet(fa, newFolder, systemUser, appendCopyToFileName, false);<NEW_LINE>if (fa.isLive()) {<NEW_LINE>APILocator.getVersionableAPI().setLive(newFileAsset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | e.getMessage(), e); |
765,512 | // Verify that connections are/are not castable to OracleConnection based on whether enableConnectionCasting=true/false.<NEW_LINE>@Test<NEW_LINE>public void testConnectionCasting() throws Exception {<NEW_LINE>OracleConnection ocon = <MASK><NEW_LINE>try {<NEW_LINE>assertTrue(ocon.isUsable());<NEW_LINE>Connection con = ocon.unwrap(Connection.class);<NEW_LINE>assertTrue(con.isWrapperFor(OracleConnection.class));<NEW_LINE>ocon = ocon.unwrap(OracleConnection.class);<NEW_LINE>assertEquals(OracleConnection.DATABASE_OK, ocon.pingDatabase());<NEW_LINE>ocon = con.unwrap(OracleConnection.class);<NEW_LINE>String propsUserName = ocon.getProperties().getProperty("user");<NEW_LINE>String metadataUserName = con.getMetaData().getUserName();<NEW_LINE>assertEquals(metadataUserName, propsUserName);<NEW_LINE>} finally {<NEW_LINE>ocon.close();<NEW_LINE>}<NEW_LINE>Connection con = ds.getConnection();<NEW_LINE>try {<NEW_LINE>assertFalse(con instanceof OracleConnection);<NEW_LINE>assertTrue(con.isWrapperFor(OracleConnection.class));<NEW_LINE>String conUserName = con.unwrap(OracleConnection.class).getUserName();<NEW_LINE>String metadataUserName = con.getMetaData().getUserName();<NEW_LINE>assertEquals(metadataUserName, conUserName);<NEW_LINE>} finally {<NEW_LINE>con.close();<NEW_LINE>}<NEW_LINE>} | (OracleConnection) ds_casting.getConnection(); |
329,351 | private SoundChain play(final Sound sound, boolean repeatedly, final SoundChain chain) {<NEW_LINE>stop(sound);<NEW_LINE>if (sound.disabled()) {<NEW_LINE>chain.takeOver();<NEW_LINE>return chain;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>InputStream stream = sound.inputStream();<NEW_LINE>// wrap the stream in another one that supports mark/reset (see issue #31)<NEW_LINE>stream = new BufferedInputStream(stream);<NEW_LINE>AudioInputStream input = AudioSystem.getAudioInputStream(stream);<NEW_LINE>Clip clip = AudioSystem.getClip();<NEW_LINE>clip.addLineListener(new ClipHandler(sound, chain));<NEW_LINE>clip.open(input);<NEW_LINE>if (repeatedly) {<NEW_LINE>clip.loop(Clip.LOOP_CONTINUOUSLY);<NEW_LINE>} else {<NEW_LINE>clip.start();<NEW_LINE>}<NEW_LINE>activeClips.put(sound, clip);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.<MASK><NEW_LINE>}<NEW_LINE>return chain;<NEW_LINE>} | error("Error while playing sound: " + sound, e); |
1,123,574 | public static void copyProperties(Object fromObj, Object toObj) {<NEW_LINE>Class<? extends Object> fromClass = fromObj.getClass();<NEW_LINE>Class<? extends Object> toClass = toObj.getClass();<NEW_LINE>try {<NEW_LINE>BeanInfo <MASK><NEW_LINE>BeanInfo toBean = Introspector.getBeanInfo(toClass);<NEW_LINE>PropertyDescriptor[] toPd = toBean.getPropertyDescriptors();<NEW_LINE>List<PropertyDescriptor> fromPd = Arrays.asList(fromBean.getPropertyDescriptors());<NEW_LINE>for (PropertyDescriptor propertyDescriptor : toPd) {<NEW_LINE>propertyDescriptor.getDisplayName();<NEW_LINE>PropertyDescriptor pd = fromPd.get(fromPd.indexOf(propertyDescriptor));<NEW_LINE>if (pd.getDisplayName().equals(propertyDescriptor.getDisplayName()) && !pd.getDisplayName().equals("class") && propertyDescriptor.getWriteMethod() != null) {<NEW_LINE>propertyDescriptor.getWriteMethod().invoke(toObj, pd.getReadMethod().invoke(fromObj, null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IntrospectionException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | fromBean = Introspector.getBeanInfo(fromClass); |
1,484,918 | final DeleteProfileKeyResult executeDeleteProfileKey(DeleteProfileKeyRequest deleteProfileKeyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteProfileKeyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteProfileKeyRequest> request = null;<NEW_LINE>Response<DeleteProfileKeyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteProfileKeyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteProfileKeyRequest));<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, "Customer Profiles");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteProfileKey");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteProfileKeyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteProfileKeyResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig); |
70,434 | public boolean checkFile(String fileName) {<NEW_LINE>boolean ret = false;<NEW_LINE>if (this.ftpInfo != null) {<NEW_LINE>try {<NEW_LINE>FtpClientService ftpClientService = new FtpClientService();<NEW_LINE>ftpClientService.connect(this.ftpInfo.getHost(), this.ftpInfo.getPort(), this.ftpInfo.getUserName(), <MASK><NEW_LINE>// check file exist<NEW_LINE>if (StringUtils.isBlank(this.ftpInfo.getFtpReceivePath())) {<NEW_LINE>List<String> files = ftpClientService.getFileList("./");<NEW_LINE>for (String file : files) {<NEW_LINE>if (file.equals(fileName)) {<NEW_LINE>ret = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>List<String> files = ftpClientService.getFileList(this.ftpInfo.getFtpReceivePath());<NEW_LINE>for (String file : files) {<NEW_LINE>if (file.equals(fileName)) {<NEW_LINE>ret = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | this.ftpInfo.getPassWord()); |
414,147 | final SubscribeResult executeSubscribe(SubscribeRequest subscribeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(subscribeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SubscribeRequest> request = null;<NEW_LINE>Response<SubscribeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SubscribeRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "codestar notifications");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "Subscribe");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SubscribeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SubscribeResultJsonUnmarshaller());<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>} | (super.beforeMarshalling(subscribeRequest)); |
1,792,226 | private Operand buildAttrAssign(Variable result, AttrAssignNode attrAssignNode) {<NEW_LINE>boolean containsAssignment = attrAssignNode.containsVariableAssignment();<NEW_LINE>Operand obj = buildWithOrder(attrAssignNode.getReceiverNode(), containsAssignment);<NEW_LINE>Label lazyLabel = null;<NEW_LINE>Label endLabel = null;<NEW_LINE>if (result == null)<NEW_LINE>result = createTemporaryVariable();<NEW_LINE>if (attrAssignNode.isLazy()) {<NEW_LINE>lazyLabel = getNewLabel();<NEW_LINE>endLabel = getNewLabel();<NEW_LINE>addInstr(new BNilInstr(lazyLabel, obj));<NEW_LINE>}<NEW_LINE>List<Operand> args = new ArrayList<>();<NEW_LINE>Node argsNode = attrAssignNode.getArgsNode();<NEW_LINE>Operand lastArg = buildAttrAssignCallArgs(args, argsNode, containsAssignment);<NEW_LINE>Operand block = setupCallClosure(attrAssignNode.getBlockNode());<NEW_LINE>addInstr(AttrAssignInstr.create(scope, obj, attrAssignNode.getName(), args.toArray(new Operand[args.size()]), block<MASK><NEW_LINE>addInstr(new CopyInstr(result, lastArg));<NEW_LINE>if (attrAssignNode.isLazy()) {<NEW_LINE>addInstr(new JumpInstr(endLabel));<NEW_LINE>addInstr(new LabelInstr(lazyLabel));<NEW_LINE>addInstr(new CopyInstr(result, manager.getNil()));<NEW_LINE>addInstr(new LabelInstr(endLabel));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | , scope.maybeUsingRefinements())); |
836,954 | public void startSelectMode(int pos) {<NEW_LINE>if (inActionMode()) {<NEW_LINE>endSelectMode();<NEW_LINE>}<NEW_LINE>if (onSelectModeListener != null) {<NEW_LINE>onSelectModeListener.onStartSelectMode();<NEW_LINE>}<NEW_LINE>selectedIds.clear();<NEW_LINE>selectedIds.add(getItemId(pos));<NEW_LINE>notifyDataSetChanged();<NEW_LINE>actionMode = activity.startActionMode(new ActionMode.Callback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onCreateActionMode(ActionMode mode, Menu menu) {<NEW_LINE><MASK><NEW_LINE>inflater.inflate(R.menu.multi_select_options, menu);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onPrepareActionMode(ActionMode mode, Menu menu) {<NEW_LINE>updateTitle();<NEW_LINE>toggleSelectAllIcon(menu.findItem(R.id.select_toggle), false);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onActionItemClicked(ActionMode mode, MenuItem item) {<NEW_LINE>if (item.getItemId() == R.id.select_toggle) {<NEW_LINE>boolean allSelected = selectedIds.size() == getItemCount();<NEW_LINE>setSelected(0, getItemCount(), !allSelected);<NEW_LINE>toggleSelectAllIcon(item, !allSelected);<NEW_LINE>updateTitle();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDestroyActionMode(ActionMode mode) {<NEW_LINE>callOnEndSelectMode();<NEW_LINE>actionMode = null;<NEW_LINE>selectedIds.clear();<NEW_LINE>notifyDataSetChanged();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>updateTitle();<NEW_LINE>} | MenuInflater inflater = mode.getMenuInflater(); |
1,088,027 | public static DescribeSystemLogResponse unmarshall(DescribeSystemLogResponse describeSystemLogResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSystemLogResponse.setRequestId(_ctx.stringValue("DescribeSystemLogResponse.RequestId"));<NEW_LINE>describeSystemLogResponse.setTotal(_ctx.longValue("DescribeSystemLogResponse.Total"));<NEW_LINE>List<SystemLogItem> systemLog = new ArrayList<SystemLogItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSystemLogResponse.SystemLog.Length"); i++) {<NEW_LINE>SystemLogItem systemLogItem = new SystemLogItem();<NEW_LINE>systemLogItem.setGmtCreate(_ctx.longValue("DescribeSystemLogResponse.SystemLog[" + i + "].GmtCreate"));<NEW_LINE>systemLogItem.setGmtModified(_ctx.longValue("DescribeSystemLogResponse.SystemLog[" + i + "].GmtModified"));<NEW_LINE>systemLogItem.setEntityType(_ctx.integerValue("DescribeSystemLogResponse.SystemLog[" + i + "].EntityType"));<NEW_LINE>systemLogItem.setEntityObject(_ctx.stringValue("DescribeSystemLogResponse.SystemLog[" + i + "].EntityObject"));<NEW_LINE>systemLogItem.setOpAction(_ctx.integerValue("DescribeSystemLogResponse.SystemLog[" + i + "].OpAction"));<NEW_LINE>systemLogItem.setOpAccount(_ctx.stringValue("DescribeSystemLogResponse.SystemLog[" + i + "].OpAccount"));<NEW_LINE>systemLogItem.setOpDesc(_ctx.stringValue<MASK><NEW_LINE>systemLogItem.setStatus(_ctx.integerValue("DescribeSystemLogResponse.SystemLog[" + i + "].Status"));<NEW_LINE>systemLog.add(systemLogItem);<NEW_LINE>}<NEW_LINE>describeSystemLogResponse.setSystemLog(systemLog);<NEW_LINE>return describeSystemLogResponse;<NEW_LINE>} | ("DescribeSystemLogResponse.SystemLog[" + i + "].OpDesc")); |
418,145 | public void draw(GLAutoDrawable drawable, boolean idle, Position machineCoord, Position workCoord, Position objectMin, Position objectMax, double scaleFactor, Position mouseWorldCoordinates, Position rotation) {<NEW_LINE>if (this.probeDepth == null || this.probeOffset == null)<NEW_LINE>return;<NEW_LINE>final int slices = 10;<NEW_LINE>final int stacks = 10;<NEW_LINE>int rot = (this.probeDepth > 0) ? 0 : 180;<NEW_LINE>double zAbs = Math.abs(this.probeDepth);<NEW_LINE>GL2 gl = drawable.getGL().getGL2();<NEW_LINE>if (this.start != null) {<NEW_LINE>gl.glTranslated(start.x, start.y, start.z);<NEW_LINE>} else {<NEW_LINE>gl.glTranslated(workCoord.x, workCoord.y, workCoord.z);<NEW_LINE>}<NEW_LINE>gl.glRotated(rot, 1, 0, 0);<NEW_LINE>// touch plate<NEW_LINE>gl.glPushMatrix();<NEW_LINE>gl.glTranslated(0, 0, zAbs);<NEW_LINE>glut.glutSolidCylinder(5, this.probeOffset, slices * 2, stacks);<NEW_LINE>gl.glPopMatrix();<NEW_LINE>// Everything is going to be red now!<NEW_LINE>gl.glColor4d(8., 0., 0., 1);<NEW_LINE>glut.glutSolidCylinder(.1, zAbs - 0.5, slices, stacks);<NEW_LINE>gl.glTranslated(<MASK><NEW_LINE>glut.glutSolidCone(.2, 1, slices, stacks);<NEW_LINE>} | 0, 0, zAbs - 1); |
100,930 | public <U1, U2, U3, U4, U5, U6, U7> Tuple7<U1, U2, U3, U4, U5, U6, U7> map(Function<? super T1, ? extends U1> f1, Function<? super T2, ? extends U2> f2, Function<? super T3, ? extends U3> f3, Function<? super T4, ? extends U4> f4, Function<? super T5, ? extends U5> f5, Function<? super T6, ? extends U6> f6, Function<? super T7, ? extends U7> f7) {<NEW_LINE>Objects.requireNonNull(f1, "f1 is null");<NEW_LINE>Objects.requireNonNull(f2, "f2 is null");<NEW_LINE><MASK><NEW_LINE>Objects.requireNonNull(f4, "f4 is null");<NEW_LINE>Objects.requireNonNull(f5, "f5 is null");<NEW_LINE>Objects.requireNonNull(f6, "f6 is null");<NEW_LINE>Objects.requireNonNull(f7, "f7 is null");<NEW_LINE>return Tuple.of(f1.apply(_1), f2.apply(_2), f3.apply(_3), f4.apply(_4), f5.apply(_5), f6.apply(_6), f7.apply(_7));<NEW_LINE>} | Objects.requireNonNull(f3, "f3 is null"); |
1,723,741 | public static <T> Managed<T> of(IO<T> acquire, Consumer<T> cleanup) {<NEW_LINE>return new Managed<T>() {<NEW_LINE><NEW_LINE>public <R> IO<R> apply(Function<? super T, ? extends IO<R>> fn) {<NEW_LINE>IO<R> y = IO.Comprehensions.forEach(acquire, t1 -> {<NEW_LINE>IO<? extends Try<? extends IO<R>, Throwable>> res1 = IO.ReactiveSeqIO.withCatch(() -> fn.apply(t1), Throwable.class);<NEW_LINE>return res1;<NEW_LINE>}, t2 -> {<NEW_LINE>Try<? extends IO<R>, Throwable> tr = t2._2();<NEW_LINE>IO<R> res = tr.fold(r -> r, e -> IO.fromPublisher(Future.ofError(e)));<NEW_LINE>cleanup.<MASK><NEW_LINE>return res;<NEW_LINE>});<NEW_LINE>return y;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | accept(t2._1()); |
1,135,848 | private String extractBodyAndScriptsFromTemplate(String html) {<NEW_LINE>// Replace UID:s<NEW_LINE>html = html.replaceAll("_UID_", pid + "__");<NEW_LINE>// Exctract script-tags<NEW_LINE>scripts = "";<NEW_LINE>int endOfPrevScript = 0;<NEW_LINE>int nextPosToCheck = 0;<NEW_LINE>String lc = html.toLowerCase(Locale.ROOT);<NEW_LINE>String res = "";<NEW_LINE>int scriptStart = lc.indexOf("<script", nextPosToCheck);<NEW_LINE>while (scriptStart > 0) {<NEW_LINE>res += html.substring(endOfPrevScript, scriptStart);<NEW_LINE>scriptStart = lc.indexOf(">", scriptStart);<NEW_LINE>final int j = lc.indexOf("</script>", scriptStart);<NEW_LINE>scripts += html.substring(scriptStart + 1, j) + ";";<NEW_LINE>endOfPrevScript <MASK><NEW_LINE>nextPosToCheck = endOfPrevScript;<NEW_LINE>scriptStart = lc.indexOf("<script", nextPosToCheck);<NEW_LINE>}<NEW_LINE>res += html.substring(endOfPrevScript);<NEW_LINE>// Extract body<NEW_LINE>html = res;<NEW_LINE>lc = html.toLowerCase(Locale.ROOT);<NEW_LINE>int startOfBody = lc.indexOf("<body");<NEW_LINE>if (startOfBody < 0) {<NEW_LINE>res = html;<NEW_LINE>} else {<NEW_LINE>res = "";<NEW_LINE>startOfBody = lc.indexOf(">", startOfBody) + 1;<NEW_LINE>final int endOfBody = lc.indexOf("</body>", startOfBody);<NEW_LINE>if (endOfBody > startOfBody) {<NEW_LINE>res = html.substring(startOfBody, endOfBody);<NEW_LINE>} else {<NEW_LINE>res = html.substring(startOfBody);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | = j + "</script>".length(); |
873,809 | public void marshall(PutScalingPolicyRequest putScalingPolicyRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (putScalingPolicyRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(putScalingPolicyRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(putScalingPolicyRequest.getFleetId(), FLEETID_BINDING);<NEW_LINE>protocolMarshaller.marshall(putScalingPolicyRequest.getScalingAdjustment(), SCALINGADJUSTMENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(putScalingPolicyRequest.getScalingAdjustmentType(), SCALINGADJUSTMENTTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(putScalingPolicyRequest.getThreshold(), THRESHOLD_BINDING);<NEW_LINE>protocolMarshaller.marshall(putScalingPolicyRequest.getComparisonOperator(), COMPARISONOPERATOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(putScalingPolicyRequest.getEvaluationPeriods(), EVALUATIONPERIODS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(putScalingPolicyRequest.getPolicyType(), POLICYTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(putScalingPolicyRequest.getTargetConfiguration(), TARGETCONFIGURATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | putScalingPolicyRequest.getMetricName(), METRICNAME_BINDING); |
1,329,147 | // Override SqlCall, to introduce a sub-query frame.<NEW_LINE>@Override<NEW_LINE>public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {<NEW_LINE>if (!writer.inQuery()) {<NEW_LINE>// If this SELECT is the topmost item in a sub-query, introduce a new<NEW_LINE>// frame. (The topmost item in the sub-query might be a UNION or<NEW_LINE>// ORDER. In this case, we don't need a wrapper frame.)<NEW_LINE>final SqlWriter.Frame frame = writer.startList(SqlWriter.FrameTypeEnum.SUB_QUERY, "(", ")");<NEW_LINE>getOperator().unparse(<MASK><NEW_LINE>writer.endList(frame);<NEW_LINE>} else {<NEW_LINE>getOperator().unparse(writer, this, leftPrec, rightPrec);<NEW_LINE>}<NEW_LINE>if (this.lockMode == LockMode.EXCLUSIVE_LOCK) {<NEW_LINE>writer.print("FOR UPDATE");<NEW_LINE>} else if (this.lockMode == LockMode.SHARED_LOCK) {<NEW_LINE>writer.print("LOCK IN SHARE MODE");<NEW_LINE>}<NEW_LINE>} | writer, this, 0, 0); |
1,743,533 | protected void buildBodyDeclarations(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration enumDeclaration2, EnumDeclaration enumDeclaration) {<NEW_LINE>// add body declaration in the lexical order<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.TypeDeclaration[] members = enumDeclaration2.memberTypes;<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.FieldDeclaration[] fields = enumDeclaration2.fields;<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration[] methods = enumDeclaration2.methods;<NEW_LINE>int fieldsLength = fields == null ? 0 : fields.length;<NEW_LINE>int methodsLength = methods == null ? 0 : methods.length;<NEW_LINE>int membersLength = members <MASK><NEW_LINE>int fieldsIndex = 0;<NEW_LINE>int methodsIndex = 0;<NEW_LINE>int membersIndex = 0;<NEW_LINE>while ((fieldsIndex < fieldsLength) || (membersIndex < membersLength) || (methodsIndex < methodsLength)) {<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.FieldDeclaration nextFieldDeclaration = null;<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration nextMethodDeclaration = null;<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = null;<NEW_LINE>int position = Integer.MAX_VALUE;<NEW_LINE>int nextDeclarationType = -1;<NEW_LINE>if (fieldsIndex < fieldsLength) {<NEW_LINE>nextFieldDeclaration = fields[fieldsIndex];<NEW_LINE>if (nextFieldDeclaration.declarationSourceStart < position) {<NEW_LINE>position = nextFieldDeclaration.declarationSourceStart;<NEW_LINE>// FIELD<NEW_LINE>nextDeclarationType = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (methodsIndex < methodsLength) {<NEW_LINE>nextMethodDeclaration = methods[methodsIndex];<NEW_LINE>if (nextMethodDeclaration.declarationSourceStart < position) {<NEW_LINE>position = nextMethodDeclaration.declarationSourceStart;<NEW_LINE>// METHOD<NEW_LINE>nextDeclarationType = 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (membersIndex < membersLength) {<NEW_LINE>nextMemberDeclaration = members[membersIndex];<NEW_LINE>if (nextMemberDeclaration.declarationSourceStart < position) {<NEW_LINE>position = nextMemberDeclaration.declarationSourceStart;<NEW_LINE>// MEMBER<NEW_LINE>nextDeclarationType = 2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>switch(nextDeclarationType) {<NEW_LINE>case 0:<NEW_LINE>if (nextFieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {<NEW_LINE>enumDeclaration.enumConstants().add(convert(nextFieldDeclaration));<NEW_LINE>} else {<NEW_LINE>checkAndAddMultipleFieldDeclaration(fields, fieldsIndex, enumDeclaration.bodyDeclarations());<NEW_LINE>}<NEW_LINE>fieldsIndex++;<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>methodsIndex++;<NEW_LINE>if (!nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit()) {<NEW_LINE>enumDeclaration.bodyDeclarations().add(convert(false, nextMethodDeclaration));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>membersIndex++;<NEW_LINE>enumDeclaration.bodyDeclarations().add(convert(nextMemberDeclaration));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>convert(enumDeclaration2.javadoc, enumDeclaration);<NEW_LINE>} | == null ? 0 : members.length; |
1,621,410 | private void buildRow(Table table, boolean fullId, boolean detailed, DiscoveryNodes discoveryNodes, TaskInfo taskInfo) {<NEW_LINE>table.startRow();<NEW_LINE>String nodeId = taskInfo.getTaskId().getNodeId();<NEW_LINE>DiscoveryNode node = discoveryNodes.get(nodeId);<NEW_LINE>table.addCell(taskInfo.getId());<NEW_LINE>table.addCell(taskInfo.getAction());<NEW_LINE>table.addCell(taskInfo.getTaskId().toString());<NEW_LINE>if (taskInfo.getParentTaskId().isSet()) {<NEW_LINE>table.addCell(taskInfo.getParentTaskId().toString());<NEW_LINE>} else {<NEW_LINE>table.addCell("-");<NEW_LINE>}<NEW_LINE>table.addCell(taskInfo.getType());<NEW_LINE>table.addCell(taskInfo.getStartTime());<NEW_LINE>table.addCell(FORMATTER.format(Instant.ofEpochMilli(taskInfo.getStartTime())));<NEW_LINE>table.addCell(taskInfo.getRunningTimeNanos());<NEW_LINE>table.addCell(TimeValue.timeValueNanos(taskInfo.getRunningTimeNanos<MASK><NEW_LINE>// Node information. Note that the node may be null because it has left the cluster between when we got this response and now.<NEW_LINE>table.addCell(fullId ? nodeId : Strings.substring(nodeId, 0, 4));<NEW_LINE>table.addCell(node == null ? "-" : node.getHostAddress());<NEW_LINE>table.addCell(node.getAddress().address().getPort());<NEW_LINE>table.addCell(node == null ? "-" : node.getName());<NEW_LINE>table.addCell(node == null ? "-" : node.getVersion().toString());<NEW_LINE>if (detailed) {<NEW_LINE>table.addCell(taskInfo.getDescription());<NEW_LINE>}<NEW_LINE>table.endRow();<NEW_LINE>} | ()).toString()); |
261,873 | public Clustering<MedoidModel> run(Relation<O> relation) {<NEW_LINE>ArrayDBIDs ids = DBIDUtil.ensureArray(relation.getDBIDs());<NEW_LINE>final int size = ids.size();<NEW_LINE>int[<MASK><NEW_LINE>double[][] s = initialization.getSimilarityMatrix(relation, ids);<NEW_LINE>double[][] r = new double[size][size], a = new double[size][size];<NEW_LINE>IndefiniteProgress prog = LOG.isVerbose() ? new IndefiniteProgress("Affinity Propagation Iteration", LOG) : null;<NEW_LINE>MutableProgress aprog = LOG.isVerbose() ? new MutableProgress("Stable assignments", size + 1, LOG) : null;<NEW_LINE>int inactive = 0;<NEW_LINE>for (int iteration = 0; iteration < maxiter && inactive < convergence; iteration++) {<NEW_LINE>updateResponsibilities(s, a, r);<NEW_LINE>updateAvailabilities(r, a);<NEW_LINE>int changed = updateAssignment(r, a, assignment);<NEW_LINE>inactive = changed > 0 ? 0 : (inactive + 1);<NEW_LINE>LOG.incrementProcessed(prog);<NEW_LINE>if (aprog != null) {<NEW_LINE>aprog.setProcessed(size - changed, LOG);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (aprog != null) {<NEW_LINE>aprog.setProcessed(aprog.getTotal(), LOG);<NEW_LINE>}<NEW_LINE>LOG.setCompleted(prog);<NEW_LINE>return buildResult(ids, assignment);<NEW_LINE>} | ] assignment = new int[size]; |
1,556,001 | private static boolean useExistingParentCastProposal(ICompilationUnit cu, CastExpression expression, Expression accessExpression, SimpleName accessSelector, ITypeBinding[] paramTypes, Collection<ChangeCorrectionProposal> proposals) {<NEW_LINE>ITypeBinding castType = expression.getType().resolveBinding();<NEW_LINE>if (castType == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (paramTypes != null) {<NEW_LINE>if (Bindings.findMethodInHierarchy(castType, accessSelector.getIdentifier(), paramTypes) == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else if (Bindings.findFieldInHierarchy(castType, accessSelector.getIdentifier()) == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>ITypeBinding bindingToCast = accessExpression.resolveTypeBinding();<NEW_LINE>if (bindingToCast != null && !bindingToCast.isCastCompatible(castType)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>IMethodBinding res = Bindings.findMethodInHierarchy(castType, accessSelector.getIdentifier(), paramTypes);<NEW_LINE>if (res != null) {<NEW_LINE>AST ast = expression.getAST();<NEW_LINE>ASTRewrite rewrite = ASTRewrite.create(ast);<NEW_LINE>CastExpression newCast = ast.newCastExpression();<NEW_LINE>newCast.setType((Type) ASTNode.copySubtree(ast, expression.getType()));<NEW_LINE>newCast.setExpression((Expression) rewrite.createCopyTarget(accessExpression));<NEW_LINE>ParenthesizedExpression parents = ast.newParenthesizedExpression();<NEW_LINE>parents.setExpression(newCast);<NEW_LINE>ASTNode node = rewrite.createCopyTarget(expression.getExpression());<NEW_LINE>rewrite.replace(expression, node, null);<NEW_LINE>rewrite.replace(accessExpression, parents, null);<NEW_LINE>String label = CorrectionMessages.UnresolvedElementsSubProcessor_missingcastbrackets_description;<NEW_LINE>ASTRewriteCorrectionProposal proposal = new ASTRewriteCorrectionProposal(label, CodeActionKind.QuickFix, <MASK><NEW_LINE>proposals.add(proposal);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | cu, rewrite, IProposalRelevance.ADD_PARENTHESES_AROUND_CAST); |
1,535,625 | public void resetParams(@NonNull OsmandApplication app, @NonNull GPXFile gpxFile) {<NEW_LINE>if (currentRecording) {<NEW_LINE>OsmandSettings settings = app.getSettings();<NEW_LINE>settings.CURRENT_TRACK_COLOR.resetToDefault();<NEW_LINE>settings.CURRENT_TRACK_WIDTH.resetToDefault();<NEW_LINE>settings.CURRENT_TRACK_COLORING_TYPE.resetToDefault();<NEW_LINE>settings.CURRENT_TRACK_ROUTE_INFO_ATTRIBUTE.resetToDefault();<NEW_LINE>settings.CURRENT_TRACK_SHOW_ARROWS.resetToDefault();<NEW_LINE>settings.CURRENT_TRACK_SHOW_START_FINISH.resetToDefault();<NEW_LINE>initCurrentTrackParams(app);<NEW_LINE>} else {<NEW_LINE>color = gpxFile.getColor(0);<NEW_LINE>width = gpxFile.getWidth(null);<NEW_LINE>showArrows = gpxFile.isShowArrows();<NEW_LINE>showStartFinish = gpxFile.isShowStartFinish();<NEW_LINE>splitInterval = gpxFile.getSplitInterval();<NEW_LINE>splitType = GpxSplitType.getSplitTypeByName(gpxFile.getSplitType()).getType();<NEW_LINE>coloringType = ColoringType.<MASK><NEW_LINE>routeInfoAttribute = ColoringType.getRouteInfoAttribute(gpxFile.getColoringType());<NEW_LINE>}<NEW_LINE>} | getNonNullTrackColoringTypeByName(gpxFile.getColoringType()); |
423,468 | private void customizeRemoteIpValve(ConfigurableTomcatWebServerFactory factory) {<NEW_LINE>Remoteip remoteIpProperties = this.serverProperties.getTomcat().getRemoteip();<NEW_LINE>String protocolHeader = remoteIpProperties.getProtocolHeader();<NEW_LINE>String remoteIpHeader = remoteIpProperties.getRemoteIpHeader();<NEW_LINE>// For back compatibility the valve is also enabled if protocol-header is set<NEW_LINE>if (StringUtils.hasText(protocolHeader) || StringUtils.hasText(remoteIpHeader) || getOrDeduceUseForwardHeaders()) {<NEW_LINE>RemoteIpValve valve = new RemoteIpValve();<NEW_LINE>valve.setProtocolHeader(StringUtils.hasLength(protocolHeader) ? protocolHeader : "X-Forwarded-Proto");<NEW_LINE>if (StringUtils.hasLength(remoteIpHeader)) {<NEW_LINE>valve.setRemoteIpHeader(remoteIpHeader);<NEW_LINE>}<NEW_LINE>// The internal proxies default to a list of "safe" internal IP addresses<NEW_LINE>valve.setInternalProxies(remoteIpProperties.getInternalProxies());<NEW_LINE>try {<NEW_LINE>valve.<MASK><NEW_LINE>} catch (NoSuchMethodError ex) {<NEW_LINE>// Avoid failure with war deployments to Tomcat 8.5 before 8.5.44 and<NEW_LINE>// Tomcat 9 before 9.0.23<NEW_LINE>}<NEW_LINE>valve.setPortHeader(remoteIpProperties.getPortHeader());<NEW_LINE>valve.setProtocolHeaderHttpsValue(remoteIpProperties.getProtocolHeaderHttpsValue());<NEW_LINE>// ... so it's safe to add this valve by default.<NEW_LINE>factory.addEngineValves(valve);<NEW_LINE>}<NEW_LINE>} | setHostHeader(remoteIpProperties.getHostHeader()); |
1,246,778 | protected void configureGeneratedSourcesAndJavadoc(Project project) {<NEW_LINE>_generateJavadocTask = project.getTasks().create("generateJavadoc", Javadoc.class);<NEW_LINE>if (_generateSourcesJarTask == null) {<NEW_LINE>//<NEW_LINE>// configuration for publishing jars containing sources for generated classes<NEW_LINE>// to the project artifacts for including in the ivy.xml<NEW_LINE>//<NEW_LINE>ConfigurationContainer configurations = project.getConfigurations();<NEW_LINE>Configuration generatedSources = configurations.maybeCreate("generatedSources");<NEW_LINE>Configuration testGeneratedSources = configurations.maybeCreate("testGeneratedSources");<NEW_LINE>testGeneratedSources.extendsFrom(generatedSources);<NEW_LINE>_generateSourcesJarTask = project.getTasks().create("generateSourcesJar", Jar.class, jarTask -> {<NEW_LINE>jarTask.setGroup(JavaBasePlugin.DOCUMENTATION_GROUP);<NEW_LINE>jarTask.setDescription("Generates a jar file containing the sources for the generated Java classes.");<NEW_LINE>// FIXME change to #getArchiveClassifier().set("sources"); breaks backwards-compatibility before 5.1<NEW_LINE>jarTask.setClassifier("sources");<NEW_LINE>});<NEW_LINE>project.getArtifacts().add("generatedSources", _generateSourcesJarTask);<NEW_LINE>}<NEW_LINE>if (_generateJavadocJarTask == null) {<NEW_LINE>//<NEW_LINE>// configuration for publishing jars containing Javadoc for generated classes<NEW_LINE>// to the project artifacts for including in the ivy.xml<NEW_LINE>//<NEW_LINE>ConfigurationContainer configurations = project.getConfigurations();<NEW_LINE>Configuration generatedJavadoc = configurations.maybeCreate("generatedJavadoc");<NEW_LINE>Configuration <MASK><NEW_LINE>testGeneratedJavadoc.extendsFrom(generatedJavadoc);<NEW_LINE>_generateJavadocJarTask = project.getTasks().create("generateJavadocJar", Jar.class, jarTask -> {<NEW_LINE>jarTask.dependsOn(_generateJavadocTask);<NEW_LINE>jarTask.setGroup(JavaBasePlugin.DOCUMENTATION_GROUP);<NEW_LINE>jarTask.setDescription("Generates a jar file containing the Javadoc for the generated Java classes.");<NEW_LINE>// FIXME change to #getArchiveClassifier().set("sources"); breaks backwards-compatibility before 5.1<NEW_LINE>jarTask.setClassifier("javadoc");<NEW_LINE>jarTask.from(_generateJavadocTask.getDestinationDir());<NEW_LINE>});<NEW_LINE>project.getArtifacts().add("generatedJavadoc", _generateJavadocJarTask);<NEW_LINE>} else {<NEW_LINE>// TODO: Tighten the types so that _generateJavadocJarTask must be of type Jar.<NEW_LINE>((Jar) _generateJavadocJarTask).from(_generateJavadocTask.getDestinationDir());<NEW_LINE>_generateJavadocJarTask.dependsOn(_generateJavadocTask);<NEW_LINE>}<NEW_LINE>} | testGeneratedJavadoc = configurations.maybeCreate("testGeneratedJavadoc"); |
283,508 | public Expression buildFilterExpression() {<NEW_LINE>if (_identifier == null) {<NEW_LINE>throw new Pql2CompilationException("Between predicate has no identifier");<NEW_LINE>}<NEW_LINE>if (getChildren().size() == 2) {<NEW_LINE>try {<NEW_LINE>LiteralAstNode left = (LiteralAstNode) getChildren().get(0);<NEW_LINE>LiteralAstNode right = (LiteralAstNode) <MASK><NEW_LINE>final Expression betweenExpr = RequestUtils.getFunctionExpression(FilterKind.BETWEEN.name());<NEW_LINE>final Function rangeFuncCall = betweenExpr.getFunctionCall();<NEW_LINE>rangeFuncCall.addToOperands(RequestUtils.createIdentifierExpression(_identifier));<NEW_LINE>rangeFuncCall.addToOperands(RequestUtils.createLiteralExpression(left));<NEW_LINE>rangeFuncCall.addToOperands(RequestUtils.createLiteralExpression(right));<NEW_LINE>return betweenExpr;<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE>throw new Pql2CompilationException("BETWEEN clause was expecting two literal AST nodes, got " + getChildren());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new Pql2CompilationException("BETWEEN clause does not have two children nodes");<NEW_LINE>}<NEW_LINE>} | getChildren().get(1); |
437,469 | private static TopComponent ui(TracerModel model, TracerController controller, FileObject snapshotFo) {<NEW_LINE>String npssFileName = snapshotFo.getName();<NEW_LINE>TopComponent tc = new IdeSnapshotComponent(npssFileName, FileUtil.toFile(snapshotFo));<NEW_LINE>final JComponent tracer = new TracerView(model, controller).createComponent();<NEW_LINE>tc.<MASK><NEW_LINE>InputMap inputMap = tc.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);<NEW_LINE>ActionMap actionMap = tc.getActionMap();<NEW_LINE>final String filterKey = org.graalvm.visualvm.lib.ui.swing.FilterUtils.FILTER_ACTION_KEY;<NEW_LINE>Action filterAction = new AbstractAction() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>Action action = tracer.getActionMap().get(filterKey);<NEW_LINE>if (action != null && action.isEnabled())<NEW_LINE>action.actionPerformed(e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ActionsSupport.registerAction(filterKey, filterAction, actionMap, inputMap);<NEW_LINE>final String findKey = SearchUtils.FIND_ACTION_KEY;<NEW_LINE>Action findAction = new AbstractAction() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>Action action = tracer.getActionMap().get(findKey);<NEW_LINE>if (action != null && action.isEnabled())<NEW_LINE>action.actionPerformed(e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ActionsSupport.registerAction(findKey, findAction, actionMap, inputMap);<NEW_LINE>return tc;<NEW_LINE>} | add(tracer, BorderLayout.CENTER); |
198,355 | public String reopenIt() {<NEW_LINE><MASK><NEW_LINE>if (!MOrder.DOCSTATUS_Closed.equals(getDocStatus())) {<NEW_LINE>return "Not closed - can't reopen";<NEW_LINE>}<NEW_LINE>//<NEW_LINE>MOrderLine[] lines = getLines(true, MOrderLine.COLUMNNAME_M_Product_ID);<NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>MOrderLine line = lines[i];<NEW_LINE>if (Env.ZERO.compareTo(line.getQtyLostSales()) != 0) {<NEW_LINE>line.setQtyOrdered(line.getQtyLostSales().add(line.getQtyDelivered()));<NEW_LINE>line.setQtyLostSales(Env.ZERO);<NEW_LINE>// QtyEntered unchanged<NEW_LINE>// Strip Close() tags from description<NEW_LINE>String desc = line.getDescription();<NEW_LINE>if (desc == null)<NEW_LINE>desc = "";<NEW_LINE>Pattern pattern = Pattern.compile("( \\| )?Close \\(.*\\)");<NEW_LINE>String[] parts = pattern.split(desc);<NEW_LINE>desc = "";<NEW_LINE>for (String s : parts) {<NEW_LINE>desc = desc.concat(s);<NEW_LINE>}<NEW_LINE>line.setDescription(desc);<NEW_LINE>line.saveEx(get_TrxName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Clear Reservations<NEW_LINE>if (!reserveStock(lines)) {<NEW_LINE>m_processMsg = "@Error@ @Undo@ @QtyReserved@ @From@ (@closed@)";<NEW_LINE>return "Failed to update reservations";<NEW_LINE>}<NEW_LINE>// Calculate Sizes (Weight & Volume)<NEW_LINE>calculateOrderSizes(Arrays.asList(lines));<NEW_LINE>setDocStatus(MOrder.DOCSTATUS_Completed);<NEW_LINE>setDocAction(DOCACTION_Close);<NEW_LINE>this.saveEx(get_TrxName());<NEW_LINE>return "";<NEW_LINE>} | log.info(toString()); |
49,022 | final ListDataSourcesResult executeListDataSources(ListDataSourcesRequest listDataSourcesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDataSourcesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDataSourcesRequest> request = null;<NEW_LINE>Response<ListDataSourcesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDataSourcesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDataSourcesRequest));<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, "AppSync");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDataSources");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDataSourcesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDataSourcesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
771,625 | public Map<String, Object> toMap() throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {<NEW_LINE>final Map<String, Object> map = new HashMap<>();<NEW_LINE>map.put("active", this.getActive());<NEW_LINE>map.put("actualCompanyId", this.getActualCompanyId());<NEW_LINE>map.put("birthday", this.getBirthday());<NEW_LINE>map.put("comments", this.getComments());<NEW_LINE>map.put("companyId", this.getCompanyId());<NEW_LINE>map.put("createDate", this.getCreateDate());<NEW_LINE>map.put("modificationDate", this.getModificationDate());<NEW_LINE>String emailAddress = this.getEmailAddress();<NEW_LINE>if (!UtilMethods.isSet(this.getEmailAddress())) {<NEW_LINE>emailAddress = StringPool.BLANK;<NEW_LINE>Logger.warn(this, String.format("Email address for user '%s' is null. Returning an empty value instead.", getUserId()));<NEW_LINE>map.put("gravitar", StringPool.BLANK);<NEW_LINE>} else {<NEW_LINE>map.put("gravitar", DigestUtils.md5Hex(emailAddress.toLowerCase()));<NEW_LINE>}<NEW_LINE>map.put("emailAddress", emailAddress);<NEW_LINE>map.put("emailaddress", emailAddress);<NEW_LINE>map.put("failedLoginAttempts", this.getFailedLoginAttempts());<NEW_LINE>map.put("male", this.getMale());<NEW_LINE>map.put("firstName", this.getFirstName());<NEW_LINE>map.put("fullName", this.getFullName());<NEW_LINE>map.put("name", getFullName());<NEW_LINE>map.put("languageId", this.getLanguageId());<NEW_LINE>map.put("lastLoginDate", this.getLastLoginDate());<NEW_LINE>map.put(<MASK><NEW_LINE>map.put("lastName", this.getLastName());<NEW_LINE>map.put("middleName", this.getMiddleName());<NEW_LINE>map.put("female", this.getFemale());<NEW_LINE>map.put("nickname", this.getNickName());<NEW_LINE>map.put("timeZoneId", this.getTimeZoneId());<NEW_LINE>map.put("deleteInProgress", getDeleteInProgress());<NEW_LINE>map.put("deleteDate", getDeleteDate());<NEW_LINE>map.put("passwordExpirationDate", getPasswordExpirationDate());<NEW_LINE>map.put("passwordExpired", isPasswordExpired());<NEW_LINE>map.put("passwordReset", isPasswordReset());<NEW_LINE>map.put("userId", getUserId());<NEW_LINE>map.put("backendUser", isBackendUser());<NEW_LINE>map.put("frontendUser", isFrontendUser());<NEW_LINE>map.put("hasConsoleAccess", hasConsoleAccess());<NEW_LINE>map.put("id", getUserId());<NEW_LINE>map.put("type", UserAjax.USER_TYPE_VALUE);<NEW_LINE>map.put("additionalInfo", getAdditionalInfo());<NEW_LINE>return map;<NEW_LINE>} | "lastLoginIP", this.getLastLoginIP()); |
437,374 | public Double apply(ClutchConfiguration config, Long currentScale, Double delta) {<NEW_LINE>double scaleUpPct = rpsConfig.getScaleUpAbovePct() / 100.0;<NEW_LINE>double scaleDownPct = rpsConfig.getScaleDownBelowPct() / 100.0;<NEW_LINE>if (delta > -scaleDownPct && delta < scaleUpPct) {<NEW_LINE>return (double) currentScale;<NEW_LINE>}<NEW_LINE>if (delta >= scaleUpPct) {<NEW_LINE>delta = delta * rpsConfig.getScaleUpMultiplier();<NEW_LINE>}<NEW_LINE>if (delta <= -scaleDownPct) {<NEW_LINE>delta = delta * rpsConfig.getScaleDownMultiplier();<NEW_LINE>}<NEW_LINE>// delta is a percentage, actual increase/decrease is computed as percentage of current scale.<NEW_LINE>double scale = Math.round(currentScale + currentScale * delta);<NEW_LINE>scale = Math.min(config.getMaxSize(), Math.max(config<MASK><NEW_LINE>return scale;<NEW_LINE>} | .getMinSize(), scale)); |
987,786 | public void publish(LogRecord record) {<NEW_LINE>if (!isLoggable(record) || m_writer == null)<NEW_LINE>return;<NEW_LINE>rotateLog(record.getMillis());<NEW_LINE>// Format<NEW_LINE>String msg = null;<NEW_LINE>try {<NEW_LINE>msg = getFormatter().format(record);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>reportError("formatting", ex, ErrorManager.FORMAT_FAILURE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Output<NEW_LINE>try {<NEW_LINE>if (!m_doneHeader) {<NEW_LINE>m_writer.write(getFormatter<MASK><NEW_LINE>m_doneHeader = true;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>m_writer.write(msg);<NEW_LINE>m_records++;<NEW_LINE>//<NEW_LINE>if (// flush every 10 records<NEW_LINE>record.getLevel() == Level.SEVERE || record.getLevel() == Level.WARNING || m_records % 10 == 0)<NEW_LINE>flush();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>reportError("writing", ex, ErrorManager.WRITE_FAILURE);<NEW_LINE>}<NEW_LINE>} | ().getHead(this)); |
87,820 | private Notification.Builder createNotification() {<NEW_LINE>String name = "net.minetest.minetest";<NEW_LINE>String channelId = "Minetest channel";<NEW_LINE>String description = "notifications from Minetest";<NEW_LINE>Notification.Builder builder;<NEW_LINE>if (mNotifyManager == null)<NEW_LINE>mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {<NEW_LINE>int importance = NotificationManager.IMPORTANCE_LOW;<NEW_LINE>NotificationChannel mChannel = null;<NEW_LINE>if (mNotifyManager != null)<NEW_LINE><MASK><NEW_LINE>if (mChannel == null) {<NEW_LINE>mChannel = new NotificationChannel(channelId, name, importance);<NEW_LINE>mChannel.setDescription(description);<NEW_LINE>// Configure the notification channel, NO SOUND<NEW_LINE>mChannel.setSound(null, null);<NEW_LINE>mChannel.enableLights(false);<NEW_LINE>mChannel.enableVibration(false);<NEW_LINE>mNotifyManager.createNotificationChannel(mChannel);<NEW_LINE>}<NEW_LINE>builder = new Notification.Builder(this, channelId);<NEW_LINE>} else {<NEW_LINE>builder = new Notification.Builder(this);<NEW_LINE>}<NEW_LINE>Intent notificationIntent = new Intent(this, MainActivity.class);<NEW_LINE>notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);<NEW_LINE>PendingIntent intent = PendingIntent.getActivity(this, 0, notificationIntent, 0);<NEW_LINE>builder.setContentTitle(getString(R.string.notification_title)).setSmallIcon(R.mipmap.ic_launcher).setContentText(getString(R.string.notification_description)).setContentIntent(intent).setOngoing(true).setProgress(0, 0, true);<NEW_LINE>mNotifyManager.notify(id, builder.build());<NEW_LINE>return builder;<NEW_LINE>} | mChannel = mNotifyManager.getNotificationChannel(channelId); |
631,738 | public LogicalPlan pruneOutputsExcept(TableStats tableStats, Collection<Symbol> outputsToKeep) {<NEW_LINE>LinkedHashSet<Symbol> lhsToKeep = new LinkedHashSet<>();<NEW_LINE>LinkedHashSet<Symbol> rhsToKeep = new LinkedHashSet<>();<NEW_LINE>for (Symbol outputToKeep : outputsToKeep) {<NEW_LINE>SymbolVisitors.intersection(outputToKeep, lhs.outputs(), lhsToKeep::add);<NEW_LINE>SymbolVisitors.intersection(outputToKeep, rhs.outputs(), rhsToKeep::add);<NEW_LINE>}<NEW_LINE>SymbolVisitors.intersection(joinCondition, lhs.outputs(), lhsToKeep::add);<NEW_LINE>SymbolVisitors.intersection(joinCondition, rhs.outputs(), rhsToKeep::add);<NEW_LINE>LogicalPlan newLhs = <MASK><NEW_LINE>LogicalPlan newRhs = rhs.pruneOutputsExcept(tableStats, rhsToKeep);<NEW_LINE>if (newLhs == lhs && newRhs == rhs) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>return new HashJoin(newLhs, newRhs, joinCondition, concreteRelation);<NEW_LINE>} | lhs.pruneOutputsExcept(tableStats, lhsToKeep); |
501,910 | protected void displayOctantInfo(GL2 gl, GLU glu) {<NEW_LINE>GLUT glut = new GLUT();<NEW_LINE>float quantum = size / 2;<NEW_LINE>float height = 15;<NEW_LINE>gl.glPushMatrix();<NEW_LINE>gl.glTranslatef(posX - quantum, posY + quantum - height, posZ + quantum);<NEW_LINE>gl.glScalef(0.1f, 0.1f, 0.1f);<NEW_LINE>gl.glColor4f(0.0f, 0.0f, 1.0f, 1.0f);<NEW_LINE>glut.glutStrokeString(GLUT.STROKE_MONO_ROMAN, "ID: " + leafId);<NEW_LINE>gl.glPopMatrix();<NEW_LINE>height += 15;<NEW_LINE>gl.glPushMatrix();<NEW_LINE>gl.glTranslatef(posX - quantum, posY + quantum - height, posZ + quantum);<NEW_LINE>gl.<MASK><NEW_LINE>gl.glColor4f(0.0f, 0.0f, 1.0f, 1.0f);<NEW_LINE>glut.glutStrokeString(GLUT.STROKE_MONO_ROMAN, "objectsCount: " + nodeCount);<NEW_LINE>gl.glPopMatrix();<NEW_LINE>} | glScalef(0.1f, 0.1f, 0.1f); |
519,207 | private void loadNode1214() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionDiagnostics_ClientConnectionTime, new QualifiedName(0, "ClientConnectionTime"), new LocalizedText("en", "ClientConnectionTime"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UtcTime, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionDiagnostics_ClientConnectionTime, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionDiagnostics_ClientConnectionTime, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionDiagnostics_ClientConnectionTime, Identifiers.HasComponent, Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionDiagnostics<MASK><NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), false)); |
134,333 | public static String propertyName(Method method) {<NEW_LINE>Optional<JsonGetter> jsonGetterAnnotation = getterAnnotation(method);<NEW_LINE>if (jsonGetterAnnotation.isPresent() && !isEmpty(jsonGetterAnnotation.get().value())) {<NEW_LINE>return jsonGetterAnnotation.get().value();<NEW_LINE>}<NEW_LINE>Optional<JsonSetter> jsonSetterAnnotation = setterAnnotation(method);<NEW_LINE>if (jsonSetterAnnotation.isPresent() && !isEmpty(jsonSetterAnnotation.get().value())) {<NEW_LINE>return jsonSetterAnnotation.get().value();<NEW_LINE>}<NEW_LINE>Matcher matcher = getter.matcher(method.getName());<NEW_LINE>if (matcher.find()) {<NEW_LINE>return toCamelCase(matcher.group(1));<NEW_LINE>}<NEW_LINE>matcher = isGetter.matcher(method.getName());<NEW_LINE>if (matcher.find()) {<NEW_LINE>return toCamelCase<MASK><NEW_LINE>}<NEW_LINE>matcher = setter.matcher(method.getName());<NEW_LINE>if (matcher.find()) {<NEW_LINE>return toCamelCase(matcher.group(1));<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>} | (matcher.group(1)); |
601,203 | public Set<String> list(boolean global) throws CoreException {<NEW_LINE>IStatus status;<NEW_LINE>if (global) {<NEW_LINE>status = runInBackground(GLOBAL_ARG, PARSEABLE_ARG, LIST);<NEW_LINE>} else {<NEW_LINE>status = runInBackground(PARSEABLE_ARG, LIST);<NEW_LINE>}<NEW_LINE>String output;<NEW_LINE>if (!status.isOK()) {<NEW_LINE>if (status.getCode() == 1 && status instanceof ProcessStatus) {<NEW_LINE>ProcessStatus ps = (ProcessStatus) status;<NEW_LINE>output = ps.getStdOut();<NEW_LINE>// TODO What else can we do to validate that this output is OK?<NEW_LINE>} else {<NEW_LINE>throw new CoreException(new Status(IStatus.ERROR, JSCorePlugin.PLUGIN_ID, MessageFormat.format(Messages.NodePackageManager_FailedListingError, status)));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>output = status.getMessage();<NEW_LINE>}<NEW_LINE>// Need to parse the output!<NEW_LINE>String[] lines = StringUtil.LINE_SPLITTER.split(output);<NEW_LINE>List<IPath> paths = CollectionsUtil.map(CollectionsUtil.newSet(lines), new IMap<String, IPath>() {<NEW_LINE><NEW_LINE>public IPath map(String item) {<NEW_LINE>return Path.fromOSString(item);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Set<String> installed = new HashSet<String>(paths.size());<NEW_LINE>for (IPath path : paths) {<NEW_LINE>try {<NEW_LINE>// The paths we get are locations on disk. We can tell a module's name by looking for a path<NEW_LINE>// that is a child of 'node_modules', i.e. "/usr/local/lib/node_modules/alloy"<NEW_LINE>int count = path.segmentCount();<NEW_LINE>if (count >= 2 && NODE_MODULES.equals(path.segment(count - 2))) {<NEW_LINE>installed.<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// There is a chance that npm throw warnings if there are any partial installations<NEW_LINE>// and npm might fail while trying to parse those warnings.<NEW_LINE>if (// $NON-NLS-1$<NEW_LINE>!path.toOSString().contains("npm WARN")) {<NEW_LINE>throw new CoreException(new Status(IStatus.ERROR, JSCorePlugin.PLUGIN_ID, e.getMessage()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return installed;<NEW_LINE>} | add(path.lastSegment()); |
1,548,180 | public static TimexProperty timexTimeAdd(TimexProperty start, TimexProperty duration) {<NEW_LINE>TimexProperty result = start.clone();<NEW_LINE>if (duration.getMinutes() != null) {<NEW_LINE>result.setMinute(result.getMinute() + (int) Math.round(duration.getMinutes().doubleValue()));<NEW_LINE>if (result.getMinute() > 59) {<NEW_LINE>result.setHour(((result.getHour() != null) ? result.getHour() : 0) + 1);<NEW_LINE>result.setMinute(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (duration.getHours() != null) {<NEW_LINE>result.setHour(result.getHour() + (int) Math.round(duration.getHours().doubleValue()));<NEW_LINE>}<NEW_LINE>if (result.getHour() != null && result.getHour() > 23) {<NEW_LINE>Double days = Math.floor(result.getHour() / 24d);<NEW_LINE>Integer hour = result.getHour() % 24;<NEW_LINE>result.setHour(hour);<NEW_LINE>if (result.getYear() != null && result.getMonth() != null && result.getDayOfMonth() != null) {<NEW_LINE>LocalDateTime d = LocalDateTime.of(result.getYear(), result.getMonth(), result.getDayOfMonth(), 0, 0, 0);<NEW_LINE>d = d.plusDays(days.longValue());<NEW_LINE>result.setYear(d.getYear());<NEW_LINE>result.setMonth(d.getMonthValue());<NEW_LINE>result.setDayOfMonth(d.getDayOfMonth());<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (result.getDayOfWeek() != null) {<NEW_LINE>result.setDayOfWeek(result.getDayOfWeek() + (int) Math.round(days));<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | result.getMinute() % 60); |
1,194,089 | private void processUserData() {<NEW_LINE>List<UserImportData> userImportData = getUserImportData();<NEW_LINE>if (userImportData == null || userImportData.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BukkitUserImportRefiner userImportRefiner = new BukkitUserImportRefiner(userImportData);<NEW_LINE>userImportData = userImportRefiner.refineData();<NEW_LINE>Database db = dbSystem.getDatabase();<NEW_LINE>Set<UUID> existingUUIDs = db.query(UserIdentifierQueries.fetchAllPlayerUUIDs());<NEW_LINE>Set<UUID> existingUserInfoTableUUIDs = db.query(UserIdentifierQueries.fetchPlayerUUIDsOfServer(serverUUID.get()));<NEW_LINE>Map<UUID, BaseUser> users = new HashMap<>();<NEW_LINE>List<UserInfo> userInfo = new ArrayList<>();<NEW_LINE>Map<UUID, List<Nickname>> nickNames = new HashMap<>();<NEW_LINE>List<FinishedSession> sessions = new ArrayList<>();<NEW_LINE>Map<UUID, List<GeoInfo>> geoInfo = new HashMap<>();<NEW_LINE>userImportData.parallelStream().forEach(data -> {<NEW_LINE>UUID uuid = data.getUuid();<NEW_LINE>if (!existingUUIDs.contains(uuid)) {<NEW_LINE>users.put(uuid, toBaseUser(data));<NEW_LINE>}<NEW_LINE>if (!existingUserInfoTableUUIDs.contains(uuid)) {<NEW_LINE>userInfo.add(toUserInfo(data));<NEW_LINE>}<NEW_LINE>nickNames.put(uuid, data.getNicknames());<NEW_LINE>geoInfo.put(uuid, convertGeoInfo(data));<NEW_LINE>sessions.add(toSession(data));<NEW_LINE>});<NEW_LINE>db.executeTransaction(new Transaction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void performOperations() {<NEW_LINE>execute(LargeStoreQueries.storeAllCommonUserInformation(users.values()));<NEW_LINE>execute(LargeStoreQueries.storeAllSessionsWithKillAndWorldData(sessions));<NEW_LINE>Map<ServerUUID, List<UserInfo>> userInformation = Collections.singletonMap(serverUUID.get(), userInfo);<NEW_LINE>execute(LargeStoreQueries.storePerServerUserInformation(userInformation));<NEW_LINE>execute(LargeStoreQueries.storeAllNicknameData(Collections.singletonMap(serverUUID.get(), nickNames)));<NEW_LINE>execute<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (LargeStoreQueries.storeAllGeoInformation(geoInfo)); |
1,543,936 | protected Object computeValueAt(int row, int col) {<NEW_LINE>long value;<NEW_LINE>switch(col) {<NEW_LINE>case 0:<NEW_LINE>return flatProfileContainer.getMethodNameAtRow(row);<NEW_LINE>case 1:<NEW_LINE>return new Float<MASK><NEW_LINE>case 2:<NEW_LINE>value = flatProfileContainer.getTimeInMcs0AtRow(row);<NEW_LINE>// NOI18N<NEW_LINE>return (value > 0 ? "+" : "") + StringUtils.mcsTimeToString(value) + " ms";<NEW_LINE>case 3:<NEW_LINE>if (collectingTwoTimeStamps) {<NEW_LINE>value = flatProfileContainer.getTimeInMcs1AtRow(row);<NEW_LINE>// NOI18N<NEW_LINE>return (value > 0 ? "+" : "") + StringUtils.mcsTimeToString(value) + " ms";<NEW_LINE>} else {<NEW_LINE>value = flatProfileContainer.getTotalTimeInMcs0AtRow(row);<NEW_LINE>// NOI18N<NEW_LINE>return (value > 0 ? "+" : "") + StringUtils.mcsTimeToString(value) + " ms";<NEW_LINE>}<NEW_LINE>case 4:<NEW_LINE>if (collectingTwoTimeStamps) {<NEW_LINE>value = flatProfileContainer.getTotalTimeInMcs0AtRow(row);<NEW_LINE>// NOI18N<NEW_LINE>return (value > 0 ? "+" : "") + StringUtils.mcsTimeToString(value) + " ms";<NEW_LINE>} else {<NEW_LINE>value = flatProfileContainer.getNInvocationsAtRow(row);<NEW_LINE>// NOI18N<NEW_LINE>return (value > 0 ? "+" : "") + intFormat.format(value);<NEW_LINE>}<NEW_LINE>case 5:<NEW_LINE>value = flatProfileContainer.getTotalTimeInMcs1AtRow(row);<NEW_LINE>// NOI18N<NEW_LINE>return (value > 0 ? "+" : "") + StringUtils.mcsTimeToString(value) + " ms";<NEW_LINE>case 6:<NEW_LINE>value = flatProfileContainer.getNInvocationsAtRow(row);<NEW_LINE>// NOI18N<NEW_LINE>return (value > 0 ? "+" : "") + intFormat.format(value);<NEW_LINE>default:<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | (flatProfileContainer.getTimeInMcs0AtRow(row)); |
160,468 | private void applyLayoutToChildComponents() {<NEW_LINE>JComponent content = view.getContent();<NEW_LINE>int spaceAround = view.getSpaceAround();<NEW_LINE>final int contentX = Math.max(spaceAround, -this.left);<NEW_LINE>int cloudHeight = CloudHeightCalculator.INSTANCE.getAdditionalCloudHeigth(view);<NEW_LINE>int contentY = spaceAround + cloudHeight / 2 - Math.min(0, this.top);<NEW_LINE>content.<MASK><NEW_LINE>int baseY = contentY - spaceAround + this.top;<NEW_LINE>int minY = 0;<NEW_LINE>for (int i = 0; i < childViewCount; i++) {<NEW_LINE>if (this.viewLevels.summaryLevels[i] == 0 && this.isChildFreeNode[i]) {<NEW_LINE>minY = Math.min(minY, contentY + this.yCoordinates[i]);<NEW_LINE>} else<NEW_LINE>minY = Math.min(minY, baseY + this.yCoordinates[i]);<NEW_LINE>}<NEW_LINE>if (minY < 0) {<NEW_LINE>contentY -= minY;<NEW_LINE>baseY -= minY;<NEW_LINE>}<NEW_LINE>final Dimension contentSize = ContentSizeCalculator.INSTANCE.calculateContentSize(view);<NEW_LINE>int width = contentX + contentSize.width + spaceAround;<NEW_LINE>int height = contentY + contentSize.height + cloudHeight / 2 + spaceAround;<NEW_LINE>content.setBounds(contentX, contentY, contentSize.width, contentSize.height);<NEW_LINE>int topOverlap = -minY;<NEW_LINE>int heigthWithoutOverlap = height;<NEW_LINE>for (int i = 0; i < childViewCount; i++) {<NEW_LINE>NodeView child = (NodeView) view.getComponent(i);<NEW_LINE>final int y;<NEW_LINE>if (this.viewLevels.summaryLevels[i] == 0 && this.isChildFreeNode[i]) {<NEW_LINE>y = contentY + this.yCoordinates[i];<NEW_LINE>} else {<NEW_LINE>y = baseY + this.yCoordinates[i];<NEW_LINE>if (!this.isChildFreeNode[i])<NEW_LINE>heigthWithoutOverlap = Math.max(heigthWithoutOverlap, y + child.getHeight() + cloudHeight / 2 - child.getBottomOverlap());<NEW_LINE>}<NEW_LINE>final int x = contentX + this.xCoordinates[i];<NEW_LINE>child.setLocation(x, y);<NEW_LINE>width = Math.max(width, child.getX() + child.getWidth());<NEW_LINE>height = Math.max(height, y + child.getHeight() + cloudHeight / 2);<NEW_LINE>}<NEW_LINE>view.setSize(width, height);<NEW_LINE>view.setTopOverlap(topOverlap);<NEW_LINE>view.setBottomOverlap(height - heigthWithoutOverlap);<NEW_LINE>} | setVisible(view.isContentVisible()); |
1,230,528 | private HttpRequest.Builder testGroupParametersRequestBuilder(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException {<NEW_LINE>// verify the required parameter 'requiredStringGroup' is set<NEW_LINE>if (requiredStringGroup == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'requiredBooleanGroup' is set<NEW_LINE>if (requiredBooleanGroup == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'requiredInt64Group' is set<NEW_LINE>if (requiredInt64Group == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters");<NEW_LINE>}<NEW_LINE>HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();<NEW_LINE>String localVarPath = "/fake";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<>();<NEW_LINE>localVarQueryParams.addAll(ApiClient.parameterToPairs("required_string_group", requiredStringGroup));<NEW_LINE>localVarQueryParams.addAll(ApiClient.parameterToPairs("required_int64_group", requiredInt64Group));<NEW_LINE>localVarQueryParams.addAll(ApiClient.parameterToPairs("string_group", stringGroup));<NEW_LINE>localVarQueryParams.addAll(ApiClient<MASK><NEW_LINE>if (!localVarQueryParams.isEmpty()) {<NEW_LINE>StringJoiner queryJoiner = new StringJoiner("&");<NEW_LINE>localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));<NEW_LINE>localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));<NEW_LINE>} else {<NEW_LINE>localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));<NEW_LINE>}<NEW_LINE>if (requiredBooleanGroup != null) {<NEW_LINE>localVarRequestBuilder.header("required_boolean_group", requiredBooleanGroup.toString());<NEW_LINE>}<NEW_LINE>if (booleanGroup != null) {<NEW_LINE>localVarRequestBuilder.header("boolean_group", booleanGroup.toString());<NEW_LINE>}<NEW_LINE>localVarRequestBuilder.header("Accept", "application/json");<NEW_LINE>localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());<NEW_LINE>if (memberVarReadTimeout != null) {<NEW_LINE>localVarRequestBuilder.timeout(memberVarReadTimeout);<NEW_LINE>}<NEW_LINE>if (memberVarInterceptor != null) {<NEW_LINE>memberVarInterceptor.accept(localVarRequestBuilder);<NEW_LINE>}<NEW_LINE>return localVarRequestBuilder;<NEW_LINE>} | .parameterToPairs("int64_group", int64Group)); |
1,302,560 | PartitionReplica[][] checkSnapshots() {<NEW_LINE>Set<UUID> shutdownRequestedReplicas = new HashSet<>();<NEW_LINE>Set<UUID> currentReplicas = new HashSet<>();<NEW_LINE>Map<UUID, Address> currentAddressMapping = new HashMap<>();<NEW_LINE>shutdownRequestedMembers.forEach(member -> shutdownRequestedReplicas.add<MASK><NEW_LINE>Collection<Member> currentMembers = node.getClusterService().getMembers(DATA_MEMBER_SELECTOR);<NEW_LINE>currentMembers.forEach(member -> currentReplicas.add(member.getUuid()));<NEW_LINE>currentMembers.forEach(member -> currentAddressMapping.put(member.getUuid(), member.getAddress()));<NEW_LINE>Set<PartitionTableView> candidates = new TreeSet<>(new PartitionTableViewDistanceComparator(partitionStateManager.getPartitionTable()));<NEW_LINE>for (PartitionTableView partitionTableView : partitionStateManager.snapshots()) {<NEW_LINE>if (partitionTableView.composedOf(currentReplicas, shutdownRequestedReplicas)) {<NEW_LINE>candidates.add(partitionTableView);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (candidates.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// find least distant<NEW_LINE>return candidates.iterator().next().toArray(currentAddressMapping);<NEW_LINE>} | (member.getUuid())); |
596,630 | private Map<ParameterServerId, PSMatricesSaveContext> split(int requestId, ModelSaveContext saveContext) {<NEW_LINE>List<MatrixSaveContext> matricesContext = saveContext.getMatricesContext();<NEW_LINE>Map<ParameterServerId, List<PSMatrixSaveContext>> psIdToContextsMap = new HashMap<>();<NEW_LINE>int size = matricesContext.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>Map<ParameterServerId, PSMatrixSaveContext> psIdToContextMap = split<MASK><NEW_LINE>for (Map.Entry<ParameterServerId, PSMatrixSaveContext> matrixEntry : psIdToContextMap.entrySet()) {<NEW_LINE>List<PSMatrixSaveContext> contexts = psIdToContextsMap.get(matrixEntry.getKey());<NEW_LINE>if (contexts == null) {<NEW_LINE>contexts = new ArrayList<>();<NEW_LINE>psIdToContextsMap.put(matrixEntry.getKey(), contexts);<NEW_LINE>}<NEW_LINE>contexts.add(matrixEntry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<ParameterServerId, PSMatricesSaveContext> ret = new HashMap<>(psIdToContextsMap.size());<NEW_LINE>int subRequestId = 0;<NEW_LINE>for (Map.Entry<ParameterServerId, List<PSMatrixSaveContext>> modelEntry : psIdToContextsMap.entrySet()) {<NEW_LINE>Path psPath = new Path(new Path(new Path(saveContext.getTmpSavePath()), ModelFilesConstent.resultDirName), modelEntry.getKey().toString());<NEW_LINE>List<PSMatrixSaveContext> psMatrixContexts = modelEntry.getValue();<NEW_LINE>for (PSMatrixSaveContext matrixContext : psMatrixContexts) {<NEW_LINE>matrixContext.setSavePath(new Path(psPath, context.getMatrixMetaManager().getMatrix(matrixContext.getMatrixId()).getName()).toString());<NEW_LINE>}<NEW_LINE>ret.put(modelEntry.getKey(), new PSMatricesSaveContext(requestId, subRequestId++, modelEntry.getValue()));<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | (matricesContext.get(i)); |
1,130,330 | public PCollection<Void> expand(PCollection<KV<ShardedKey<DestinationT>, Iterable<byte[]>>> input) {<NEW_LINE>String operationName = input.getName() + "/" + getName();<NEW_LINE>// Append records to the Storage API streams.<NEW_LINE>PCollection<KV<String, Operation>> written = input.apply("Write Records", ParDo.of(new WriteRecordsDoFn(operationName, streamIdleTime)).withSideInputs(dynamicDestinations.getSideInputs()));<NEW_LINE>SchemaCoder<Operation> operationCoder;<NEW_LINE>try {<NEW_LINE>SchemaRegistry schemaRegistry = input.getPipeline().getSchemaRegistry();<NEW_LINE>operationCoder = SchemaCoder.of(schemaRegistry.getSchema(Operation.class), TypeDescriptor.of(Operation.class), schemaRegistry.getToRowFunction(Operation.class), schemaRegistry<MASK><NEW_LINE>} catch (NoSuchSchemaException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>// Send all successful writes to be flushed.<NEW_LINE>return written.setCoder(KvCoder.of(StringUtf8Coder.of(), operationCoder)).apply(Window.<KV<String, Operation>>configure().triggering(Repeatedly.forever(AfterProcessingTime.pastFirstElementInPane().plusDelayOf(Duration.standardSeconds(1)))).discardingFiredPanes()).apply("maxFlushPosition", Combine.perKey(Max.naturalOrder(new Operation(-1, false)))).apply("Flush and finalize writes", ParDo.of(new StorageApiFlushAndFinalizeDoFn(bqServices)));<NEW_LINE>} | .getFromRowFunction(Operation.class)); |
818,671 | public ClassificationPoliciesConfig requestClassificationPoliciesConfig(String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/system/config/policies/classifications";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));<NEW_LINE>final <MASK><NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<ClassificationPoliciesConfig> localVarReturnType = new GenericType<ClassificationPoliciesConfig>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | String[] localVarAccepts = { "application/json" }; |
993,479 | public void testNotSupportedXAOptionA() throws Exception {<NEW_LINE>String deliveryID = "MD_test5a";<NEW_LINE>prepareTRA();<NEW_LINE>// construct a FVTMessage<NEW_LINE>FVTMessage message = new FVTMessage();<NEW_LINE>message.addTestResult("CMTJMSNotSupported", 51);<NEW_LINE>// Add a FVTXAResourceImpl for this delivery.<NEW_LINE>message.addXAResource("CMTJMSNotSupported", 51, new FVTXAResourceImpl());<NEW_LINE>// Add a option A delivery<NEW_LINE>message.add("CMTJMSNotSupported", "message1", 51);<NEW_LINE>message.<MASK><NEW_LINE>System.out.println(message.toString());<NEW_LINE>baseProvider.sendDirectMessage(deliveryID, message);<NEW_LINE>MessageEndpointTestResults results = baseProvider.getTestResult(deliveryID);<NEW_LINE>assertTrue("isDeliveryTransacted returns false for a method with the Required attribute.", !results.isDeliveryTransacted());<NEW_LINE>assertTrue("Number of messages delivered is 2", results.getNumberOfMessagesDelivered() == 2);<NEW_LINE>assertTrue("Delivery option A is used for this test.", results.optionAMessageDeliveryUsed());<NEW_LINE>// assertTrue("This message delivery is in a local transaction context.", results.mdbInvokedInLocalTransactionContext());<NEW_LINE>assertFalse("The commit should not be driven on the XAResource provided by TRA.", results.raXaResourceCommitWasDriven());<NEW_LINE>assertFalse("The RA XAResource should not be enlisted in the global transaction.", results.raXaResourceEnlisted());<NEW_LINE>baseProvider.releaseDeliveryId(deliveryID);<NEW_LINE>} | add("CMTJMSNotSupported", "message2", 51); |
275,238 | public SendVoiceMessageResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SendVoiceMessageResult sendVoiceMessageResult = new SendVoiceMessageResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return sendVoiceMessageResult;<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("MessageId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sendVoiceMessageResult.setMessageId(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 sendVoiceMessageResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,803,332 | public void marshall(AssistantSummary assistantSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (assistantSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(assistantSummary.getAssistantArn(), ASSISTANTARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(assistantSummary.getAssistantId(), ASSISTANTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(assistantSummary.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(assistantSummary.getServerSideEncryptionConfiguration(), SERVERSIDEENCRYPTIONCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(assistantSummary.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(assistantSummary.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(assistantSummary.getType(), TYPE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | assistantSummary.getName(), NAME_BINDING); |
493,135 | boolean yolov4(String model_config_path, String filename) {<NEW_LINE>// https://deeplearning4j.konduit.ai/<NEW_LINE>int height = 608;<NEW_LINE>int width = 608;<NEW_LINE>int channels = 3;<NEW_LINE>NativeImageLoader loader = new NativeImageLoader(height, width, channels);<NEW_LINE>INDArray BGRimage = null;<NEW_LINE>try {<NEW_LINE>BGRimage = loader.asMatrix(new File(filename));<NEW_LINE>} catch (java.io.IOException e) {<NEW_LINE>System.out.println("load image fail.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// shape: (channels, height, width)<NEW_LINE>BGRimage = BGRimage.reshape(channels, height, width);<NEW_LINE>INDArray RGBimage = Nd4j.<MASK><NEW_LINE>// BGR2RGB<NEW_LINE>CustomOp op = DynamicCustomOp.builder("reverse").addInputs(BGRimage).addOutputs(RGBimage).addIntegerArguments(0).build();<NEW_LINE>Nd4j.getExecutioner().exec(op);<NEW_LINE>// Div(255.0)<NEW_LINE>INDArray image = RGBimage.divi(255.0);<NEW_LINE>long[] batch_shape = { 1, image.shape()[0], image.shape()[1], image.shape()[2] };<NEW_LINE>INDArray batch_image = image.reshape(batch_shape);<NEW_LINE>INDArray im_size = Nd4j.createFromArray(new int[] { height, width });<NEW_LINE>long[] batch_size_shape = { 1, 2 };<NEW_LINE>INDArray batch_im_size = im_size.reshape(batch_size_shape);<NEW_LINE>HashMap<String, Object> feed_data = new HashMap<String, Object>() {<NEW_LINE><NEW_LINE>{<NEW_LINE>put("image", batch_image);<NEW_LINE>put("im_size", batch_im_size);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>List<String> fetch = Arrays.asList("save_infer_model/scale_0.tmp_0");<NEW_LINE>Client client = new Client();<NEW_LINE>client.setIP("127.0.0.1");<NEW_LINE>client.setPort("9393");<NEW_LINE>client.loadClientConfig(model_config_path);<NEW_LINE>String result = client.predict(feed_data, fetch, true, 0);<NEW_LINE>System.out.println(result);<NEW_LINE>return true;<NEW_LINE>} | create(BGRimage.shape()); |
1,326,688 | public static void main(String[] args) throws Exception {<NEW_LINE>// Need the source doc as a DOM for later, and also<NEW_LINE>// as XSLT input<NEW_LINE>Document doc = XmlUtils.getNewDocumentBuilder().parse(new File(System.getProperty("user.dir") + "/sample-docs/glox/extracted/data-sample.xml"));<NEW_LINE>GloxPackage gloxPackage = (GloxPackage) OpcPackage.load(new File(System.getProperty("user.dir") + "/sample-docs/glox/extracted/CirclePictureHierarchy.glox"));<NEW_LINE>CTDiagramDefinition diagramLayoutObj = gloxPackage.getDiagramLayoutPart().getJaxbElement();<NEW_LINE>Templates layoutTreeCreatorXslt = DiagramLayoutPart.generateLayoutTreeXSLT(diagramLayoutObj);<NEW_LINE>Templates layoutTree2DiagramDataXslt = XmlUtils.getTransformerTemplate(new StreamSource(org.docx4j.utils.ResourceUtils.getResource("org/docx4j/openpackaging/parts/DrawingML/DiagramLayoutTree4AlgHier.xslt")));<NEW_LINE>CreatePptxWithSmartArt creatorPptx = new CreatePptxWithSmartArt(diagramLayoutObj, layoutTreeCreatorXslt, layoutTree2DiagramDataXslt);<NEW_LINE>PresentationMLPackage pkg = creatorPptx.createSmartArtPkg(SlideSizesWellKnown.A3, true, doc);<NEW_LINE>SaveToZipFile saver = new SaveToZipFile(pkg);<NEW_LINE>saver.save(new File(System.getProperty("user.dir") + "/OUT.pptx"));<NEW_LINE><MASK><NEW_LINE>} | System.out.println("Done!"); |
1,275,858 | public void createPartControl(Composite parent) {<NEW_LINE>Composite composite = new Composite(parent, SWT.NONE);<NEW_LINE>composite.setLayout(new GridLayout(1, true));<NEW_LINE>text = new StyledText(composite, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);<NEW_LINE>text.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));<NEW_LINE>text.setText("");<NEW_LINE>if (SystemUtil.IS_MAC_OSX) {<NEW_LINE>text.setFont(new Font(null, "Courier New", 12, SWT.NORMAL));<NEW_LINE>} else {<NEW_LINE>text.setFont(new Font(null, "Courier New", 10, SWT.NORMAL));<NEW_LINE>}<NEW_LINE>text.setBackgroundImage(Activator.getImage("icons/grid.jpg"));<NEW_LINE>IToolBarManager man = getViewSite()<MASK><NEW_LINE>man.add(openSqlSummaryDialog);<NEW_LINE>man.add(helpAction);<NEW_LINE>IMenuManager menuManager = getViewSite().getActionBars().getMenuManager();<NEW_LINE>menuManager.add(saveFullProfile);<NEW_LINE>createContextMenu();<NEW_LINE>} | .getActionBars().getToolBarManager(); |
469,309 | private void copyFileToDestination(Path exportPath) {<NEW_LINE>Optional<Path> fileToExport = linkedFile.findIn(databaseContext, filePreferences);<NEW_LINE>Optional<Path> newPath = OptionalUtil.combine(Optional.of<MASK><NEW_LINE>if (newPath.isPresent()) {<NEW_LINE>Path newFile = newPath.get();<NEW_LINE>boolean success = fileToExport.isPresent() && FileUtil.copyFile(fileToExport.get(), newFile, false);<NEW_LINE>if (success) {<NEW_LINE>dialogService.showInformationDialogAndWait(Localization.lang("Copy linked file"), Localization.lang("Successfully copied file to %0.", newPath.map(Path::getParent).map(Path::toString).orElse("")));<NEW_LINE>} else {<NEW_LINE>dialogService.showErrorDialogAndWait(Localization.lang("Copy linked file"), Localization.lang("Could not copy file to %0, maybe the file is already existing?", newPath.map(Path::getParent).map(Path::toString).orElse("")));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dialogService.showErrorDialogAndWait(Localization.lang("Could not resolve the file %0", fileToExport.map(Path::getParent).map(Path::toString).orElse("")));<NEW_LINE>}<NEW_LINE>} | (exportPath), fileToExport, resolvePathFilename); |
1,819,291 | public StringBuffer printHeader(int indent, StringBuffer output) {<NEW_LINE>printModifiers(this.modifiers, output);<NEW_LINE>if (this.annotations != null) {<NEW_LINE>printAnnotations(this.annotations, output);<NEW_LINE>output.append(' ');<NEW_LINE>}<NEW_LINE>switch(kind(this.modifiers)) {<NEW_LINE>case TypeDeclaration.CLASS_DECL:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>output.append("class ");<NEW_LINE>break;<NEW_LINE>case TypeDeclaration.INTERFACE_DECL:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>output.append("interface ");<NEW_LINE>break;<NEW_LINE>case TypeDeclaration.ENUM_DECL:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>output.append("enum ");<NEW_LINE>break;<NEW_LINE>case TypeDeclaration.ANNOTATION_TYPE_DECL:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>output.append("@interface ");<NEW_LINE>break;<NEW_LINE>case TypeDeclaration.RECORD_DECL:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>output.append("record ");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>output.append(this.name);<NEW_LINE>if (this.isRecord()) {<NEW_LINE>output.append('(');<NEW_LINE>if (this.nRecordComponents > 0 && this.fields != null) {<NEW_LINE>for (int i = 0; i < this.nRecordComponents; i++) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>if (i > 0)<NEW_LINE>output.append(", ");<NEW_LINE>output.append(this.fields[i].type<MASK><NEW_LINE>output.append(' ');<NEW_LINE>output.append(this.fields[i].name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>output.append(')');<NEW_LINE>}<NEW_LINE>if (this.typeParameters != null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>output.append("<");<NEW_LINE>for (int i = 0; i < this.typeParameters.length; i++) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>if (i > 0)<NEW_LINE>output.append(", ");<NEW_LINE>this.typeParameters[i].print(0, output);<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>output.append(">");<NEW_LINE>}<NEW_LINE>if (!this.isRecord() && this.superclass != null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>output.append(" extends ");<NEW_LINE>this.superclass.print(0, output);<NEW_LINE>}<NEW_LINE>if (this.superInterfaces != null && this.superInterfaces.length > 0) {<NEW_LINE>switch(kind(this.modifiers)) {<NEW_LINE>case TypeDeclaration.CLASS_DECL:<NEW_LINE>case TypeDeclaration.ENUM_DECL:<NEW_LINE>case TypeDeclaration.RECORD_DECL:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>output.append(" implements ");<NEW_LINE>break;<NEW_LINE>case TypeDeclaration.INTERFACE_DECL:<NEW_LINE>case TypeDeclaration.ANNOTATION_TYPE_DECL:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>output.append(" extends ");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < this.superInterfaces.length; i++) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>if (i > 0)<NEW_LINE>output.append(", ");<NEW_LINE>this.superInterfaces[i].print(0, output);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>} | .getTypeName()[0]); |
1,058,723 | protected void drawGrad(BufferBuilder renderer, int x, int y, double width, double height, Vector4i colorL, Vector4i colorR) {<NEW_LINE>renderer.pos(x + 0, y + 0, 0.0D).color(colorL.x, colorL.y, colorL.z, <MASK><NEW_LINE>renderer.pos(x + 0, y + height, 0.0D).color(colorL.x, colorL.y, colorL.z, colorL.w).endVertex();<NEW_LINE>renderer.pos(x + width, y + height, 0.0D).color(colorR.x, colorR.y, colorR.z, colorR.w).endVertex();<NEW_LINE>renderer.pos(x + width, y + 0, 0.0D).color(colorR.x, colorR.y, colorR.z, colorR.w).endVertex();<NEW_LINE>} | colorL.w).endVertex(); |
723,145 | public static GetClusterVolumesResponse unmarshall(GetClusterVolumesResponse getClusterVolumesResponse, UnmarshallerContext _ctx) {<NEW_LINE>getClusterVolumesResponse.setRequestId(_ctx.stringValue("GetClusterVolumesResponse.RequestId"));<NEW_LINE>getClusterVolumesResponse.setRegionId(_ctx.stringValue("GetClusterVolumesResponse.RegionId"));<NEW_LINE>List<VolumeInfo> volumes = new ArrayList<VolumeInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetClusterVolumesResponse.Volumes.Length"); i++) {<NEW_LINE>VolumeInfo volumeInfo = new VolumeInfo();<NEW_LINE>volumeInfo.setVolumeId(_ctx.stringValue("GetClusterVolumesResponse.Volumes[" + i + "].VolumeId"));<NEW_LINE>volumeInfo.setVolumeType(_ctx.stringValue("GetClusterVolumesResponse.Volumes[" + i + "].VolumeType"));<NEW_LINE>volumeInfo.setVolumeProtocol(_ctx.stringValue("GetClusterVolumesResponse.Volumes[" + i + "].VolumeProtocol"));<NEW_LINE>volumeInfo.setVolumeMountpoint(_ctx.stringValue("GetClusterVolumesResponse.Volumes[" + i + "].VolumeMountpoint"));<NEW_LINE>volumeInfo.setRemoteDirectory(_ctx.stringValue("GetClusterVolumesResponse.Volumes[" + i + "].RemoteDirectory"));<NEW_LINE>volumeInfo.setLocalDirectory(_ctx.stringValue("GetClusterVolumesResponse.Volumes[" + i + "].LocalDirectory"));<NEW_LINE>volumeInfo.setLocation(_ctx.stringValue("GetClusterVolumesResponse.Volumes[" + i + "].Location"));<NEW_LINE>volumeInfo.setJobQueue(_ctx.stringValue<MASK><NEW_LINE>volumeInfo.setMustKeep(_ctx.booleanValue("GetClusterVolumesResponse.Volumes[" + i + "].MustKeep"));<NEW_LINE>List<RoleInfo> roles = new ArrayList<RoleInfo>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("GetClusterVolumesResponse.Volumes[" + i + "].Roles.Length"); j++) {<NEW_LINE>RoleInfo roleInfo = new RoleInfo();<NEW_LINE>roleInfo.setName(_ctx.stringValue("GetClusterVolumesResponse.Volumes[" + i + "].Roles[" + j + "].Name"));<NEW_LINE>roles.add(roleInfo);<NEW_LINE>}<NEW_LINE>volumeInfo.setRoles(roles);<NEW_LINE>volumes.add(volumeInfo);<NEW_LINE>}<NEW_LINE>getClusterVolumesResponse.setVolumes(volumes);<NEW_LINE>return getClusterVolumesResponse;<NEW_LINE>} | ("GetClusterVolumesResponse.Volumes[" + i + "].JobQueue")); |
907,367 | protected void addPseudoClassArguments(String pseudoClassName, List<ICompletionProposal> proposals, int offset) {<NEW_LINE>if (pseudoClassName == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<PseudoClassElement> classes = this._queryHelper.getPseudoClasses();<NEW_LINE>if (classes != null) {<NEW_LINE>for (PseudoClassElement pseudoClass : classes) {<NEW_LINE>if (!pseudoClass.getName().equals(pseudoClassName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<ValueElement> values = pseudoClass.getValues();<NEW_LINE>if (values != null) {<NEW_LINE>for (ValueElement value : values) {<NEW_LINE>// String description = CSSModelFormatter.getDescription(value);<NEW_LINE>List<String<MASK><NEW_LINE>String[] userAgentIds = userAgentIdList.toArray(new String[userAgentIdList.size()]);<NEW_LINE>addProposal(proposals, value.getName(), ELEMENT_ICON, value.getDescription(), userAgentIds, offset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > userAgentIdList = pseudoClass.getUserAgentNames(); |
1,044,551 | public Mono<Void> disposeLater(Duration quietPeriod, Duration timeout) {<NEW_LINE>return Mono.defer(() -> {<NEW_LINE>long quietPeriodMillis = quietPeriod.toMillis();<NEW_LINE>long timeoutMillis = timeout.toMillis();<NEW_LINE>EventLoopGroup serverLoopsGroup = serverLoops.get();<NEW_LINE>EventLoopGroup clientLoopsGroup = clientLoops.get();<NEW_LINE>EventLoopGroup serverSelectLoopsGroup = serverSelectLoops.get();<NEW_LINE>EventLoopGroup cacheNativeClientGroup = cacheNativeClientLoops.get();<NEW_LINE>EventLoopGroup cacheNativeSelectGroup = cacheNativeSelectLoops.get();<NEW_LINE>EventLoopGroup cacheNativeServerGroup = cacheNativeServerLoops.get();<NEW_LINE>Mono<?> clMono = Mono.empty();<NEW_LINE>Mono<?> sslMono = Mono.empty();<NEW_LINE>Mono<?> slMono = Mono.empty();<NEW_LINE>Mono<?> cnclMono = Mono.empty();<NEW_LINE>Mono<?> cnslMono = Mono.empty();<NEW_LINE>Mono<?> cnsrvlMono = Mono.empty();<NEW_LINE>if (running.compareAndSet(true, false)) {<NEW_LINE>if (clientLoopsGroup != null) {<NEW_LINE>clMono = FutureMono.from((Future) clientLoopsGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (serverSelectLoopsGroup != null) {<NEW_LINE>sslMono = FutureMono.from((Future) serverSelectLoopsGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (serverLoopsGroup != null) {<NEW_LINE>slMono = FutureMono.from((Future) serverLoopsGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (cacheNativeClientGroup != null) {<NEW_LINE>cnclMono = FutureMono.from((Future) cacheNativeClientGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (cacheNativeSelectGroup != null) {<NEW_LINE>cnslMono = FutureMono.from((Future) cacheNativeSelectGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (cacheNativeServerGroup != null) {<NEW_LINE>cnsrvlMono = FutureMono.from((Future) cacheNativeServerGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Mono.when(clMono, sslMono, <MASK><NEW_LINE>});<NEW_LINE>} | slMono, cnclMono, cnslMono, cnsrvlMono); |
63,267 | default ToDoubleNullable<T> mapToDoubleIfPresent(FloatToDoubleFunction mapper) {<NEW_LINE>final ToFloatNullable<T> delegate = this;<NEW_LINE>return new ToDoubleNullable<T>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Double apply(T object) {<NEW_LINE>return delegate.isNull(object) ? null : mapper.applyAsDouble<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double applyAsDouble(T object) {<NEW_LINE>return mapper.applyAsDouble(delegate.applyAsFloat(object));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ToDouble<T> orElseGet(ToDouble<T> getter) {<NEW_LINE>return object -> delegate.isNull(object) ? getter.applyAsDouble(object) : mapper.applyAsDouble(delegate.applyAsFloat(object));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ToDouble<T> orElse(Double value) {<NEW_LINE>return object -> delegate.isNull(object) ? value : mapper.applyAsDouble(delegate.applyAsFloat(object));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isNull(T object) {<NEW_LINE>return delegate.isNull(object);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isNotNull(T object) {<NEW_LINE>return delegate.isNotNull(object);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | (delegate.applyAsFloat(object)); |
163,070 | private CompletableFuture<Void> copyBytes(ChunkHandle writeHandle, ConcatArgument arg) {<NEW_LINE>return Futures.loop(() -> bytesToRead.get() > 0, () -> {<NEW_LINE>val buffer = new byte[Math.toIntExact(Math.min(chunkedSegmentStorage.getConfig().getMaxBufferSizeForChunkDataTransfer(), bytesToRead.get()))];<NEW_LINE>return chunkedSegmentStorage.getChunkStorage().read(ChunkHandle.readHandle(arg.getName()), readAtOffset.get(), buffer.length, buffer, 0).thenComposeAsync(size -> {<NEW_LINE>bytesToRead.addAndGet(-size);<NEW_LINE>readAtOffset.addAndGet(size);<NEW_LINE>return chunkedSegmentStorage.getChunkStorage().write(writeHandle, writeAtOffset.get(), size, new ByteArrayInputStream(buffer, 0, size)).thenAcceptAsync(writeAtOffset::addAndGet, chunkedSegmentStorage.getExecutor());<NEW_LINE>}, chunkedSegmentStorage.getExecutor());<NEW_LINE><MASK><NEW_LINE>} | }, chunkedSegmentStorage.getExecutor()); |
1,136,156 | public AutogenEnvironmentVariablesDiff generate(SourceOfRandomness r, GenerationStatus status) {<NEW_LINE>// if (r.nextBoolean())<NEW_LINE>// return null;<NEW_LINE>AutogenEnvironmentVariablesDiff obj = new AutogenEnvironmentVariablesDiff();<NEW_LINE>if (r.nextBoolean()) {<NEW_LINE>obj.setA(Utils.removeEmpty(gen().type(AutogenEnvironmentVariablesBlob.class).generate(r, status)));<NEW_LINE>}<NEW_LINE>if (r.nextBoolean()) {<NEW_LINE>obj.setB(Utils.removeEmpty(gen().type(AutogenEnvironmentVariablesBlob.class).generate(r, status)));<NEW_LINE>}<NEW_LINE>if (r.nextBoolean()) {<NEW_LINE>obj.setC(Utils.removeEmpty(gen().type(AutogenEnvironmentVariablesBlob.class).<MASK><NEW_LINE>}<NEW_LINE>if (r.nextBoolean()) {<NEW_LINE>obj.setStatus(Utils.removeEmpty(gen().type(AutogenDiffStatusEnumDiffStatus.class).generate(r, status)));<NEW_LINE>}<NEW_LINE>return obj;<NEW_LINE>} | generate(r, status))); |
892,792 | public int run(final String[] strings) throws Exception {<NEW_LINE>LOGGER.info(<MASK><NEW_LINE>TableUtils.ensureTableExists(store);<NEW_LINE>// Hadoop configuration<NEW_LINE>final Configuration conf = getConf();<NEW_LINE>final FileSystem fs = FileSystem.get(conf);<NEW_LINE>checkHdfsDirectories(failurePath, fs);<NEW_LINE>// Remove the _SUCCESS file to prevent warning in Accumulo<NEW_LINE>LOGGER.info("Removing file {}/_SUCCESS", inputPath);<NEW_LINE>fs.delete(new Path(inputPath + "/_SUCCESS"), false);<NEW_LINE>// Set all permissions<NEW_LINE>if (options == null || !Boolean.parseBoolean(options.get(AccumuloProperties.HDFS_SKIP_PERMISSIONS))) {<NEW_LINE>IngestUtils.setDirectoryPermsForAccumulo(fs, new Path(inputPath));<NEW_LINE>}<NEW_LINE>// Import the files<NEW_LINE>LOGGER.info("Importing files in {} to table {}", inputPath, store.getTableName());<NEW_LINE>store.getConnection().tableOperations().importDirectory(store.getTableName(), inputPath, failurePath, false);<NEW_LINE>return SUCCESS_RESPONSE;<NEW_LINE>} | "Ensuring table {} exists", store.getTableName()); |
443,471 | static // O(V^3)<NEW_LINE>// O(V^3)<NEW_LINE>int pushRelabel() {<NEW_LINE>int[] h = new int[V], e = new int[V], f[] = new int[V][V];<NEW_LINE>h[s] = V - 1;<NEW_LINE>Queue<Integer> q = new LinkedList<Integer>();<NEW_LINE>q.add(t);<NEW_LINE>while (!q.isEmpty()) {<NEW_LINE>int u = q.remove();<NEW_LINE>for (int v = 0; v < V; ++v) if (v != t && v != s && h[v] == 0) {<NEW_LINE>h[v] = h[u] + 1;<NEW_LINE>q.add(v);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean[] isActive = new boolean[V];<NEW_LINE>for (int i = 0; i < V; ++i) {<NEW_LINE>f[i][s] = -(f[s][i] = e[i] = c[s][i]);<NEW_LINE>if (i != s && i != t && e[i] > 0) {<NEW_LINE>isActive[i] = true;<NEW_LINE>q.add(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (!q.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>boolean pushed = false;<NEW_LINE>for (int v = 0; v < V && e[u] != 0; ++v) if (h[u] == h[v] + 1 && c[u][v] - f[u][v] > 0) {<NEW_LINE>int df = Math.min(e[u], c[u][v] - f[u][v]);<NEW_LINE>f[u][v] += df;<NEW_LINE>f[v][u] -= df;<NEW_LINE>e[u] -= df;<NEW_LINE>e[v] += df;<NEW_LINE>if (v != s && v != t && !isActive[v]) {<NEW_LINE>isActive[v] = true;<NEW_LINE>q.add(v);<NEW_LINE>}<NEW_LINE>pushed = true;<NEW_LINE>}<NEW_LINE>if (e[u] == 0) {<NEW_LINE>isActive[u] = false;<NEW_LINE>q.remove();<NEW_LINE>}<NEW_LINE>if (!pushed) {<NEW_LINE>h[u] = INF;<NEW_LINE>for (int v = 0; v < V; ++v) if (h[v] + 1 < h[u] && c[u][v] - f[u][v] > 0)<NEW_LINE>h[u] = h[v] + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return e[t];<NEW_LINE>} | int u = q.peek(); |
1,711,439 | public static void main(String[] args) {<NEW_LINE>final String USAGE = "To run this example, supply:\n" + "* a rule name\n" + "* lambda function arn\n" + "* target id\n\n" + "Ex: PutTargets <rule-name> <lambda-function-arn> <target-id>\n";<NEW_LINE>if (args.length != 3) {<NEW_LINE>System.out.println(USAGE);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>String rule_name = args[0];<NEW_LINE>String function_arn = args[1];<NEW_LINE>String target_id = args[2];<NEW_LINE>final AmazonCloudWatchEvents cwe = AmazonCloudWatchEventsClientBuilder.defaultClient();<NEW_LINE>Target target = new Target().withArn(function_arn).withId(target_id);<NEW_LINE>PutTargetsRequest request = new PutTargetsRequest().withTargets(target).withRule(rule_name);<NEW_LINE>PutTargetsResult response = cwe.putTargets(request);<NEW_LINE>System.<MASK><NEW_LINE>} | out.printf("Successfully created CloudWatch events target for rule %s", rule_name); |
241,832 | public PersistenceResponse updateEntity(EntityForm entityForm, String[] customCriteria, List<SectionCrumb> sectionCrumb) throws ServiceException {<NEW_LINE>PersistencePackageRequest ppr = getRequestForEntityForm(entityForm, customCriteria, sectionCrumb);<NEW_LINE>ppr.setRequestingEntityName(entityForm.getMainEntityName());<NEW_LINE>// If the entity form has dynamic forms inside of it, we need to persist those as well.<NEW_LINE>// They are typically done in their own custom persistence handlers, which will get triggered<NEW_LINE>// based on the criteria specific in the PersistencePackage.<NEW_LINE>for (Entry<String, EntityForm> entry : entityForm.getDynamicForms().entrySet()) {<NEW_LINE>DynamicEntityFormInfo info = entityForm.getDynamicFormInfo(entry.getKey());<NEW_LINE>if (info.getCustomCriteriaOverride() != null) {<NEW_LINE>customCriteria = info.getCustomCriteriaOverride();<NEW_LINE>} else {<NEW_LINE>String propertyName = info.getPropertyName();<NEW_LINE>String propertyValue = entityForm.findField(propertyName).getValue();<NEW_LINE>customCriteria = new String[] { info.getCriteriaName(), entityForm.getId(), propertyName, propertyValue };<NEW_LINE>}<NEW_LINE>PersistencePackageRequest subRequest = getRequestForEntityForm(entry.<MASK><NEW_LINE>subRequest.withSecurityCeilingEntityClassname(info.getSecurityCeilingClassName());<NEW_LINE>ppr.addSubRequest(info.getPropertyName(), subRequest);<NEW_LINE>}<NEW_LINE>return update(ppr);<NEW_LINE>} | getValue(), customCriteria, sectionCrumb); |
1,531,572 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>BigImageViewer.initialize(FrescoImageLoader<MASK><NEW_LINE>setContentView(R.layout.activity_custom_ssiv);<NEW_LINE>findViewById(R.id.mBtnLoad).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>BigImageView bigImageView = findViewById(R.id.mBigImage);<NEW_LINE>bigImageView.setProgressIndicator(new ProgressPieIndicator());<NEW_LINE>bigImageView.setImageViewFactory(new ImageViewFactory() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected SubsamplingScaleImageView createStillImageView(final Context context) {<NEW_LINE>return new MySSIV(context);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>bigImageView.showImage(Uri.parse("https://images.unsplash.com/photo-1497240299146-17ff4089466a?dpr=2&auto=compress,format&fit=crop&w=376"), Uri.parse("https://images.unsplash.com/photo-1497240299146-17ff4089466a"));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | .with(getApplicationContext())); |
1,205,088 | public void render(PebbleTemplateImpl self, Writer writer, EvaluationContextImpl context) throws IOException {<NEW_LINE>final Object iterableEvaluation = this.iterableExpression.evaluate(self, context);<NEW_LINE>Iterable<?> iterable;<NEW_LINE>if (iterableEvaluation == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>iterable = this.toIterable(iterableEvaluation);<NEW_LINE>if (iterable == null) {<NEW_LINE>throw new PebbleException(null, "Not an iterable object. Value = [" + iterableEvaluation.toString() + "]", this.getLineNumber(), self.getName());<NEW_LINE>}<NEW_LINE>Iterator<?> iterator = iterable.iterator();<NEW_LINE>if (iterator.hasNext()) {<NEW_LINE>ScopeChain scopeChain = context.getScopeChain();<NEW_LINE>scopeChain.pushScope();<NEW_LINE>LazyLength length = new LazyLength(iterableEvaluation);<NEW_LINE>int index = 0;<NEW_LINE>LoopVariables loop = null;<NEW_LINE>boolean usingExecutorService = context.getExecutorService() != null;<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>if (index == 0 || usingExecutorService) {<NEW_LINE>loop = new LoopVariables();<NEW_LINE>loop.first = index == 0;<NEW_LINE>loop.last = !iterator.hasNext();<NEW_LINE>loop.length = length;<NEW_LINE>} else if (index == 1) {<NEW_LINE>// second iteration<NEW_LINE>loop.first = false;<NEW_LINE>}<NEW_LINE>loop.revindex = new LazyRevIndex(index, length);<NEW_LINE>loop.index = index++;<NEW_LINE><MASK><NEW_LINE>scopeChain.put(this.variableName, iterator.next());<NEW_LINE>// last iteration<NEW_LINE>if (!iterator.hasNext()) {<NEW_LINE>loop.last = true;<NEW_LINE>}<NEW_LINE>this.body.render(self, writer, context);<NEW_LINE>}<NEW_LINE>scopeChain.popScope();<NEW_LINE>} else if (this.elseBody != null) {<NEW_LINE>this.elseBody.render(self, writer, context);<NEW_LINE>}<NEW_LINE>} | scopeChain.put("loop", loop); |
1,748,616 | protected final Trigger loadCode(SectionNode sectionNode, String name, Class<? extends Event>... events) {<NEW_LINE>ParserInstance parser = getParser();<NEW_LINE><MASK><NEW_LINE>Class<? extends Event>[] previousEvents = parser.getCurrentEvents();<NEW_LINE>SkriptEvent previousSkriptEvent = parser.getCurrentSkriptEvent();<NEW_LINE>List<TriggerSection> previousSections = parser.getCurrentSections();<NEW_LINE>Kleenean previousDelay = parser.getHasDelayBefore();<NEW_LINE>parser.setCurrentEvent(name, events);<NEW_LINE>SkriptEvent skriptEvent = new SectionSkriptEvent(name, this);<NEW_LINE>parser.setCurrentSkriptEvent(skriptEvent);<NEW_LINE>parser.setCurrentSections(new ArrayList<>());<NEW_LINE>parser.setHasDelayBefore(Kleenean.FALSE);<NEW_LINE>List<TriggerItem> triggerItems = ScriptLoader.loadItems(sectionNode);<NEW_LINE>// noinspection ConstantConditions - We are resetting it to what it was<NEW_LINE>parser.setCurrentEvent(previousName, previousEvents);<NEW_LINE>parser.setCurrentSkriptEvent(previousSkriptEvent);<NEW_LINE>parser.setCurrentSections(previousSections);<NEW_LINE>parser.setHasDelayBefore(previousDelay);<NEW_LINE>Config script = parser.getCurrentScript();<NEW_LINE>return new Trigger(script != null ? script.getFile() : null, name, skriptEvent, triggerItems);<NEW_LINE>} | String previousName = parser.getCurrentEventName(); |
509,050 | void ensureColumnCanBeUpdated(ColumnIdent ci) {<NEW_LINE>if (ci.isSystemColumn()) {<NEW_LINE>throw new ColumnValidationException(ci.toString(), tableInfo.ident(), "Updating a system column is not supported");<NEW_LINE>}<NEW_LINE>for (ColumnIdent pkIdent : tableInfo.primaryKey()) {<NEW_LINE>ensureNotUpdated(ci, pkIdent, "Updating a primary key is not supported");<NEW_LINE>}<NEW_LINE>if (tableInfo.clusteredBy() != null) {<NEW_LINE>ensureNotUpdated(ci, tableInfo.clusteredBy(), "Updating a clustered-by column is not supported");<NEW_LINE>}<NEW_LINE>List<GeneratedReference> generatedReferences = tableInfo.generatedColumns();<NEW_LINE>for (Reference partitionRef : tableInfo.partitionedByColumns()) {<NEW_LINE>ensureNotUpdated(ci, partitionRef.column(), "Updating a partitioned-by column is not supported");<NEW_LINE>if (!(partitionRef instanceof GeneratedReference)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int idx = generatedReferences.indexOf(partitionRef);<NEW_LINE>if (idx >= 0) {<NEW_LINE>GeneratedReference generatedReference = generatedReferences.get(idx);<NEW_LINE>for (Reference reference : generatedReference.referencedReferences()) {<NEW_LINE>ensureNotUpdated(ci, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | reference.column(), "Updating a column which is referenced in a partitioned by generated column expression is not supported"); |
1,099,691 | public MultRegisterCenter initMultConsul(MultRegisterCenterService multRegisterCenterService, MultRegisterCenterServerMgmtConfig mgmtConfig) {<NEW_LINE>Map<String, String> URL_MAP;<NEW_LINE>MultRegisterCenter multRegisterCenter;<NEW_LINE>log.info("start init MultRegisterCenter");<NEW_LINE>URL_MAP = multRegisterCenterService.getRegisterCenterList();<NEW_LINE>if (URL_MAP.isEmpty()) {<NEW_LINE>multRegisterCenter = new MultRegisterCenter(new ConcurrentHashMap<>(), new ConcurrentHashMap<>());<NEW_LINE>return multRegisterCenter;<NEW_LINE>}<NEW_LINE>Map<String, ConsulDiscoveryClient> multConsulMap = Maps.newConcurrentMap();<NEW_LINE>Map<ConsulDiscoveryClient, HeartbeatMonitor> multHeartbeatMonitorMap = Maps.newConcurrentMap();<NEW_LINE>URL_MAP.entrySet().forEach(e -> {<NEW_LINE>log.info("start init consul server:{}", e.getKey() + "-" + e.getValue());<NEW_LINE>ConsulDiscoveryClient consulClient = mgmtConfig.consulClient(e.getValue());<NEW_LINE>multConsulMap.put(e.getKey(), consulClient);<NEW_LINE>multHeartbeatMonitorMap.put(consulClient, new HeartbeatMonitor());<NEW_LINE>log.info("init consul server:{} end!", e.getKey() + "-" + e.getValue());<NEW_LINE>});<NEW_LINE>multRegisterCenter <MASK><NEW_LINE>log.info("init MultRegisterCenter End!");<NEW_LINE>return multRegisterCenter;<NEW_LINE>} | = new MultRegisterCenter(multConsulMap, multHeartbeatMonitorMap); |
252,430 | public Optional<Path> documentPath(DocumentId documentId) {<NEW_LINE>for (ModuleId moduleId : currentPackage().moduleIds()) {<NEW_LINE>Module module = currentPackage().module(moduleId);<NEW_LINE>Optional<Path> modulePath = modulePath(moduleId);<NEW_LINE>if (module.documentIds().contains(documentId)) {<NEW_LINE>if (modulePath.isPresent()) {<NEW_LINE>return Optional.of(modulePath.get().resolve(module.document(documentId).name()));<NEW_LINE>}<NEW_LINE>} else if (module.testDocumentIds().contains(documentId)) {<NEW_LINE>if (modulePath.isPresent()) {<NEW_LINE>return Optional.of(modulePath.get().resolve(ProjectConstants.TEST_DIR_NAME).resolve(module.document(documentId).name().split(ProjectConstants.TEST_DIR_NAME <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>} | + "/")[1])); |
806,051 | public synchronized void loadTextureFile(File file) throws IOException, ParseResourceException {<NEW_LINE>textureList.clear();<NEW_LINE>textureMap.clear();<NEW_LINE>try (FileReader fileReader = new FileReader(file)) {<NEW_LINE>JsonStreamParser jsonFile = new JsonStreamParser(fileReader);<NEW_LINE>JsonArray textures = jsonFile.next().getAsJsonObject().getAsJsonArray("textures");<NEW_LINE>int size = textures.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>while (i >= textureList.size()) {<NEW_LINE>// prepopulate with placeholder so we don't get an IndexOutOfBounds below<NEW_LINE>textureList.add(new Texture(textureList.size(), "empty", new Color(), false, EMPTY_BASE64));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>JsonObject texture = textures.get(i).getAsJsonObject();<NEW_LINE>String path = texture.get("id").getAsString();<NEW_LINE>boolean transparent = texture.get("transparent").getAsBoolean();<NEW_LINE>Color color = readColor(texture.get("color").getAsJsonArray());<NEW_LINE>textureList.set(i, new Texture(i, path, color, transparent, texture.get("texture").getAsString()));<NEW_LINE>} catch (ParseResourceException | RuntimeException ex) {<NEW_LINE>Logger.global.logWarning("Failed to load texture with id " + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>throw new ParseResourceException("Invalid texture file format!", ex);<NEW_LINE>} finally {<NEW_LINE>regenerateMap();<NEW_LINE>}<NEW_LINE>} | i + " from texture file " + file + "!"); |
1,797,241 | public void defaultFeedPtsRoutines() {<NEW_LINE>switch(Parameters.seedPts) {<NEW_LINE>case Constants.seedPts_allUser:<NEW_LINE>setAllUserCodeVariablesUseful();<NEW_LINE>break;<NEW_LINE>case Constants.seedPts_all:<NEW_LINE>// All pointers will be processed<NEW_LINE>for (int i = 0; i < n_var; ++i) {<NEW_LINE>IVarAbstraction pn = int2var.get(i);<NEW_LINE>if (pn != null && pn.getRepresentative() == pn) {<NEW_LINE>pn.willUpdate = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// We always refine the callsites that have multiple call targets<NEW_LINE>Set<Node> multiBaseptrs = new HashSet<Node>();<NEW_LINE>for (Stmt callsite : geomPTA.multiCallsites) {<NEW_LINE>InstanceInvokeExpr iie = (InstanceInvokeExpr) callsite.getInvokeExpr();<NEW_LINE>VarNode vn = geomPTA.<MASK><NEW_LINE>multiBaseptrs.add(vn);<NEW_LINE>}<NEW_LINE>addUserDefPts(multiBaseptrs);<NEW_LINE>} | findLocalVarNode(iie.getBase()); |
966,282 | protected void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet result) {<NEW_LINE>PsiElement position = parameters.getPosition();<NEW_LINE>ErlangFile file = (ErlangFile) position.getContainingFile();<NEW_LINE>ErlangQVar originalVar = PsiTreeUtil.getParentOfType(parameters.getOriginalPosition(), ErlangQVar.class);<NEW_LINE>if (originalVar != null) {<NEW_LINE>boolean isDeclaration = inArgumentDefinition(originalVar) || inLeftPartOfAssignment(originalVar);<NEW_LINE>PsiReference reference = !isDeclaration ? originalVar.getReference() : null;<NEW_LINE>PsiElement resolved = reference != null ? reference.resolve() : null;<NEW_LINE>if (isDeclaration || resolved != null && resolved != originalVar) {<NEW_LINE>addVariable(result, originalVar.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!(position.getParent() instanceof ErlangRecordExpression)) {<NEW_LINE>Collection<String> vars = new HashSet<>();<NEW_LINE>PsiElement scopeOwner = PsiTreeUtil.getParentOfType(position, ErlangFunctionClause.class, ErlangMacrosDefinition.class, ErlangTypeDefinition.class, ErlangSpecification.class);<NEW_LINE>ResolveUtil.treeWalkUp(position, new MyBaseScopeProcessor(vars, position, scopeOwner, false));<NEW_LINE>ErlangModule module = file.getModule();<NEW_LINE>if (module != null) {<NEW_LINE>module.processDeclarations(new MyBaseScopeProcessor(vars, position, scopeOwner, true), ResolveState.<MASK><NEW_LINE>}<NEW_LINE>addVariables(result, vars);<NEW_LINE>}<NEW_LINE>Map<String, ErlangQVar> erlangVarContext = file.getOriginalFile().getUserData(ErlangVarProcessor.ERLANG_VARIABLE_CONTEXT);<NEW_LINE>if (erlangVarContext != null && PsiTreeUtil.getParentOfType(position, ErlangColonQualifiedExpression.class) == null) {<NEW_LINE>addVariables(result, erlangVarContext.keySet());<NEW_LINE>}<NEW_LINE>} | initial(), module, module); |
1,346,791 | private void updateContext(Map<String, Object> value) {<NEW_LINE>if (value == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object values = value.get("values");<NEW_LINE>Map<String, Object> map = new HashMap<>();<NEW_LINE>if (values instanceof ContextEntity) {<NEW_LINE>map = ((ContextEntity) values).getContextMap();<NEW_LINE>} else if (values instanceof Model) {<NEW_LINE>map = Mapper.toMap(value);<NEW_LINE>} else if (values instanceof Map) {<NEW_LINE>map = (Map<String, Object>) values;<NEW_LINE>}<NEW_LINE>values = value.get("attrs");<NEW_LINE>if (values instanceof Map) {<NEW_LINE>for (Object key : ((Map<String, Object>) values).keySet()) {<NEW_LINE>String name = key.toString();<NEW_LINE>Map<String, Object> attrs = (Map<String, Object>) ((Map<String, Object>) values).get(key);<NEW_LINE>if (attrs.containsKey("value")) {<NEW_LINE>map.put(name<MASK><NEW_LINE>}<NEW_LINE>if (attrs.containsKey("value:set")) {<NEW_LINE>map.put(name, attrs.get("value:set"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>context.putAll(map);<NEW_LINE>} | , attrs.get("value")); |
1,637,041 | final void connectionErrorOccurred(final Exception exception, boolean callJCAListener) {<NEW_LINE>final String methodName = "connectionErrorOccurred";<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {<NEW_LINE>SibTr.entry(this, TRACE, methodName, new Object[] { exception, Boolean.valueOf(callJCAListener) });<NEW_LINE>}<NEW_LINE>if (!SibRaEngineComponent.isServerStopping()) {<NEW_LINE>final ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, exception);<NEW_LINE>// Copy list to protect against concurrent modification by listener<NEW_LINE>final List<ConnectionEventListener> copy;<NEW_LINE>synchronized (_connectionListeners) {<NEW_LINE>copy = new ArrayList<ConnectionEventListener>(_connectionListeners);<NEW_LINE>}<NEW_LINE>// We will probably want to look into some how figuring out that the listener<NEW_LINE>// that we have is the JCA one and not some other one that is registered as we<NEW_LINE>// want to call those ones regardless of the flag. Today we only expect JCA listeners<NEW_LINE>// to be registered<NEW_LINE>if (callJCAListener) {<NEW_LINE>for (final Iterator iterator = copy.iterator(); iterator.hasNext(); ) {<NEW_LINE>final <MASK><NEW_LINE>if (object instanceof ConnectionEventListener) {<NEW_LINE>((ConnectionEventListener) object).connectionErrorOccurred(event);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {<NEW_LINE>SibTr.exit(this, TRACE, methodName);<NEW_LINE>}<NEW_LINE>} | Object object = iterator.next(); |
151,394 | private void initOrUpdateSink() {<NEW_LINE>Map<String, SinkRequest> sinkRequests = streamContext.getSinkRequests();<NEW_LINE>InlongStreamInfo streamInfo = streamContext.getStreamInfo();<NEW_LINE>final String groupId = streamInfo.getInlongGroupId();<NEW_LINE>final String streamId = streamInfo.getInlongStreamId();<NEW_LINE>List<StreamSink> streamSinks = sinkClient.listSinks(groupId, streamId);<NEW_LINE>List<String> updateSinkNames = Lists.newArrayList();<NEW_LINE>for (StreamSink sink : streamSinks) {<NEW_LINE>final String sinkName = sink.getSinkName();<NEW_LINE>final int id = sink.getId();<NEW_LINE>if (sinkRequests.get(sinkName) == null) {<NEW_LINE>boolean isDelete = sinkClient.deleteSink(id);<NEW_LINE>if (!isDelete) {<NEW_LINE>throw new RuntimeException(String.format("Delete sink=%s failed", sink));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>SinkRequest sinkRequest = sinkRequests.get(sinkName);<NEW_LINE>sinkRequest.setId(id);<NEW_LINE>Pair<Boolean, String> updateState = sinkClient.updateSink(sinkRequest);<NEW_LINE>if (!updateState.getKey()) {<NEW_LINE>throw new RuntimeException(String.format("Update sink=%s failed with err=%s", sinkRequest<MASK><NEW_LINE>}<NEW_LINE>updateSinkNames.add(sinkName);<NEW_LINE>sinkRequest.setId(sink.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, SinkRequest> requestEntry : sinkRequests.entrySet()) {<NEW_LINE>String sinkName = requestEntry.getKey();<NEW_LINE>if (updateSinkNames.contains(sinkName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>SinkRequest sinkRequest = requestEntry.getValue();<NEW_LINE>sinkRequest.setId(sinkClient.createSink(sinkRequest));<NEW_LINE>}<NEW_LINE>} | , updateState.getValue())); |
113,000 | public PyObject __call__(PyObject[] args, String[] keywords) {<NEW_LINE>int nargs = args.length;<NEW_LINE>if (nargs < 1 || nargs == keywords.length) {<NEW_LINE>throw Py.TypeError(for_type.fastGetName() + ".__new__(): not enough arguments");<NEW_LINE>}<NEW_LINE>PyObject arg0 = args[0];<NEW_LINE>if (!(arg0 instanceof PyType)) {<NEW_LINE>throw Py.TypeError(for_type.fastGetName() + ".__new__(X): X is not a type object (" + arg0.getType().fastGetName() + ")");<NEW_LINE>}<NEW_LINE>PyType subtype = (PyType) arg0;<NEW_LINE>if (!subtype.isSubType(for_type)) {<NEW_LINE>throw Py.TypeError(for_type.fastGetName() + ".__new__(" + subtype.fastGetName() + "): " + subtype.fastGetName() + " is not a subtype of " + for_type.fastGetName());<NEW_LINE>}<NEW_LINE>if (subtype.getStatic() != for_type) {<NEW_LINE>throw Py.TypeError(for_type.fastGetName() + ".__new__(" + subtype.fastGetName() + ") is not safe, use " + <MASK><NEW_LINE>}<NEW_LINE>PyObject[] rest = new PyObject[nargs - 1];<NEW_LINE>System.arraycopy(args, 1, rest, 0, nargs - 1);<NEW_LINE>return new_impl(false, subtype, rest, keywords);<NEW_LINE>} | subtype.fastGetName() + ".__new__()"); |
287,449 | public static ListDevicesResponse unmarshall(ListDevicesResponse listDevicesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDevicesResponse.setRequestId(_ctx.stringValue("ListDevicesResponse.RequestId"));<NEW_LINE>listDevicesResponse.setMessage(_ctx.stringValue("ListDevicesResponse.Message"));<NEW_LINE>listDevicesResponse.setCode(_ctx.stringValue("ListDevicesResponse.Code"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotalPage<MASK><NEW_LINE>data.setPageNumber(_ctx.integerValue("ListDevicesResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListDevicesResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListDevicesResponse.Data.TotalCount"));<NEW_LINE>List<Record> records = new ArrayList<Record>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDevicesResponse.Data.Records.Length"); i++) {<NEW_LINE>Record record = new Record();<NEW_LINE>record.setStatus(_ctx.integerValue("ListDevicesResponse.Data.Records[" + i + "].Status"));<NEW_LINE>record.setSipGBId(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].SipGBId"));<NEW_LINE>record.setDeviceDirection(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].DeviceDirection"));<NEW_LINE>record.setDeviceName(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].DeviceName"));<NEW_LINE>record.setDeviceAddress(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].DeviceAddress"));<NEW_LINE>record.setDeviceType(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].DeviceType"));<NEW_LINE>record.setCreateTime(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].CreateTime"));<NEW_LINE>record.setSipPassword(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].SipPassword"));<NEW_LINE>record.setSipServerPort(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].SipServerPort"));<NEW_LINE>record.setVendor(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].Vendor"));<NEW_LINE>record.setGbId(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].GbId"));<NEW_LINE>record.setCoverImageUrl(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].CoverImageUrl"));<NEW_LINE>record.setAccessProtocolType(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].AccessProtocolType"));<NEW_LINE>record.setDeviceSite(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].DeviceSite"));<NEW_LINE>record.setLongitude(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].Longitude"));<NEW_LINE>record.setLatitude(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].Latitude"));<NEW_LINE>record.setResolution(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].Resolution"));<NEW_LINE>record.setSipServerIp(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].SipServerIp"));<NEW_LINE>record.setBitRate(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].BitRate"));<NEW_LINE>records.add(record);<NEW_LINE>}<NEW_LINE>data.setRecords(records);<NEW_LINE>listDevicesResponse.setData(data);<NEW_LINE>return listDevicesResponse;<NEW_LINE>} | (_ctx.integerValue("ListDevicesResponse.Data.TotalPage")); |
651,130 | public static <T1, T2, T3> double conditionalMI(WeightedTripleDistribution<T1, T2, T3> tripleRV) {<NEW_LINE>Map<CachedTriple<T1, T2, T3>, WeightCountTuple> jointCount = tripleRV.getJointCount();<NEW_LINE>Map<CachedPair<T1, T3>, WeightCountTuple> acCount = tripleRV.getACCount();<NEW_LINE>Map<CachedPair<T2, T3>, WeightCountTuple> bcCount = tripleRV.getBCCount();<NEW_LINE>Map<T3, WeightCountTuple> cCount = tripleRV.getCCount();<NEW_LINE>double vectorLength = tripleRV.count;<NEW_LINE>double cmi = 0.0;<NEW_LINE>for (Entry<CachedTriple<T1, T2, T3>, WeightCountTuple> e : jointCount.entrySet()) {<NEW_LINE>double weight = e.getValue().weight;<NEW_LINE>double jointCurCount = e.getValue().count;<NEW_LINE>double prob = jointCurCount / vectorLength;<NEW_LINE>CachedPair<T1, T3> acPair = e.getKey().getAC();<NEW_LINE>CachedPair<T2, T3> bcPair = e.getKey().getBC();<NEW_LINE>double acCurCount = acCount.get(acPair).count;<NEW_LINE>double bcCurCount = bcCount.get(bcPair).count;<NEW_LINE>double cCurCount = cCount.get(e.getKey().getC()).count;<NEW_LINE>cmi += weight * prob * Math.log((cCurCount * jointCurCount) / (acCurCount * bcCurCount));<NEW_LINE>}<NEW_LINE>cmi /= LOG_BASE;<NEW_LINE>double stateRatio = vectorLength / jointCount.size();<NEW_LINE>if (stateRatio < SAMPLES_RATIO) {<NEW_LINE>logger.log(Level.INFO, "Conditional MI estimate of {0} had samples/state ratio of {1}", new Object<MASK><NEW_LINE>}<NEW_LINE>return cmi;<NEW_LINE>} | [] { cmi, stateRatio }); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.