idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
182,014 | public final TextEdit rewriteImports(IProgressMonitor monitor) throws CoreException {<NEW_LINE>SubMonitor subMonitor = SubMonitor.convert(monitor, Messages.bind(Messages.importRewrite_processDescription), 2);<NEW_LINE>if (!hasRecordedChanges()) {<NEW_LINE>this.createdImports = CharOperation.NO_STRINGS;<NEW_LINE>this.createdStaticImports = CharOperation.NO_STRINGS;<NEW_LINE>return new MultiTextEdit();<NEW_LINE>}<NEW_LINE>CompilationUnit usedAstRoot = this.astRoot;<NEW_LINE>if (usedAstRoot == null) {<NEW_LINE>ASTParser parser = ASTParser.newParser(AST.JLS11);<NEW_LINE>parser.setSource(this.compilationUnit);<NEW_LINE>// reduced AST<NEW_LINE>parser.setFocalPosition(0);<NEW_LINE>parser.setResolveBindings(false);<NEW_LINE>usedAstRoot = (CompilationUnit) parser.createAST(subMonitor.split(1));<NEW_LINE>}<NEW_LINE>ImportRewriteConfiguration config = buildImportRewriteConfiguration();<NEW_LINE>ImportRewriteAnalyzer computer = new ImportRewriteAnalyzer(this.compilationUnit, usedAstRoot, config);<NEW_LINE>for (String addedImport : this.addedImports) {<NEW_LINE>boolean isStatic = STATIC_PREFIX == addedImport.charAt(0);<NEW_LINE>String qualifiedName = addedImport.substring(1);<NEW_LINE>computer.addImport(isStatic, qualifiedName);<NEW_LINE>}<NEW_LINE>for (String removedImport : this.removedImports) {<NEW_LINE>boolean isStatic = STATIC_PREFIX == removedImport.charAt(0);<NEW_LINE>String qualifiedName = removedImport.substring(1);<NEW_LINE>computer.removeImport(isStatic, qualifiedName);<NEW_LINE>}<NEW_LINE>for (String typeExplicitSimpleName : this.typeExplicitSimpleNames) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>for (String staticExplicitSimpleName : this.staticExplicitSimpleNames) {<NEW_LINE>computer.requireExplicitImport(true, staticExplicitSimpleName);<NEW_LINE>}<NEW_LINE>ImportRewriteAnalyzer.RewriteResult result = computer.analyzeRewrite(subMonitor.split(1));<NEW_LINE>this.createdImports = result.getCreatedImports();<NEW_LINE>this.createdStaticImports = result.getCreatedStaticImports();<NEW_LINE>return result.getTextEdit();<NEW_LINE>} | computer.requireExplicitImport(false, typeExplicitSimpleName); |
25,511 | private void selectInEditor(boolean openEditor) {<NEW_LINE>if (bug == null || (file == null && javaElt == null)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>IWorkbenchPage page = contributingPart.getSite().getPage();<NEW_LINE>IEditorPart activeEditor = page.getActiveEditor();<NEW_LINE>IEditorInput input = activeEditor != null ? activeEditor.getEditorInput() : null;<NEW_LINE>if (openEditor && !matchInput(input)) {<NEW_LINE>try {<NEW_LINE>if (file != null) {<NEW_LINE>activeEditor = <MASK><NEW_LINE>} else if (javaElt != null) {<NEW_LINE>activeEditor = JavaUI.openInEditor(javaElt, true, true);<NEW_LINE>}<NEW_LINE>if (activeEditor != null) {<NEW_LINE>input = activeEditor.getEditorInput();<NEW_LINE>}<NEW_LINE>} catch (PartInitException e) {<NEW_LINE>FindbugsPlugin.getDefault().logException(e, "Could not open editor for " + bug.getMessage());<NEW_LINE>} catch (CoreException e) {<NEW_LINE>FindbugsPlugin.getDefault().logException(e, "Could not open editor for " + bug.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (matchInput(input)) {<NEW_LINE>showAnnotation(activeEditor);<NEW_LINE>}<NEW_LINE>} | IDE.openEditor(page, file); |
726,689 | public double minDist(SpatialComparable mbr1, SpatialComparable mbr2) {<NEW_LINE>final int dim1 = mbr1.getDimensionality(), dim2 = mbr2.getDimensionality();<NEW_LINE>final int mindim = (dim1 < dim2) ? dim1 : dim2;<NEW_LINE>double agg = 0.;<NEW_LINE>for (int d = 0; d < mindim; d++) {<NEW_LINE>final double min1 = mbr1.getMin(d), max1 = mbr1.getMax(d);<NEW_LINE>final double min2 = mbr2.getMin(d), <MASK><NEW_LINE>final double diff = min2 > max1 ? min2 - max1 : min1 > max2 ? min1 - max2 : 0;<NEW_LINE>if (diff > 0) {<NEW_LINE>// Maximum sum<NEW_LINE>final double si = max1 + max2;<NEW_LINE>if (!(si > 0)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>agg += diff * diff / si;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int d = mindim; d < dim1; d++) {<NEW_LINE>final double min1 = mbr1.getMin(d);<NEW_LINE>if (min1 > 0.) {<NEW_LINE>agg += min1;<NEW_LINE>} else {<NEW_LINE>final double max1 = mbr1.getMax(d);<NEW_LINE>if (max1 < 0.) {<NEW_LINE>// Should never happen.<NEW_LINE>agg += max1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int d = mindim; d < dim2; d++) {<NEW_LINE>final double min2 = mbr2.getMin(d);<NEW_LINE>if (min2 > 0.) {<NEW_LINE>agg += min2;<NEW_LINE>} else {<NEW_LINE>final double max2 = mbr2.getMax(d);<NEW_LINE>if (max2 < 0.) {<NEW_LINE>// Should never happen.<NEW_LINE>agg += max2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 2. * agg;<NEW_LINE>} | max2 = mbr2.getMax(d); |
1,180,688 | private void requestScrollPositionInternal(int position, @NonNull OnPerformScroll onPerformScroll, @NonNull Runnable onScrollRequestComplete, @NonNull Runnable onInvalidPosition) {<NEW_LINE>Objects.requireNonNull(scrollRequestValidator, "Cannot request positions when SnapToTopObserver was initialized without a validator.");<NEW_LINE>if (!scrollRequestValidator.isPositionStillValid(position)) {<NEW_LINE>Log.d(TAG, "requestScrollPositionInternal(" + position + ") Invalid");<NEW_LINE>onInvalidPosition.run();<NEW_LINE>} else if (scrollRequestValidator.isItemAtPositionLoaded(position)) {<NEW_LINE>Log.d(<MASK><NEW_LINE>onPerformScroll.onPerformScroll(layoutManager, position);<NEW_LINE>onScrollRequestComplete.run();<NEW_LINE>} else {<NEW_LINE>Log.d(TAG, "requestScrollPositionInternal(" + position + ") Deferring");<NEW_LINE>deferred.setDeferred(true);<NEW_LINE>deferred.defer(() -> {<NEW_LINE>Log.d(TAG, "requestScrollPositionInternal(" + position + ") Executing deferred");<NEW_LINE>requestScrollPositionInternal(position, onPerformScroll, onScrollRequestComplete, onInvalidPosition);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | TAG, "requestScrollPositionInternal(" + position + ") Scrolling"); |
1,655,444 | public static void buildPredDCIns(int blkX, int blkY, int mbX, boolean leftAvailable, boolean topAvailable, byte[] leftRow, byte[] topLine, byte[] pixOut) {<NEW_LINE>int s0, blkOffX = (blkX << 2) + (mbX << 3), blkOffY = blkY << 2;<NEW_LINE>if (leftAvailable && topAvailable) {<NEW_LINE>s0 = 0;<NEW_LINE>for (int i = 0; i < 4; i++) <MASK><NEW_LINE>for (int i = 0; i < 4; i++) s0 += topLine[blkOffX + i];<NEW_LINE>s0 = (s0 + 4) >> 3;<NEW_LINE>} else if (leftAvailable) {<NEW_LINE>s0 = 0;<NEW_LINE>for (int i = 0; i < 4; i++) s0 += leftRow[blkOffY + i];<NEW_LINE>s0 = (s0 + 2) >> 2;<NEW_LINE>} else if (topAvailable) {<NEW_LINE>s0 = 0;<NEW_LINE>for (int i = 0; i < 4; i++) s0 += topLine[blkOffX + i];<NEW_LINE>s0 = (s0 + 2) >> 2;<NEW_LINE>} else {<NEW_LINE>s0 = 0;<NEW_LINE>}<NEW_LINE>for (int j = 0; j < 16; j++) {<NEW_LINE>pixOut[j] = (byte) s0;<NEW_LINE>}<NEW_LINE>} | s0 += leftRow[i + blkOffY]; |
1,239,052 | public static void main(String[] args) {<NEW_LINE><MASK><NEW_LINE>String webwolfPort = System.getenv("WEBWOLF_PORT");<NEW_LINE>String webWolfHost = null == System.getenv("WEBWOLF_HOST") ? "127.0.0.1" : System.getenv("WEBWOLF_HOST");<NEW_LINE>String fileEncoding = System.getProperty("file.encoding");<NEW_LINE>int wolfPort = webwolfPort == null ? 9090 : Integer.parseInt(webwolfPort);<NEW_LINE>if (null == fileEncoding || !fileEncoding.equals("UTF-8")) {<NEW_LINE>System.out.println("It seems the application is started on a OS with non default UTF-8 encoding:" + fileEncoding);<NEW_LINE>System.out.println("Please add: -Dfile.encoding=UTF-8");<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>if (isAlreadyRunning(webWolfHost, wolfPort)) {<NEW_LINE>System.out.println("Port " + webWolfHost + ":" + wolfPort + " is in use. Use environment value WEBWOLF_PORT to set a different value.");<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>SpringApplication.run(WebWolf.class, args);<NEW_LINE>} | System.setProperty("spring.config.name", "application-webwolf"); |
780,076 | public int compare(Message a, Message b) {<NEW_LINE>MessagePart a0 = firstPartOf(a);<NEW_LINE>MessagePart b0 = firstPartOf(b);<NEW_LINE>InputSource aSrc = toInputSource(a0), bSrc = toInputSource(b0);<NEW_LINE>// Compure by source first.<NEW_LINE>if (aSrc != null && bSrc != null) {<NEW_LINE>int delta = aSrc.getUri().compareTo(bSrc.getUri());<NEW_LINE>if (delta != 0) {<NEW_LINE>return delta;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Sort positionless parts after ones with a position.<NEW_LINE>long aSPos = Integer.MAX_VALUE + 1L, aEPos = Integer.MAX_VALUE + 1L;<NEW_LINE>long bSPos = Integer.MAX_VALUE + 1L<MASK><NEW_LINE>if (a0 instanceof FilePosition) {<NEW_LINE>FilePosition pos = (FilePosition) a0;<NEW_LINE>aSPos = pos.startCharInFile();<NEW_LINE>aEPos = pos.endCharInFile();<NEW_LINE>} else if (a0 instanceof InputSource) {<NEW_LINE>// sort file level messages before messages within file<NEW_LINE>aSPos = aEPos = -1;<NEW_LINE>}<NEW_LINE>if (b0 instanceof FilePosition) {<NEW_LINE>FilePosition pos = (FilePosition) b0;<NEW_LINE>bSPos = pos.startCharInFile();<NEW_LINE>bEPos = pos.endCharInFile();<NEW_LINE>} else if (b0 instanceof InputSource) {<NEW_LINE>// sort file level messages before messages within file<NEW_LINE>bSPos = bEPos = -1;<NEW_LINE>}<NEW_LINE>int delta = Long.signum(aSPos - bSPos);<NEW_LINE>if (delta != 0) {<NEW_LINE>return delta;<NEW_LINE>}<NEW_LINE>delta = Long.signum(aEPos - bEPos);<NEW_LINE>if (delta != 0) {<NEW_LINE>return delta;<NEW_LINE>}<NEW_LINE>StringBuilder aBuf = new StringBuilder(), bBuf = new StringBuilder();<NEW_LINE>MessageContext mc = new MessageContext();<NEW_LINE>try {<NEW_LINE>a0.format(mc, aBuf);<NEW_LINE>b0.format(mc, bBuf);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>return aBuf.toString().compareTo(bBuf.toString());<NEW_LINE>} | , bEPos = Integer.MAX_VALUE + 1L; |
555,620 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = new String[] { "sumb" };<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>// create window<NEW_LINE>String stmtTextCreate = namedWindow ? "@name('create') @public create window MyInfraSA#keepall as select theString as a, intPrimitive as b from SupportBean" : "@name('create') @public create table MyInfraSA (a string primary key, b int primary key)";<NEW_LINE>env.compileDeploy(stmtTextCreate, path);<NEW_LINE>// create select stmt<NEW_LINE>String stmtTextSelect = "@name('select') on SupportBean_A select sum(b) as sumb from MyInfraSA";<NEW_LINE>env.compileDeploy(stmtTextSelect, path).addListener("select");<NEW_LINE>// create insert into<NEW_LINE>String stmtTextInsertOne = "insert into MyInfraSA select theString as a, intPrimitive as b from SupportBean";<NEW_LINE>env.compileDeploy(stmtTextInsertOne, path);<NEW_LINE>// send 3 event<NEW_LINE>sendSupportBean(env, "E1", 1);<NEW_LINE>sendSupportBean(env, "E2", 2);<NEW_LINE>sendSupportBean(env, "E3", 3);<NEW_LINE>env.assertListenerNotInvoked("select");<NEW_LINE>env.milestone(0);<NEW_LINE>// fire trigger<NEW_LINE>sendSupportBean_A(env, "A1");<NEW_LINE>env.assertPropsNew("select", fields, <MASK><NEW_LINE>// create delete stmt<NEW_LINE>String stmtTextDelete = "on SupportBean_B delete from MyInfraSA where id = a";<NEW_LINE>env.compileDeploy(stmtTextDelete, path);<NEW_LINE>// Delete E2<NEW_LINE>sendSupportBean_B(env, "E2");<NEW_LINE>env.milestone(1);<NEW_LINE>// fire trigger<NEW_LINE>sendSupportBean_A(env, "A2");<NEW_LINE>env.assertPropsNew("select", fields, new Object[] { 4 });<NEW_LINE>sendSupportBean(env, "E4", 10);<NEW_LINE>sendSupportBean_A(env, "A3");<NEW_LINE>env.assertPropsNew("select", fields, new Object[] { 14 });<NEW_LINE>env.assertStatement("select", statement -> {<NEW_LINE>EventType resultType = statement.getEventType();<NEW_LINE>assertEquals(1, resultType.getPropertyNames().length);<NEW_LINE>assertEquals(Integer.class, resultType.getPropertyType("sumb"));<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>} | new Object[] { 6 }); |
1,040,620 | ASTNode clone0(AST target) {<NEW_LINE>MethodDeclaration result = new MethodDeclaration(target);<NEW_LINE>result.setSourceRange(getStartPosition(), getLength());<NEW_LINE>result.setJavadoc((Javadoc) ASTNode.copySubtree(target, getJavadoc()));<NEW_LINE>if (this.ast.apiLevel == AST.JLS2_INTERNAL) {<NEW_LINE>result.internalSetModifiers(getModifiers());<NEW_LINE>result.setReturnType((Type) ASTNode.copySubtree(target, getReturnType()));<NEW_LINE>}<NEW_LINE>if (this.ast.apiLevel >= AST.JLS3_INTERNAL) {<NEW_LINE>result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers()));<NEW_LINE>result.typeParameters().addAll(ASTNode.copySubtrees(target, typeParameters()));<NEW_LINE>result.setReturnType2((Type) ASTNode.copySubtree(target, getReturnType2()));<NEW_LINE>}<NEW_LINE>result.setConstructor(isConstructor());<NEW_LINE>result.setName((SimpleName) getName().clone(target));<NEW_LINE>if (this.ast.apiLevel >= AST.JLS8_INTERNAL) {<NEW_LINE>result.setReceiverType((Type) ASTNode.copySubtree(target, getReceiverType()));<NEW_LINE>result.setReceiverQualifier((SimpleName) ASTNode.copySubtree(target, getReceiverQualifier()));<NEW_LINE>}<NEW_LINE>result.parameters().addAll(ASTNode.copySubtrees(target, parameters()));<NEW_LINE>if (this.ast.apiLevel >= AST.JLS8_INTERNAL) {<NEW_LINE>result.extraDimensions().addAll(ASTNode.copySubtrees(target, extraDimensions()));<NEW_LINE>} else {<NEW_LINE>result.setExtraDimensions(getExtraDimensions());<NEW_LINE>}<NEW_LINE>if (this.ast.apiLevel() >= AST.JLS8_INTERNAL) {<NEW_LINE>result.thrownExceptionTypes().addAll(ASTNode.copySubtrees<MASK><NEW_LINE>} else {<NEW_LINE>result.thrownExceptions().addAll(ASTNode.copySubtrees(target, thrownExceptions()));<NEW_LINE>}<NEW_LINE>result.setBody((Block) ASTNode.copySubtree(target, getBody()));<NEW_LINE>return result;<NEW_LINE>} | (target, thrownExceptionTypes())); |
663,227 | protected Control createControl(Composite editPlaceholder) {<NEW_LINE>Object value = valueController.getValue();<NEW_LINE>valueController.getEditPlaceholder();<NEW_LINE>boolean inline = valueController.getEditType() == IValueController.EditType.INLINE;<NEW_LINE>timeEditor = new CustomTimeEditor(editPlaceholder, SWT.MULTI, true, inline);<NEW_LINE>textMode = new TextMode(this, timeEditor, valueController);<NEW_LINE>dateEditorMode <MASK><NEW_LINE>if (!isCalendarMode()) {<NEW_LINE>textMode.run();<NEW_LINE>textMode.setChecked(true);<NEW_LINE>} else<NEW_LINE>dateEditorMode.setChecked(true);<NEW_LINE>timeEditor.addSelectionAdapter(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>dirty = true;<NEW_LINE>Event selectionEvent = new Event();<NEW_LINE>selectionEvent.widget = timeEditor.getControl();<NEW_LINE>timeEditor.getControl().notifyListeners(SWT.Selection, selectionEvent);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>timeEditor.addModifyListener(e -> {<NEW_LINE>dirty = true;<NEW_LINE>Event modificationEvent = new Event();<NEW_LINE>modificationEvent.widget = timeEditor.getControl();<NEW_LINE>timeEditor.getControl().notifyListeners(SWT.Modify, modificationEvent);<NEW_LINE>});<NEW_LINE>primeEditorValue(value);<NEW_LINE>timeEditor.createDateFormat(valueController.getValueType());<NEW_LINE>timeEditor.setEditable(!valueController.isReadOnly());<NEW_LINE>return timeEditor.getControl();<NEW_LINE>} | = new DateEditorMode(this, timeEditor); |
363,609 | public void checkPrivilege(String driverName, String url, String userName, String password, String tableName, String schema, List<String> privilegeList) {<NEW_LINE>Connection connection = JdbcConnectionUtil.getConnectionWithRetry(driverName, url, userName, password);<NEW_LINE>Statement statement = null;<NEW_LINE>String tableInfo = Objects.isNull(schema) ? tableName : schema + "." + tableName;<NEW_LINE>String privilege = null;<NEW_LINE>try {<NEW_LINE>statement = connection.createStatement();<NEW_LINE>for (String s : privilegeList) {<NEW_LINE>privilege = s;<NEW_LINE>statement.execute(StringUtils.replace(PRIVILEGE_SQL_MAP.get(privilege.toLowerCase(<MASK><NEW_LINE>}<NEW_LINE>} catch (SQLException sqlException) {<NEW_LINE>if (sqlException.getMessage().contains("command denied")) {<NEW_LINE>throw new SuppressRestartsException(new Throwable(String.format("user [%s] don't have [%s] privilege of table [%s]", userName, privilege, tableInfo)));<NEW_LINE>}<NEW_LINE>throw new SuppressRestartsException(new IllegalArgumentException(sqlException.getMessage()));<NEW_LINE>} finally {<NEW_LINE>JdbcConnectionUtil.closeConnectionResource(null, statement, connection, false);<NEW_LINE>}<NEW_LINE>} | )), "$table", tableName)); |
214,607 | public ListSigningProfilesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListSigningProfilesResult listSigningProfilesResult = new ListSigningProfilesResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listSigningProfilesResult;<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("profiles", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listSigningProfilesResult.setProfiles(new ListUnmarshaller<SigningProfile>(SigningProfileJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listSigningProfilesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listSigningProfilesResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,836,475 | protected void channelRead0(ChannelHandlerContext ctx, StreamResponse response) throws Exception {<NEW_LINE>final Map<String, String> headers = new <MASK><NEW_LINE>headers.putAll(response.getHeaders());<NEW_LINE>final Map<String, String> wireAttrs = WireAttributeHelper.removeWireAttributes(headers);<NEW_LINE>final StreamResponse newResponse = new StreamResponseBuilder(response).unsafeSetHeaders(headers).build(response.getEntityStream());<NEW_LINE>// In general there should always be a callback to handle a received message,<NEW_LINE>// but it could have been removed due to a previous exception or closure on the<NEW_LINE>// channel<NEW_LINE>TransportCallback<StreamResponse> callback = ctx.channel().attr(CALLBACK_ATTR_KEY).getAndSet(null);<NEW_LINE>if (callback != null) {<NEW_LINE>LOG.debug("{}: handling a response", ctx.channel().remoteAddress());<NEW_LINE>callback.onResponse(TransportResponseImpl.success(newResponse, wireAttrs));<NEW_LINE>} else {<NEW_LINE>LOG.debug("{}: dropped a response", ctx.channel().remoteAddress());<NEW_LINE>}<NEW_LINE>} | TreeMap<>(String.CASE_INSENSITIVE_ORDER); |
1,217,553 | private void printGetBorder() {<NEW_LINE>String sumToFloat = image.getSumType().<MASK><NEW_LINE>out.print("\tpublic void get_border(float x, float y, float[] values) {\n" + "\t\tfloat xf = (float)Math.floor(x);\n" + "\t\tfloat yf = (float)Math.floor(y);\n" + "\t\tint xt = (int) xf;\n" + "\t\tint yt = (int) yf;\n" + "\t\tfloat ax = x - xf;\n" + "\t\tfloat ay = y - yf;\n" + "\n" + "\t\tImageBorder_IL_" + borderType + " border = (ImageBorder_IL_" + borderType + ")this.border;\n" + "\t\tborder.get(xt , yt , temp0);\n" + "\t\tborder.get(xt+1 , yt , temp1);\n" + "\t\tborder.get(xt+1 , yt+1, temp2);\n" + "\t\tborder.get(xt , yt+1, temp3);\n" + "\n" + "\t\tfinal int numBands = orig.numBands;\n" + "\n" + "\t\tfor( int i = 0; i < numBands; i++ ) {\n" + "\t\t\tfloat val = (1.0f - ax) * (1.0f - ay) * " + sumToFloat + "temp0[i]; // (x,y)\n" + "\t\t\tval += ax * (1.0f - ay) * " + sumToFloat + "temp1[i]; // (x+1,y)\n" + "\t\t\tval += ax * ay * " + sumToFloat + "temp2[i]; // (x+1,y+1)\n" + "\t\t\tval += (1.0f - ax) * ay * " + sumToFloat + "temp3[i]; // (x,y+1)\n" + "\n" + "\t\t\tvalues[i] = val;\n" + "\t\t}\n" + "\t}\n" + "\n");<NEW_LINE>} | equals("float") ? "" : "(float)"; |
755,434 | private long createPhoto(PrintWriter respWriter) throws RemoteInvocationException {<NEW_LINE>// make create photo request and send with the rest client synchronously<NEW_LINE>// response of create request does not have body, therefore use EmptyRecord as template<NEW_LINE>// create an instance of photo pragmatically<NEW_LINE>// this resembles to photo-create.json<NEW_LINE>final LatLong newLatLong = new LatLong().setLatitude(37.42394f).setLongitude(-122.0708f);<NEW_LINE>final EXIF newExif = new EXIF().setLocation(newLatLong);<NEW_LINE>final Photo newPhoto = new Photo().setTitle("New Photo").setFormat(PhotoFormats.PNG).setExif(newExif);<NEW_LINE>final Request<IdResponse<Long>> createReq1 = _photoBuilders.create().<MASK><NEW_LINE>final ResponseFuture<IdResponse<Long>> createFuture1 = _restClient.sendRequest(createReq1);<NEW_LINE>// Future.getResource() blocks until server responds<NEW_LINE>final Response<IdResponse<Long>> createResp1 = createFuture1.getResponse();<NEW_LINE>createResp1.getEntity();<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final IdResponse<Long> entity = createResp1.getEntity();<NEW_LINE>final long newPhotoId = entity.getId();<NEW_LINE>respWriter.println("New photo ID: " + newPhotoId);<NEW_LINE>return newPhotoId;<NEW_LINE>} | input(newPhoto).build(); |
247,773 | public ConcurrentMap<String, Object> deserializeAttributes(final byte[] in) {<NEW_LINE>ByteArrayInputStream bis = null;<NEW_LINE>ObjectInputStream ois = null;<NEW_LINE>try {<NEW_LINE>bis = new ByteArrayInputStream(in);<NEW_LINE>ois = createObjectInputStream(bis);<NEW_LINE>final ConcurrentMap<String, Object> attributes = new ConcurrentHashMap<String, Object>();<NEW_LINE>final int n = ((Integer) ois.readObject()).intValue();<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>final String name = (String) ois.readObject();<NEW_LINE>final Object value = ois.readObject();<NEW_LINE>if ((value instanceof String) && (value.equals(NOT_SERIALIZED))) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug(" loading attribute '" + name + "' with value '" + value + "'");<NEW_LINE>}<NEW_LINE>attributes.put(name, value);<NEW_LINE>}<NEW_LINE>return attributes;<NEW_LINE>} catch (final ClassNotFoundException e) {<NEW_LINE>LOG.warn("Caught CNFE decoding " + in.length + " bytes of data", e);<NEW_LINE>throw new TranscoderDeserializationException("Caught CNFE decoding data", e);<NEW_LINE>} catch (final IOException e) {<NEW_LINE>LOG.warn("Caught IOException decoding " + in.length + " bytes of data", e);<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>closeSilently(bis);<NEW_LINE>closeSilently(ois);<NEW_LINE>}<NEW_LINE>} | throw new TranscoderDeserializationException("Caught IOException decoding data", e); |
1,386,997 | final GetUnfilteredTableMetadataResult executeGetUnfilteredTableMetadata(GetUnfilteredTableMetadataRequest getUnfilteredTableMetadataRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getUnfilteredTableMetadataRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetUnfilteredTableMetadataRequest> request = null;<NEW_LINE>Response<GetUnfilteredTableMetadataResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetUnfilteredTableMetadataRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getUnfilteredTableMetadataRequest));<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, "Glue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetUnfilteredTableMetadata");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetUnfilteredTableMetadataResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetUnfilteredTableMetadataResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,334,527 | public static void init() {<NEW_LINE>logger.info("server starts");<NEW_LINE>// setup system property to redirect undertow logs to slf4j/logback.<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>loadConfigs();<NEW_LINE>// this will make sure that all log statement will have serviceId<NEW_LINE>MDC.put(SID, getServerConfig().getServiceId());<NEW_LINE>// merge status.yml and app-status.yml if app-status.yml is provided<NEW_LINE>mergeStatusConfig();<NEW_LINE>// register the module to /server/info<NEW_LINE>List<String> masks = new ArrayList<>();<NEW_LINE>masks.add("keystorePass");<NEW_LINE>masks.add("keyPass");<NEW_LINE>masks.add("truststorePass");<NEW_LINE>ModuleRegistry.registerModule(Server.class.getName(), Config.getInstance().getJsonMapConfigNoCache(SERVER_CONFIG_NAME), masks);<NEW_LINE>// start the server<NEW_LINE>start();<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>// Handle any exception encountered during server start-up<NEW_LINE>logger.error("Server is not operational! Failed with exception", e);<NEW_LINE>System.out.println("Failed to start server:" + e.getMessage());<NEW_LINE>// send a graceful system shutdown<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>} | System.setProperty("org.jboss.logging.provider", "slf4j"); |
645,691 | public void writeToParcel(Parcel dest, int flags) {<NEW_LINE>dest.writeLong(this.id);<NEW_LINE>dest.writeParcelable(this.user, flags);<NEW_LINE>dest.writeString(this.url);<NEW_LINE>dest.writeString(this.body);<NEW_LINE>dest.writeString(this.bodyHtml);<NEW_LINE>dest.writeString(this.htmlUrl);<NEW_LINE>dest.writeLong(this.createdAt != null ? this.createdAt.getTime() : -1);<NEW_LINE>dest.writeLong(this.updatedAt != null ? this.updatedAt.getTime() : -1);<NEW_LINE>dest.writeInt(this.position);<NEW_LINE>dest.writeInt(this.line);<NEW_LINE><MASK><NEW_LINE>dest.writeString(this.commitId);<NEW_LINE>dest.writeString(this.repoId);<NEW_LINE>dest.writeString(this.login);<NEW_LINE>dest.writeString(this.gistId);<NEW_LINE>dest.writeString(this.issueId);<NEW_LINE>dest.writeString(this.pullRequestId);<NEW_LINE>dest.writeParcelable(this.reactions, flags);<NEW_LINE>dest.writeString(this.authorAssociation);<NEW_LINE>} | dest.writeString(this.path); |
697,066 | private void writeClass() {<NEW_LINE>if (writingAssocBean) {<NEW_LINE>writer.append("/**").eol();<NEW_LINE>writer.append(" * Association query bean for %s.", shortName).eol();<NEW_LINE>writer.append(" * ").eol();<NEW_LINE>writer.append(" * THIS IS A GENERATED OBJECT, DO NOT MODIFY THIS CLASS.").eol();<NEW_LINE>writer.append(" */").eol();<NEW_LINE>writer.append(Constants.AT_GENERATED).eol();<NEW_LINE>writer.append(<MASK><NEW_LINE>lang().beginAssocClass(writer, shortName, origShortName);<NEW_LINE>} else {<NEW_LINE>writer.append("/**").eol();<NEW_LINE>writer.append(" * Query bean for %s.", shortName).eol();<NEW_LINE>writer.append(" * ").eol();<NEW_LINE>writer.append(" * THIS IS A GENERATED OBJECT, DO NOT MODIFY THIS CLASS.").eol();<NEW_LINE>writer.append(" */").eol();<NEW_LINE>writer.append(Constants.AT_GENERATED).eol();<NEW_LINE>writer.append(Constants.AT_TYPEQUERYBEAN).eol();<NEW_LINE>lang().beginClass(writer, shortName);<NEW_LINE>}<NEW_LINE>writer.eol();<NEW_LINE>} | Constants.AT_TYPEQUERYBEAN).eol(); |
119,627 | private void generateClinicians() {<NEW_LINE>Random random = new Random(999L);<NEW_LINE>for (int i = 0; i < CLINICIANS; i++) {<NEW_LINE>Person clinician = new Person(random.nextLong());<NEW_LINE>if (random.nextBoolean()) {<NEW_LINE>clinician.attributes.put(Person.GENDER, "M");<NEW_LINE>} else {<NEW_LINE>clinician.attributes.put(Person.GENDER, "F");<NEW_LINE>}<NEW_LINE>clinician.attributes.put(Person.RACE, "unknown");<NEW_LINE>clinician.attributes.put(Person.ETHNICITY, "unknown");<NEW_LINE>clinician.attributes.put(Person.FIRST_LANGUAGE, "English");<NEW_LINE><MASK><NEW_LINE>String name = "Dr. " + clinician.attributes.get(Person.FIRST_NAME);<NEW_LINE>name += " " + clinician.attributes.get(Person.LAST_NAME);<NEW_LINE>sstaff.addFact("" + i, clean(name));<NEW_LINE>}<NEW_LINE>} | LifecycleModule.birth(clinician, 0L); |
1,562,092 | public static boolean isJavadocContext(TokenHierarchy hierarchy, int offset) {<NEW_LINE>TokenSequence<JavaTokenId> ts = SourceUtils.getJavaTokenSequence(hierarchy, offset);<NEW_LINE>if (!movedToJavadocToken(ts, offset)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>TokenSequence<JavadocTokenId> jdts = ts.embedded(JavadocTokenId.language());<NEW_LINE>if (jdts == null) {<NEW_LINE>return false;<NEW_LINE>} else if (jdts.isEmpty()) {<NEW_LINE>return isEmptyJavadoc(ts.token(), <MASK><NEW_LINE>}<NEW_LINE>jdts.move(offset);<NEW_LINE>if (!jdts.moveNext() && !jdts.movePrevious()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// this checks /** and */ headers<NEW_LINE>return isInsideToken(jdts, offset) && !isInsideIndent(jdts.token(), offset - jdts.offset());<NEW_LINE>} | offset - ts.offset()); |
1,525,581 | public static If suppressSummarizedPrefixes(Configuration c, String vrfName, Stream<Prefix> summaryOnlyPrefixes) {<NEW_LINE>Iterator<Prefix> prefixesToSuppress = summaryOnlyPrefixes.iterator();<NEW_LINE>if (!prefixesToSuppress.hasNext()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Create a RouteFilterList that matches any network longer than a prefix marked summary only.<NEW_LINE>RouteFilterList matchLonger = new RouteFilterList("~MATCH_SUPPRESSED_SUMMARY_ONLY:" + vrfName + "~");<NEW_LINE>prefixesToSuppress.forEachRemaining(p -> matchLonger.addLine(new RouteFilterLine(LineAction.PERMIT, PrefixRange.moreSpecificThan(p))));<NEW_LINE>// Bookkeeping: record that we created this RouteFilterList to match longer networks.<NEW_LINE>c.getRouteFilterLists().put(matchLonger.getName(), matchLonger);<NEW_LINE>return new If("Suppress more specific networks for summary-only aggregate-address networks", new MatchPrefixSet(DestinationNetwork.instance(), new NamedPrefixSet(matchLonger.getName())), ImmutableList.of(Statements.Suppress.toStaticStatement()<MASK><NEW_LINE>} | ), ImmutableList.of()); |
1,096,778 | final DescribeCrossAccountAccessRoleResult executeDescribeCrossAccountAccessRole(DescribeCrossAccountAccessRoleRequest describeCrossAccountAccessRoleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeCrossAccountAccessRoleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeCrossAccountAccessRoleRequest> request = null;<NEW_LINE>Response<DescribeCrossAccountAccessRoleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeCrossAccountAccessRoleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeCrossAccountAccessRoleRequest));<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, "Inspector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeCrossAccountAccessRole");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeCrossAccountAccessRoleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeCrossAccountAccessRoleResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,532,581 | public void marshall(PostCommentForPullRequestRequest postCommentForPullRequestRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (postCommentForPullRequestRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(postCommentForPullRequestRequest.getPullRequestId(), PULLREQUESTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(postCommentForPullRequestRequest.getRepositoryName(), REPOSITORYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(postCommentForPullRequestRequest.getBeforeCommitId(), BEFORECOMMITID_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(postCommentForPullRequestRequest.getLocation(), LOCATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(postCommentForPullRequestRequest.getContent(), CONTENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(postCommentForPullRequestRequest.getClientRequestToken(), CLIENTREQUESTTOKEN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | postCommentForPullRequestRequest.getAfterCommitId(), AFTERCOMMITID_BINDING); |
235,292 | public boolean onHoverEvent(MotionEvent event) {<NEW_LINE>// if in layout inspector and talkback is running, override the first click to locate the<NEW_LINE>// clicked view<NEW_LINE>if (mConnection != null && AccessibilityUtil.isTalkbackEnabled(getContext()) && event.getPointerCount() == 1) {<NEW_LINE>FlipperObject params = new FlipperObject.Builder().put("type", "usage").put("eventName", "accessibility:clickToInspectTalkbackRunning").build();<NEW_LINE>mConnection.send("track", params);<NEW_LINE>final <MASK><NEW_LINE>switch(action) {<NEW_LINE>case MotionEvent.ACTION_HOVER_ENTER:<NEW_LINE>{<NEW_LINE>event.setAction(MotionEvent.ACTION_DOWN);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MotionEvent.ACTION_HOVER_MOVE:<NEW_LINE>{<NEW_LINE>event.setAction(MotionEvent.ACTION_MOVE);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MotionEvent.ACTION_HOVER_EXIT:<NEW_LINE>{<NEW_LINE>event.setAction(MotionEvent.ACTION_UP);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return onTouchEvent(event);<NEW_LINE>}<NEW_LINE>// otherwise use the default<NEW_LINE>return super.onHoverEvent(event);<NEW_LINE>} | int action = event.getAction(); |
1,029,295 | public IniFileProperties read(Reader input) throws IOException {<NEW_LINE>final BufferedReader reader = new BufferedReader(input);<NEW_LINE>final IniFileProperties properties = new IniFileProperties();<NEW_LINE>String currentSection = null;<NEW_LINE>String line;<NEW_LINE>while ((line = reader.readLine()) != null) {<NEW_LINE>line = line.trim();<NEW_LINE>if (!isCommentLine(line)) {<NEW_LINE>if (isSectionLine(line)) {<NEW_LINE>currentSection = line.substring(1, <MASK><NEW_LINE>} else {<NEW_LINE>String key = "";<NEW_LINE>String value = "";<NEW_LINE>int index = findSeparator(line);<NEW_LINE>if (index >= 0) {<NEW_LINE>key = line.substring(0, index);<NEW_LINE>value = parseValue(line.substring(index + 1), reader);<NEW_LINE>} else {<NEW_LINE>key = line;<NEW_LINE>}<NEW_LINE>key = StringUtils.defaultIfEmpty(key.trim(), " ");<NEW_LINE>properties.addSectionProperty(currentSection, key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return properties;<NEW_LINE>} | line.length() - 1); |
597,846 | public List<R> visit(final ConstructorDeclaration n, final A arg) {<NEW_LINE>List<R> result = new ArrayList<>();<NEW_LINE>List<R> tmp;<NEW_LINE>{<NEW_LINE>tmp = n.getBody().accept(this, arg);<NEW_LINE>if (tmp != null)<NEW_LINE>result.addAll(tmp);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>tmp = n.getModifiers(<MASK><NEW_LINE>if (tmp != null)<NEW_LINE>result.addAll(tmp);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>tmp = n.getName().accept(this, arg);<NEW_LINE>if (tmp != null)<NEW_LINE>result.addAll(tmp);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>tmp = n.getParameters().accept(this, arg);<NEW_LINE>if (tmp != null)<NEW_LINE>result.addAll(tmp);<NEW_LINE>}<NEW_LINE>if (n.getReceiverParameter().isPresent()) {<NEW_LINE>tmp = n.getReceiverParameter().get().accept(this, arg);<NEW_LINE>if (tmp != null)<NEW_LINE>result.addAll(tmp);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>tmp = n.getThrownExceptions().accept(this, arg);<NEW_LINE>if (tmp != null)<NEW_LINE>result.addAll(tmp);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>tmp = n.getTypeParameters().accept(this, arg);<NEW_LINE>if (tmp != null)<NEW_LINE>result.addAll(tmp);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>tmp = n.getAnnotations().accept(this, arg);<NEW_LINE>if (tmp != null)<NEW_LINE>result.addAll(tmp);<NEW_LINE>}<NEW_LINE>if (n.getComment().isPresent()) {<NEW_LINE>tmp = n.getComment().get().accept(this, arg);<NEW_LINE>if (tmp != null)<NEW_LINE>result.addAll(tmp);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | ).accept(this, arg); |
394,035 | private Mono<Response<Flux<ByteBuffer>>> createOrUpdateWithResponseAsync(String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (ddosProtectionPlanName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter ddosProtectionPlanName 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>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2018-11-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, ddosProtectionPlanName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context);<NEW_LINE>} | this.client.mergeContext(context); |
933,373 | private static long insertModuleVersion(long moduleId, ModuleVersion version) {<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>values.put(ModuleVersionsColumns.MODULE_ID, moduleId);<NEW_LINE>values.put(ModuleVersionsColumns.NAME, version.name);<NEW_LINE>values.put(ModuleVersionsColumns.CODE, version.code);<NEW_LINE>values.put(ModuleVersionsColumns.DOWNLOAD_LINK, version.downloadLink);<NEW_LINE>values.put(ModuleVersionsColumns.MD5SUM, version.md5sum);<NEW_LINE>values.put(<MASK><NEW_LINE>values.put(ModuleVersionsColumns.CHANGELOG_IS_HTML, version.changelogIsHtml);<NEW_LINE>values.put(ModuleVersionsColumns.RELTYPE, version.relType.ordinal());<NEW_LINE>values.put(ModuleVersionsColumns.UPLOADED, version.uploaded);<NEW_LINE>return sDb.insertOrThrow(ModuleVersionsColumns.TABLE_NAME, null, values);<NEW_LINE>} | ModuleVersionsColumns.CHANGELOG, version.changelog); |
812,084 | public void purgeTaskHistory(String requestId, int count, Optional<Integer> limit, Optional<Date> purgeBefore, boolean deleteRowInsteadOfUpdate, Integer maxPurgeCount) {<NEW_LINE>if (limit.isPresent() && count > limit.get()) {<NEW_LINE>Date beforeBasedOnLimit = history.getMinUpdatedAtWithLimitForRequest(requestId, limit.get());<NEW_LINE>if (deleteRowInsteadOfUpdate) {<NEW_LINE>LOG.debug("Deleting task history for {} above {} items (before {})", requestId, limit.get(), beforeBasedOnLimit);<NEW_LINE>history.deleteTaskHistoryForRequestBefore(requestId, beforeBasedOnLimit, maxPurgeCount);<NEW_LINE>} else {<NEW_LINE>LOG.debug("Purging task history bytes for {} above {} items (before {})", requestId, limit.get(), beforeBasedOnLimit);<NEW_LINE>history.updateTaskHistoryNullBytesForRequestBefore(requestId, beforeBasedOnLimit, maxPurgeCount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (purgeBefore.isPresent()) {<NEW_LINE>if (deleteRowInsteadOfUpdate) {<NEW_LINE>LOG.debug("Deleting task history for {} before {}", requestId, purgeBefore.get());<NEW_LINE>history.deleteTaskHistoryForRequestBefore(requestId, purgeBefore.get(), maxPurgeCount);<NEW_LINE>} else {<NEW_LINE>LOG.debug("Purging task history bytes for {} before {}", requestId, purgeBefore.get());<NEW_LINE>history.updateTaskHistoryNullBytesForRequestBefore(requestId, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | purgeBefore.get(), maxPurgeCount); |
339,901 | private void triggerImportProtocol(boolean verbose, URL importURL, String boltUri, Path source, long crc32Sum, String bearerToken) throws IOException {<NEW_LINE>HttpURLConnection connection = (HttpURLConnection) importURL.openConnection();<NEW_LINE>try (Closeable c = connection::disconnect) {<NEW_LINE>connection.setRequestMethod("POST");<NEW_LINE>connection.setRequestProperty("Content-Type", "application/json");<NEW_LINE>connection.setRequestProperty("Authorization", bearerToken);<NEW_LINE>connection.setDoOutput(true);<NEW_LINE>try (OutputStream postData = connection.getOutputStream()) {<NEW_LINE>postData.write(String.format("{\"Crc32\":%d}", crc32Sum).getBytes(UTF_8));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>switch(responseCode) {<NEW_LINE>case HTTP_NOT_FOUND:<NEW_LINE>// fallthrough<NEW_LINE>case HTTP_MOVED_PERM:<NEW_LINE>throw updatePluginErrorResponse(connection);<NEW_LINE>case HTTP_TOO_MANY_REQUESTS:<NEW_LINE>throw resumePossibleErrorResponse(connection, source, boltUri);<NEW_LINE>case HTTP_CONFLICT:<NEW_LINE>throw errorResponse(verbose, connection, "The target database contained data and consent to overwrite the data was not given. Aborting");<NEW_LINE>case HTTP_OK:<NEW_LINE>// All good, we managed to trigger the import protocol after our completed upload<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw resumePossibleErrorResponse(connection, source, boltUri);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int responseCode = connection.getResponseCode(); |
945,612 | final ListPendingInvitationResourcesResult executeListPendingInvitationResources(ListPendingInvitationResourcesRequest listPendingInvitationResourcesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPendingInvitationResourcesRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListPendingInvitationResourcesRequest> request = null;<NEW_LINE>Response<ListPendingInvitationResourcesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListPendingInvitationResourcesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPendingInvitationResourcesRequest));<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, "RAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListPendingInvitationResources");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListPendingInvitationResourcesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPendingInvitationResourcesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,640,236 | static String printRules(AutomationCommandsPluggable autoCommands, Map<String, String> ruleUIDs) {<NEW_LINE>int[] columnWidths = new int[] { COLUMN_ID, COLUMN_RULE_UID, COLUMN_RULE_NAME, COLUMN_RULE_STATUS };<NEW_LINE>List<String> columnValues = new ArrayList<>();<NEW_LINE>columnValues.add(ID);<NEW_LINE>columnValues.add(UID);<NEW_LINE>columnValues.add(NAME);<NEW_LINE>columnValues.add(STATUS);<NEW_LINE>String titleRow = Utils.getRow(columnWidths, columnValues);<NEW_LINE>List<String> rulesRows = new ArrayList<>();<NEW_LINE>for (int i = 1; i <= ruleUIDs.size(); i++) {<NEW_LINE>String id = String.valueOf(i);<NEW_LINE>String uid = ruleUIDs.get(id);<NEW_LINE>if (uid != null) {<NEW_LINE>columnValues.set(0, id);<NEW_LINE>columnValues.set(1, uid);<NEW_LINE>Rule rule = autoCommands.getRule(uid);<NEW_LINE>columnValues.set(<MASK><NEW_LINE>columnValues.set(3, autoCommands.getRuleStatus(uid).toString());<NEW_LINE>rulesRows.add(Utils.getRow(columnWidths, columnValues));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Utils.getTableContent(TABLE_WIDTH, columnWidths, rulesRows, titleRow);<NEW_LINE>} | 2, rule.getName()); |
1,741,377 | public Observable<ServiceResponse<Project>> updateProjectWithServiceResponseAsync(UUID projectId, Project updatedProject) {<NEW_LINE>if (this.client.endpoint() == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (projectId == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter projectId is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (updatedProject == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter updatedProject is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (this.client.apiKey() == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null.");<NEW_LINE>}<NEW_LINE>Validator.validate(updatedProject);<NEW_LINE>String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint());<NEW_LINE>return service.updateProject(projectId, updatedProject, this.client.apiKey(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Project>>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Observable<ServiceResponse<Project>> call(Response<ResponseBody> response) {<NEW_LINE>try {<NEW_LINE>ServiceResponse<<MASK><NEW_LINE>return Observable.just(clientResponse);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>return Observable.error(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | Project> clientResponse = updateProjectDelegate(response); |
1,844,657 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create context ContextOne start SupportBean_S0 end SupportBean_S1", path);<NEW_LINE>String eplCreate = namedWindow ? "@public context ContextOne create window MyInfra#keepall as (pkey0 string, pkey1 int, c0 long)" : "@public context ContextOne create table MyInfra as (pkey0 string primary key, pkey1 int primary key, c0 long)";<NEW_LINE>env.compileDeploy(eplCreate, path);<NEW_LINE>env.compileDeploy("context ContextOne insert into MyInfra select theString as pkey0, intPrimitive as pkey1, longPrimitive as c0 from SupportBean", path);<NEW_LINE>// start<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>makeSendSupportBean(env, "E1", 10, 100);<NEW_LINE>makeSendSupportBean(env, "E2", 20, 200);<NEW_LINE>register(env, path, 1, "context ContextOne select * from MyInfra output snapshot when terminated");<NEW_LINE>register(<MASK><NEW_LINE>register(env, path, 3, "context ContextOne select pkey0, count(*) as thecnt from MyInfra output snapshot when terminated");<NEW_LINE>register(env, path, 4, "context ContextOne select pkey0, count(*) as thecnt from MyInfra group by pkey0 output snapshot when terminated");<NEW_LINE>register(env, path, 5, "context ContextOne select pkey0, pkey1, count(*) as thecnt from MyInfra group by pkey0 output snapshot when terminated");<NEW_LINE>register(env, path, 6, "context ContextOne select pkey0, pkey1, count(*) as thecnt from MyInfra group by rollup (pkey0, pkey1) output snapshot when terminated");<NEW_LINE>env.milestone(0);<NEW_LINE>// end<NEW_LINE>env.sendEventBean(new SupportBean_S1(0));<NEW_LINE>env.assertPropsPerRowLastNewAnyOrder("s1", "pkey0,pkey1,c0".split(","), new Object[][] { { "E1", 10, 100L }, { "E2", 20, 200L } });<NEW_LINE>env.assertPropsNew("s2", "thecnt".split(","), new Object[] { 2L });<NEW_LINE>env.assertPropsPerRowLastNewAnyOrder("s3", "pkey0,thecnt".split(","), new Object[][] { { "E1", 2L }, { "E2", 2L } });<NEW_LINE>env.assertPropsPerRowLastNewAnyOrder("s4", "pkey0,thecnt".split(","), new Object[][] { { "E1", 1L }, { "E2", 1L } });<NEW_LINE>env.assertPropsPerRowLastNewAnyOrder("s5", "pkey0,pkey1,thecnt".split(","), new Object[][] { { "E1", 10, 1L }, { "E2", 20, 1L } });<NEW_LINE>env.assertPropsPerRowLastNewAnyOrder("s6", "pkey0,pkey1,thecnt".split(","), new Object[][] { { "E1", 10, 1L }, { "E2", 20, 1L }, { "E1", null, 1L }, { "E2", null, 1L }, { null, null, 2L } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | env, path, 2, "context ContextOne select count(*) as thecnt from MyInfra output snapshot when terminated"); |
342,785 | default ToDoubleNullable<T> mapToDoubleIfPresent(IntToDoubleFunction mapper) {<NEW_LINE><MASK><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(delegate.applyAsInt(object));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double applyAsDouble(T object) {<NEW_LINE>return mapper.applyAsDouble(delegate.applyAsInt(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.applyAsInt(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.applyAsInt(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>} | final ToIntNullable<T> delegate = this; |
1,365,930 | public Adjustment unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Adjustment adjustment = new Adjustment();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Metric", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>adjustment.setMetric(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Reason", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>adjustment.setReason(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 adjustment;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,235,985 | public void init() {<NEW_LINE>leftSide = app.getSettings()<MASK><NEW_LINE>app.registerReceiver(new BroadcastReceiver() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReceive(Context context, Intent intent) {<NEW_LINE>RoutingHelper routingHelper = app.getRoutingHelper();<NEW_LINE>routingHelper.setRoutePlanningMode(true);<NEW_LINE>routingHelper.setFollowingMode(false);<NEW_LINE>routingHelper.setPauseNavigation(true);<NEW_LINE>}<NEW_LINE>}, new IntentFilter(OSMAND_PAUSE_NAVIGATION_SERVICE_ACTION));<NEW_LINE>app.registerReceiver(new BroadcastReceiver() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReceive(Context context, Intent intent) {<NEW_LINE>RoutingHelper routingHelper = app.getRoutingHelper();<NEW_LINE>routingHelper.setRoutePlanningMode(false);<NEW_LINE>routingHelper.setFollowingMode(true);<NEW_LINE>routingHelper.setCurrentLocation(getLastKnownLocation(), false);<NEW_LINE>}<NEW_LINE>}, new IntentFilter(OSMAND_RESUME_NAVIGATION_SERVICE_ACTION));<NEW_LINE>app.registerReceiver(new BroadcastReceiver() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReceive(Context context, Intent intent) {<NEW_LINE>app.stopNavigation();<NEW_LINE>}<NEW_LINE>}, new IntentFilter(OSMAND_STOP_NAVIGATION_SERVICE_ACTION));<NEW_LINE>} | .DRIVING_REGION.get().leftHandDriving; |
570,922 | public DataPoint next() {<NEW_LINE>scratch.zeroOut();<NEW_LINE><MASK><NEW_LINE>// for (int j = 0; j < cur_col_vals.length; j++)//slow option, not needed b/c we maintain sparse set mapping<NEW_LINE>for (int j : nonZeroTable.getOrDefault(i, empty_set)) if (cur_col_vals[j] != null && cur_col_vals[j].getIndex() <= i) {<NEW_LINE>if (// on the spot, use it!<NEW_LINE>cur_col_vals[j].getIndex() == i)<NEW_LINE>scratch.set(j, cur_col_vals[j].getValue());<NEW_LINE>// move iterator<NEW_LINE>if (col_iters.get(j).hasNext()) {<NEW_LINE>cur_col_vals[j] = col_iters.get(j).next();<NEW_LINE>int i_future = cur_col_vals[j].getIndex();<NEW_LINE>Set<Integer> row_i_future = nonZeroTable.get(i_future);<NEW_LINE>if (row_i_future == null) {<NEW_LINE>// use alinked map to maintain iteration order which is sorted by default, which will have better performance later for sparse insertions<NEW_LINE>row_i_future = Collections.newSetFromMap(new LinkedHashMap<>());<NEW_LINE>nonZeroTable.put(i_future, row_i_future);<NEW_LINE>}<NEW_LINE>row_i_future.add(j);<NEW_LINE>} else<NEW_LINE>cur_col_vals[j] = null;<NEW_LINE>}<NEW_LINE>nonZeroTable.remove(i);<NEW_LINE>for (int j = 0; j < self.numCategorical(); j++) {<NEW_LINE>scratch_cat[j] = self.getCatColumn(j)[i];<NEW_LINE>}<NEW_LINE>return new DataPoint(scratch, scratch_cat, categoricalData);<NEW_LINE>} | int i = pos.getAndIncrement(); |
1,168,019 | final DescribeReservedInstanceOfferingsResult executeDescribeReservedInstanceOfferings(DescribeReservedInstanceOfferingsRequest describeReservedInstanceOfferingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeReservedInstanceOfferingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeReservedInstanceOfferingsRequest> request = null;<NEW_LINE>Response<DescribeReservedInstanceOfferingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeReservedInstanceOfferingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeReservedInstanceOfferingsRequest));<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, "OpenSearch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeReservedInstanceOfferings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeReservedInstanceOfferingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeReservedInstanceOfferingsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
718,703 | private void checkACXmlJ2eeVersion(FileObject appClientXML) {<NEW_LINE>try {<NEW_LINE>BigDecimal version = getACXmlVersion(appClientXML);<NEW_LINE>if (version == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (new BigDecimal(org.netbeans.modules.j2ee.dd.api.client.AppClient.VERSION_1_4).equals(version)) {<NEW_LINE>j2eeSpecComboBox.setSelectedItem(new ProfileItem(Profile.J2EE_14));<NEW_LINE>} else if (new BigDecimal(org.netbeans.modules.j2ee.dd.api.client.AppClient.VERSION_5_0).equals(version)) {<NEW_LINE>j2eeSpecComboBox.setSelectedItem(new ProfileItem(Profile.JAVA_EE_5));<NEW_LINE>} else if (new BigDecimal(org.netbeans.modules.j2ee.dd.api.client.AppClient.VERSION_6_0).equals(version)) {<NEW_LINE>j2eeSpecComboBox.setSelectedItem(<MASK><NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>// NOI18N<NEW_LINE>String message = NbBundle.getMessage(ProjectServerPanel.class, "MSG_AppClientXmlCorrupted");<NEW_LINE>Exceptions.printStackTrace(Exceptions.attachLocalizedMessage(e, message));<NEW_LINE>}<NEW_LINE>} | new ProfileItem(Profile.JAVA_EE_6_FULL)); |
813,419 | public double[] solve(double[] b) {<NEW_LINE>int dim = b.length;<NEW_LINE>ArgChecker.isTrue(dim == _lArray.length, "b array of incorrect size");<NEW_LINE>double[] x = new double[dim];<NEW_LINE>System.arraycopy(b, 0, x, 0, dim);<NEW_LINE>// L y = b (y stored in x array)<NEW_LINE>for (int looprow = 0; looprow < dim; looprow++) {<NEW_LINE>x[looprow] /= _lArray[looprow][looprow];<NEW_LINE>for (int j = looprow + 1; j < dim; j++) {<NEW_LINE>x[j] -= x[looprow] <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// L^T x = y<NEW_LINE>for (int looprow = dim - 1; looprow >= -0; looprow--) {<NEW_LINE>x[looprow] /= _lArray[looprow][looprow];<NEW_LINE>for (int j = 0; j < looprow; j++) {<NEW_LINE>x[j] -= x[looprow] * _lArray[looprow][j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return x;<NEW_LINE>} | * _lArray[j][looprow]; |
347,654 | public FileSystem HdfsConfigure(String[] xmlfiles, String uri, String hdfUser) throws IOException {<NEW_LINE>JobConf conf = new JobConf();<NEW_LINE>{<NEW_LINE>String envPath = System.getProperty("java.library.path");<NEW_LINE>String path = System.getProperty("user.dir");<NEW_LINE>System.setProperty("HADOOP_USER_NAME", hdfUser);<NEW_LINE>System.setProperty("HADOOP_USER_GROUP", "supergroup");<NEW_LINE><MASK><NEW_LINE>System.setProperty("USERNAME", "root");<NEW_LINE>envPath = path + ";" + envPath;<NEW_LINE>path = path.replace("\\bin", "");<NEW_LINE>System.setProperty("hadoop.home.dir", path);<NEW_LINE>System.setProperty("java.library.path", envPath);<NEW_LINE>}<NEW_LINE>if (xmlfiles != null) {<NEW_LINE>for (int i = 0; i < xmlfiles.length; i++) {<NEW_LINE>FileObject fo = new FileObject(xmlfiles[i]);<NEW_LINE>if (fo.isExists()) {<NEW_LINE>conf.addResource(fo.getInputStream());<NEW_LINE>} else {<NEW_LINE>System.out.println("file: " + xmlfiles[i] + " not existed");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (uri != null) {<NEW_LINE>conf.set("fs.defaultFS", uri);<NEW_LINE>}<NEW_LINE>m_classLoader = Thread.currentThread().getContextClassLoader();<NEW_LINE>ClassLoader classLoader = HdfsClient.this.getClass().getClassLoader();<NEW_LINE>Thread.currentThread().setContextClassLoader(classLoader);<NEW_LINE>conf.setClassLoader(classLoader);<NEW_LINE>conf.set("fs.hdfs.impl", org.apache.hadoop.hdfs.DistributedFileSystem.class.getName());<NEW_LINE>m_ctx.setParamValue("classLoader", m_classLoader);<NEW_LINE>FileSystem fs = null;<NEW_LINE>if (uri == null) {<NEW_LINE>fs = FileSystem.get(conf);<NEW_LINE>} else {<NEW_LINE>fs = FileSystem.get(URI.create(uri), conf);<NEW_LINE>}<NEW_LINE>return fs;<NEW_LINE>} | System.setProperty("user.name", "root"); |
1,713,934 | public boolean createFailedExecutorHealthCheckMessage(final List<ExecutableFlow> flows, final Executor executor, final ExecutorManagerException failureException, final EmailMessage message, final String azkabanName, final String scheme, final String clientHostname, final String clientPortNumber, final List<String> emailList) {<NEW_LINE>if (emailList == null || emailList.isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>message.addAllToAddress(emailList);<NEW_LINE>message.setMimeType("text/html");<NEW_LINE>message.setSubject("Alert: Executor is unreachable, " + executor.getHost() + " on " + azkabanName);<NEW_LINE>message.println("<h2 style=\"color:#FFA500\"> Executor is unreachable. Executor host - " + executor.getHost() + " on Cluster - " + azkabanName + "</h2>");<NEW_LINE>message.println("Remedial action will be attempted on affected executions - <br>");<NEW_LINE>message.println("Following flows were reported as running on the executor and will be " + "finalized.");<NEW_LINE>message.println("");<NEW_LINE>message.println("<h3>Affected executions</h3>");<NEW_LINE>message.println("<ul>");<NEW_LINE>appendFlowLinksToMessage(message, flows, scheme, clientHostname, clientPortNumber);<NEW_LINE>message.println("</ul>");<NEW_LINE>message.println("");<NEW_LINE>message.println("<h3>Error detail</h3>");<NEW_LINE>message.println(String.format("Following error was reported for executor-id: %s, " + "executor-host: %s, executor-port: %d", executor.getId(), executor.getHost(), executor.getPort()));<NEW_LINE>message.println("<pre>" + ExceptionUtils<MASK><NEW_LINE>return true;<NEW_LINE>} | .getStackTrace(failureException) + "</pre>"); |
955,125 | public static DescribeTotalAndRateLineResponse unmarshall(DescribeTotalAndRateLineResponse describeTotalAndRateLineResponse, UnmarshallerContext context) {<NEW_LINE>describeTotalAndRateLineResponse.setRequestId(context.stringValue("DescribeTotalAndRateLineResponse.RequestId"));<NEW_LINE>List<String> categories = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeTotalAndRateLineResponse.Categories.Length"); i++) {<NEW_LINE>categories.add(context.stringValue("DescribeTotalAndRateLineResponse.Categories[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeTotalAndRateLineResponse.setCategories(categories);<NEW_LINE>List<Item> items <MASK><NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeTotalAndRateLineResponse.Items.Length"); i++) {<NEW_LINE>Item item = new Item();<NEW_LINE>item.setData(context.floatValue("DescribeTotalAndRateLineResponse.Items[" + i + "].Data"));<NEW_LINE>item.setId(context.stringValue("DescribeTotalAndRateLineResponse.Items[" + i + "].Id"));<NEW_LINE>item.setName(context.stringValue("DescribeTotalAndRateLineResponse.Items[" + i + "].Name"));<NEW_LINE>items.add(item);<NEW_LINE>}<NEW_LINE>describeTotalAndRateLineResponse.setItems(items);<NEW_LINE>return describeTotalAndRateLineResponse;<NEW_LINE>} | = new ArrayList<Item>(); |
1,650,125 | private void runBashCommand(String bisqCmd) throws IOException, InterruptedException {<NEW_LINE>String cmdDescription = config.runSubprojectJars ? "java -> " + bisqAppConfig.mainClassName + " -> " + bisqAppConfig.appName : bisqAppConfig.startupScript + " -> " + bisqAppConfig.appName;<NEW_LINE>BashCommand bashCommand = new BashCommand(bisqCmd);<NEW_LINE>log.info("Starting {} ...\n$ {}", <MASK><NEW_LINE>bashCommand.runInBackground();<NEW_LINE>if (bashCommand.getExitStatus() != 0)<NEW_LINE>throw new IllegalStateException(format("Error starting BisqApp%n%s%nError: %s", bisqAppConfig.appName, bashCommand.getError()));<NEW_LINE>// Sometimes it takes a little extra time to find the linux process id.<NEW_LINE>// Wait up to two seconds before giving up and throwing an Exception.<NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>pid = findBisqAppPid();<NEW_LINE>if (pid != -1)<NEW_LINE>break;<NEW_LINE>MILLISECONDS.sleep(500L);<NEW_LINE>}<NEW_LINE>if (!isAlive(pid))<NEW_LINE>throw new IllegalStateException(format("Error finding pid for %s", this.name));<NEW_LINE>log.info("{} running with pid {}", cmdDescription, pid);<NEW_LINE>log.info("Log {}", config.rootAppDataDir + "/" + bisqAppConfig.appName + "/bisq.log");<NEW_LINE>} | cmdDescription, bashCommand.getCommand()); |
1,790,503 | public void onClick(View v) {<NEW_LINE>String appID = viewAppID.getText().toString();<NEW_LINE>String productID = viewProductID.getText().toString();<NEW_LINE>if (appID.length() == 0) {<NEW_LINE>showAlert("Invalid App ID!");<NEW_LINE>} else if (productID.length() == 0) {<NEW_LINE>showAlert("Invalid Product ID!");<NEW_LINE>} else {<NEW_LINE>String autoAppLink = "fb" + appID + "://applinks?al_applink_data=";<NEW_LINE>JSONObject data = new JSONObject();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>data.put("is_auto_applink", true);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>showAlert("Cannot generate auto applink url!");<NEW_LINE>}<NEW_LINE>String dataString = data.toString();<NEW_LINE>autoAppLink = autoAppLink + Uri.encode(dataString);<NEW_LINE>Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(autoAppLink));<NEW_LINE>startActivity(intent);<NEW_LINE>}<NEW_LINE>} | data.put("product_id", productID); |
456,648 | public static void updateProxyButtonAndTooltip() {<NEW_LINE>if (applyProxyButton == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>applyProxyButton.setVerticalTextPosition(SwingConstants.BOTTOM);<NEW_LINE>applyProxyButton.setHorizontalTextPosition(SwingConstants.CENTER);<NEW_LINE>if (ProxyUtils.isProxyEnabled()) {<NEW_LINE>applyProxyButton.setIcon(UISupport.createImageIcon(PROXY_ENABLED_ICON));<NEW_LINE>if (ProxyUtils.isAutoProxy()) {<NEW_LINE>applyProxyButton.getAction().<MASK><NEW_LINE>} else {<NEW_LINE>applyProxyButton.getAction().putValue(Action.SHORT_DESCRIPTION, "Proxy Setting: Manual");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>applyProxyButton.setIcon(UISupport.createImageIcon(PROXY_DISABLED_ICON));<NEW_LINE>applyProxyButton.getAction().putValue(Action.SHORT_DESCRIPTION, "Proxy Setting: None");<NEW_LINE>}<NEW_LINE>applyProxyButton.setSelected(ProxyUtils.isProxyEnabled());<NEW_LINE>UIManager.put("ToggleButton.select", Color.WHITE);<NEW_LINE>SwingUtilities.updateComponentTreeUI(applyProxyButton);<NEW_LINE>} | putValue(Action.SHORT_DESCRIPTION, "Proxy Setting: Automatic"); |
892,016 | public okhttp3.Call addPetCall(Pet body, final ApiCallback _callback) throws ApiException {<NEW_LINE>String basePath = null;<NEW_LINE>// Operation Servers<NEW_LINE>String[] localBasePaths = new String[] {};<NEW_LINE>// Determine Base Path to Use<NEW_LINE>if (localCustomBaseUrl != null) {<NEW_LINE>basePath = localCustomBaseUrl;<NEW_LINE>} else if (localBasePaths.length > 0) {<NEW_LINE>basePath = localBasePaths[localHostIndex];<NEW_LINE>} else {<NEW_LINE>basePath = null;<NEW_LINE>}<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/pet";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new <MASK><NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json", "application/xml" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>if (localVarContentType != null) {<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] { "petstore_auth" };<NEW_LINE>return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | HashMap<String, Object>(); |
535,432 | private void rewritePolymer1ClassDefinition(Node node, Node parent, NodeTraversal traversal) {<NEW_LINE><MASK><NEW_LINE>if (grandparent.isConst()) {<NEW_LINE>grandparent.setToken(Token.LET);<NEW_LINE>Node scriptNode = traversal.getCurrentScript();<NEW_LINE>if (scriptNode != null) {<NEW_LINE>NodeUtil.addFeatureToScript(scriptNode, Feature.LET_DECLARATIONS, compiler);<NEW_LINE>}<NEW_LINE>traversal.reportCodeChange();<NEW_LINE>}<NEW_LINE>if (NodeUtil.isNameDeclaration(grandparent) && grandparent.getParent().isExport()) {<NEW_LINE>normalizePolymerExport(grandparent, grandparent.getParent());<NEW_LINE>traversal.reportCodeChange();<NEW_LINE>}<NEW_LINE>PolymerClassDefinition def = PolymerClassDefinition.extractFromCallNode(node, compiler, getModuleMetadata(traversal), behaviorExtractor);<NEW_LINE>if (def != null) {<NEW_LINE>if (def.nativeBaseElement != null) {<NEW_LINE>appendPolymerElementExterns(def);<NEW_LINE>}<NEW_LINE>PolymerClassRewriter rewriter = new PolymerClassRewriter(compiler, polymerVersion, polymerExportPolicy, this.propertyRenamingEnabled);<NEW_LINE>rewriter.rewritePolymerCall(def, traversal);<NEW_LINE>}<NEW_LINE>} | Node grandparent = parent.getParent(); |
208,424 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>repository = getSerializableExtra(EXTRA_REPOSITORY);<NEW_LINE>Project project = getSerializableExtra(EXTRA_PROJECT);<NEW_LINE>loadingBar = finder.<MASK><NEW_LINE>ActionBar actionBar = getSupportActionBar();<NEW_LINE>actionBar.setDisplayHomeAsUpEnabled(true);<NEW_LINE>actionBar.setTitle(project.name);<NEW_LINE>actionBar.setSubtitle(repository.generateId());<NEW_LINE>ViewUtils.setGone(loadingBar, false);<NEW_LINE>setGone(true);<NEW_LINE>new RefreshProjectColumnsTask(this, project) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onSuccess(Collection<ProjectColumn> items) throws Exception {<NEW_LINE>super.onSuccess(items);<NEW_LINE>columns = (List<ProjectColumn>) items;<NEW_LINE>configurePager();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onException(Exception e) throws RuntimeException {<NEW_LINE>super.onException(e);<NEW_LINE>ToastUtils.show(ProjectViewActivity.this, R.string.error_repo_load);<NEW_LINE>ViewUtils.setGone(loadingBar, true);<NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>} | find(R.id.pb_loading); |
152,675 | public void updateBackground(int x0, int y0, int x1, int y1, T frame) {<NEW_LINE>interpolationInput.setImage(frame);<NEW_LINE>final int numBands = frame.getNumBands();<NEW_LINE>final float minusLearn = 1.0f - learnRate;<NEW_LINE>transform.setModel(worldToCurrent);<NEW_LINE>for (int y = y0; y < y1; y++) {<NEW_LINE>int indexBG = background.startIndex + y * background.stride + x0 * numBands;<NEW_LINE>for (int x = x0; x < x1; x++) {<NEW_LINE>transform.compute(x, y, pixel);<NEW_LINE>if (pixel.x >= 0 && pixel.x < frame.width && pixel.y >= 0 && pixel.y < frame.height) {<NEW_LINE>interpolationInput.get(pixel.x, pixel.y, valueInput);<NEW_LINE>for (int band = 0; band < numBands; band++, indexBG++) {<NEW_LINE>float value = valueInput[band];<NEW_LINE>float <MASK><NEW_LINE>if (bg == Float.MAX_VALUE) {<NEW_LINE>background.data[indexBG] = value;<NEW_LINE>} else {<NEW_LINE>background.data[indexBG] = minusLearn * bg + learnRate * value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>indexBG += numBands;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | bg = background.data[indexBG]; |
1,483,179 | private void handleCloseReason(ChannelHandlerContext ctx, CloseReason cr, boolean writeCloseReason) {<NEW_LINE>cleanupBuffer();<NEW_LINE>if (closed.compareAndSet(false, true)) {<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Closing WebSocket session {} with reason {}", getSession(), cr);<NEW_LINE>}<NEW_LINE>Optional<? extends MethodExecutionHandle<?, ?>> opt = webSocketBean.closeMethod();<NEW_LINE>if (opt.isPresent()) {<NEW_LINE>MethodExecutionHandle<?, ?> methodExecutionHandle = opt.get();<NEW_LINE>Object target = methodExecutionHandle.getTarget();<NEW_LINE>try {<NEW_LINE>BoundExecutable boundExecutable = bindMethod(originatingRequest, webSocketBinder, methodExecutionHandle, Collections.singletonList(cr));<NEW_LINE>invokeAndClose(ctx, <MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (LOG.isErrorEnabled()) {<NEW_LINE>LOG.error("Error invoking @OnClose handler for WebSocket bean [" + target + "]: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (writeCloseReason) {<NEW_LINE>writeCloseFrameAndTerminate(ctx, cr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | target, boundExecutable, methodExecutionHandle, true); |
262,967 | public static String createLiveCopy(CQClient client, String srcPath, String destPath, String title, String label, int... expectedStatus) throws ClientException {<NEW_LINE>FormEntityBuilder feb = FormEntityBuilder.create();<NEW_LINE>feb.addParameter("cmd", "createLiveCopy");<NEW_LINE><MASK><NEW_LINE>feb.addParameter("destPath", destPath);<NEW_LINE>feb.addParameter("_charset_", "utf-8");<NEW_LINE>feb.addParameter("title", title);<NEW_LINE>feb.addParameter("label", label);<NEW_LINE>try {<NEW_LINE>return client.doPost("/bin/wcmcommand", feb.build(), HttpUtils.getExpectedStatus(200, expectedStatus)).getSlingPath();<NEW_LINE>} catch (ClientException ex) {<NEW_LINE>throw new ClientException("Unable to create livecopy of " + srcPath + " at " + destPath + " with error : " + ex, ex);<NEW_LINE>}<NEW_LINE>} | feb.addParameter("srcPath", srcPath); |
1,282,703 | private void computeFoldingRanges(List<FoldingRange> foldingRanges, ITypeRoot unit, IProgressMonitor monitor) {<NEW_LINE>try {<NEW_LINE>ISourceRange range = unit.getSourceRange();<NEW_LINE>if (!SourceRange.isAvailable(range)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String contents = unit.getSource();<NEW_LINE>if (StringUtils.isBlank(contents)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int shift = range.getOffset();<NEW_LINE>IScanner scanner = getScanner();<NEW_LINE>scanner.setSource(contents.toCharArray());<NEW_LINE>scanner.resetTo(shift, shift + range.getLength());<NEW_LINE>int start = shift;<NEW_LINE>int token = 0;<NEW_LINE>Stack<Integer> regionStarts = new Stack<>();<NEW_LINE>while (token != ITerminalSymbols.TokenNameEOF) {<NEW_LINE>start = scanner.getCurrentTokenStartPosition();<NEW_LINE>switch(token) {<NEW_LINE>case ITerminalSymbols.TokenNameCOMMENT_JAVADOC:<NEW_LINE>case ITerminalSymbols.TokenNameCOMMENT_BLOCK:<NEW_LINE>int end = scanner.getCurrentTokenEndPosition();<NEW_LINE>FoldingRange commentFoldingRange = new FoldingRange(scanner.getLineNumber(start) - 1, scanner.getLineNumber(end) - 1);<NEW_LINE><MASK><NEW_LINE>foldingRanges.add(commentFoldingRange);<NEW_LINE>break;<NEW_LINE>case ITerminalSymbols.TokenNameCOMMENT_LINE:<NEW_LINE>String currentSource = String.valueOf(scanner.getCurrentTokenSource());<NEW_LINE>if (REGION_START_PATTERN.matcher(currentSource).lookingAt()) {<NEW_LINE>regionStarts.push(start);<NEW_LINE>} else if (REGION_END_PATTERN.matcher(currentSource).lookingAt()) {<NEW_LINE>if (regionStarts.size() > 0) {<NEW_LINE>FoldingRange regionFolding = new FoldingRange(scanner.getLineNumber(regionStarts.pop()) - 1, scanner.getLineNumber(start) - 1);<NEW_LINE>regionFolding.setKind(FoldingRangeKind.Region);<NEW_LINE>foldingRanges.add(regionFolding);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>token = getNextToken(scanner);<NEW_LINE>}<NEW_LINE>computeTypeRootRanges(foldingRanges, unit, scanner);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>JavaLanguageServerPlugin.logException("Problem with folding range for " + unit.getPath().toPortableString(), e);<NEW_LINE>monitor.setCanceled(true);<NEW_LINE>}<NEW_LINE>} | commentFoldingRange.setKind(FoldingRangeKind.Comment); |
478,911 | private void addCSSClasses(SVGPlot svgp) {<NEW_LINE>final StyleLibrary style = context.getStyleLibrary();<NEW_LINE>// Class for the cube<NEW_LINE>if (!svgp.getCSSClassManager().contains(CSS_CUBE)) {<NEW_LINE>CSSClass cls = new CSSClass(this, CSS_CUBE);<NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_VALUE, style.getColor(StyleLibrary.SELECTION));<NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_OPACITY_PROPERTY, style.getOpacity(StyleLibrary.SELECTION));<NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_WIDTH_PROPERTY, style.getLineWidth(StyleLibrary.PLOT));<NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_LINECAP_PROPERTY, SVGConstants.CSS_ROUND_VALUE);<NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_LINEJOIN_PROPERTY, SVGConstants.CSS_ROUND_VALUE);<NEW_LINE>if (settings.nofill) {<NEW_LINE>cls.setStatement(SVGConstants.CSS_FILL_PROPERTY, SVGConstants.CSS_NONE_VALUE);<NEW_LINE>} else {<NEW_LINE>cls.setStatement(SVGConstants.CSS_FILL_PROPERTY, style<MASK><NEW_LINE>cls.setStatement(SVGConstants.CSS_FILL_OPACITY_PROPERTY, style.getOpacity(StyleLibrary.SELECTION));<NEW_LINE>}<NEW_LINE>svgp.addCSSClassOrLogError(cls);<NEW_LINE>}<NEW_LINE>// Class for the cube frame<NEW_LINE>if (!svgp.getCSSClassManager().contains(CSS_CUBEFRAME)) {<NEW_LINE>CSSClass cls = new CSSClass(this, CSS_CUBEFRAME);<NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_VALUE, style.getColor(StyleLibrary.SELECTION));<NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_OPACITY_PROPERTY, style.getOpacity(StyleLibrary.SELECTION));<NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_WIDTH_PROPERTY, style.getLineWidth(StyleLibrary.SELECTION));<NEW_LINE>svgp.addCSSClassOrLogError(cls);<NEW_LINE>}<NEW_LINE>} | .getColor(StyleLibrary.SELECTION)); |
252,001 | public boolean print(DateTimePrintContext context, StringBuilder buf) {<NEW_LINE>Long offsetSecs = context.getValue(OFFSET_SECONDS);<NEW_LINE>if (offsetSecs == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>buf.append("GMT");<NEW_LINE>if (style == TextStyle.FULL) {<NEW_LINE>return new OffsetIdPrinterParser("", "+HH:MM:ss").print(context, buf);<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>if (totalSecs != 0) {<NEW_LINE>// anything larger than 99 silently dropped<NEW_LINE>int absHours = Math.abs((totalSecs / 3600) % 100);<NEW_LINE>int absMinutes = Math.abs((totalSecs / 60) % 60);<NEW_LINE>int absSeconds = Math.abs(totalSecs % 60);<NEW_LINE>buf.append(totalSecs < 0 ? "-" : "+").append(absHours);<NEW_LINE>if (absMinutes > 0 || absSeconds > 0) {<NEW_LINE>buf.append(":").append((char) (absMinutes / 10 + '0')).append((char) (absMinutes % 10 + '0'));<NEW_LINE>if (absSeconds > 0) {<NEW_LINE>buf.append(":").append((char) (absSeconds / 10 + '0')).append((char) (absSeconds % 10 + '0'));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | totalSecs = Jdk8Methods.safeToInt(offsetSecs); |
594,349 | private Cipher createCipher(byte[] salt, final int mode) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException {<NEW_LINE>digest.reset();<NEW_LINE>byte[] pwdAsBytes = getKeyAsBytes();<NEW_LINE>byte[] keyAndIv = new byte[16 * 2];<NEW_LINE>byte[] result;<NEW_LINE>int currentPos = 0;<NEW_LINE>while (currentPos < keyAndIv.length) {<NEW_LINE>digest.update(pwdAsBytes);<NEW_LINE>digest.update(salt, 0, 8);<NEW_LINE>result = digest.digest();<NEW_LINE>int stillNeed = keyAndIv.length - currentPos;<NEW_LINE>if (result.length > stillNeed) {<NEW_LINE>byte[] b = new byte[stillNeed];<NEW_LINE>System.arraycopy(result, 0, b, 0, b.length);<NEW_LINE>result = b;<NEW_LINE>}<NEW_LINE>System.arraycopy(result, 0, keyAndIv, currentPos, result.length);<NEW_LINE>currentPos += result.length;<NEW_LINE>if (currentPos < keyAndIv.length) {<NEW_LINE>digest.reset();<NEW_LINE>digest.update(result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>byte[] key = new byte[16];<NEW_LINE>byte[] iv = new byte[16];<NEW_LINE>System.arraycopy(keyAndIv, 0, key, 0, key.length);<NEW_LINE>System.arraycopy(keyAndIv, key.length, <MASK><NEW_LINE>Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");<NEW_LINE>cipher.init(mode, new SecretKeySpec(key, "AES"), new IvParameterSpec(iv));<NEW_LINE>return cipher;<NEW_LINE>} | iv, 0, iv.length); |
303,544 | private String contrast() {<NEW_LINE>final MetaDataDO before = (MetaDataDO) getBefore();<NEW_LINE>Objects.requireNonNull(before);<NEW_LINE>final MetaDataDO after = (MetaDataDO) getAfter();<NEW_LINE>Objects.requireNonNull(after);<NEW_LINE>if (Objects.equals(before, after)) {<NEW_LINE>return "it no change";<NEW_LINE>}<NEW_LINE>final StringBuilder builder = new StringBuilder();<NEW_LINE>if (!Objects.equals(before.getAppName(), after.getAppName())) {<NEW_LINE>builder.append(String.format("appName[%s => %s] ", before.getAppName(), after.getAppName()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getPath(), after.getPath())) {<NEW_LINE>builder.append(String.format("path[%s => %s] ", before.getPath(), after.getPath()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getPathDesc(), after.getPathDesc())) {<NEW_LINE>builder.append(String.format("path desc[%s => %s] ", before.getPathDesc()<MASK><NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getEnabled(), after.getEnabled())) {<NEW_LINE>builder.append(String.format("enable[%s => %s] ", before.getEnabled(), after.getEnabled()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getServiceName(), after.getServiceName())) {<NEW_LINE>builder.append(String.format("service[%s => %s] ", before.getServiceName(), after.getServiceName()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getMethodName(), after.getMethodName())) {<NEW_LINE>builder.append(String.format("method[%s => %s] ", before.getMethodName(), after.getMethodName()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getParameterTypes(), after.getParameterTypes())) {<NEW_LINE>builder.append(String.format("parameter type [%s => %s] ", before.getParameterTypes(), after.getParameterTypes()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getEnabled(), after.getEnabled())) {<NEW_LINE>builder.append(String.format("enable [%s => %s] ", before.getEnabled(), after.getEnabled()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getRpcType(), after.getRpcType())) {<NEW_LINE>builder.append(String.format("rpc type [%s => %s] ", before.getRpcType(), after.getRpcType()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getRpcExt(), after.getRpcExt())) {<NEW_LINE>builder.append(String.format("rpc ext [%s => %s] ", before.getRpcExt(), after.getRpcExt()));<NEW_LINE>}<NEW_LINE>return builder.toString();<NEW_LINE>} | , after.getPathDesc())); |
1,165,511 | private void onRecipientChanged(@NonNull Recipient recipient) {<NEW_LINE>if (getContext() == null) {<NEW_LINE>Log.w(TAG, "onRecipientChanged called in detached state. Ignoring.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Log.i(TAG, "onModified(" + recipient.getId() + <MASK><NEW_LINE>titleView.setTitle(glideRequests, recipient);<NEW_LINE>titleView.setVerified(identityRecords.isVerified());<NEW_LINE>setBlockedUserState(recipient, isSecureText, isDefaultSms);<NEW_LINE>updateReminders();<NEW_LINE>updateDefaultSubscriptionId(recipient.getDefaultSubscriptionId());<NEW_LINE>updatePaymentsAvailable();<NEW_LINE>initializeSecurity(isSecureText, isDefaultSms);<NEW_LINE>if (searchViewItem == null || !searchViewItem.isActionViewExpanded()) {<NEW_LINE>invalidateOptionsMenu();<NEW_LINE>}<NEW_LINE>if (groupViewModel != null) {<NEW_LINE>groupViewModel.onRecipientChange(recipient);<NEW_LINE>}<NEW_LINE>if (mentionsViewModel != null) {<NEW_LINE>mentionsViewModel.onRecipientChange(recipient);<NEW_LINE>}<NEW_LINE>if (groupCallViewModel != null) {<NEW_LINE>groupCallViewModel.onRecipientChange(recipient);<NEW_LINE>}<NEW_LINE>if (draftViewModel != null) {<NEW_LINE>draftViewModel.onRecipientChanged(recipient);<NEW_LINE>}<NEW_LINE>if (this.threadId == -1) {<NEW_LINE>SimpleTask.run(() -> SignalDatabase.threads().getThreadIdIfExistsFor(recipient.getId()), threadId -> {<NEW_LINE>if (this.threadId != threadId) {<NEW_LINE>Log.d(TAG, "Thread id changed via recipient change");<NEW_LINE>this.threadId = threadId;<NEW_LINE>fragment.reload(recipient, this.threadId);<NEW_LINE>setVisibleThread(this.threadId);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | ") " + recipient.getRegistered()); |
1,540,958 | private void startUpdateNodes() {<NEW_LINE>Thread nodes = new Thread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>for (; ; ) {<NEW_LINE>try {<NEW_LINE>if (isDetach()) {<NEW_LINE>LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(2000));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>UshardInterface.SubscribeKvPrefixInput input = UshardInterface.SubscribeKvPrefixInput.newBuilder().setIndex(0).setDuration(60).setKeyPrefix(ClusterPathUtil.BASE_PATH).build();<NEW_LINE>stub.withDeadlineAfter(GRPC_SUBTIMEOUT, TimeUnit.SECONDS).subscribeKvPrefix(input);<NEW_LINE>firstReturnToCluster();<NEW_LINE>return;<NEW_LINE>} catch (DetachedException e) {<NEW_LINE>LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(2000));<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (isDetach()) {<NEW_LINE>LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(2000));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>LOGGER.warn("error in ucore nodes watch,try for another time", e);<NEW_LINE>Channel channel = ManagedChannelBuilder.forAddress("127.0.0.1", ClusterConfig.getInstance().getClusterPort()).<MASK><NEW_LINE>UshardSender.this.setStubIfPossible(DbleClusterGrpc.newBlockingStub(channel).withDeadlineAfter(GENERAL_GRPC_TIMEOUT, TimeUnit.SECONDS));<NEW_LINE>LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(2000));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>nodes.setName("USHARD_RECONNECT_LISTENER");<NEW_LINE>nodes.start();<NEW_LINE>} | usePlaintext(true).build(); |
616,480 | public BatchGetDevEndpointsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BatchGetDevEndpointsResult batchGetDevEndpointsResult = new BatchGetDevEndpointsResult();<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 batchGetDevEndpointsResult;<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("DevEndpoints", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchGetDevEndpointsResult.setDevEndpoints(new ListUnmarshaller<DevEndpoint>(DevEndpointJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DevEndpointsNotFound", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchGetDevEndpointsResult.setDevEndpointsNotFound(new ListUnmarshaller<String>(context.getUnmarshaller(String.class<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return batchGetDevEndpointsResult;<NEW_LINE>} | )).unmarshall(context)); |
1,829,934 | public MethodVisitor visitMethod(int flags, String name, String descriptor, String signature, String[] exceptions) {<NEW_LINE>// TODO should we special case statics (and not have them require an extra leading param)?<NEW_LINE>if (isClinitOrInit(name)) {<NEW_LINE>if (name.charAt(1) != 'c') {<NEW_LINE>// avoid <clinit><NEW_LINE>// It is a constructor<NEW_LINE>String newDescriptor = createDescriptorWithPrefixedParameter(descriptor);<NEW_LINE>// Need a modified name<NEW_LINE>name = "___init___";<NEW_LINE>interfaceWriter.visitMethod(ACC_PUBLIC_ABSTRACT, <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String newDescriptor = createDescriptorWithPrefixedParameter(descriptor);<NEW_LINE>// generic signature is erased<NEW_LINE>MethodMember method = typeDescriptor.getByDescriptor(name, descriptor);<NEW_LINE>if (MethodMember.isClash(method)) {<NEW_LINE>name = "__" + name;<NEW_LINE>}<NEW_LINE>interfaceWriter.visitMethod(ACC_PUBLIC_ABSTRACT, name, newDescriptor, null, exceptions);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | name, newDescriptor, signature, exceptions); |
79,016 | public void postConfig() {<NEW_LINE>// We use java.util.Random here because SplittableRandom doesn't have nextGaussian yet.<NEW_LINE>Random rng = new Random(seed);<NEW_LINE>if (weights.length != 4) {<NEW_LINE>throw new PropertyException("", "weights", "Must supply 4 weights, found " + weights.length);<NEW_LINE>}<NEW_LINE>if (xZeroMax <= xZeroMin) {<NEW_LINE>throw new PropertyException("", "xZeroMax", "xZeroMax must be greater than xZeroMin, found xZeroMax = " + xZeroMax + ", xZeroMin = " + xZeroMin);<NEW_LINE>}<NEW_LINE>if (xOneMax <= xOneMin) {<NEW_LINE>throw new PropertyException("", "xOneMax", "xOneMax must be greater than xOneMin, found xOneMax = " + xOneMax + ", xOneMin = " + xOneMin);<NEW_LINE>}<NEW_LINE>if (variance <= 0.0) {<NEW_LINE>throw new PropertyException(<MASK><NEW_LINE>}<NEW_LINE>List<Example<Regressor>> examples = new ArrayList<>(numSamples);<NEW_LINE>double zeroRange = xZeroMax - xZeroMin;<NEW_LINE>double oneRange = xOneMax - xOneMin;<NEW_LINE>for (int i = 0; i < numSamples; i++) {<NEW_LINE>double xZero = (rng.nextDouble() * zeroRange) + xZeroMin;<NEW_LINE>double xOne = (rng.nextDouble() * oneRange) + xOneMin;<NEW_LINE>// N(w_0*x_0 + w_1*x_1 + w_2*x_1*x_0 + w_3*x_1*x_1*x_1 + intercept,variance).<NEW_LINE>double outputValue = (weights[0] * xZero) + (weights[1] * xOne) + (weights[2] * xZero * xOne) + (weights[3] * Math.pow(xOne, 3)) + intercept;<NEW_LINE>Regressor output = new Regressor("Y", (rng.nextGaussian() * variance) + outputValue);<NEW_LINE>ArrayExample<Regressor> e = new ArrayExample<>(output, featureNames, new double[] { xZero, xOne });<NEW_LINE>examples.add(e);<NEW_LINE>}<NEW_LINE>this.examples = Collections.unmodifiableList(examples);<NEW_LINE>} | "", "variance", "Variance must be positive, found variance = " + variance); |
786,752 | private static NodeMetadata loadNodeMetadata(Settings settings, Logger logger, NodePath... nodePaths) throws IOException {<NEW_LINE>final Path[] paths = Arrays.stream(nodePaths).map(np -> np.path).toArray(Path[]::new);<NEW_LINE>NodeMetadata metadata = PersistedClusterStateService.nodeMetadata(paths);<NEW_LINE>if (metadata == null) {<NEW_LINE>// load legacy metadata<NEW_LINE>final Set<String> nodeIds = new HashSet<>();<NEW_LINE>for (final Path path : paths) {<NEW_LINE>final NodeMetadata oldStyleMetadata = NodeMetadata.FORMAT.loadLatestState(logger, NamedXContentRegistry.EMPTY, path);<NEW_LINE>if (oldStyleMetadata != null) {<NEW_LINE>nodeIds.add(oldStyleMetadata.nodeId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (nodeIds.size() > 1) {<NEW_LINE>// Technically this can never happen with our our current state because the path will always be prefixed with 'node/$nodeid'<NEW_LINE>// and therefore will be never multiple metadata files within this folder. However, i would still keep this for consistency<NEW_LINE>// reasons<NEW_LINE>throw new IllegalStateException("data paths " + Arrays.toString(paths) + " belong to multiple nodes with IDs " + nodeIds);<NEW_LINE>}<NEW_LINE>// load legacy metadata<NEW_LINE>final NodeMetadata legacyMetadata = NodeMetadata.FORMAT.loadLatestState(logger, NamedXContentRegistry.EMPTY, paths);<NEW_LINE>if (legacyMetadata == null) {<NEW_LINE>assert nodeIds.isEmpty() : nodeIds;<NEW_LINE>metadata = new NodeMetadata(generateNodeId(settings), Version.CURRENT);<NEW_LINE>} else {<NEW_LINE>assert nodeIds.equals(Collections.singleton(legacyMetadata.nodeId()<MASK><NEW_LINE>metadata = legacyMetadata;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>metadata = metadata.upgradeToCurrentVersion();<NEW_LINE>assert metadata.nodeVersion().equals(Version.CURRENT) : metadata.nodeVersion() + " != " + Version.CURRENT;<NEW_LINE>return metadata;<NEW_LINE>} | )) : nodeIds + " doesn't match " + legacyMetadata; |
1,116,863 | private void walkFile(BufferedReader reader) throws Exception {<NEW_LINE>if (reader.ready()) {<NEW_LINE><MASK><NEW_LINE>if (isNodeFirstLine(firstLine)) {<NEW_LINE>findNodeColumns(firstLine);<NEW_LINE>boolean edgesWalking = false;<NEW_LINE>while (reader.ready() && !cancel) {<NEW_LINE>String line = reader.readLine();<NEW_LINE>if (isEdgeFirstLine(line)) {<NEW_LINE>edgesWalking = true;<NEW_LINE>findEdgeColumns(line);<NEW_LINE>} else if (!edgesWalking) {<NEW_LINE>// Nodes<NEW_LINE>nodeLines.add(line);<NEW_LINE>} else {<NEW_LINE>// Edges<NEW_LINE>edgeLines.add(line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>report.logIssue(new Issue(NbBundle.getMessage(ImporterGDF.class, "importerGDF_error_dataformat1"), Issue.Level.CRITICAL));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>report.logIssue(new Issue(NbBundle.getMessage(ImporterGDF.class, "importerGDF_error_dataformat1"), Issue.Level.CRITICAL));<NEW_LINE>}<NEW_LINE>} | String firstLine = reader.readLine(); |
367,478 | public Operand buildMatch2(Variable result, Match2Node matchNode) {<NEW_LINE>Operand receiver = build(matchNode.getReceiverNode());<NEW_LINE>Operand value = build(matchNode.getValueNode());<NEW_LINE>if (result == null)<NEW_LINE>result = createTemporaryVariable();<NEW_LINE>addInstr(new MatchInstr(scope, result, receiver, value));<NEW_LINE>if (matchNode instanceof Match2CaptureNode) {<NEW_LINE>Match2CaptureNode m2c = (Match2CaptureNode) matchNode;<NEW_LINE>for (int slot : m2c.getScopeOffsets()) {<NEW_LINE>// Static scope scope offsets store both depth and offset<NEW_LINE>int depth = slot >> 16;<NEW_LINE>int offset = slot & 0xffff;<NEW_LINE>// For now, we'll continue to implicitly reference "$~"<NEW_LINE>RubySymbol var = manager.runtime.newSymbol(getVarNameFromScopeTree<MASK><NEW_LINE>addInstr(new SetCapturedVarInstr(getLocalVariable(var, depth), result, var));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | (scope, depth, offset)); |
1,324,575 | public void opExecution(SameDiff sd, At at, MultiDataSet batch, SameDiffOp op, OpContext opContext, INDArray[] outputs) {<NEW_LINE>super.opExecution(sd, at, batch, op, opContext, outputs);<NEW_LINE>if (op.getOp() instanceof Enter) {<NEW_LINE>entersExecuted.incrementCount(op.getName(), 1.0);<NEW_LINE>} else if (op.getOp() instanceof Exit) {<NEW_LINE>exitsExecuted.incrementCount(<MASK><NEW_LINE>} else if (op.getOp() instanceof NextIteration) {<NEW_LINE>nextIterationExecuted.incrementCount(op.getName(), 1.0);<NEW_LINE>} else if (op.getOp() instanceof Switch) {<NEW_LINE>switchesExecuted.incrementCount(op.getName(), 1.0);<NEW_LINE>} else if (op.getOp() instanceof Merge) {<NEW_LINE>mergesExecuted.incrementCount(op.getName(), 1.0);<NEW_LINE>} else if (op.getOp() instanceof LoopCond) {<NEW_LINE>loopCondExecuted.incrementCount(op.getName(), 1.0);<NEW_LINE>}<NEW_LINE>} | op.getName(), 1.0); |
1,368,123 | public Operand buildDXStr(Variable result, DXStrNode node) {<NEW_LINE>Node[] nodePieces = node.children();<NEW_LINE>Operand[] pieces = new Operand[nodePieces.length];<NEW_LINE>int estimatedSize = 0;<NEW_LINE>for (int i = 0; i < pieces.length; i++) {<NEW_LINE>estimatedSize += dynamicPiece(pieces, i, nodePieces[i]);<NEW_LINE>}<NEW_LINE>Variable stringResult = createTemporaryVariable();<NEW_LINE>if (result == null)<NEW_LINE>result = createTemporaryVariable();<NEW_LINE>boolean debuggingFrozenStringLiteral = manager<MASK><NEW_LINE>addInstr(new BuildCompoundStringInstr(stringResult, pieces, node.getEncoding(), estimatedSize, false, debuggingFrozenStringLiteral, getFileName(), node.getLine()));<NEW_LINE>return addResultInstr(CallInstr.create(scope, FUNCTIONAL, result, manager.getRuntime().newSymbol("`"), Self.SELF, new Operand[] { stringResult }, null));<NEW_LINE>} | .getInstanceConfig().isDebuggingFrozenStringLiteral(); |
468,663 | private Map<String, Object> toJson(Trigger trigger, ZoneId zoneId) throws SchedulerException {<NEW_LINE>Scheduler scheduler = getScheduler();<NEW_LINE>Trigger.TriggerState state = scheduler.getTriggerState(trigger.getKey());<NEW_LINE>Map<String, Object> json = new LinkedHashMap<>();<NEW_LINE>json.put("key", trigger.getKey().toString());<NEW_LINE>json.put("state", state);<NEW_LINE>json.put("priority", trigger.getPriority());<NEW_LINE>Optional.ofNullable(trigger.getCalendarName()).ifPresent(value -> json.put("calendarName", value));<NEW_LINE>Optional.ofNullable(trigger.getDescription()).ifPresent(value -> json.put("description", value));<NEW_LINE>json.put("zoneId", zoneId);<NEW_LINE>json.put("startTime", format(trigger.getStartTime(), zoneId));<NEW_LINE>json.put("endTime", format(trigger.getEndTime(), zoneId));<NEW_LINE>json.put("finalFireTime", format(trigger.getFinalFireTime(), zoneId));<NEW_LINE>json.put("nextFireTime", format(trigger<MASK><NEW_LINE>json.put("previousFireTime", format(trigger.getPreviousFireTime(), zoneId));<NEW_LINE>json.put("misfireInstruction", trigger.getMisfireInstruction());<NEW_LINE>json.put("mayFireAgain", trigger.mayFireAgain());<NEW_LINE>if (trigger instanceof CronTrigger) {<NEW_LINE>json.put("cron", ((CronTrigger) trigger).getCronExpression());<NEW_LINE>} else if (trigger instanceof SimpleTrigger) {<NEW_LINE>json.put("repeatCount", ((SimpleTrigger) trigger).getRepeatCount());<NEW_LINE>json.put("repeatInterval", ((SimpleTrigger) trigger).getRepeatInterval());<NEW_LINE>} else if (trigger instanceof CalendarIntervalTrigger) {<NEW_LINE>json.put("repeatInterval", ((CalendarIntervalTrigger) trigger).getRepeatInterval());<NEW_LINE>json.put("repeatIntervalUnit", ((CalendarIntervalTrigger) trigger).getRepeatIntervalUnit());<NEW_LINE>} else if (trigger instanceof DailyTimeIntervalTrigger) {<NEW_LINE>json.put("repeatInterval", ((DailyTimeIntervalTrigger) trigger).getRepeatInterval());<NEW_LINE>json.put("repeatIntervalUnit", ((DailyTimeIntervalTrigger) trigger).getRepeatIntervalUnit());<NEW_LINE>}<NEW_LINE>json.put("jobDataMap", trigger.getJobDataMap());<NEW_LINE>return json;<NEW_LINE>} | .getNextFireTime(), zoneId)); |
595,919 | protected static int underflowDistanceAdd(int op1, int op2) {<NEW_LINE>int result = op1 + op2;<NEW_LINE>if (op1 <= 0 && op2 <= 0) {<NEW_LINE>if (op1 == Integer.MIN_VALUE && op2 == Integer.MIN_VALUE) {<NEW_LINE>return Integer.MIN_VALUE;<NEW_LINE>} else {<NEW_LINE>// result has to be < 0 for overflow<NEW_LINE>return result > 0 ? -result : HALFWAY - scaleTo(Math.abs((long) result), HALFWAY) + 1;<NEW_LINE>}<NEW_LINE>} else if (op1 > 0 && op2 > 0) {<NEW_LINE>// if both are positive then both need to be decreased<NEW_LINE>return HALFWAY + scaleTo(Math.abs((long) op1) + Math.abs((long) op2), HALFWAY);<NEW_LINE>} else if (op1 >= 0 && op2 < 0) {<NEW_LINE>return HALFWAY + scaleTo(Math.abs(op1), HALFWAY);<NEW_LINE>} else if (op1 < 0 && op2 >= 0) {<NEW_LINE>return HALFWAY + scaleTo(Math<MASK><NEW_LINE>} else {<NEW_LINE>// Unreachable<NEW_LINE>return Integer.MAX_VALUE;<NEW_LINE>}<NEW_LINE>} | .abs(op2), HALFWAY); |
1,181,827 | public static void main(String[] args) throws FileNotFoundException, IOException {<NEW_LINE>// Process the command-line options<NEW_LINE>CommandOption.setSummary(Vectors2Info.class, "A tool for printing information about instance lists of feature vectors.");<NEW_LINE>CommandOption.process(Vectors2Info.class, args);<NEW_LINE>// Print some helpful messages for error cases<NEW_LINE>if (args.length == 0) {<NEW_LINE>CommandOption.getList(Vectors2Info.class).printUsage(false);<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>if (false && !inputFile.wasInvoked()) {<NEW_LINE>System.err.println("You must specify an input instance list, with --input.");<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>// Read the InstanceList<NEW_LINE>InstanceList instances = InstanceList.load(inputFile.value);<NEW_LINE>if (printLabels.value) {<NEW_LINE>Alphabet labelAlphabet = instances.getTargetAlphabet();<NEW_LINE>for (int i = 0; i < labelAlphabet.size(); i++) {<NEW_LINE>System.out.println(labelAlphabet.lookupObject(i));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (printInstances.value) {<NEW_LINE>for (Instance instance : instances) {<NEW_LINE>System.out.println(instance.getName() + "\t" + instance.getTarget() + "\t" + instance.getData());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (printFeatureCounts.value) {<NEW_LINE>FeatureCountTool counter = new FeatureCountTool(instances);<NEW_LINE>counter.count();<NEW_LINE>counter.printCounts();<NEW_LINE>}<NEW_LINE>if (printFeatures.value) {<NEW_LINE>Alphabet alphabet = instances.getDataAlphabet();<NEW_LINE>for (int i = 0; i < alphabet.size(); i++) {<NEW_LINE>System.out.println(alphabet.lookupObject(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (printInfogain.value > 0) {<NEW_LINE>InfoGain ig = new InfoGain(instances);<NEW_LINE>for (int i = 0; i < printInfogain.value; i++) {<NEW_LINE>System.out.println("" + i + " " + ig.getObjectAtRank(i));<NEW_LINE>}<NEW_LINE>System.out.print("\n");<NEW_LINE>}<NEW_LINE>if (printMatrix.wasInvoked()) {<NEW_LINE>printInstanceList(instances, printMatrix.value);<NEW_LINE>}<NEW_LINE>} | System.out.print("\n"); |
897,111 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>logDebug("onCreateView");<NEW_LINE>View v = inflater.inflate(R.layout.fragment_clouddriveprovider, container, false);<NEW_LINE>Display display = getActivity().getWindowManager().getDefaultDisplay();<NEW_LINE>DisplayMetrics metrics = new DisplayMetrics();<NEW_LINE>display.getMetrics(metrics);<NEW_LINE>listView = (RecyclerView) v.findViewById(R.id.provider_list_view_browser);<NEW_LINE>listView.<MASK><NEW_LINE>mLayoutManager = new LinearLayoutManager(context);<NEW_LINE>listView.setLayoutManager(mLayoutManager);<NEW_LINE>listView.setItemAnimator(noChangeRecyclerViewItemAnimator());<NEW_LINE>listView.addOnScrollListener(new RecyclerView.OnScrollListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {<NEW_LINE>super.onScrolled(recyclerView, dx, dy);<NEW_LINE>checkScroll();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>emptyImageView = (ImageView) v.findViewById(R.id.provider_list_empty_image);<NEW_LINE>emptyTextViewFirst = (TextView) v.findViewById(R.id.provider_list_empty_text_first);<NEW_LINE>if (context instanceof FileProviderActivity) {<NEW_LINE>parentHandle = ((FileProviderActivity) context).getIncParentHandle();<NEW_LINE>deepBrowserTree = ((FileProviderActivity) context).getIncomingDeepBrowserTree();<NEW_LINE>logDebug("The parent handle is: " + parentHandle);<NEW_LINE>logDebug("The browser tree deep is: " + deepBrowserTree);<NEW_LINE>}<NEW_LINE>if (adapter == null) {<NEW_LINE>adapter = new MegaProviderAdapter(context, this, nodes, parentHandle, listView, emptyImageView, INCOMING_SHARES_PROVIDER_ADAPTER);<NEW_LINE>}<NEW_LINE>listView.setAdapter(adapter);<NEW_LINE>if (parentHandle == -1) {<NEW_LINE>findNodes();<NEW_LINE>setNodes(nodes);<NEW_LINE>adapter.setParentHandle(-1);<NEW_LINE>} else {<NEW_LINE>adapter.setParentHandle(parentHandle);<NEW_LINE>MegaNode parentNode = megaApi.getNodeByHandle(parentHandle);<NEW_LINE>if (parentNode != null) {<NEW_LINE>nodes = megaApi.getChildren(parentNode);<NEW_LINE>setNodes(nodes);<NEW_LINE>logDebug("INCOMING is in: " + parentNode.getName());<NEW_LINE>changeActionBarTitle(parentNode.getName());<NEW_LINE>} else {<NEW_LINE>logWarning("ERROR parentNode is NULL");<NEW_LINE>findNodes();<NEW_LINE>setNodes(nodes);<NEW_LINE>parentHandle = -1;<NEW_LINE>adapter.setParentHandle(-1);<NEW_LINE>changeActionBarTitle(getString(R.string.file_provider_title).toUpperCase());<NEW_LINE>if (context instanceof FileProviderActivity) {<NEW_LINE>((FileProviderActivity) context).setParentHandle(parentHandle);<NEW_LINE>logDebug("PArentHandle change to: " + parentHandle);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>adapter.setPositionClicked(-1);<NEW_LINE>return v;<NEW_LINE>} | addItemDecoration(new SimpleDividerItemDecoration(context)); |
385,968 | public void syncApiCase(LoadTestWithBLOBs loadTest, List<ApiLoadTest> apiLoadTests) {<NEW_LINE>List<String> caseIds = apiLoadTests.stream().filter(i -> i.getType().equals(ApiLoadType.API_CASE.name())).map(ApiLoadTest::getApiId).collect(Collectors.toList());<NEW_LINE>if (!CollectionUtils.isEmpty(caseIds)) {<NEW_LINE>ApiScenarioBatchRequest scenarioRequest = new ApiScenarioBatchRequest();<NEW_LINE>scenarioRequest.setIds(caseIds);<NEW_LINE>List<JmxInfoDTO> jmxInfoDTOS = apiTestCaseService.exportJmx(caseIds, apiLoadTests.get<MASK><NEW_LINE>deleteLoadTestFiles(loadTest.getId());<NEW_LINE>jmxInfoDTOS.forEach(item -> {<NEW_LINE>apiPerformanceService.UpdateVersion(loadTest.getId(), item.getId(), item.getVersion());<NEW_LINE>saveJmxFile(item.getXml(), item.getName(), loadTest.getProjectId(), loadTest.getId());<NEW_LINE>saveBodyFile(item.getFileMetadataList(), loadTest.getId(), item.getId());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | (0).getEnvId()); |
1,380,695 | public static GetTopicStatusResponse unmarshall(GetTopicStatusResponse getTopicStatusResponse, UnmarshallerContext _ctx) {<NEW_LINE>getTopicStatusResponse.setRequestId(_ctx.stringValue("GetTopicStatusResponse.RequestId"));<NEW_LINE>getTopicStatusResponse.setSuccess(_ctx.booleanValue("GetTopicStatusResponse.Success"));<NEW_LINE>getTopicStatusResponse.setCode(_ctx.integerValue("GetTopicStatusResponse.Code"));<NEW_LINE>getTopicStatusResponse.setMessage(_ctx.stringValue("GetTopicStatusResponse.Message"));<NEW_LINE>TopicStatus topicStatus = new TopicStatus();<NEW_LINE>topicStatus.setTotalCount(_ctx.longValue("GetTopicStatusResponse.TopicStatus.TotalCount"));<NEW_LINE>topicStatus.setLastTimeStamp(_ctx.longValue("GetTopicStatusResponse.TopicStatus.LastTimeStamp"));<NEW_LINE>List<OffsetTableItem> offsetTable <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetTopicStatusResponse.TopicStatus.OffsetTable.Length"); i++) {<NEW_LINE>OffsetTableItem offsetTableItem = new OffsetTableItem();<NEW_LINE>offsetTableItem.setMinOffset(_ctx.longValue("GetTopicStatusResponse.TopicStatus.OffsetTable[" + i + "].MinOffset"));<NEW_LINE>offsetTableItem.setMaxOffset(_ctx.longValue("GetTopicStatusResponse.TopicStatus.OffsetTable[" + i + "].MaxOffset"));<NEW_LINE>offsetTableItem.setLastUpdateTimestamp(_ctx.longValue("GetTopicStatusResponse.TopicStatus.OffsetTable[" + i + "].LastUpdateTimestamp"));<NEW_LINE>offsetTableItem.setTopic(_ctx.stringValue("GetTopicStatusResponse.TopicStatus.OffsetTable[" + i + "].Topic"));<NEW_LINE>offsetTableItem.setPartition(_ctx.integerValue("GetTopicStatusResponse.TopicStatus.OffsetTable[" + i + "].Partition"));<NEW_LINE>offsetTable.add(offsetTableItem);<NEW_LINE>}<NEW_LINE>topicStatus.setOffsetTable(offsetTable);<NEW_LINE>getTopicStatusResponse.setTopicStatus(topicStatus);<NEW_LINE>return getTopicStatusResponse;<NEW_LINE>} | = new ArrayList<OffsetTableItem>(); |
322,576 | public void start() throws Exception {<NEW_LINE>MqttClientOptions options = new MqttClientOptions().setKeepAliveInterval(2);<NEW_LINE>MqttClient client = MqttClient.create(Vertx.vertx(), options);<NEW_LINE>// handler will be called when we have a message in topic we subscribing for<NEW_LINE>client.publishHandler(publish -> {<NEW_LINE>System.out.println("Just received message on [" + publish.topicName() + "] payload [" + publish.payload().toString(Charset.defaultCharset()) + "] with QoS [" + <MASK><NEW_LINE>});<NEW_LINE>// handle response on subscribe request<NEW_LINE>client.subscribeCompletionHandler(h -> {<NEW_LINE>System.out.println("Receive SUBACK from server with granted QoS : " + h.grantedQoSLevels());<NEW_LINE>// let's publish a message to the subscribed topic<NEW_LINE>client.publish(MQTT_TOPIC, Buffer.buffer(MQTT_MESSAGE), MqttQoS.AT_MOST_ONCE, false, false, s -> System.out.println("Publish sent to a server"));<NEW_LINE>// unsubscribe from receiving messages for earlier subscribed topic<NEW_LINE>vertx.setTimer(5000, l -> client.unsubscribe(MQTT_TOPIC));<NEW_LINE>});<NEW_LINE>// handle response on unsubscribe request<NEW_LINE>client.unsubscribeCompletionHandler(h -> {<NEW_LINE>System.out.println("Receive UNSUBACK from server");<NEW_LINE>vertx.setTimer(5000, l -> client.disconnect(d -> System.out.println("Disconnected form server")));<NEW_LINE>});<NEW_LINE>// connect to a server<NEW_LINE>client.connect(BROKER_PORT, BROKER_HOST, ch -> {<NEW_LINE>if (ch.succeeded()) {<NEW_LINE>System.out.println("Connected to a server");<NEW_LINE>client.subscribe(MQTT_TOPIC, 0);<NEW_LINE>} else {<NEW_LINE>System.out.println("Failed to connect to a server");<NEW_LINE>System.out.println(ch.cause());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | publish.qosLevel() + "]"); |
24,184 | public Builder fromSeed(DeterministicSeed seed, Script.ScriptType outputScriptType) {<NEW_LINE>if (outputScriptType == Script.ScriptType.P2PKH) {<NEW_LINE>DeterministicKeyChain chain = DeterministicKeyChain.builder().seed(seed).outputScriptType(Script.ScriptType.P2PKH).accountPath(structure.accountPathFor(Script.ScriptType.P2PKH)).build();<NEW_LINE>this.chains.clear();<NEW_LINE>this.chains.add(chain);<NEW_LINE>} else if (outputScriptType == Script.ScriptType.P2WPKH) {<NEW_LINE>DeterministicKeyChain fallbackChain = DeterministicKeyChain.builder().seed(seed).outputScriptType(Script.ScriptType.P2PKH).accountPath(structure.accountPathFor(Script.ScriptType.P2PKH)).build();<NEW_LINE>DeterministicKeyChain defaultChain = DeterministicKeyChain.builder().seed(seed).outputScriptType(Script.ScriptType.P2WPKH).accountPath(structure.accountPathFor(Script.ScriptType.P2WPKH)).build();<NEW_LINE>this.chains.clear();<NEW_LINE>this.chains.add(fallbackChain);<NEW_LINE>this.chains.add(defaultChain);<NEW_LINE>} else {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | IllegalArgumentException(outputScriptType.toString()); |
132,981 | static void encodePrivateKey(byte[] privateKey, final long[] secretPolynomial, final long[] errorPolynomial, final byte[] seed, int seedOffset, byte[] publicKey) {<NEW_LINE>int i, k = 0;<NEW_LINE>int skPtr = 0;<NEW_LINE>for (i = 0; i < PARAM_N; i++) {<NEW_LINE>privateKey[skPtr + i] = (byte) secretPolynomial[i];<NEW_LINE>}<NEW_LINE>skPtr += PARAM_N;<NEW_LINE>for (k = 0; k < PARAM_K; k++) {<NEW_LINE>for (i = 0; i < PARAM_N; i++) {<NEW_LINE>privateKey[skPtr + (k * PARAM_N + i)] = (byte) errorPolynomial[k * PARAM_N + i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>skPtr += PARAM_K * PARAM_N;<NEW_LINE>System.arraycopy(seed, seedOffset, <MASK><NEW_LINE>skPtr += CRYPTO_SEEDBYTES * 2; | privateKey, skPtr, CRYPTO_SEEDBYTES * 2); |
1,813,492 | public Request<CreateServiceLinkedRoleRequest> marshall(CreateServiceLinkedRoleRequest createServiceLinkedRoleRequest) {<NEW_LINE>if (createServiceLinkedRoleRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<CreateServiceLinkedRoleRequest> request = new DefaultRequest<CreateServiceLinkedRoleRequest>(createServiceLinkedRoleRequest, "AmazonIdentityManagement");<NEW_LINE>request.addParameter("Action", "CreateServiceLinkedRole");<NEW_LINE>request.addParameter("Version", "2010-05-08");<NEW_LINE><MASK><NEW_LINE>if (createServiceLinkedRoleRequest.getAWSServiceName() != null) {<NEW_LINE>request.addParameter("AWSServiceName", StringUtils.fromString(createServiceLinkedRoleRequest.getAWSServiceName()));<NEW_LINE>}<NEW_LINE>if (createServiceLinkedRoleRequest.getDescription() != null) {<NEW_LINE>request.addParameter("Description", StringUtils.fromString(createServiceLinkedRoleRequest.getDescription()));<NEW_LINE>}<NEW_LINE>if (createServiceLinkedRoleRequest.getCustomSuffix() != null) {<NEW_LINE>request.addParameter("CustomSuffix", StringUtils.fromString(createServiceLinkedRoleRequest.getCustomSuffix()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.setHttpMethod(HttpMethodName.POST); |
695,083 | public static void init(List<String> packages) {<NEW_LINE>if (_init) {<NEW_LINE>LOGGER.info("TableConfigTunerRegistry already initialized, skipping.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>List<URL> urls = new ArrayList<>();<NEW_LINE>for (String pack : packages) {<NEW_LINE>urls.addAll(ClasspathHelper.forPackage(pack));<NEW_LINE>}<NEW_LINE>Reflections reflections = new Reflections(new ConfigurationBuilder().setUrls(urls).filterInputsBy(new FilterBuilder.Include(".*\\.tuner\\..*")).setScanners(new ResourcesScanner(), new TypeAnnotationsScanner(), new SubTypesScanner()));<NEW_LINE>Set<Class<?>> classes = reflections.getTypesAnnotatedWith(Tuner.class);<NEW_LINE>classes.forEach(tunerClass -> {<NEW_LINE>Tuner tunerAnnotation = tunerClass.getAnnotation(Tuner.class);<NEW_LINE>if (tunerAnnotation.enabled()) {<NEW_LINE>if (tunerAnnotation.name().isEmpty()) {<NEW_LINE>LOGGER.error("Cannot register an unnamed config tuner for annotation {} ", tunerAnnotation);<NEW_LINE>} else {<NEW_LINE>String tunerName = tunerAnnotation.name();<NEW_LINE>TableConfigTuner tuner;<NEW_LINE>try {<NEW_LINE>tuner = (TableConfigTuner) tunerClass.newInstance();<NEW_LINE>CONFIG_TUNER_MAP.putIfAbsent(tunerName, tuner);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error(String.format<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>_init = true;<NEW_LINE>LOGGER.info("Initialized TableConfigTunerRegistry with {} tuners: {} in {} ms", CONFIG_TUNER_MAP.size(), CONFIG_TUNER_MAP.keySet(), (System.currentTimeMillis() - startTime));<NEW_LINE>} | ("Unable to register tuner %s . Cannot instantiate.", tunerName), e); |
533,439 | final DescribeStorageResult executeDescribeStorage(DescribeStorageRequest describeStorageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeStorageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeStorageRequest> request = null;<NEW_LINE>Response<DescribeStorageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeStorageRequestMarshaller().marshall(super.beforeMarshalling(describeStorageRequest));<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, "Redshift");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeStorageResult> responseHandler = new StaxResponseHandler<DescribeStorageResult>(new DescribeStorageResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeStorage"); |
614,917 | private void tryDecode(ChannelHandlerContext ctx, ByteBuf buf) throws Exception {<NEW_LINE>if (!ctx.channel().isActive() || !buf.isReadable()) {<NEW_LINE>buf.release();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int originalReaderIndex = buf.readerIndex();<NEW_LINE>int packetId = ProtocolUtils.readVarInt(buf);<NEW_LINE>MinecraftPacket packet = this.registry.createPacket(packetId);<NEW_LINE>if (packet == null) {<NEW_LINE>buf.readerIndex(originalReaderIndex);<NEW_LINE>ctx.fireChannelRead(buf);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>doLengthSanityChecks(buf, packet);<NEW_LINE>try {<NEW_LINE>packet.decode(buf, direction, registry.version);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw <MASK><NEW_LINE>}<NEW_LINE>if (buf.isReadable()) {<NEW_LINE>throw handleOverflow(packet, buf.readerIndex(), buf.writerIndex());<NEW_LINE>}<NEW_LINE>ctx.fireChannelRead(packet);<NEW_LINE>} finally {<NEW_LINE>buf.release();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | handleDecodeFailure(e, packet, packetId); |
785,969 | private static Vector apply(LongDoubleVector v1, Unary op) {<NEW_LINE>LongDoubleVector res;<NEW_LINE>if (op.isOrigin() || v1.isDense()) {<NEW_LINE>if (!op.isInplace()) {<NEW_LINE>res = v1.copy();<NEW_LINE>} else {<NEW_LINE>res = v1;<NEW_LINE>}<NEW_LINE>if (v1.isDense()) {<NEW_LINE>double[] values = res.getStorage().getValues();<NEW_LINE>for (int i = 0; i < values.length; i++) {<NEW_LINE>values[i] = op.apply(values[i]);<NEW_LINE>}<NEW_LINE>} else if (v1.isSparse()) {<NEW_LINE>ObjectIterator<Long2DoubleMap.Entry> iter = res.getStorage().entryIterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Long2DoubleMap.Entry entry = iter.next();<NEW_LINE>entry.setValue(op.apply(entry.getDoubleValue()));<NEW_LINE>}<NEW_LINE>} else if (v1.isSorted()) {<NEW_LINE>double[] values = res.getStorage().getValues();<NEW_LINE>for (int i = 0; i < v1.size(); i++) {<NEW_LINE>values[i] = op<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new AngelException("The operation is not support!");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new AngelException("The operation is not supported!");<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | .apply(values[i]); |
1,588,680 | public void onCharacteristicChanged(final BluetoothGatt gatt, final BluetoothGattCharacteristic characteristic) {<NEW_LINE>final int responseType = characteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_UINT8, 0);<NEW_LINE>switch(responseType) {<NEW_LINE>case OP_CODE_PACKET_RECEIPT_NOTIF_KEY:<NEW_LINE>mProgressInfo.setBytesReceived(characteristic.getIntValue<MASK><NEW_LINE>handlePacketReceiptNotification(gatt, characteristic);<NEW_LINE>break;<NEW_LINE>case OP_CODE_RESPONSE_CODE_KEY:<NEW_LINE>default:<NEW_LINE>if (mRemoteErrorOccurred)<NEW_LINE>break;<NEW_LINE>final int status = characteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_UINT8, 2);<NEW_LINE>if (status != DFU_STATUS_SUCCESS)<NEW_LINE>mRemoteErrorOccurred = true;<NEW_LINE>handleNotification(gatt, characteristic);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>notifyLock();<NEW_LINE>} | (BluetoothGattCharacteristic.FORMAT_UINT32, 1)); |
1,152,678 | final CreateLocationS3Result executeCreateLocationS3(CreateLocationS3Request createLocationS3Request) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createLocationS3Request);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateLocationS3Request> request = null;<NEW_LINE>Response<CreateLocationS3Result> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateLocationS3RequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createLocationS3Request));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLocationS3");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateLocationS3Result>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateLocationS3ResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
594,477 | public static void registerPercentileRanksAggregator(ValuesSourceRegistry.Builder builder) {<NEW_LINE>builder.register(PercentileRanksAggregationBuilder.REGISTRY_KEY, AnalyticsValuesSourceType.HISTOGRAM, (name, valuesSource, context, parent, percents, percentilesConfig, keyed, formatter, metadata) -> {<NEW_LINE>if (percentilesConfig.getMethod().equals(PercentilesMethod.TDIGEST)) {<NEW_LINE>double compression = ((PercentilesConfig.TDigest) percentilesConfig).getCompression();<NEW_LINE>return new HistoBackedTDigestPercentileRanksAggregator(name, valuesSource, context, parent, percents, compression, keyed, formatter, metadata);<NEW_LINE>} else if (percentilesConfig.getMethod().equals(PercentilesMethod.HDR)) {<NEW_LINE>int numSigFig = ((PercentilesConfig.Hdr) percentilesConfig).getNumberOfSignificantValueDigits();<NEW_LINE>return new HistoBackedHDRPercentileRanksAggregator(name, valuesSource, context, parent, percents, <MASK><NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("Percentiles algorithm: [" + percentilesConfig.getMethod().toString() + "] " + "is not compatible with Histogram field");<NEW_LINE>}, true);<NEW_LINE>} | numSigFig, keyed, formatter, metadata); |
1,571,815 | public boolean isValidForSlot(Slot s, ItemStack is) {<NEW_LINE>final ItemStack top = getHost().getInternalInventory().getStackInSlot(0);<NEW_LINE>final ItemStack bot = getHost().getInternalInventory().getStackInSlot(1);<NEW_LINE>if (s == this.middle) {<NEW_LINE>ItemDefinition<?> press = AEItems.NAME_PRESS;<NEW_LINE>if (press.isSameAs(top) || press.isSameAs(bot)) {<NEW_LINE>return !press.isSameAs(is);<NEW_LINE>}<NEW_LINE>return InscriberRecipes.findRecipe(getHost().getLevel(), is, top, bot, false) != null;<NEW_LINE>} else if (s == this.top && !bot.isEmpty() || s == this.bottom && !top.isEmpty()) {<NEW_LINE>ItemStack otherSlot;<NEW_LINE>if (s == this.top) {<NEW_LINE>otherSlot = this.bottom.getItem();<NEW_LINE>} else {<NEW_LINE>otherSlot = this.top.getItem();<NEW_LINE>}<NEW_LINE>// name presses<NEW_LINE>ItemDefinition<MASK><NEW_LINE>if (namePress.isSameAs(otherSlot)) {<NEW_LINE>return namePress.isSameAs(is);<NEW_LINE>}<NEW_LINE>// everything else<NEW_LINE>// test for a partial recipe match (ignoring the middle slot)<NEW_LINE>return InscriberRecipes.isValidOptionalIngredientCombination(getHost().getLevel(), is, otherSlot);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | <?> namePress = AEItems.NAME_PRESS; |
168,562 | public void marshall(LicenseConfiguration licenseConfiguration, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (licenseConfiguration == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getLicenseConfigurationId(), LICENSECONFIGURATIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getLicenseConfigurationArn(), LICENSECONFIGURATIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getLicenseCountingType(), LICENSECOUNTINGTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getLicenseRules(), LICENSERULES_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getLicenseCount(), LICENSECOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getLicenseCountHardLimit(), LICENSECOUNTHARDLIMIT_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getDisassociateWhenNotFound(), DISASSOCIATEWHENNOTFOUND_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getConsumedLicenses(), CONSUMEDLICENSES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getOwnerAccountId(), OWNERACCOUNTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getConsumedLicenseSummaryList(), CONSUMEDLICENSESUMMARYLIST_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getManagedResourceSummaryList(), MANAGEDRESOURCESUMMARYLIST_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getProductInformationList(), PRODUCTINFORMATIONLIST_BINDING);<NEW_LINE>protocolMarshaller.marshall(licenseConfiguration.getAutomatedDiscoveryInformation(), AUTOMATEDDISCOVERYINFORMATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | licenseConfiguration.getStatus(), STATUS_BINDING); |
1,262,670 | /*<NEW_LINE>* Retrieve the address of the heap on the device<NEW_LINE>*/<NEW_LINE>public TaskMetaData compileLookupBufferKernel() {<NEW_LINE>TaskMetaData meta = new TaskMetaData(scheduleMeta, OCLCodeCache.LOOKUP_BUFFER_KERNEL_NAME);<NEW_LINE>meta.setDevice(deviceContext.asMapping());<NEW_LINE>OCLCodeCache codeCache = deviceContext.getCodeCache();<NEW_LINE>int[] deviceInfo = getDriverAndDevice();<NEW_LINE>String deviceFullName = getDriverAndDevice(meta, deviceInfo);<NEW_LINE>if (deviceContext.isCached("internal", OCLCodeCache.LOOKUP_BUFFER_KERNEL_NAME)) {<NEW_LINE>// Option 1) Getting the lookupBufferAddress from the cache<NEW_LINE>lookupCode = deviceContext.getInstalledCode("internal", OCLCodeCache.LOOKUP_BUFFER_KERNEL_NAME);<NEW_LINE>if (lookupCode != null) {<NEW_LINE>lookupCodeAvailable = true;<NEW_LINE>}<NEW_LINE>} else if (codeCache.isLoadBinaryOptionEnabled() && codeCache.getOpenCLBinary(deviceFullName) != null) {<NEW_LINE>// Option 2) Loading pre-compiled lookupBufferAddress kernel FPGA<NEW_LINE>Path lookupPath = Paths.get(codeCache.getOpenCLBinary(deviceFullName));<NEW_LINE>lookupCode = codeCache.installEntryPointForBinaryForFPGAs(meta.getId(), lookupPath, OCLCodeCache.LOOKUP_BUFFER_KERNEL_NAME);<NEW_LINE>if (lookupCode != null) {<NEW_LINE>lookupCodeAvailable = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Option 3) JIT Compilation of the lookupBufferAddress kernel<NEW_LINE>// Avoid JIT compilation for FPGAs due to unsupported feature<NEW_LINE>ResolvedJavaMethod resolveMethod = getTornadoRuntime().resolveMethod(getLookupMethod());<NEW_LINE>OCLProviders providers = (OCLProviders) getProviders();<NEW_LINE>OCLCompilationResult result = OCLCompiler.compileCodeForDevice(resolveMethod, null, meta, providers, this);<NEW_LINE>if (VIRTUAL_DEVICE_ENABLED) {<NEW_LINE>RuntimeUtilities.maybePrintSource(result.getTargetCode());<NEW_LINE>}<NEW_LINE>boolean isCompilationForFPGAs = isJITCompilationForFPGAs(deviceFullName);<NEW_LINE>if (isDeviceAnFPGAAccelerator(deviceContext)) {<NEW_LINE>lookupCode = deviceContext.installCode(result.getId(), result.getName(), result.getTargetCode(), false);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (deviceContext.isKernelAvailable() && !isCompilationForFPGAs) {<NEW_LINE>lookupCodeAvailable = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return meta;<NEW_LINE>} | lookupCode = deviceContext.installCode(result); |
1,595,211 | protected void configure() {<NEW_LINE>bind(CronPredictor.class).to(CronPredictorImpl.class);<NEW_LINE>bind(CronPredictorImpl.class).in(Singleton.class);<NEW_LINE>bind(CronJobManager.class).to(CronJobManagerImpl.class);<NEW_LINE>bind(CronJobManagerImpl.class).in(Singleton.class);<NEW_LINE>bind(CronScheduler.class).to(CronSchedulerImpl.class);<NEW_LINE>bind(CronSchedulerImpl.class).in(Singleton.class);<NEW_LINE>bind(AuroraCronJobFactory.class).in(Singleton.class);<NEW_LINE>bind(AuroraCronJob.class).in(Singleton.class);<NEW_LINE>bind(AuroraCronJob.Config.class).toInstance(new AuroraCronJob.Config(new BackoffHelper(options.cronStartInitialBackoff, options.cronStartMaxBackoff)));<NEW_LINE>PubsubEventModule.bindSubscriber(<MASK><NEW_LINE>bind(CronLifecycle.class).in(Singleton.class);<NEW_LINE>addSchedulerActiveServiceBinding(binder()).to(CronLifecycle.class);<NEW_LINE>bind(new TypeLiteral<Integer>() {<NEW_LINE>}).annotatedWith(AuroraCronJob.CronMaxBatchSize.class).toInstance(options.cronMaxBatchSize);<NEW_LINE>bind(CronBatchWorker.class).in(Singleton.class);<NEW_LINE>addSchedulerActiveServiceBinding(binder()).to(CronBatchWorker.class);<NEW_LINE>} | binder(), AuroraCronJob.class); |
1,454,556 | public void collect(JRCrosstab crosstab) {<NEW_LINE>collectElement(crosstab);<NEW_LINE>createCrosstabId(crosstab);<NEW_LINE>JRCrosstabDataset dataset = crosstab.getDataset();<NEW_LINE>collect(dataset);<NEW_LINE>JRExpressionCollector datasetCollector = getCollector(dataset);<NEW_LINE>JRExpressionCollector crosstabCollector = getCollector(crosstab);<NEW_LINE>crosstabCollector.collect(report.getDefaultStyle());<NEW_LINE>addExpression(crosstab.getParametersMapExpression());<NEW_LINE>JRCrosstabParameter[] parameters = crosstab.getParameters();<NEW_LINE>if (parameters != null) {<NEW_LINE>for (int i = 0; i < parameters.length; i++) {<NEW_LINE>addExpression(parameters[i].getExpression());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (crosstab.getTitleCell() != null) {<NEW_LINE>crosstabCollector.collect(crosstab.getTitleCell().getCellContents());<NEW_LINE>}<NEW_LINE>crosstabCollector.collect(crosstab.getHeaderCell());<NEW_LINE>JRCrosstabRowGroup[] rowGroups = crosstab.getRowGroups();<NEW_LINE>if (rowGroups != null) {<NEW_LINE>for (int i = 0; i < rowGroups.length; i++) {<NEW_LINE>JRCrosstabRowGroup rowGroup = rowGroups[i];<NEW_LINE>JRCrosstabBucket bucket = rowGroup.getBucket();<NEW_LINE>datasetCollector.addExpression(bucket.getExpression());<NEW_LINE>crosstabCollector.pushContextObject(rowGroup);<NEW_LINE>// order by expression is in the crosstab context<NEW_LINE>crosstabCollector.addExpression(bucket.getOrderByExpression());<NEW_LINE>addExpression(bucket.getComparatorExpression());<NEW_LINE>crosstabCollector.collect(rowGroup.getHeader());<NEW_LINE>crosstabCollector.collect(rowGroup.getTotalHeader());<NEW_LINE>crosstabCollector.popContextObject();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JRCrosstabColumnGroup[] colGroups = crosstab.getColumnGroups();<NEW_LINE>if (colGroups != null) {<NEW_LINE>for (int i = 0; i < colGroups.length; i++) {<NEW_LINE>JRCrosstabColumnGroup columnGroup = colGroups[i];<NEW_LINE>JRCrosstabBucket bucket = columnGroup.getBucket();<NEW_LINE>datasetCollector.addExpression(bucket.getExpression());<NEW_LINE>crosstabCollector.pushContextObject(columnGroup);<NEW_LINE>// order by expression is in the crosstab context<NEW_LINE>crosstabCollector.addExpression(bucket.getOrderByExpression());<NEW_LINE><MASK><NEW_LINE>crosstabCollector.collect(columnGroup.getCrosstabHeader());<NEW_LINE>crosstabCollector.collect(columnGroup.getHeader());<NEW_LINE>crosstabCollector.collect(columnGroup.getTotalHeader());<NEW_LINE>crosstabCollector.popContextObject();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JRCrosstabMeasure[] measures = crosstab.getMeasures();<NEW_LINE>if (measures != null) {<NEW_LINE>for (int i = 0; i < measures.length; i++) {<NEW_LINE>datasetCollector.addExpression(measures[i].getValueExpression());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>crosstabCollector.collect(crosstab.getWhenNoDataCell());<NEW_LINE>collectCrosstabCells(crosstab, crosstabCollector);<NEW_LINE>} | addExpression(bucket.getComparatorExpression()); |
1,785,881 | public void write(org.apache.thrift.protocol.TProtocol prot, revokeTablePermission_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetPrincipal()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetTableName()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetPermission()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 5);<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>struct.tinfo.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>struct.credentials.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetPrincipal()) {<NEW_LINE>oprot.writeString(struct.principal);<NEW_LINE>}<NEW_LINE>if (struct.isSetTableName()) {<NEW_LINE>oprot.writeString(struct.tableName);<NEW_LINE>}<NEW_LINE>if (struct.isSetPermission()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | oprot.writeByte(struct.permission); |
1,737,327 | public void run(ApplicationArguments applicationArguments) throws Exception {<NEW_LINE>String[] templates = { "Up and running with %s", "%s Basics", "%s for Beginners", "%s for Neckbeards", "Under the hood: %s", "Discovering %s", "A short guide to %s", "%s with Baeldung" };<NEW_LINE>String[] buzzWords = { "Spring REST Data", "Java 9", "Scala", "Groovy", "Hibernate", "Spring HATEOS", "The HAL Browser", "Spring webflux" };<NEW_LINE>String[] authorFirstName = { "John %s", "Steve %s", "Samantha %s", "Gale %s", "Tom %s" };<NEW_LINE>String[] authorLastName = { "Giles", "Gill", "Smith", "Armstrong" };<NEW_LINE>String[] blurbs = { "It was getting dark when the %s %s", "Scott was nearly there when he heard that a %s %s", "Diana was a lovable Java coder until the %s %s", "The gripping story of a small %s and the day it %s" };<NEW_LINE>String[] blublMiddles = { "distaster", "dog", "cat", "turtle", "hurricane" };<NEW_LINE>String[] end = { "hit the school", "memorised pi to 100 decimal places!", "became a world champion armwrestler", "became a Java REST master!!" };<NEW_LINE>Random random = new Random();<NEW_LINE>IntStream.range(0, 100).forEach(i -> {<NEW_LINE>String template = templates[i % templates.length];<NEW_LINE>String buzzword = buzzWords[i % buzzWords.length];<NEW_LINE>String blurbStart = <MASK><NEW_LINE>String middle = blublMiddles[i % blublMiddles.length];<NEW_LINE>String ending = end[i % end.length];<NEW_LINE>String blurb = String.format(blurbStart, middle, ending);<NEW_LINE>String firstName = authorFirstName[i % authorFirstName.length];<NEW_LINE>String lastname = authorLastName[i % authorLastName.length];<NEW_LINE>Book book = new Book(String.format(template, buzzword), String.format(firstName, lastname), blurb, random.nextInt(1000 - 200) + 200);<NEW_LINE>bookRepository.save(book);<NEW_LINE>System.out.println(book);<NEW_LINE>});<NEW_LINE>} | blurbs[i % blurbs.length]; |
1,022,871 | void expandColumns() {<NEW_LINE>if (!isUndefinedWidth()) {<NEW_LINE>int usedSpace = calcColumnUsedSpace();<NEW_LINE>float[] actualExpandRatio = calcColumnExpandRatio();<NEW_LINE>// Round down to avoid problems with fractions (100.1px available -><NEW_LINE>// can use 100, not 101)<NEW_LINE>int availableSpace = (int) LayoutManager.get(client).getInnerWidthDouble(getElement());<NEW_LINE>int excessSpace = availableSpace - usedSpace;<NEW_LINE>int distributed = 0;<NEW_LINE>if (excessSpace > 0) {<NEW_LINE>float expandRatioSum = 0;<NEW_LINE>for (int i = 0; i < columnWidths.length; i++) {<NEW_LINE>expandRatioSum += actualExpandRatio[i];<NEW_LINE>}<NEW_LINE>for (int i = 0; i < columnWidths.length; i++) {<NEW_LINE>int ew = (int) (excessSpace <MASK><NEW_LINE>columnWidths[i] = minColumnWidths[i] + ew;<NEW_LINE>distributed += ew;<NEW_LINE>}<NEW_LINE>excessSpace -= distributed;<NEW_LINE>int c = 0;<NEW_LINE>while (excessSpace > 0) {<NEW_LINE>columnWidths[c % columnWidths.length]++;<NEW_LINE>excessSpace--;<NEW_LINE>c++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | * actualExpandRatio[i] / expandRatioSum); |
1,537,648 | final GetLifecyclePolicyPreviewResult executeGetLifecyclePolicyPreview(GetLifecyclePolicyPreviewRequest getLifecyclePolicyPreviewRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getLifecyclePolicyPreviewRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetLifecyclePolicyPreviewRequest> request = null;<NEW_LINE>Response<GetLifecyclePolicyPreviewResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetLifecyclePolicyPreviewRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getLifecyclePolicyPreviewRequest));<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, "ECR");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetLifecyclePolicyPreview");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetLifecyclePolicyPreviewResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetLifecyclePolicyPreviewResultJsonUnmarshaller());<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); |
99,917 | private boolean convergence(List<Page> pages) {<NEW_LINE>double aveHubDelta = 100;<NEW_LINE>double aveAuthDelta = 100;<NEW_LINE>if (pages == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// get current values from pages<NEW_LINE>double[] currHubVals = new <MASK><NEW_LINE>double[] currAuthVals = new double[pages.size()];<NEW_LINE>for (int i = 0; i < pages.size(); i++) {<NEW_LINE>Page currPage = pages.get(i);<NEW_LINE>currHubVals[i] = currPage.hub;<NEW_LINE>currHubVals[i] = currPage.authority;<NEW_LINE>}<NEW_LINE>if (prevHubVals == null || prevAuthVals == null) {<NEW_LINE>prevHubVals = currHubVals;<NEW_LINE>prevAuthVals = currAuthVals;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// compare to past values<NEW_LINE>aveHubDelta = getAveDelta(currHubVals, prevHubVals);<NEW_LINE>aveAuthDelta = getAveDelta(currAuthVals, prevAuthVals);<NEW_LINE>if (aveHubDelta + aveAuthDelta < DELTA_TOLERANCE || (Math.abs(prevAveHubDelta - aveHubDelta) < 0.01 && Math.abs(prevAveAuthDelta - aveAuthDelta) < 0.01)) {<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>prevHubVals = currHubVals;<NEW_LINE>prevAuthVals = currAuthVals;<NEW_LINE>prevAveHubDelta = aveHubDelta;<NEW_LINE>prevAveAuthDelta = aveAuthDelta;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | double[pages.size()]; |
190,925 | public ArtifactConfigInput unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ArtifactConfigInput artifactConfigInput = new ArtifactConfigInput();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("S3Encryption", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>artifactConfigInput.setS3Encryption(S3EncryptionConfigJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return artifactConfigInput;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,054,219 | public void nullDefaultAnnotationIsRedundant(ASTNode location, Annotation[] annotations, Binding outer) {<NEW_LINE>if (outer == Scope.NOT_REDUNDANT)<NEW_LINE>return;<NEW_LINE>Annotation annotation = <MASK><NEW_LINE>int start = annotation != null ? annotation.sourceStart : location.sourceStart;<NEW_LINE>int end = annotation != null ? annotation.sourceEnd : location.sourceStart;<NEW_LINE>String[] args = NoArgument;<NEW_LINE>String[] shortArgs = NoArgument;<NEW_LINE>if (outer != null) {<NEW_LINE>args = new String[] { new String(outer.readableName()) };<NEW_LINE>shortArgs = new String[] { new String(outer.shortReadableName()) };<NEW_LINE>}<NEW_LINE>int problemId = IProblem.RedundantNullDefaultAnnotation;<NEW_LINE>if (outer instanceof ModuleBinding) {<NEW_LINE>problemId = IProblem.RedundantNullDefaultAnnotationModule;<NEW_LINE>} else if (outer instanceof PackageBinding) {<NEW_LINE>problemId = IProblem.RedundantNullDefaultAnnotationPackage;<NEW_LINE>} else if (outer instanceof ReferenceBinding) {<NEW_LINE>problemId = IProblem.RedundantNullDefaultAnnotationType;<NEW_LINE>} else if (outer instanceof MethodBinding) {<NEW_LINE>problemId = IProblem.RedundantNullDefaultAnnotationMethod;<NEW_LINE>} else if (outer instanceof LocalVariableBinding) {<NEW_LINE>problemId = IProblem.RedundantNullDefaultAnnotationLocal;<NEW_LINE>} else if (outer instanceof FieldBinding) {<NEW_LINE>problemId = IProblem.RedundantNullDefaultAnnotationField;<NEW_LINE>}<NEW_LINE>this.handle(problemId, args, shortArgs, start, end);<NEW_LINE>} | findAnnotation(annotations, TypeIds.BitNonNullByDefaultAnnotation); |
79,602 | public void createMenuItems(Bundle savedInstanceState) {<NEW_LINE>Context ctx = getContext();<NEW_LINE>Bundle args = getArguments();<NEW_LINE>if (ctx == null || args == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String contentsJson = args.getString(CONTENTS_JSON_KEY);<NEW_LINE>if (contentsJson == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final WikivoyageContentItem contentItem = WikivoyageJsonParser.parseJsonContents(contentsJson);<NEW_LINE>if (contentItem == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>items.add(new TitleItem(getString(R.string.shared_string_contents)));<NEW_LINE>Drawable transparent = AppCompatResources.getDrawable(ctx, R.color.color_transparent);<NEW_LINE>expListView = new ExpandableListView(ctx);<NEW_LINE>expListView.setAdapter(new ExpandableListAdapter(ctx, contentItem));<NEW_LINE>expListView.setDivider(transparent);<NEW_LINE>expListView.setGroupIndicator(transparent);<NEW_LINE>expListView.setSelector(transparent);<NEW_LINE>expListView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));<NEW_LINE>expListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {<NEW_LINE>WikivoyageContentItem wikivoyageContentItem = contentItem.getSubItems().get(groupPosition);<NEW_LINE>String link = wikivoyageContentItem.getSubItems().get(childPosition).getLink();<NEW_LINE>String name = wikivoyageContentItem.getLink().substring(1);<NEW_LINE>sendResults(link, name);<NEW_LINE>dismiss();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>expListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {<NEW_LINE>WikivoyageContentItem wikivoyageContentItem = contentItem.getSubItems().get(groupPosition);<NEW_LINE>String link = wikivoyageContentItem.getLink();<NEW_LINE>String name = wikivoyageContentItem.getLink().substring(1);<NEW_LINE>sendResults(link, name);<NEW_LINE>dismiss();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>LinearLayout container = new LinearLayout(ctx);<NEW_LINE>container.addView(expListView);<NEW_LINE>items.add(new SimpleBottomSheetItem.Builder().setCustomView<MASK><NEW_LINE>} | (container).create()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.