idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,566,713 | public final static AuthUserSession parseHttpResponse(String responseStr) {<NEW_LINE>if (responseStr == null || responseStr.isEmpty()) {<NEW_LINE>throw new AuthInvalidParameterException("Invalid (null) response from Amazon Cognito Auth endpoint");<NEW_LINE>}<NEW_LINE>AccessToken accessToken = new AccessToken(null);<NEW_LINE>IdToken idToken = new IdToken(null);<NEW_LINE>RefreshToken refreshToken = new RefreshToken(null);<NEW_LINE>JSONObject responseJson;<NEW_LINE>try {<NEW_LINE>responseJson = new JSONObject(responseStr);<NEW_LINE>if (responseJson.has(ClientConstants.DOMAIN_QUERY_PARAM_ERROR)) {<NEW_LINE>String errorText = responseJson.getString(ClientConstants.DOMAIN_QUERY_PARAM_ERROR);<NEW_LINE>if (ClientConstants.HTTP_RESPONSE_INVALID_GRANT.equals(errorText)) {<NEW_LINE>throw new AuthInvalidGrantException(errorText);<NEW_LINE>} else {<NEW_LINE>throw new AuthServiceException(errorText);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (responseJson.has(ClientConstants.HTTP_RESPONSE_ACCESS_TOKEN)) {<NEW_LINE>accessToken = new AccessToken(responseJson.getString(ClientConstants.HTTP_RESPONSE_ACCESS_TOKEN));<NEW_LINE>}<NEW_LINE>if (responseJson.has(ClientConstants.HTTP_RESPONSE_ID_TOKEN)) {<NEW_LINE>idToken = new IdToken(responseJson<MASK><NEW_LINE>}<NEW_LINE>if (responseJson.has(ClientConstants.HTTP_RESPONSE_REFRESH_TOKEN)) {<NEW_LINE>refreshToken = new RefreshToken(responseJson.getString(ClientConstants.HTTP_RESPONSE_REFRESH_TOKEN));<NEW_LINE>}<NEW_LINE>} catch (AuthInvalidGrantException invg) {<NEW_LINE>throw invg;<NEW_LINE>} catch (AuthServiceException seve) {<NEW_LINE>throw seve;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new AuthClientException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>return new AuthUserSession(idToken, accessToken, refreshToken);<NEW_LINE>} | .getString(ClientConstants.HTTP_RESPONSE_ID_TOKEN)); |
840,561 | private <F> void parseFrameSections(boolean eof, Set<OntologyAxiomPair> axioms, F frameSubject, Map<ManchesterOWLSyntax, AnnAxiom<F, ?>> sectionParsers) {<NEW_LINE>while (true) {<NEW_LINE>String sect = peekToken();<NEW_LINE>AnnAxiom<F, ?> parser = sectionParsers.get(parse(sect));<NEW_LINE>if (parser != null) {<NEW_LINE>consumeToken();<NEW_LINE>Set<OWLOntology> onts = getOntologies();<NEW_LINE>if (!isEmptyFrameSection(sectionParsers)) {<NEW_LINE>axioms.addAll(parseAnnotatedListItems(frameSubject, parser, onts));<NEW_LINE>}<NEW_LINE>} else if (eof && !eof(sect)) {<NEW_LINE>List<ManchesterOWLSyntax> <MASK><NEW_LINE>expected.addAll(sectionParsers.keySet());<NEW_LINE>if (frameSubject instanceof OWLAnnotationSubject || frameSubject instanceof OWLEntity) {<NEW_LINE>expected.add(ANNOTATIONS);<NEW_LINE>}<NEW_LINE>throw new ExceptionBuilder().withKeyword(expected).build();<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | expected = new ArrayList<>(); |
1,735,014 | public static <T> String applySortingPagingQueryOptions(Class<T> entityClass, SpannerPageableQueryOptions options, String sql, SpannerMappingContext mappingContext, boolean fetchInterleaved) {<NEW_LINE>SpannerPersistentEntity<?> persistentEntity = mappingContext.getPersistentEntity(entityClass);<NEW_LINE>// Cloud Spanner does not preserve the order of derived tables so we must not wrap the<NEW_LINE>// derived table<NEW_LINE>// in SELECT * FROM () if there is no overriding pageable param.<NEW_LINE>if ((options.getSort() == null || options.getSort().isUnsorted()) && options.getLimit() == null && options.getOffset() == null && !fetchInterleaved) {<NEW_LINE>return sql;<NEW_LINE>}<NEW_LINE>final String subquery = fetchInterleaved ? <MASK><NEW_LINE>final String alias = subquery.isEmpty() ? "" : " " + persistentEntity.tableName();<NEW_LINE>StringBuilder sb = applySort(options.getSort(), new StringBuilder("SELECT *").append(subquery).append(" FROM (").append(sql).append(")").append(alias).append(buildWhere(persistentEntity)), persistentEntity);<NEW_LINE>if (options.getLimit() != null) {<NEW_LINE>sb.append(" LIMIT ").append(options.getLimit());<NEW_LINE>}<NEW_LINE>if (options.getOffset() != null) {<NEW_LINE>sb.append(" OFFSET ").append(options.getOffset());<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | getChildrenSubquery(persistentEntity, mappingContext) : ""; |
410,540 | private void addConstructor(AnnotationTypeDeclaration node, Map<ExecutableElement, VariableElement> fieldElements) {<NEW_LINE><MASK><NEW_LINE>String typeName = nameTable.getFullName(type);<NEW_LINE>FunctionDeclaration constructorDecl = new FunctionDeclaration("create_" + typeName, type.asType());<NEW_LINE>Block constructorBody = new Block();<NEW_LINE>constructorDecl.setBody(constructorBody);<NEW_LINE>List<Statement> stmts = constructorBody.getStatements();<NEW_LINE>stmts.add(new NativeStatement(UnicodeUtils.format("%s *self = AUTORELEASE([[%s alloc] init]);", typeName, typeName)));<NEW_LINE>for (ExecutableElement memberElement : ElementUtil.getSortedAnnotationMembers(type)) {<NEW_LINE>TypeMirror memberType = memberElement.getReturnType();<NEW_LINE>String propName = NameTable.getAnnotationPropertyName(memberElement);<NEW_LINE>String fieldName = nameTable.getVariableShortName(fieldElements.get(memberElement));<NEW_LINE>VariableElement param = GeneratedVariableElement.newParameter(propName, memberType, null);<NEW_LINE>constructorDecl.addParameter(new SingleVariableDeclaration(param));<NEW_LINE>String paramName = nameTable.getVariableShortName(param);<NEW_LINE>String rhs = TypeUtil.isReferenceType(memberType) ? "RETAIN_(" + paramName + ")" : paramName;<NEW_LINE>stmts.add(new NativeStatement("self->" + fieldName + " = " + rhs + ";"));<NEW_LINE>}<NEW_LINE>stmts.add(new NativeStatement("return self;"));<NEW_LINE>node.addBodyDeclaration(constructorDecl);<NEW_LINE>} | TypeElement type = node.getTypeElement(); |
633,539 | public void rebalance(final URI uri, final String clientRole) {<NEW_LINE>if (!isWorkerServiceAvailable()) {<NEW_LINE>throwUnavailableException();<NEW_LINE>}<NEW_LINE>if (worker().getWorkerConfig().isAuthorizationEnabled() && !isSuperUser(clientRole)) {<NEW_LINE>log.error("Client [{}] is not authorized to rebalance cluster", clientRole);<NEW_LINE>throw new RestException(Status.UNAUTHORIZED, "Client is not authorized to perform operation");<NEW_LINE>}<NEW_LINE>if (worker().getLeaderService().isLeader()) {<NEW_LINE>try {<NEW_LINE>worker().getSchedulerManager().rebalanceIfNotInprogress();<NEW_LINE>} catch (SchedulerManager.RebalanceInProgressException e) {<NEW_LINE>throw new <MASK><NEW_LINE>} catch (SchedulerManager.TooFewWorkersException e) {<NEW_LINE>throw new RestException(Status.BAD_REQUEST, "Too few workers (need at least 2)");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>WorkerInfo workerInfo = worker().getMembershipManager().getLeader();<NEW_LINE>URI redirect = UriBuilder.fromUri(uri).host(workerInfo.getWorkerHostname()).port(workerInfo.getPort()).build();<NEW_LINE>throw new WebApplicationException(Response.temporaryRedirect(redirect).build());<NEW_LINE>}<NEW_LINE>} | RestException(Status.BAD_REQUEST, "Rebalance already in progress"); |
157,802 | protected ResolveResult[] innerResolve(boolean caseSensitive, @NotNull PsiFile file) {<NEW_LINE>if (isFirst()) {<NEW_LINE>if (".".equals(getCanonicalText())) {<NEW_LINE>PsiDirectory directory = getDirectory();<NEW_LINE>return directory != null ? new PsiElementResolveResult[] { new PsiElementResolveResult(directory) } : ResolveResult.EMPTY_ARRAY;<NEW_LINE>} else if ("..".equals(getCanonicalText())) {<NEW_LINE>PsiDirectory directory = getDirectory();<NEW_LINE>PsiDirectory grandParent = directory != null ? directory.getParentDirectory() : null;<NEW_LINE>return grandParent != null ? new PsiElementResolveResult[] { new PsiElementResolveResult(grandParent) } : ResolveResult.EMPTY_ARRAY;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String referenceText = getText();<NEW_LINE>Set<ResolveResult> result = ContainerUtil.newLinkedHashSet();<NEW_LINE>Set<ResolveResult> innerResult = ContainerUtil.newLinkedHashSet();<NEW_LINE>for (PsiFileSystemItem context : getContexts()) {<NEW_LINE>innerResolveInContext(referenceText, context, innerResult, caseSensitive);<NEW_LINE>for (ResolveResult resolveResult : innerResult) {<NEW_LINE>PsiElement element = resolveResult.getElement();<NEW_LINE>if (element instanceof PsiDirectory) {<NEW_LINE>if (isLast()) {<NEW_LINE>return new ResolveResult[] { resolveResult };<NEW_LINE>}<NEW_LINE>result.add(resolveResult);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>innerResult.clear();<NEW_LINE>}<NEW_LINE>return result.isEmpty() ? ResolveResult.EMPTY_ARRAY : result.toArray(new ResolveResult<MASK><NEW_LINE>} | [result.size()]); |
624,018 | public void transition(PSAttempt psAttempt, PSAttemptEvent event) {<NEW_LINE>psAttempt.setFinishTime();<NEW_LINE>// send PS_ATTEMPT_FAILED to AMParameterServer, AMParameterServer will retry another attempt<NEW_LINE>// or failed<NEW_LINE>switch(finishState) {<NEW_LINE>case FAILED:<NEW_LINE>psAttempt.getContext().getEventHandler().handle(new PSPAttemptEvent(psAttempt.attemptId, AMParameterServerEventType.PS_ATTEMPT_FAILED));<NEW_LINE>break;<NEW_LINE>case KILLED:<NEW_LINE>psAttempt.getContext().getEventHandler().handle(new PSPAttemptEvent(psAttempt.attemptId, AMParameterServerEventType.PS_ATTEMPT_KILLED));<NEW_LINE>break;<NEW_LINE>case SUCCESS:<NEW_LINE>psAttempt.getContext().getEventHandler().handle(new PSPAttemptEvent(psAttempt.attemptId, AMParameterServerEventType.PS_ATTEMPT_SUCCESS));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>LOG.error("invalid PSAttemptStateInternal in PSAttemptFinishedTransition!");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// remove ps attempt id from heartbeat timeout monitor list<NEW_LINE>psAttempt.getContext().getParameterServerManager(<MASK><NEW_LINE>// release container:send a release request to container launcher<NEW_LINE>AngelDeployMode deployMode = psAttempt.getContext().getDeployMode();<NEW_LINE>if (deployMode == AngelDeployMode.KUBERNETES) {<NEW_LINE>} else {<NEW_LINE>ContainerLauncherEvent launchEvent = null;<NEW_LINE>if (deployMode == AngelDeployMode.LOCAL) {<NEW_LINE>launchEvent = new LocalContainerLauncherEvent(ContainerLauncherEventType.CONTAINER_REMOTE_CLEANUP, psAttempt.attemptId);<NEW_LINE>} else {<NEW_LINE>launchEvent = new YarnContainerLauncherEvent(psAttempt.getId(), psAttempt.container.getId(), StringInterner.weakIntern(psAttempt.container.getNodeId().toString()), psAttempt.container.getContainerToken(), ContainerLauncherEventType.CONTAINER_REMOTE_CLEANUP);<NEW_LINE>}<NEW_LINE>psAttempt.getContext().getEventHandler().handle(launchEvent);<NEW_LINE>}<NEW_LINE>} | ).unRegister(psAttempt.attemptId); |
1,438,224 | public int networkDelayTime(int[][] times, int N, int K) {<NEW_LINE>// Dijkstra<NEW_LINE>Map<Integer, List<int[]>> graph = new HashMap();<NEW_LINE>for (int[] edge : times) {<NEW_LINE>if (!graph.containsKey(edge[0]))<NEW_LINE>graph.put(edge[0], new ArrayList<int[]>());<NEW_LINE>graph.get(edge[0]).add(new int[] { edge[1], edge[2] });<NEW_LINE>}<NEW_LINE>dist = new HashMap();<NEW_LINE>for (int node = 1; node <= N; ++node) dist.put(node, Integer.MAX_VALUE);<NEW_LINE><MASK><NEW_LINE>boolean[] seen = new boolean[N + 1];<NEW_LINE>while (true) {<NEW_LINE>int candNode = -1;<NEW_LINE>int candDist = Integer.MAX_VALUE;<NEW_LINE>for (int i = 1; i <= N; ++i) {<NEW_LINE>if (!seen[i] && dist.get(i) < candDist) {<NEW_LINE>candDist = dist.get(i);<NEW_LINE>candNode = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (candNode < 0)<NEW_LINE>break;<NEW_LINE>seen[candNode] = true;<NEW_LINE>if (graph.containsKey(candNode))<NEW_LINE>for (int[] info : graph.get(candNode)) dist.put(info[0], Math.min(dist.get(info[0]), dist.get(candNode) + info[1]));<NEW_LINE>}<NEW_LINE>int ans = 0;<NEW_LINE>for (int cand : dist.values()) {<NEW_LINE>if (cand == Integer.MAX_VALUE)<NEW_LINE>return -1;<NEW_LINE>ans = Math.max(ans, cand);<NEW_LINE>}<NEW_LINE>return ans;<NEW_LINE>} | dist.put(K, 0); |
364,474 | public void writeToParcel(Parcel parcel, int i) {<NEW_LINE>parcel.writeString(id);<NEW_LINE>parcel.writeString(fullName);<NEW_LINE>parcel.writeString(subredditName);<NEW_LINE>parcel.writeString(subredditNamePrefixed);<NEW_LINE>parcel.writeString(subredditIconUrl);<NEW_LINE>parcel.writeString(author);<NEW_LINE>parcel.writeString(authorNamePrefixed);<NEW_LINE>parcel.writeString(authorFlair);<NEW_LINE>parcel.writeString(authorFlairHTML);<NEW_LINE>parcel.writeString(authorIconUrl);<NEW_LINE>parcel.writeLong(postTimeMillis);<NEW_LINE>parcel.writeString(title);<NEW_LINE>parcel.writeString(selfText);<NEW_LINE>parcel.writeString(selfTextPlain);<NEW_LINE>parcel.writeString(selfTextPlainTrimmed);<NEW_LINE>parcel.writeString(url);<NEW_LINE>parcel.writeString(videoUrl);<NEW_LINE>parcel.writeString(videoDownloadUrl);<NEW_LINE>parcel.writeString(gfycatId);<NEW_LINE>parcel.writeString(streamableShortCode);<NEW_LINE>parcel.writeByte((byte) <MASK><NEW_LINE>parcel.writeByte((byte) (isGfycat ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (isRedgifs ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (isStreamable ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (loadGfyOrStreamableVideoSuccess ? 1 : 0));<NEW_LINE>parcel.writeString(permalink);<NEW_LINE>parcel.writeString(flair);<NEW_LINE>parcel.writeString(awards);<NEW_LINE>parcel.writeInt(nAwards);<NEW_LINE>parcel.writeInt(score);<NEW_LINE>parcel.writeInt(postType);<NEW_LINE>parcel.writeInt(voteType);<NEW_LINE>parcel.writeInt(nComments);<NEW_LINE>parcel.writeInt(upvoteRatio);<NEW_LINE>parcel.writeByte((byte) (hidden ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (spoiler ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (nsfw ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (stickied ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (archived ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (locked ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (saved ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (isCrosspost ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (isRead ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (isHiddenInRecyclerView ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (isHiddenManuallyByUser ? 1 : 0));<NEW_LINE>parcel.writeString(crosspostParentId);<NEW_LINE>parcel.writeTypedList(previews);<NEW_LINE>parcel.writeTypedList(gallery);<NEW_LINE>} | (isImgur ? 1 : 0)); |
838,827 | private String safelyExecuteRequest(String url, ClassicHttpRequest request) {<NEW_LINE>if (hostHeader != null) {<NEW_LINE>request.addHeader(HOST, hostHeader);<NEW_LINE>}<NEW_LINE>List<HttpHeader> httpHeaders = authenticator.generateAuthHeaders();<NEW_LINE>for (HttpHeader header : httpHeaders) {<NEW_LINE>for (String value : header.values()) {<NEW_LINE>request.addHeader(header.key(), value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try (CloseableHttpResponse response = httpClient.execute(request)) {<NEW_LINE>int statusCode = response.getCode();<NEW_LINE>if (HttpStatus.isServerError(statusCode)) {<NEW_LINE>throw new VerificationException("Expected status 2xx for " + url + " but was " + statusCode);<NEW_LINE>}<NEW_LINE>if (statusCode == 401) {<NEW_LINE>throw new NotAuthorisedException();<NEW_LINE>}<NEW_LINE>String body = getEntityAsStringAndCloseStream(response);<NEW_LINE>if (HttpStatus.isClientError(statusCode)) {<NEW_LINE>Errors errors = Json.<MASK><NEW_LINE>throw ClientError.fromErrors(errors);<NEW_LINE>}<NEW_LINE>return body;<NEW_LINE>} catch (Exception e) {<NEW_LINE>return throwUnchecked(e, String.class);<NEW_LINE>}<NEW_LINE>} | read(body, Errors.class); |
51,878 | public T overwrite(@NonNull final T other) {<NEW_LINE>checkNotNull(other, "Can't overwrite with null value");<NEW_LINE>if (equals(other)) {<NEW_LINE>return (T) this;<NEW_LINE>}<NEW_LINE>for (Field field : getTypeParameterClass().getDeclaredFields()) {<NEW_LINE>final int modifiers = field.getModifiers();<NEW_LINE>if (hasIllegalAccessModifiers(modifiers)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!Modifier.isPublic(modifiers) || Modifier.isFinal(modifiers)) {<NEW_LINE>// We want to overwrite also private and final fields. This allows field access<NEW_LINE>// for this instance of the field. The actual field of the class isn't modified.<NEW_LINE>field.setAccessible(true);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!isEmpty(field, other)) {<NEW_LINE>field.set(this<MASK><NEW_LINE>}<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>Log.e(TAG, "Failed set at " + field.getName(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (T) this;<NEW_LINE>} | , field.get(other)); |
157,247 | public static String[] formatBytesParts(long bytes, boolean showTB) {<NEW_LINE>DecimalFormat formatter = new DecimalFormat(FILE_SIZE_FORMAT_PATTERN);<NEW_LINE>if (bytes < 1048576) {<NEW_LINE>// less than 1MB<NEW_LINE>return new String[] { formatter.format(bytes / 1024.0), "KB" };<NEW_LINE>}<NEW_LINE>if (bytes < 1073741824) {<NEW_LINE>// less than 1GB<NEW_LINE>return new String[] { formatter.format(bytes / (1024.0 * 1024.0)), "MB" };<NEW_LINE>}<NEW_LINE>if (showTB) {<NEW_LINE>if (bytes < (1073741824L * 1024L)) {<NEW_LINE>return new String[] { formatter.format(bytes / (1024.0 * 1024.0 * 1024.0)), "GB" };<NEW_LINE>}<NEW_LINE>return new String[] { formatter.format(bytes / (1024.0 * 1024.0 * <MASK><NEW_LINE>}<NEW_LINE>return new String[] { formatter.format(bytes / (1024.0 * 1024.0 * 1024.0)), "GB" };<NEW_LINE>} | 1024.0 * 1024.0)), "TB" }; |
630,747 | private void writeFileHistories(IndentXmlStreamWriter xmlOut, Collection<PartialFileHistory> fileHistories) throws XMLStreamException, IOException {<NEW_LINE>xmlOut.writeStartElement("fileHistories");<NEW_LINE>for (PartialFileHistory fileHistory : fileHistories) {<NEW_LINE>xmlOut.writeStartElement("fileHistory");<NEW_LINE>xmlOut.writeAttribute("id", fileHistory.getFileHistoryId().toString());<NEW_LINE>xmlOut.writeStartElement("fileVersions");<NEW_LINE>Collection<FileVersion> fileVersions = fileHistory.getFileVersions().values();<NEW_LINE>for (FileVersion fileVersion : fileVersions) {<NEW_LINE>if (fileVersion.getVersion() == null || fileVersion.getType() == null || fileVersion.getPath() == null || fileVersion.getStatus() == null || fileVersion.getSize() == null || fileVersion.getLastModified() == null) {<NEW_LINE>throw new IOException("Unable to write file version, because one or many mandatory fields are null (version, type, path, name, status, size, last modified): " + fileVersion);<NEW_LINE>}<NEW_LINE>if (fileVersion.getType() == FileType.SYMLINK && fileVersion.getLinkTarget() == null) {<NEW_LINE>throw new IOException("Unable to write file version: All symlinks must have a target.");<NEW_LINE>}<NEW_LINE>xmlOut.writeEmptyElement("fileVersion");<NEW_LINE>xmlOut.writeAttribute("version", fileVersion.getVersion());<NEW_LINE>xmlOut.writeAttribute("type", fileVersion.getType().toString());<NEW_LINE>xmlOut.writeAttribute("status", fileVersion.getStatus().toString());<NEW_LINE>if (containsXmlRestrictedChars(fileVersion.getPath())) {<NEW_LINE>xmlOut.writeAttribute("pathEncoded", encodeXmlRestrictedChars(fileVersion.getPath()));<NEW_LINE>} else {<NEW_LINE>xmlOut.writeAttribute("path", fileVersion.getPath());<NEW_LINE>}<NEW_LINE>xmlOut.writeAttribute("size", fileVersion.getSize());<NEW_LINE>xmlOut.writeAttribute("lastModified", fileVersion.getLastModified().getTime());<NEW_LINE>if (fileVersion.getLinkTarget() != null) {<NEW_LINE>xmlOut.writeAttribute(<MASK><NEW_LINE>}<NEW_LINE>if (fileVersion.getUpdated() != null) {<NEW_LINE>xmlOut.writeAttribute("updated", fileVersion.getUpdated().getTime());<NEW_LINE>}<NEW_LINE>if (fileVersion.getChecksum() != null) {<NEW_LINE>xmlOut.writeAttribute("checksum", fileVersion.getChecksum().toString());<NEW_LINE>}<NEW_LINE>if (fileVersion.getDosAttributes() != null) {<NEW_LINE>xmlOut.writeAttribute("dosattrs", fileVersion.getDosAttributes());<NEW_LINE>}<NEW_LINE>if (fileVersion.getPosixPermissions() != null) {<NEW_LINE>xmlOut.writeAttribute("posixperms", fileVersion.getPosixPermissions());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// </fileVersions><NEW_LINE>xmlOut.writeEndElement();<NEW_LINE>// </fileHistory><NEW_LINE>xmlOut.writeEndElement();<NEW_LINE>}<NEW_LINE>// </fileHistories><NEW_LINE>xmlOut.writeEndElement();<NEW_LINE>} | "linkTarget", fileVersion.getLinkTarget()); |
1,447,804 | private static String extractXMLCertificateSubject(String certificateInputDirectory, String rootCertificate) {<NEW_LINE>// Register XmlClasses and Types<NEW_LINE>Registry.getInstance();<NEW_LINE>CcaFileManager ccaFileManager = CcaFileManager.getReference(certificateInputDirectory);<NEW_LINE>// Load X.509 root certificate and get Subject principal<NEW_LINE>try {<NEW_LINE>CertificateFactory <MASK><NEW_LINE>ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(ccaFileManager.getFileContent(rootCertificate));<NEW_LINE>X509Certificate x509Certificate = (X509Certificate) certificateFactory.generateCertificate(byteArrayInputStream);<NEW_LINE>X500Principal x500PrincipalSubject = x509Certificate.getSubjectX500Principal();<NEW_LINE>byte[] encodedSubject = x500PrincipalSubject.getEncoded();<NEW_LINE>StringBuilder stringBuilder = new StringBuilder();<NEW_LINE>for (byte b : encodedSubject) {<NEW_LINE>stringBuilder.append(String.format("%02x", b));<NEW_LINE>}<NEW_LINE>return stringBuilder.toString();<NEW_LINE>} catch (CertificateException ce) {<NEW_LINE>LOGGER.error("Error while either instantiating X.509 CertificateFactory or generating certificate from " + "fileInputStream. " + ce);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | certificateFactory = CertificateFactory.getInstance("X.509"); |
595,240 | public Integer handleUpload(JobChunk<Integer> jc, File upload) {<NEW_LINE>String karateLog = upload.getPath() + File.separator + "karate.log";<NEW_LINE>File karateLogFile = new File(karateLog);<NEW_LINE>if (karateLogFile.exists()) {<NEW_LINE>karateLogFile.renameTo(new File(karateLog + ".txt"));<NEW_LINE>}<NEW_LINE>String gatlingReportDir <MASK><NEW_LINE>new File(gatlingReportDir).mkdirs();<NEW_LINE>File[] dirs = upload.listFiles();<NEW_LINE>for (File dir : dirs) {<NEW_LINE>if (dir.isDirectory()) {<NEW_LINE>File file = JobUtils.getFirstFileMatching(dir, n -> n.endsWith("simulation.log"));<NEW_LINE>if (file != null) {<NEW_LINE>FileUtils.copy(file, new File(gatlingReportDir + File.separator + "simulation_" + jc.getId() + ".log"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return jc.getValue();<NEW_LINE>} | = buildDir + File.separator + reportDir; |
993,475 | public final // /home/matthias/src/netbeans/ide/css.lib/src/org/netbeans/modules/css/lib/Css3.g:548:1: vendorAtRule : ( moz_document | webkitKeyframes | generic_at_rule );<NEW_LINE>void vendorAtRule() throws RecognitionException {<NEW_LINE>try {<NEW_LINE>dbg.enterRule(getGrammarFileName(), "vendorAtRule");<NEW_LINE>if (getRuleLevel() == 0) {<NEW_LINE>dbg.commence();<NEW_LINE>}<NEW_LINE>incRuleLevel();<NEW_LINE>dbg.location(548, 0);<NEW_LINE>try {<NEW_LINE>// /home/matthias/src/netbeans/ide/css.lib/src/org/netbeans/modules/css/lib/Css3.g:549:3: ( moz_document | webkitKeyframes | generic_at_rule )<NEW_LINE>int alt122 = 3;<NEW_LINE>try {<NEW_LINE>dbg.enterDecision(122, decisionCanBacktrack[122]);<NEW_LINE>switch(input.LA(1)) {<NEW_LINE>case MOZ_DOCUMENT_SYM:<NEW_LINE>{<NEW_LINE>alt122 = 1;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case WEBKIT_KEYFRAMES_SYM:<NEW_LINE>{<NEW_LINE>alt122 = 2;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case AT_IDENT:<NEW_LINE>{<NEW_LINE>alt122 = 3;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>if (state.backtracking > 0) {<NEW_LINE>state.failed = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>NoViableAltException nvae = new NoViableAltException(<MASK><NEW_LINE>dbg.recognitionException(nvae);<NEW_LINE>throw nvae;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>dbg.exitDecision(122);<NEW_LINE>}<NEW_LINE>switch(alt122) {<NEW_LINE>case 1:<NEW_LINE>dbg.enterAlt(1);<NEW_LINE>// /home/matthias/src/netbeans/ide/css.lib/src/org/netbeans/modules/css/lib/Css3.g:549:3: moz_document<NEW_LINE>{<NEW_LINE>dbg.location(549, 3);<NEW_LINE>pushFollow(FOLLOW_moz_document_in_vendorAtRule2438);<NEW_LINE>moz_document();<NEW_LINE>state._fsp--;<NEW_LINE>if (state.failed)<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>dbg.enterAlt(2);<NEW_LINE>// /home/matthias/src/netbeans/ide/css.lib/src/org/netbeans/modules/css/lib/Css3.g:549:18: webkitKeyframes<NEW_LINE>{<NEW_LINE>dbg.location(549, 18);<NEW_LINE>pushFollow(FOLLOW_webkitKeyframes_in_vendorAtRule2442);<NEW_LINE>webkitKeyframes();<NEW_LINE>state._fsp--;<NEW_LINE>if (state.failed)<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>dbg.enterAlt(3);<NEW_LINE>// /home/matthias/src/netbeans/ide/css.lib/src/org/netbeans/modules/css/lib/Css3.g:549:36: generic_at_rule<NEW_LINE>{<NEW_LINE>dbg.location(549, 36);<NEW_LINE>pushFollow(FOLLOW_generic_at_rule_in_vendorAtRule2446);<NEW_LINE>generic_at_rule();<NEW_LINE>state._fsp--;<NEW_LINE>if (state.failed)<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>reportError(re);<NEW_LINE>recover(input, re);<NEW_LINE>} finally {<NEW_LINE>// do for sure before leaving<NEW_LINE>}<NEW_LINE>dbg.location(549, 50);<NEW_LINE>} finally {<NEW_LINE>dbg.exitRule(getGrammarFileName(), "vendorAtRule");<NEW_LINE>decRuleLevel();<NEW_LINE>if (getRuleLevel() == 0) {<NEW_LINE>dbg.terminate();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "", 122, 0, input); |
473,446 | final DisassociateTeamMemberResult executeDisassociateTeamMember(DisassociateTeamMemberRequest disassociateTeamMemberRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateTeamMemberRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateTeamMemberRequest> request = null;<NEW_LINE>Response<DisassociateTeamMemberResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateTeamMemberRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateTeamMemberRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CodeStar");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateTeamMember");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateTeamMemberResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateTeamMemberResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,148,834 | public Message unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Message message = new Message();<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("plainTextMessage", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>message.setPlainTextMessage(PlainTextMessageJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("customPayload", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>message.setCustomPayload(CustomPayloadJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ssmlMessage", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>message.setSsmlMessage(SSMLMessageJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("imageResponseCard", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>message.setImageResponseCard(ImageResponseCardJsonUnmarshaller.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 message;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
627,131 | private static MediaType create(String type, String subtype, Multimap<String, String> parameters) {<NEW_LINE>checkNotNull(type);<NEW_LINE>checkNotNull(subtype);<NEW_LINE>checkNotNull(parameters);<NEW_LINE>String normalizedType = normalizeToken(type);<NEW_LINE>String normalizedSubtype = normalizeToken(subtype);<NEW_LINE>checkArgument(!WILDCARD.equals(normalizedType) || WILDCARD.equals(normalizedSubtype), "A wildcard type cannot be used with a non-wildcard subtype");<NEW_LINE>ImmutableListMultimap.Builder<String, String> builder = ImmutableListMultimap.builder();<NEW_LINE>for (Entry<String, String> entry : parameters.entries()) {<NEW_LINE>String attribute = <MASK><NEW_LINE>builder.put(attribute, normalizeParameterValue(attribute, entry.getValue()));<NEW_LINE>}<NEW_LINE>MediaType mediaType = new MediaType(normalizedType, normalizedSubtype, builder.build());<NEW_LINE>// Return one of the constants if the media type is a known type.<NEW_LINE>return firstNonNull(KNOWN_TYPES.get(mediaType), mediaType);<NEW_LINE>} | normalizeToken(entry.getKey()); |
445,302 | public static QueryRecordPlansResponse unmarshall(QueryRecordPlansResponse queryRecordPlansResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryRecordPlansResponse.setRequestId(_ctx.stringValue("QueryRecordPlansResponse.RequestId"));<NEW_LINE>queryRecordPlansResponse.setSuccess(_ctx.booleanValue("QueryRecordPlansResponse.Success"));<NEW_LINE>queryRecordPlansResponse.setErrorMessage(_ctx.stringValue("QueryRecordPlansResponse.ErrorMessage"));<NEW_LINE>queryRecordPlansResponse.setCode(_ctx.stringValue("QueryRecordPlansResponse.Code"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotal(_ctx.integerValue("QueryRecordPlansResponse.Data.Total"));<NEW_LINE>data.setPageSize(_ctx.integerValue("QueryRecordPlansResponse.Data.PageSize"));<NEW_LINE>data.setPage(_ctx.integerValue("QueryRecordPlansResponse.Data.Page"));<NEW_LINE>data.setPageCount(_ctx.integerValue("QueryRecordPlansResponse.Data.PageCount"));<NEW_LINE>List<ListItem> list = new ArrayList<ListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryRecordPlansResponse.Data.List.Length"); i++) {<NEW_LINE>ListItem listItem = new ListItem();<NEW_LINE>listItem.setPlanId(_ctx.stringValue("QueryRecordPlansResponse.Data.List[" + i + "].PlanId"));<NEW_LINE>listItem.setName(_ctx.stringValue("QueryRecordPlansResponse.Data.List[" + i + "].Name"));<NEW_LINE>listItem.setTemplateId(_ctx.stringValue<MASK><NEW_LINE>list.add(listItem);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>queryRecordPlansResponse.setData(data);<NEW_LINE>return queryRecordPlansResponse;<NEW_LINE>} | ("QueryRecordPlansResponse.Data.List[" + i + "].TemplateId")); |
1,591,524 | public void cleanUpFeature(ClusterService clusterService, Client client, ActionListener<ResetFeatureStateStatus> listener) {<NEW_LINE>Collection<SystemDataStreamDescriptor> dataStreamDescriptors = getSystemDataStreamDescriptors();<NEW_LINE>if (dataStreamDescriptors.isEmpty() == false) {<NEW_LINE>try {<NEW_LINE>Request request = new Request(dataStreamDescriptors.stream().map(SystemDataStreamDescriptor::getDataStreamName).collect(Collectors.toList()).toArray(Strings.EMPTY_ARRAY));<NEW_LINE>EnumSet<Option> options = request.indicesOptions().options();<NEW_LINE>options.add(Option.IGNORE_UNAVAILABLE);<NEW_LINE>options.add(Option.ALLOW_NO_INDICES);<NEW_LINE>request.indicesOptions(new IndicesOptions(options, request.indicesOptions().expandWildcards()));<NEW_LINE>client.execute(DeleteDataStreamAction.INSTANCE, request, ActionListener.wrap(response -> SystemIndexPlugin.super.cleanUpFeature(clusterService, client, listener), e -> {<NEW_LINE>Throwable unwrapped = ExceptionsHelper.unwrapCause(e);<NEW_LINE>if (unwrapped instanceof ResourceNotFoundException) {<NEW_LINE>SystemIndexPlugin.super.cleanUpFeature(clusterService, client, listener);<NEW_LINE>} else {<NEW_LINE>listener.onFailure(e);<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>} catch (Exception e) {<NEW_LINE>Throwable unwrapped = ExceptionsHelper.unwrapCause(e);<NEW_LINE>if (unwrapped instanceof ResourceNotFoundException) {<NEW_LINE>SystemIndexPlugin.super.cleanUpFeature(clusterService, client, listener);<NEW_LINE>} else {<NEW_LINE>listener.onFailure(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>SystemIndexPlugin.super.<MASK><NEW_LINE>}<NEW_LINE>} | cleanUpFeature(clusterService, client, listener); |
952,693 | final CreatePoolResult executeCreatePool(CreatePoolRequest createPoolRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createPoolRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreatePoolRequest> request = null;<NEW_LINE>Response<CreatePoolResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreatePoolRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createPoolRequest));<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, "Pinpoint SMS Voice V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreatePool");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreatePoolResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreatePoolResultJsonUnmarshaller());<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()); |
224,844 | public void afterCreateL2Network(L2NetworkInventory l2Network) {<NEW_LINE>if (!supportedL2NetworkTypes.contains(l2Network.getType())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>NetworkServiceProviderVO vo = getRouterVO();<NEW_LINE>NetworkServiceProvider router = providerFactory.getNetworkServiceProvider(vo);<NEW_LINE>try {<NEW_LINE>router.attachToL2Network(l2Network, null);<NEW_LINE>} catch (NetworkException e) {<NEW_LINE>String err = String.format("unable to attach network service provider[uuid:%s, name:%s, type:%s] to l2network[uuid:%s, name:%s, type:%s], %s", vo.getUuid(), vo.getName(), vo.getType(), l2Network.getUuid(), l2Network.getName(), l2Network.getType(), e.getMessage());<NEW_LINE>logger.warn(err, e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>NetworkServiceProviderL2NetworkRefVO ref = new NetworkServiceProviderL2NetworkRefVO();<NEW_LINE>ref.<MASK><NEW_LINE>ref.setL2NetworkUuid(l2Network.getUuid());<NEW_LINE>dbf.persist(ref);<NEW_LINE>String info = String.format("successfully attach network service provider[uuid:%s, name:%s, type:%s] to l2network[uuid:%s, name:%s, type:%s]", vo.getUuid(), vo.getName(), vo.getType(), l2Network.getUuid(), l2Network.getName(), l2Network.getType());<NEW_LINE>logger.debug(info);<NEW_LINE>} | setNetworkServiceProviderUuid(vo.getUuid()); |
1,556,697 | public RefactoringUI create(CompilationInfo info, TreePathHandle[] handles, FileObject[] files, NonRecursiveFolder[] packages) {<NEW_LINE>assert handles.length == 1;<NEW_LINE>Collection<? extends ParameterInfo> params = lookup.lookupAll(ParameterInfo.class);<NEW_LINE>final ParameterInfo[] configuration = params.isEmpty() ? null : new ParameterInfo[params.size()];<NEW_LINE>int index = 0;<NEW_LINE>for (ParameterInfo parameterInfo : params) {<NEW_LINE>configuration[index] = parameterInfo;<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>TreePath path = handles[0].resolve(info);<NEW_LINE>Kind kind;<NEW_LINE>while (path != null && (kind = path.getLeaf().getKind()) != Kind.METHOD && kind != Kind.METHOD_INVOCATION && kind != Kind.NEW_CLASS && kind != Kind.MEMBER_REFERENCE) {<NEW_LINE>path = path.getParentPath();<NEW_LINE>}<NEW_LINE>if (path != null && ((kind = path.getLeaf().getKind()) == Kind.METHOD_INVOCATION || kind == Kind.NEW_CLASS || kind == Kind.MEMBER_REFERENCE)) {<NEW_LINE>Element element = info.getTrees().getElement(path);<NEW_LINE>if (element == null || element.asType().getKind() == TypeKind.ERROR) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ExecutableElement method = (ExecutableElement) element;<NEW_LINE>path = info.<MASK><NEW_LINE>}<NEW_LINE>return path != null ? new ChangeParametersUI(TreePathHandle.create(path, info), info, configuration, CodeStyle.getDefault(info.getFileObject())) : null;<NEW_LINE>} | getTrees().getPath(method); |
1,408,237 | public ExperimentTemplateS3LogConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ExperimentTemplateS3LogConfiguration experimentTemplateS3LogConfiguration = new ExperimentTemplateS3LogConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("bucketName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>experimentTemplateS3LogConfiguration.setBucketName(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("prefix", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>experimentTemplateS3LogConfiguration.setPrefix(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 experimentTemplateS3LogConfiguration;<NEW_LINE>} | class).unmarshall(context)); |
1,508,276 | public void performOperationStep(DeploymentOperation operationContext) {<NEW_LINE>final AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);<NEW_LINE>final Map<URL, ProcessesXml> processesXmls = operationContext.getAttachment(PROCESSES_XML_RESOURCES);<NEW_LINE>final Map<String, DeployedProcessArchive> processArchiveDeploymentMap = operationContext.getAttachment(PROCESS_ARCHIVE_DEPLOYMENT_MAP);<NEW_LINE>final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();<NEW_LINE>ProcessApplicationInfoImpl <MASK><NEW_LINE>// create service<NEW_LINE>JmxManagedProcessApplication mbean = new JmxManagedProcessApplication(processApplicationInfo, processApplication.getReference());<NEW_LINE>mbean.setProcessesXmls(new ArrayList<ProcessesXml>(processesXmls.values()));<NEW_LINE>mbean.setDeploymentMap(processArchiveDeploymentMap);<NEW_LINE>// start service<NEW_LINE>serviceContainer.startService(ServiceTypes.PROCESS_APPLICATION, processApplication.getName(), mbean);<NEW_LINE>notifyBpmPlatformPlugins(serviceContainer, processApplication);<NEW_LINE>} | processApplicationInfo = createProcessApplicationInfo(processApplication, processArchiveDeploymentMap); |
1,293,317 | private String generateScriptsForDynamicOrderedNumbers() {<NEW_LINE>StringBuilder script = new StringBuilder();<NEW_LINE>// Start if<NEW_LINE>String startIf = formatter.getStartIfDirectiveIfExists(DocxContextHelper.NUMBERING_REGISTRY_KEY);<NEW_LINE>script.append(startIf);<NEW_LINE>String listInfos = formatter.formatAsSimpleField(false, <MASK><NEW_LINE>String itemListInfos = formatter.formatAsSimpleField(false, ITEM_INFO);<NEW_LINE>// 1) Start loop<NEW_LINE>String startLoop = formatter.getStartLoopDirective(itemListInfos, listInfos);<NEW_LINE>script.append(startLoop);<NEW_LINE>String abstractNumId = formatter.formatAsSimpleField(false, ITEM_INFO, "abstractNumId");<NEW_LINE>String abstractNumOrdered = formatter.formatAsSimpleField(false, ITEM_INFO, "ordered");<NEW_LINE>String startIfOrderedList = formatter.getStartIfDirective(abstractNumOrdered);<NEW_LINE>script.append(startIfOrderedList);<NEW_LINE>script.append(formatter.getFunctionDirective(DocxContextHelper.STYLES_GENERATOR_KEY, IDocxStylesGenerator.generateAbstractNumDecimal, DocxContextHelper.DEFAULT_STYLE_KEY, abstractNumId));<NEW_LINE>script.append(formatter.getEndIfDirective(abstractNumOrdered));<NEW_LINE>// 3) end loop<NEW_LINE>script.append(formatter.getEndLoopDirective(itemListInfos));<NEW_LINE>script.append(formatter.getEndIfDirective(DocxContextHelper.NUMBERING_REGISTRY_KEY));<NEW_LINE>return script.toString();<NEW_LINE>} | DocxContextHelper.NUMBERING_REGISTRY_KEY, NumberingRegistry.numbersMethod); |
620,294 | final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "MediaStore");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<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.CLIENT_ENDPOINT, endpoint); |
1,622,303 | public void updateUserInfo(final String userId) {<NEW_LINE>if (!getUserVisibleHint()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (getActivity() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (getActivity() != null) {<NEW_LINE>this.getActivity().runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>Message <MASK><NEW_LINE>if (message != null) {<NEW_LINE>int index = messageList.indexOf(message);<NEW_LINE>View view = recyclerView.getChildAt(index - linearLayoutManager.findFirstVisibleItemPosition());<NEW_LINE>Contact contact = baseContactService.getContactById(userId);<NEW_LINE>if (view != null && contact != null) {<NEW_LINE>ImageView contactImage = (ImageView) view.findViewById(R.id.contactImage);<NEW_LINE>TextView displayNameTextView = (TextView) view.findViewById(R.id.smReceivers);<NEW_LINE>displayNameTextView.setText(contact.getDisplayName());<NEW_LINE>recyclerAdapter.contactImageLoader.loadImage(contact, contactImage);<NEW_LINE>recyclerAdapter.notifyDataSetChanged();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Utils.printLog(getActivity(), "AL", "Exception while updating view .");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | message = latestMessageForEachContact.get(userId); |
1,013,393 | public void deleteFoldersId(String folderId, String ifMatch, Boolean recursive) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'folderId' is set<NEW_LINE>if (folderId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'folderId' when calling deleteFoldersId");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/folders/{folder_id}".replaceAll("\\{" + "folder_id" + "\\}", apiClient.escapeString(folderId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "recursive", recursive));<NEW_LINE>if (ifMatch != null)<NEW_LINE>localVarHeaderParams.put("if-match", apiClient.parameterToString(ifMatch));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE><MASK><NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>} | final String[] localVarContentTypes = {}; |
1,236,847 | public boolean onOptionsItemSelected(MenuItem item) {<NEW_LINE>// handle menu item selection<NEW_LINE>// if-else is used because this sample is used elsewhere as a Library module<NEW_LINE>int itemId = item.getItemId();<NEW_LINE>if (itemId == R.id.Cities) {<NEW_LINE>if (mLayers.get(0).isVisible() && mCities.isChecked()) {<NEW_LINE>// cities layer is on and menu item checked<NEW_LINE>mLayers.get(0).setVisible(false);<NEW_LINE>mCities.setChecked(false);<NEW_LINE>} else if (!mLayers.get(0).isVisible() && !mCities.isChecked()) {<NEW_LINE>// cities layer is off and menu item unchecked<NEW_LINE>mLayers.get(0).setVisible(true);<NEW_LINE>Log.d("cities", String.valueOf(mLayers.get(<MASK><NEW_LINE>mCities.setChecked(true);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else if (itemId == R.id.Continents) {<NEW_LINE>if (mLayers.get(1).isVisible() && mContinent.isChecked()) {<NEW_LINE>// continent layer is on and menu item checked<NEW_LINE>mLayers.get(1).setVisible(false);<NEW_LINE>mContinent.setChecked(false);<NEW_LINE>} else if (!mLayers.get(1).isVisible() && !mContinent.isChecked()) {<NEW_LINE>// continent layer is off and menu item unchecked<NEW_LINE>mLayers.get(1).setVisible(true);<NEW_LINE>Log.d("continents", String.valueOf(mLayers.get(1).getOpacity()));<NEW_LINE>mContinent.setChecked(true);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else if (itemId == R.id.World) {<NEW_LINE>if (mLayers.get(2).isVisible() && mWorld.isChecked()) {<NEW_LINE>// world layer is on and menu item checked<NEW_LINE>mLayers.get(2).setVisible(false);<NEW_LINE>mWorld.setChecked(false);<NEW_LINE>} else if (!mLayers.get(2).isVisible() && !mWorld.isChecked()) {<NEW_LINE>// world layer is off and menu item unchecked<NEW_LINE>mLayers.get(2).setVisible(true);<NEW_LINE>Log.d("world", String.valueOf(mLayers.get(2).getOpacity()));<NEW_LINE>mWorld.setChecked(true);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return super.onOptionsItemSelected(item);<NEW_LINE>}<NEW_LINE>} | 0).getOpacity())); |
1,358,818 | private CollisionShape createShape(Transform vertexToShape, Vector3f center, VectorSet vertexLocations) {<NEW_LINE>int numVectors = vertexLocations.numVectors();<NEW_LINE>assert numVectors > 0 : numVectors;<NEW_LINE>Vector3f tempLocation = new Vector3f();<NEW_LINE>int numPoints = vertexLocations.numVectors();<NEW_LINE>float[] points = new float[3 * numPoints];<NEW_LINE>FloatBuffer buffer = vertexLocations.toBuffer();<NEW_LINE>buffer.rewind();<NEW_LINE>int floatIndex = 0;<NEW_LINE>while (buffer.hasRemaining()) {<NEW_LINE>tempLocation.x = buffer.get();<NEW_LINE>tempLocation<MASK><NEW_LINE>tempLocation.z = buffer.get();<NEW_LINE>tempLocation.subtractLocal(center);<NEW_LINE>vertexToShape.transformVector(tempLocation, tempLocation);<NEW_LINE>points[floatIndex] = tempLocation.x;<NEW_LINE>points[floatIndex + 1] = tempLocation.y;<NEW_LINE>points[floatIndex + 2] = tempLocation.z;<NEW_LINE>floatIndex += 3;<NEW_LINE>}<NEW_LINE>CollisionShape result = new HullCollisionShape(points);<NEW_LINE>return result;<NEW_LINE>} | .y = buffer.get(); |
1,749,914 | public void removeMap(final JSONArray args, final CallbackContext callbackContext) throws JSONException {<NEW_LINE>String mapId = args.getString(0);<NEW_LINE>if (mPluginLayout.pluginOverlays.containsKey(mapId)) {<NEW_LINE>IPluginView pluginOverlay = mPluginLayout.removePluginOverlay(mapId);<NEW_LINE>if (pluginOverlay != null) {<NEW_LINE>pluginOverlay.remove(null, null);<NEW_LINE>pluginOverlay.onDestroy();<NEW_LINE>mPluginLayout.HTMLNodes.remove(mapId);<NEW_LINE>pluginOverlay = null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Field pluginMapField = pluginManager.<MASK><NEW_LINE>pluginMapField.setAccessible(true);<NEW_LINE>LinkedHashMap<String, CordovaPlugin> pluginMapInstance = (LinkedHashMap<String, CordovaPlugin>) pluginMapField.get(pluginManager);<NEW_LINE>pluginMapInstance.remove(mapId);<NEW_LINE>Field entryMapField = pluginManager.getClass().getDeclaredField("entryMap");<NEW_LINE>entryMapField.setAccessible(true);<NEW_LINE>LinkedHashMap<String, PluginEntry> entryMapInstance = (LinkedHashMap<String, PluginEntry>) entryMapField.get(pluginManager);<NEW_LINE>entryMapInstance.remove(mapId);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.gc();<NEW_LINE>Runtime.getRuntime().gc();<NEW_LINE>callbackContext.success();<NEW_LINE>} | getClass().getDeclaredField("pluginMap"); |
335,697 | public void run(RegressionEnvironment env) {<NEW_LINE>final long startTime = 1000;<NEW_LINE>sendTimer(env, startTime);<NEW_LINE>String epl = "@name('s0') select symbol, sum(price) as s from SupportMarketDataBean#time_length_batch(5, 10, \"START_EAGER\") group by symbol order by symbol asc";<NEW_LINE>env.compileDeployAddListenerMileZero(epl, "s0");<NEW_LINE>sendTimer(env, startTime + 4000);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendTimer(env, startTime + 6000);<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>assertEquals(1, listener.getNewDataList().size());<NEW_LINE>EventBean[] events = listener.getLastNewData();<NEW_LINE>assertNull(events);<NEW_LINE>listener.reset();<NEW_LINE>});<NEW_LINE>sendTimer(env, startTime + 7000);<NEW_LINE>env.sendEventBean(new SupportMarketDataBean("S1", "e1", 10d));<NEW_LINE>sendTimer(env, startTime + 8000);<NEW_LINE>env.sendEventBean(new SupportMarketDataBean("S2", "e2", 77d));<NEW_LINE>sendTimer(env, startTime + 9000);<NEW_LINE>env.sendEventBean(new SupportMarketDataBean("S1", "e3", 1d));<NEW_LINE>sendTimer(env, startTime + 10000);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE><MASK><NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>assertEquals(1, listener.getNewDataList().size());<NEW_LINE>EventBean[] events = listener.getLastNewData();<NEW_LINE>assertEquals(2, events.length);<NEW_LINE>assertEquals("S1", events[0].get("symbol"));<NEW_LINE>assertEquals(11d, events[0].get("s"));<NEW_LINE>assertEquals("S2", events[1].get("symbol"));<NEW_LINE>assertEquals(77d, events[1].get("s"));<NEW_LINE>listener.reset();<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>} | sendTimer(env, startTime + 11000); |
439,170 | public FieldValue applyTo(FieldValue fval) {<NEW_LINE>if (fval instanceof Array) {<NEW_LINE>Array array = (Array) fval;<NEW_LINE>FieldValue element = array.getFieldValue(((IntegerFieldValue) value).getInteger());<NEW_LINE>element = update.applyTo(element);<NEW_LINE>array.set(((IntegerFieldValue) value).getInteger(), element);<NEW_LINE>} else if (fval instanceof WeightedSet) {<NEW_LINE>WeightedSet wset = (WeightedSet) fval;<NEW_LINE>WeightedSetDataType wtype = wset.getDataType();<NEW_LINE>Integer weight = wset.get(value);<NEW_LINE>if (weight == null) {<NEW_LINE>if (wtype.createIfNonExistent() && update instanceof ArithmeticValueUpdate) {<NEW_LINE>weight = 0;<NEW_LINE>} else {<NEW_LINE>return fval;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>weight = (Integer) update.applyTo(new IntegerFieldValue(weight)).getWrappedValue();<NEW_LINE><MASK><NEW_LINE>if (wtype.removeIfZero() && update instanceof ArithmeticValueUpdate && weight == 0) {<NEW_LINE>wset.remove(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return fval;<NEW_LINE>} | wset.put(value, weight); |
939,879 | final DeleteOptedOutNumberResult executeDeleteOptedOutNumber(DeleteOptedOutNumberRequest deleteOptedOutNumberRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteOptedOutNumberRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteOptedOutNumberRequest> request = null;<NEW_LINE>Response<DeleteOptedOutNumberResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteOptedOutNumberRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteOptedOutNumberRequest));<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, "Pinpoint SMS Voice V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteOptedOutNumber");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteOptedOutNumberResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteOptedOutNumberResultJsonUnmarshaller());<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); |
677,151 | public okhttp3.Call readNamespacedEndpointSliceCall(String name, String namespace, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<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 HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<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 = {};<NEW_LINE>final String <MASK><NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); |
1,599,121 | final DeleteTemplateResult executeDeleteTemplate(DeleteTemplateRequest deleteTemplateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteTemplateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DeleteTemplateRequest> request = null;<NEW_LINE>Response<DeleteTemplateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteTemplateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteTemplateRequest));<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, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteTemplate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteTemplateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteTemplateResultJsonUnmarshaller());<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); |
309,513 | private void generate(final Instant start, final Instant end, final ResourceId resourceId) {<NEW_LINE>if (start == null || end == null || resourceId == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ResourceType resourceType = getResourceType(resourceId);<NEW_LINE>final TemporalUnit durationUnit = resourceType.getDurationUnit();<NEW_LINE>final String rowKey_DailyCapacity = Msg.translate(Env.getCtx(), "DailyCapacity");<NEW_LINE>final String rowKey_ActualLoad = Msg.translate(Env.getCtx(), "ActualLoad");<NEW_LINE>final DateFormat formatter = DisplayType.getDateFormat(DisplayType.DateTime, Env.getLanguage(Env.getCtx()));<NEW_LINE>final I_S_Resource resource = resourcesRepo.getById(resourceId);<NEW_LINE>final Duration dailyCapacity = getDailyCapacity(resource);<NEW_LINE>final BigDecimal dailyCapacityBD = DurationUtils.toBigDecimal(dailyCapacity, durationUnit);<NEW_LINE>dataset = new DefaultCategoryDataset();<NEW_LINE>final HashMap<DefaultMutableTreeNode, String> names = new HashMap<>();<NEW_LINE>final DefaultMutableTreeNode root = new DefaultMutableTreeNode(resource);<NEW_LINE>names.put(root, getTreeNodeRepresentation(null, root, resource));<NEW_LINE>Instant dateTime = start;<NEW_LINE>while (end.isAfter(dateTime)) {<NEW_LINE>final String columnKey = formatter.format(TimeUtil.asDate(dateTime));<NEW_LINE>names.putAll(addTreeNodes(dateTime, root, resource));<NEW_LINE>if (isAvailable(resource, dateTime)) {<NEW_LINE>final BigDecimal actualLoadBD = BigDecimal.valueOf(calculateLoad(dateTime, resourceId).get(durationUnit));<NEW_LINE>dataset.addValue(dailyCapacityBD, rowKey_DailyCapacity, columnKey);<NEW_LINE>dataset.addValue(actualLoadBD, rowKey_ActualLoad, columnKey);<NEW_LINE>} else {<NEW_LINE>dataset.addValue(<MASK><NEW_LINE>dataset.addValue(BigDecimal.ZERO, rowKey_ActualLoad, columnKey);<NEW_LINE>}<NEW_LINE>// TODO: teo_sarca: increment should be more general, not only days<NEW_LINE>dateTime = dateTime.plus(1, ChronoUnit.DAYS);<NEW_LINE>}<NEW_LINE>tree = new JTree(root);<NEW_LINE>tree.setCellRenderer(new DiagramTreeCellRenderer(names));<NEW_LINE>} | BigDecimal.ZERO, rowKey_DailyCapacity, columnKey); |
1,111,592 | public void translateTag(NbtMapBuilder builder, CompoundTag tag, int blockState) {<NEW_LINE>if (tag == null || tag.size() < 5) {<NEW_LINE>// These values aren't here<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Java infers from the block state, but Bedrock needs it in the tag<NEW_LINE>builder.put("conditionalMode", BlockStateValues.getCommandBlockValues().getOrDefault(blockState, (byte) 0));<NEW_LINE>// Java and Bedrock values<NEW_LINE>builder.put("conditionMet", ((ByteTag) tag.get("conditionMet")).getValue());<NEW_LINE>builder.put("auto", ((ByteTag) tag.get("auto")).getValue());<NEW_LINE>builder.put("CustomName", MessageTranslator.convertMessage(((StringTag) tag.get("CustomName")).getValue()));<NEW_LINE>builder.put("powered", ((ByteTag) tag.get("powered")).getValue());<NEW_LINE>builder.put("Command", ((StringTag) tag.get("Command")).getValue());<NEW_LINE>builder.put("SuccessCount", ((IntTag) tag.get("SuccessCount")).getValue());<NEW_LINE>builder.put("TrackOutput", ((ByteTag) tag.get("TrackOutput")).getValue());<NEW_LINE>builder.put("UpdateLastExecution", ((ByteTag) tag.get(<MASK><NEW_LINE>if (tag.get("LastExecution") != null) {<NEW_LINE>builder.put("LastExecution", ((LongTag) tag.get("LastExecution")).getValue());<NEW_LINE>} else {<NEW_LINE>builder.put("LastExecution", (long) 0);<NEW_LINE>}<NEW_LINE>} | "UpdateLastExecution")).getValue()); |
1,719,469 | public void postAction(Object action, final Runnable actionPerformedNotifier) {<NEW_LINE>logger.fine("S StartActionProvider.postAction ()");<NEW_LINE>JPDADebuggerImpl debugger = (JPDADebuggerImpl) lookupProvider.lookupFirst(null, JPDADebugger.class);<NEW_LINE>if (debugger != null && debugger.getVirtualMachine() != null) {<NEW_LINE>actionPerformedNotifier.run();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final AbstractDICookie cookie = lookupProvider.lookupFirst(null, AbstractDICookie.class);<NEW_LINE><MASK><NEW_LINE>// JS<NEW_LINE>debuggerImpl.setStarting();<NEW_LINE>logger.fine("S StartActionProvider." + "postAction () setStarting end");<NEW_LINE>debuggerImpl.getRequestProcessor().post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>// debuggerImpl.setStartingThread(Thread.currentThread());<NEW_LINE>synchronized (startingThreadLock) {<NEW_LINE>startingThread = Thread.currentThread();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>doStartDebugger(cookie);<NEW_LINE>// } catch (InterruptedException iex) {<NEW_LINE>// We've interrupted ourselves<NEW_LINE>} finally {<NEW_LINE>synchronized (startingThreadLock) {<NEW_LINE>startingThread = null;<NEW_LINE>startingThreadLock.notifyAll();<NEW_LINE>}<NEW_LINE>// debuggerImpl.unsetStartingThread();<NEW_LINE>actionPerformedNotifier.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | logger.fine("S StartActionProvider." + "postAction () setStarting"); |
1,043,422 | public static Map<String, String> byBufferedReader(String filePath, DupKeyOption dupKeyOption) {<NEW_LINE>HashMap<String, String> map = new HashMap<>();<NEW_LINE>String line;<NEW_LINE>try (BufferedReader reader = new BufferedReader(new FileReader(filePath))) {<NEW_LINE>while ((line = reader.readLine()) != null) {<NEW_LINE>String[] keyValuePair = line.split(":", 2);<NEW_LINE>if (keyValuePair.length > 1) {<NEW_LINE>String key = keyValuePair[0];<NEW_LINE>String value = keyValuePair[1];<NEW_LINE>if (DupKeyOption.OVERWRITE == dupKeyOption) {<NEW_LINE>map.put(key, value);<NEW_LINE>} else if (DupKeyOption.DISCARD == dupKeyOption) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.out.println("No Key:Value found in line, ignoring: " + line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>} | map.putIfAbsent(key, value); |
799,883 | final ListInvitationsResult executeListInvitations(ListInvitationsRequest listInvitationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listInvitationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListInvitationsRequest> request = null;<NEW_LINE>Response<ListInvitationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListInvitationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listInvitationsRequest));<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, "ManagedBlockchain");<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>HttpResponseHandler<AmazonWebServiceResponse<ListInvitationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListInvitationsResultJsonUnmarshaller());<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, "ListInvitations"); |
414,147 | final SubscribeResult executeSubscribe(SubscribeRequest subscribeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(subscribeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SubscribeRequest> request = null;<NEW_LINE>Response<SubscribeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SubscribeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(subscribeRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "codestar notifications");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "Subscribe");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SubscribeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>} | false), new SubscribeResultJsonUnmarshaller()); |
822,720 | public final long ctxTypeGenericNew(long typeHandle) {<NEW_LINE>Counter.UpcallTypeGenericNew.increment();<NEW_LINE>Object type = getObjectForHPyHandle(GraalHPyBoxing.unboxHandle(typeHandle)).getDelegate();<NEW_LINE>if (type instanceof PythonClass) {<NEW_LINE>PythonClass clazz = (PythonClass) type;<NEW_LINE>PythonObject pythonObject;<NEW_LINE>long basicSize = clazz.basicSize;<NEW_LINE>if (basicSize != -1) {<NEW_LINE>// allocate native space<NEW_LINE>long dataPtr = unsafe.allocateMemory(basicSize);<NEW_LINE>unsafe.setMemory(dataPtr<MASK><NEW_LINE>pythonObject = slowPathFactory.createPythonHPyObject(clazz, dataPtr);<NEW_LINE>} else {<NEW_LINE>pythonObject = slowPathFactory.createPythonObject(clazz);<NEW_LINE>}<NEW_LINE>return GraalHPyBoxing.boxHandle(createHandle(pythonObject).getId(this, ConditionProfile.getUncached()));<NEW_LINE>}<NEW_LINE>throw CompilerDirectives.shouldNotReachHere("not implemented");<NEW_LINE>} | , basicSize, (byte) 0); |
672,398 | private static void tryAssertion12(RegressionEnvironment env, String stmtText, String outputLimit, AtomicInteger milestone) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>String[] fields = new String[] { "symbol", "volume", "sum(price)" };<NEW_LINE>ResultAssertTestResult expected = new ResultAssertTestResult(CATEGORY, outputLimit, fields);<NEW_LINE>expected.addResultInsert(200, 1, new Object[][] { { "IBM", 100L, 25d } });<NEW_LINE>expected.addResultInsert(800, 1, new Object[][] { { "MSFT", 5000L, 9d } });<NEW_LINE>expected.addResultInsert(1500, 1, new Object[][] { { "IBM", 150L, 49d } });<NEW_LINE>expected.addResultInsert(1500, 2, new Object[][] { { "YAH", 10000L, 1d } });<NEW_LINE>expected.addResultInsert(2100, 1, new Object[][] { { "IBM", 155L, 75d } });<NEW_LINE>expected.addResultInsert(3500, 1, new Object[][] { { "YAH", 11000L, 3d } });<NEW_LINE>expected.addResultInsert(4300, 1, new Object[][] { { "IBM", 150L, 97d } });<NEW_LINE>expected.addResultInsert(4900, 1, new Object[][] { { "YAH", 11500L, 6d } });<NEW_LINE>expected.addResultRemove(5700, 0, new Object[][] { { <MASK><NEW_LINE>expected.addResultInsert(5900, 1, new Object[][] { { "YAH", 10500L, 7d } });<NEW_LINE>expected.addResultRemove(6300, 0, new Object[][] { { "MSFT", 5000L, null } });<NEW_LINE>expected.addResultRemove(7000, 0, new Object[][] { { "IBM", 150L, 48d }, { "YAH", 10000L, 6d } });<NEW_LINE>ResultAssertExecution execution = new ResultAssertExecution(stmtText, env, expected);<NEW_LINE>execution.execute(false, milestone);<NEW_LINE>} | "IBM", 100L, 72d } }); |
1,755,108 | final void updatePresence() {<NEW_LINE>if (connection == null) {<NEW_LINE>parent.getEss().getLogger().warning(tl("xmppNotConfigured"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int usercount;<NEW_LINE>final StringBuilder stringBuilder = new StringBuilder();<NEW_LINE>usercount = parent.getEss().getOnlinePlayers().size();<NEW_LINE>if (usercount == 0) {<NEW_LINE>final String presenceMsg = "No one online.";<NEW_LINE>connection.sendPacket(new Presence(Presence.Type.available, presenceMsg, 2<MASK><NEW_LINE>}<NEW_LINE>if (usercount == 1) {<NEW_LINE>final String presenceMsg = "1 player online.";<NEW_LINE>connection.sendPacket(new Presence(Presence.Type.available, presenceMsg, 2, Presence.Mode.available));<NEW_LINE>}<NEW_LINE>if (usercount > 1) {<NEW_LINE>stringBuilder.append(usercount).append(" players online.");<NEW_LINE>connection.sendPacket(new Presence(Presence.Type.available, stringBuilder.toString(), 2, Presence.Mode.available));<NEW_LINE>}<NEW_LINE>} | , Presence.Mode.dnd)); |
1,656,708 | final CreateStackInstancesResult executeCreateStackInstances(CreateStackInstancesRequest createStackInstancesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createStackInstancesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateStackInstancesRequest> request = null;<NEW_LINE>Response<CreateStackInstancesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateStackInstancesRequestMarshaller().marshall(super.beforeMarshalling(createStackInstancesRequest));<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, "CloudFormation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateStackInstances");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateStackInstancesResult> responseHandler = new StaxResponseHandler<CreateStackInstancesResult>(new CreateStackInstancesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,337,906 | public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {<NEW_LINE>final InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer);<NEW_LINE>// Async Object<NEW_LINE>target.addField(AsyncContextAccessor.class);<NEW_LINE>target.addField(ReactorContextAccessor.class);<NEW_LINE>for (InstrumentMethod constructorMethod : target.getDeclaredConstructors()) {<NEW_LINE>final String[] parameterTypes = constructorMethod.getParameterTypes();<NEW_LINE>if (parameterTypes != null || parameterTypes.length > 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>final InstrumentMethod subscribeMethod = target.getDeclaredMethod("subscribe", "reactor.core.CoreSubscriber");<NEW_LINE>if (subscribeMethod != null) {<NEW_LINE>subscribeMethod.addInterceptor(FluxAndMonoOperatorSubscribeInterceptor.class, va(ReactorNettyConstants.REACTOR_NETTY_INTERNAL));<NEW_LINE>}<NEW_LINE>// since 3.3.0<NEW_LINE>final InstrumentMethod subscribeOrReturnMethod = target.getDeclaredMethod("subscribeOrReturn", "reactor.core.CoreSubscriber");<NEW_LINE>if (subscribeOrReturnMethod != null) {<NEW_LINE>subscribeOrReturnMethod.addInterceptor(FluxAndMonoOperatorSubscribeInterceptor.class, va(ReactorNettyConstants.REACTOR_NETTY_INTERNAL));<NEW_LINE>}<NEW_LINE>return target.toBytecode();<NEW_LINE>} | constructorMethod.addInterceptor(FluxAndMonoOperatorConstructorInterceptor.class); |
211,561 | // this is dynamic, don't have concrete classes for the FieldDef<NEW_LINE>@SuppressWarnings({ "unchecked", "rawtypes" })<NEW_LINE>private ActionMetadata toActionMetadata(ActionSchema action) {<NEW_LINE>ArrayList<FieldDef<?>> fieldDefs = new ArrayList<>();<NEW_LINE>if (action.hasParameters()) {<NEW_LINE>for (ParameterSchema parameterSchema : action.getParameters()) {<NEW_LINE>DataSchema dataSchema = RestSpecCodec.textToSchema(parameterSchema.getType(), _schemaResolver);<NEW_LINE>Class<?> paramClass = toType(dataSchema);<NEW_LINE>FieldDef<?> fieldDef = new FieldDef(parameterSchema.getName(), paramClass, dataSchema);<NEW_LINE>fieldDefs.add(fieldDef);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collection<FieldDef<?>> response;<NEW_LINE>if (action.hasReturns()) {<NEW_LINE>DataSchema returnType = RestSpecCodec.textToSchema(action.getReturns(), _schemaResolver);<NEW_LINE>Class<<MASK><NEW_LINE>response = Collections.<FieldDef<?>>singletonList(new FieldDef("value", returnClass, returnType));<NEW_LINE>} else {<NEW_LINE>response = Collections.emptyList();<NEW_LINE>}<NEW_LINE>return new ActionMetadata(action.getName(), new DynamicRecordMetadata(action.getName(), fieldDefs), new DynamicRecordMetadata(action.getName(), response));<NEW_LINE>} | ?> returnClass = toType(returnType); |
916,271 | public void startDrag(DragSourceContext dsc, Cursor c, Image di, Point p) throws InvalidDnDOperationException {<NEW_LINE>if (getTrigger().getTriggerEvent() == null) {<NEW_LINE>throw new InvalidDnDOperationException("DragGestureEvent has a null trigger");<NEW_LINE>}<NEW_LINE>dragSourceContext = dsc;<NEW_LINE>cursor = c;<NEW_LINE>sourceActions = getDragSourceContext().getSourceActions();<NEW_LINE>dragImage = di;<NEW_LINE>dragImageOffset = p;<NEW_LINE>Transferable transferable = getDragSourceContext().getTransferable();<NEW_LINE>SortedMap<Long, DataFlavor> formatMap = DataTransferer.getInstance().getFormatsForTransferable(transferable, DataTransferer.adaptFlavorMap(getTrigger().getDragSource<MASK><NEW_LINE>long[] formats = DataTransferer.getInstance().keysToLongArray(formatMap);<NEW_LINE>startDrag(transferable, formats, formatMap);<NEW_LINE>discardingMouseEvents = true;<NEW_LINE>EventQueue.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>discardingMouseEvents = false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ().getFlavorMap())); |
1,403,356 | void anonfun_9(Guard pc_21, EventBuffer effects, NamedTupleVS var_rTrans) {<NEW_LINE>PrimitiveVS<Machine> var_$tmp0 = new PrimitiveVS<Machine>().restrict(pc_21);<NEW_LINE>PrimitiveVS<Machine> var_$tmp1 = new PrimitiveVS<Machine>().restrict(pc_21);<NEW_LINE>PrimitiveVS<Event> var_$tmp2 = new PrimitiveVS<Event>(_null).restrict(pc_21);<NEW_LINE>NamedTupleVS var_$tmp3 = new NamedTupleVS("client", new PrimitiveVS<Machine>(), "key", new PrimitiveVS<Integer>(0)).restrict(pc_21);<NEW_LINE>PrimitiveVS<Machine> temp_var_70;<NEW_LINE>temp_var_70 = (PrimitiveVS<Machine>) scheduler.getNextElement(var_participants.restrict(pc_21), pc_21);<NEW_LINE>var_$tmp0 = var_$tmp0.updateUnderGuard(pc_21, temp_var_70);<NEW_LINE>PrimitiveVS<Machine> temp_var_71;<NEW_LINE>temp_var_71 = var_$tmp0.restrict(pc_21);<NEW_LINE>var_$tmp1 = var_$tmp1.updateUnderGuard(pc_21, temp_var_71);<NEW_LINE>PrimitiveVS<Event> temp_var_72;<NEW_LINE>temp_var_72 = new PrimitiveVS<Event>(eReadTransReq).restrict(pc_21);<NEW_LINE>var_$tmp2 = var_$tmp2.updateUnderGuard(pc_21, temp_var_72);<NEW_LINE>NamedTupleVS temp_var_73;<NEW_LINE>temp_var_73 = var_rTrans.restrict(pc_21);<NEW_LINE>var_$tmp3 = <MASK><NEW_LINE>effects.send(pc_21, var_$tmp1.restrict(pc_21), var_$tmp2.restrict(pc_21), new UnionVS(var_$tmp3.restrict(pc_21)));<NEW_LINE>} | var_$tmp3.updateUnderGuard(pc_21, temp_var_73); |
554,448 | public void checkAvailability(final ReturnValueCompletion<Boolean> completion) {<NEW_LINE>ConsoleProxyCommands.CheckAvailabilityCmd cmd = new ConsoleProxyCommands.CheckAvailabilityCmd();<NEW_LINE>cmd.setProxyHostname(self.getProxyHostname());<NEW_LINE>cmd.<MASK><NEW_LINE>cmd.setTargetSchema(self.getTargetSchema());<NEW_LINE>cmd.setTargetHostname(self.getTargetHostname());<NEW_LINE>cmd.setTargetPort(self.getTargetPort());<NEW_LINE>cmd.setProxyIdentity(self.getProxyIdentity());<NEW_LINE>cmd.setToken(self.getToken());<NEW_LINE>cmd.setScheme(self.getScheme());<NEW_LINE>restf.asyncJsonPost(URLBuilder.buildHttpUrl(self.getAgentIp(), agentPort, ConsoleConstants.CONSOLE_PROXY_CHECK_PROXY_PATH), cmd, new JsonAsyncRESTCallback<ConsoleProxyCommands.CheckAvailabilityRsp>(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode err) {<NEW_LINE>completion.fail(err);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(ConsoleProxyCommands.CheckAvailabilityRsp ret) {<NEW_LINE>if (ret.isSuccess()) {<NEW_LINE>completion.success(ret.getAvailable());<NEW_LINE>} else {<NEW_LINE>completion.fail(operr("unable to check console proxy availability, because %s", ret.getError()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Class<ConsoleProxyCommands.CheckAvailabilityRsp> getReturnClass() {<NEW_LINE>return ConsoleProxyCommands.CheckAvailabilityRsp.class;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | setProxyPort(self.getProxyPort()); |
1,052,119 | public static void convolve5(Kernel2D_S32 kernel, GrayS32 src, GrayS32 dest) {<NEW_LINE>final int[] dataSrc = src.data;<NEW_LINE>final int[] dataDst = dest.data;<NEW_LINE>final int width = src.getWidth();<NEW_LINE>final int height = src.getHeight();<NEW_LINE>final int kernelRadius = kernel.getRadius();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(kernelRadius, height-kernelRadius, y -> {<NEW_LINE>for (int y = kernelRadius; y < height - kernelRadius; y++) {<NEW_LINE>// first time through the value needs to be set<NEW_LINE>int k1 = kernel.data[0];<NEW_LINE>int k2 = kernel.data[1];<NEW_LINE>int k3 = kernel.data[2];<NEW_LINE>int k4 = kernel.data[3];<NEW_LINE>int k5 = kernel.data[4];<NEW_LINE>int indexDst = dest.startIndex + y * dest.stride + kernelRadius;<NEW_LINE>int indexSrcRow = src.startIndex + (y - kernelRadius) * src.stride - kernelRadius;<NEW_LINE>for (int x = kernelRadius; x < width - kernelRadius; x++) {<NEW_LINE>int indexSrc = indexSrcRow + x;<NEW_LINE>int total = 0;<NEW_LINE>total += (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (<MASK><NEW_LINE>total += (dataSrc[indexSrc++]) * k4;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>dataDst[indexDst++] = total;<NEW_LINE>}<NEW_LINE>// rest of the convolution rows are an addition<NEW_LINE>for (int i = 1; i < 5; i++) {<NEW_LINE>indexDst = dest.startIndex + y * dest.stride + kernelRadius;<NEW_LINE>indexSrcRow = src.startIndex + (y + i - kernelRadius) * src.stride - kernelRadius;<NEW_LINE>k1 = kernel.data[i * 5 + 0];<NEW_LINE>k2 = kernel.data[i * 5 + 1];<NEW_LINE>k3 = kernel.data[i * 5 + 2];<NEW_LINE>k4 = kernel.data[i * 5 + 3];<NEW_LINE>k5 = kernel.data[i * 5 + 4];<NEW_LINE>for (int x = kernelRadius; x < width - kernelRadius; x++) {<NEW_LINE>int indexSrc = indexSrcRow + x;<NEW_LINE>int total = 0;<NEW_LINE>total += (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (dataSrc[indexSrc++]) * k3;<NEW_LINE>total += (dataSrc[indexSrc++]) * k4;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>dataDst[indexDst++] += total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | dataSrc[indexSrc++]) * k3; |
289,086 | static void selectNextPrev(final boolean next, boolean isQuery, JTree tree) {<NEW_LINE>int[] rows = tree.getSelectionRows();<NEW_LINE>int newRow = rows == null || rows.length == 0 ? 0 : rows[0];<NEW_LINE>int maxcount = tree.getRowCount();<NEW_LINE>CheckNode node;<NEW_LINE>do {<NEW_LINE>if (next) {<NEW_LINE>newRow++;<NEW_LINE>if (newRow >= maxcount) {<NEW_LINE>newRow = 0;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>newRow--;<NEW_LINE>if (newRow < 0) {<NEW_LINE>newRow = maxcount - 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TreePath path = tree.getPathForRow(newRow);<NEW_LINE>node = <MASK><NEW_LINE>if (!node.isLeaf()) {<NEW_LINE>tree.expandRow(newRow);<NEW_LINE>maxcount = tree.getRowCount();<NEW_LINE>}<NEW_LINE>} while (!node.isLeaf());<NEW_LINE>tree.setSelectionRow(newRow);<NEW_LINE>tree.scrollRowToVisible(newRow);<NEW_LINE>if (isQuery) {<NEW_LINE>CheckNodeListener.findInSource(node);<NEW_LINE>} else {<NEW_LINE>CheckNodeListener.openDiff(node);<NEW_LINE>}<NEW_LINE>} | (CheckNode) path.getLastPathComponent(); |
176,074 | public void read(org.apache.thrift.protocol.TProtocol prot, BuckCacheMultiContainsRequest struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(3);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TList _list39 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.<MASK><NEW_LINE>struct.ruleKeys = new java.util.ArrayList<RuleKey>(_list39.size);<NEW_LINE>@org.apache.thrift.annotation.Nullable<NEW_LINE>RuleKey _elem40;<NEW_LINE>for (int _i41 = 0; _i41 < _list39.size; ++_i41) {<NEW_LINE>_elem40 = new RuleKey();<NEW_LINE>_elem40.read(iprot);<NEW_LINE>struct.ruleKeys.add(_elem40);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>struct.setRuleKeysIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.repository = iprot.readString();<NEW_LINE>struct.setRepositoryIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct.scheduleType = iprot.readString();<NEW_LINE>struct.setScheduleTypeIsSet(true);<NEW_LINE>}<NEW_LINE>} | STRUCT, iprot.readI32()); |
1,133,239 | public static void main(String[] args) {<NEW_LINE>// Queue for incoming messages represented as Flux<NEW_LINE>// Imagine that every fireAndForget that is pushed is processed by a worker<NEW_LINE>BlockingQueue<Runnable> tasksQueue <MASK><NEW_LINE>ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, CONCURRENT_WORKERS_COUNT, 1, TimeUnit.MINUTES, tasksQueue);<NEW_LINE>Scheduler workScheduler = Schedulers.fromExecutorService(threadPoolExecutor);<NEW_LINE>LeaseManager periodicLeaseSender = new LeaseManager(CONCURRENT_WORKERS_COUNT, PROCESSING_TASK_TIME);<NEW_LINE>Disposable.Composite disposable = Disposables.composite();<NEW_LINE>RSocket clientRSocket = RSocketConnector.create().acceptor(SocketAcceptor.with(new TasksHandlingRSocket(disposable, workScheduler, PROCESSING_TASK_TIME))).lease((config) -> config.sender(new LimitBasedLeaseSender(UUID.randomUUID().toString(), periodicLeaseSender, VegasLimit.newBuilder().initialLimit(CONCURRENT_WORKERS_COUNT).maxConcurrency(QUEUE_CAPACITY).build()))).connect(TcpClientTransport.create("localhost", 7000)).block();<NEW_LINE>Objects.requireNonNull(clientRSocket);<NEW_LINE>disposable.add(clientRSocket);<NEW_LINE>clientRSocket.onClose().block();<NEW_LINE>} | = new ArrayBlockingQueue<>(QUEUE_CAPACITY); |
1,791,802 | public GetScalingPlanResourceForecastDataResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetScalingPlanResourceForecastDataResult getScalingPlanResourceForecastDataResult = new GetScalingPlanResourceForecastDataResult();<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 getScalingPlanResourceForecastDataResult;<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("Datapoints", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getScalingPlanResourceForecastDataResult.setDatapoints(new ListUnmarshaller<Datapoint>(DatapointJsonUnmarshaller.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 getScalingPlanResourceForecastDataResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
126,223 | void storeFinishedSessions(List<FinishedSession> sessions) {<NEW_LINE>if (sessions.isEmpty())<NEW_LINE>return;<NEW_LINE>if (storeLocation.toFile().exists()) {<NEW_LINE>sessions.addAll(loadFinishedSessions());<NEW_LINE>}<NEW_LINE>List<String> lines = sessions.stream().map(FinishedSession::serializeCSV).collect(Collectors.toList());<NEW_LINE>try {<NEW_LINE>Files.write(storeLocation, lines, StandardCharsets.UTF_8, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.warn("Place this to " + storeLocation.toFile(<MASK><NEW_LINE>logger.warn(new TextStringBuilder().appendWithSeparators(lines, "\n").build());<NEW_LINE>throw new IllegalStateException("Could not write " + storeLocation.toFile().getAbsolutePath() + ", " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | ).getAbsolutePath() + " if you wish to store missing sessions:"); |
180,813 | default void applyTaskIdHistoryBaseQuery(StringBuilder sqlBuilder, Map<String, Object> binds, Optional<String> requestId, Optional<String> deployId, Optional<String> runId, Optional<String> host, Optional<ExtendedTaskState> lastTaskStatus, Optional<Long> startedBefore, Optional<Long> startedAfter, Optional<Long> updatedBefore, Optional<Long> updatedAfter) {<NEW_LINE>if (shouldAddForceIndexClause(requestId, deployId, runId, host, lastTaskStatus, updatedBefore, updatedAfter)) {<NEW_LINE>sqlBuilder.append(" FORCE INDEX (hostUpdated) ");<NEW_LINE>}<NEW_LINE>if (requestId.isPresent()) {<NEW_LINE>addWhereOrAnd(sqlBuilder, binds.isEmpty());<NEW_LINE>sqlBuilder.append("requestId = :requestId");<NEW_LINE>binds.put(<MASK><NEW_LINE>}<NEW_LINE>if (deployId.isPresent()) {<NEW_LINE>addWhereOrAnd(sqlBuilder, binds.isEmpty());<NEW_LINE>sqlBuilder.append("deployId = :deployId");<NEW_LINE>binds.put("deployId", deployId.get());<NEW_LINE>}<NEW_LINE>if (runId.isPresent()) {<NEW_LINE>addWhereOrAnd(sqlBuilder, binds.isEmpty());<NEW_LINE>sqlBuilder.append("runId = :runId");<NEW_LINE>binds.put("runId", runId.get());<NEW_LINE>}<NEW_LINE>if (host.isPresent()) {<NEW_LINE>addWhereOrAnd(sqlBuilder, binds.isEmpty());<NEW_LINE>sqlBuilder.append("host = :host");<NEW_LINE>binds.put("host", host.get());<NEW_LINE>}<NEW_LINE>if (lastTaskStatus.isPresent()) {<NEW_LINE>addWhereOrAnd(sqlBuilder, binds.isEmpty());<NEW_LINE>sqlBuilder.append("lastTaskStatus = :lastTaskStatus");<NEW_LINE>binds.put("lastTaskStatus", lastTaskStatus.get().name());<NEW_LINE>}<NEW_LINE>if (startedBefore.isPresent()) {<NEW_LINE>addWhereOrAnd(sqlBuilder, binds.isEmpty());<NEW_LINE>sqlBuilder.append("startedAt < :startedBefore");<NEW_LINE>binds.put("startedBefore", new Date(startedBefore.get()));<NEW_LINE>}<NEW_LINE>if (startedAfter.isPresent()) {<NEW_LINE>addWhereOrAnd(sqlBuilder, binds.isEmpty());<NEW_LINE>sqlBuilder.append("startedAt > :startedAfter");<NEW_LINE>binds.put("startedAfter", new Date(startedAfter.get()));<NEW_LINE>}<NEW_LINE>if (updatedBefore.isPresent()) {<NEW_LINE>addWhereOrAnd(sqlBuilder, binds.isEmpty());<NEW_LINE>sqlBuilder.append("updatedAt < :updatedBefore");<NEW_LINE>binds.put("updatedBefore", new Date(updatedBefore.get()));<NEW_LINE>}<NEW_LINE>if (updatedAfter.isPresent()) {<NEW_LINE>addWhereOrAnd(sqlBuilder, binds.isEmpty());<NEW_LINE>sqlBuilder.append("updatedAt > :updatedAfter");<NEW_LINE>binds.put("updatedAfter", new Date(updatedAfter.get()));<NEW_LINE>}<NEW_LINE>} | "requestId", requestId.get()); |
1,109,658 | protected void createBpmnZipEntries(List<AppModelDefinition> modelDefinitions, ZipOutputStream zipOutputStream, ConverterContext converterContext) throws Exception {<NEW_LINE>for (AppModelDefinition modelDef : modelDefinitions) {<NEW_LINE>Model model = modelService.<MASK><NEW_LINE>List<Model> referencedModels = modelRepository.findByParentModelId(model.getId());<NEW_LINE>for (Model childModel : referencedModels) {<NEW_LINE>if (Model.MODEL_TYPE_FORM == childModel.getModelType()) {<NEW_LINE>converterContext.addFormModel(childModel);<NEW_LINE>} else if (Model.MODEL_TYPE_DECISION_TABLE == childModel.getModelType()) {<NEW_LINE>converterContext.addDecisionTableModel(childModel);<NEW_LINE>} else if (Model.MODEL_TYPE_DECISION_SERVICE == childModel.getModelType()) {<NEW_LINE>converterContext.addDecisionServiceModel(childModel);<NEW_LINE>List<Model> referencedDecisionTableModels = modelRepository.findByParentModelId(childModel.getId());<NEW_LINE>referencedDecisionTableModels.stream().filter(refModel -> Model.MODEL_TYPE_DECISION_TABLE == refModel.getModelType()).forEach(converterContext::addReferencedDecisionTableModel);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BpmnModel bpmnModel = modelService.getBpmnModel(model, converterContext);<NEW_LINE>Map<String, StartEvent> noneStartEventMap = new HashMap<>();<NEW_LINE>postProcessFlowElements(new ArrayList<>(), noneStartEventMap, bpmnModel);<NEW_LINE>for (Process process : bpmnModel.getProcesses()) {<NEW_LINE>processUserTasks(process.getFlowElements(), process, noneStartEventMap);<NEW_LINE>}<NEW_LINE>byte[] modelXML = modelService.getBpmnXML(bpmnModel);<NEW_LINE>// add BPMN XML model<NEW_LINE>createZipEntry(zipOutputStream, "bpmn-models/" + model.getKey().replaceAll(" ", "") + ".bpmn", modelXML);<NEW_LINE>// add JSON model<NEW_LINE>createZipEntries(model, "bpmn-models", zipOutputStream);<NEW_LINE>}<NEW_LINE>} | getModel(modelDef.getId()); |
1,202,878 | private ORawBuffer readRecord(final ORecordId rid, final boolean prefetchRecords) {<NEW_LINE>checkOpennessAndMigration();<NEW_LINE>if (!rid.isPersistent()) {<NEW_LINE>throw new ORecordNotFoundException(rid, "Cannot read record " + rid + " since the position is invalid in database '" + name + '\'');<NEW_LINE>}<NEW_LINE>if (transaction.get() != null) {<NEW_LINE>final OCluster cluster;<NEW_LINE>try {<NEW_LINE>cluster = doGetAndCheckCluster(rid.getClusterId());<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Disabled this assert have no meaning anymore<NEW_LINE>// assert iLockingStrategy.equals(LOCKING_STRATEGY.DEFAULT);<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>stateLock.acquireReadLock();<NEW_LINE>try {<NEW_LINE>interruptionManager.enterCriticalPath();<NEW_LINE>if (readLock) {<NEW_LINE>final ODatabaseDocumentInternal db = ODatabaseRecordThreadLocal.instance().getIfDefined();<NEW_LINE>if (db == null || !((OTransactionAbstract) db.getTransaction()).getLockedRecords().contains(rid)) {<NEW_LINE>acquireReadLock(rid);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>checkOpennessAndMigration();<NEW_LINE>checkIfThreadIsBlocked();<NEW_LINE>final OCluster cluster;<NEW_LINE>try {<NEW_LINE>cluster = doGetAndCheckCluster(rid.getClusterId());<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return doReadRecord(cluster, rid, prefetchRecords);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (readLock) {<NEW_LINE>final ODatabaseDocumentInternal db = ODatabaseRecordThreadLocal.instance().getIfDefined();<NEW_LINE>if (db == null || !((OTransactionAbstract) db.getTransaction()).getLockedRecords().contains(rid)) {<NEW_LINE>releaseReadLock(rid);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>stateLock.releaseReadLock();<NEW_LINE>interruptionManager.exitCriticalPath();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | doReadRecord(cluster, rid, prefetchRecords); |
89,706 | private void registerActions() {<NEW_LINE>InputMap inputMap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);<NEW_LINE>ActionMap actionMap = getActionMap();<NEW_LINE>final String filterKey = org.netbeans.lib.profiler.ui.swing.FilterUtils.FILTER_ACTION_KEY;<NEW_LINE>Action filterAction = new AbstractAction() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>ProfilerFeature feature = featuresView.getSelectedFeature();<NEW_LINE>JPanel resultsUI = feature == null ? null : feature.getResultsUI();<NEW_LINE>if (resultsUI == null)<NEW_LINE>return;<NEW_LINE>Action action = resultsUI.getActionMap().get(filterKey);<NEW_LINE>if (action != null && action.isEnabled())<NEW_LINE>action.actionPerformed(e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ActionsSupport.registerAction(<MASK><NEW_LINE>final String findKey = SearchUtils.FIND_ACTION_KEY;<NEW_LINE>Action findAction = new AbstractAction() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>ProfilerFeature feature = featuresView.getSelectedFeature();<NEW_LINE>JPanel resultsUI = feature == null ? null : feature.getResultsUI();<NEW_LINE>if (resultsUI == null)<NEW_LINE>return;<NEW_LINE>Action action = resultsUI.getActionMap().get(findKey);<NEW_LINE>if (action != null && action.isEnabled())<NEW_LINE>action.actionPerformed(e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ActionsSupport.registerAction(findKey, findAction, actionMap, inputMap);<NEW_LINE>} | filterKey, filterAction, actionMap, inputMap); |
1,752,501 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>pastOccurrencesCheckbox = <MASK><NEW_LINE>crFrequencyList = new org.sleuthkit.autopsy.guiutils.CheckBoxListPanel<>();<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(pastOccurrencesCheckbox, org.openide.util.NbBundle.getMessage(PastOccurrencesFilterPanel.class, "PastOccurrencesFilterPanel.pastOccurrencesCheckbox.text"));<NEW_LINE>pastOccurrencesCheckbox.setMaximumSize(new java.awt.Dimension(150, 25));<NEW_LINE>pastOccurrencesCheckbox.setMinimumSize(new java.awt.Dimension(150, 25));<NEW_LINE>pastOccurrencesCheckbox.setPreferredSize(new java.awt.Dimension(150, 25));<NEW_LINE>pastOccurrencesCheckbox.addActionListener(new java.awt.event.ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>pastOccurrencesCheckboxActionPerformed(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>setMinimumSize(new java.awt.Dimension(250, 30));<NEW_LINE>setPreferredSize(new java.awt.Dimension(250, 30));<NEW_LINE>setLayout(new java.awt.BorderLayout());<NEW_LINE>add(crFrequencyList, java.awt.BorderLayout.CENTER);<NEW_LINE>} | new javax.swing.JCheckBox(); |
61,854 | public void execute() {<NEW_LINE>updateOutputComboBox();<NEW_LINE>boolean hasRelevantFigureSettings = has("fig.width") || has("fig.height");<NEW_LINE>useCustomFigureCheckbox_.setValue(hasRelevantFigureSettings);<NEW_LINE>if (hasRelevantFigureSettings)<NEW_LINE>useCustomFigureCheckbox_.setVisible(true);<NEW_LINE>figureDimensionsPanel_.setVisible(hasRelevantFigureSettings);<NEW_LINE>if (has("fig.width"))<NEW_LINE>figWidthBox_<MASK><NEW_LINE>else<NEW_LINE>figWidthBox_.setText("");<NEW_LINE>if (has("fig.height"))<NEW_LINE>figHeightBox_.setText(get("fig.height"));<NEW_LINE>else<NEW_LINE>figHeightBox_.setText("");<NEW_LINE>if (has("warning"))<NEW_LINE>showWarningsInOutputCb_.setValue(getBoolean("warning"));<NEW_LINE>if (has("message"))<NEW_LINE>showMessagesInOutputCb_.setValue(getBoolean("message"));<NEW_LINE>if (has("paged.print"))<NEW_LINE>printTableAsTextCb_.setValue(getBoolean("paged.print"));<NEW_LINE>if (has("cache"))<NEW_LINE>cacheChunkCb_.setValue(getBoolean("cache"));<NEW_LINE>if (has("engine.path")) {<NEW_LINE>String enginePath = StringUtil.stringValue(get("engine.path"));<NEW_LINE>enginePath = enginePath.replaceAll("\\\\\\\\", "\\\\");<NEW_LINE>enginePathBox_.setValue(enginePath);<NEW_LINE>}<NEW_LINE>if (has("engine.opts")) {<NEW_LINE>String engineOpts = StringUtil.stringValue(get("engine.opts"));<NEW_LINE>engineOpts = engineOpts.replaceAll("\\\\\\\\", "\\\\");<NEW_LINE>engineOptsBox_.setValue(engineOpts);<NEW_LINE>}<NEW_LINE>setVisible(true);<NEW_LINE>} | .setText(get("fig.width")); |
175,601 | private void init(ApplicationListener listener, AndroidApplicationConfiguration config, boolean isForView) {<NEW_LINE>if (this.getVersion() < MINIMUM_SDK) {<NEW_LINE>throw new GdxRuntimeException("libGDX requires Android API Level " + MINIMUM_SDK + " or later.");<NEW_LINE>}<NEW_LINE>GdxNativesLoader.load();<NEW_LINE>setApplicationLogger(new AndroidApplicationLogger());<NEW_LINE>graphics = new AndroidGraphics(this, config, config.resolutionStrategy == null ? new FillResolutionStrategy() : config.resolutionStrategy);<NEW_LINE>input = createInput(this, this, graphics.view, config);<NEW_LINE>audio = createAudio(this, config);<NEW_LINE>files = createFiles();<NEW_LINE>net = new AndroidNet(this, config);<NEW_LINE>this.listener = listener;<NEW_LINE>this.handler = new Handler();<NEW_LINE>this.useImmersiveMode = config.useImmersiveMode;<NEW_LINE>this<MASK><NEW_LINE>// Add a specialized audio lifecycle listener<NEW_LINE>addLifecycleListener(new LifecycleListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void resume() {<NEW_LINE>// No need to resume audio here<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void pause() {<NEW_LINE>audio.pause();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void dispose() {<NEW_LINE>audio.dispose();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Gdx.app = this;<NEW_LINE>Gdx.input = this.getInput();<NEW_LINE>Gdx.audio = this.getAudio();<NEW_LINE>Gdx.files = this.getFiles();<NEW_LINE>Gdx.graphics = this.getGraphics();<NEW_LINE>Gdx.net = this.getNet();<NEW_LINE>if (!isForView) {<NEW_LINE>try {<NEW_LINE>requestWindowFeature(Window.FEATURE_NO_TITLE);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>log("AndroidApplication", "Content already displayed, cannot request FEATURE_NO_TITLE", ex);<NEW_LINE>}<NEW_LINE>getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);<NEW_LINE>getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);<NEW_LINE>setContentView(graphics.getView(), createLayoutParams());<NEW_LINE>}<NEW_LINE>createWakeLock(config.useWakelock);<NEW_LINE>useImmersiveMode(this.useImmersiveMode);<NEW_LINE>if (this.useImmersiveMode && getVersion() >= Build.VERSION_CODES.KITKAT) {<NEW_LINE>AndroidVisibilityListener vlistener = new AndroidVisibilityListener();<NEW_LINE>vlistener.createListener(this);<NEW_LINE>}<NEW_LINE>// detect an already connected bluetooth keyboardAvailable<NEW_LINE>if (getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS)<NEW_LINE>input.setKeyboardAvailable(true);<NEW_LINE>} | .clipboard = new AndroidClipboard(this); |
434,385 | private Pair<KeyspaceMetadata, UserType> createOrUpdateUserType(KeyspaceMetadata ksm, String typeName, Map<String, CQL3Type.Raw> fields, final Collection<Mutation> mutations, final Collection<Event.SchemaChange> events) {<NEW_LINE>ColumnIdentifier ci = new ColumnIdentifier(typeName, true);<NEW_LINE>Optional<UserType> userTypeOption = getType(ksm, ci);<NEW_LINE>if (!userTypeOption.isPresent()) {<NEW_LINE>return createUserTypeIfNotExists(ksm, typeName, fields, mutations, events);<NEW_LINE>} else {<NEW_LINE>KeyspaceMetadata ksmOut = ksm;<NEW_LINE>UserType userType = userTypeOption.get();<NEW_LINE>UTName name = new UTName(new ColumnIdentifier(ksm.name, true), ci);<NEW_LINE>logger.trace("update keyspace.type=[{}].[{}] fields={}", <MASK><NEW_LINE>for (Map.Entry<String, CQL3Type.Raw> field : fields.entrySet()) {<NEW_LINE>FieldIdentifier fieldIdentifier = FieldIdentifier.forInternalString(field.getKey());<NEW_LINE>int i = userType.fieldPosition(fieldIdentifier);<NEW_LINE>if (i == -1) {<NEW_LINE>// add missing field<NEW_LINE>logger.trace("add field to keyspace.type=[{}].[{}] field={}", ksm.name, typeName, fieldIdentifier);<NEW_LINE>AlterTypeStatement ats = AlterTypeStatement.addition(name, fieldIdentifier, field.getValue());<NEW_LINE>userType = ats.updateUserType(ksmOut, mutations, events);<NEW_LINE>ksmOut = ksmOut.withSwapped(ksmOut.types.without(userType.name).with(userType));<NEW_LINE>} else {<NEW_LINE>CQL3Type newType = field.getValue().prepare(ksmOut);<NEW_LINE>CQL3Type existingType = userType.fieldType(i).asCQL3Type();<NEW_LINE>if (!newType.getType().isCompatibleWith(existingType.getType())) {<NEW_LINE>throw new InvalidRequestException(String.format(Locale.ROOT, "Field \"%s\" with type %s does not match updated type %s", field.getKey(), existingType, newType));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Pair.create(ksmOut, userType);<NEW_LINE>}<NEW_LINE>} | ksm.name, typeName, fields); |
1,273,324 | public void layout(LayoutContext c, int contentStart) {<NEW_LINE>BlockFormattingContext bfc = new BlockFormattingContext(this, c);<NEW_LINE>c.pushBFC(bfc);<NEW_LINE>addBoxID(c);<NEW_LINE>this.calcDimensions(c);<NEW_LINE>int colCount = getStyle().columnCount();<NEW_LINE>int colGapCount = colCount - 1;<NEW_LINE>float colGap = getStyle().isIdent(CSSName.COLUMN_GAP, IdentValue.NORMAL) ? getStyle().getLineHeight(c) : /* Use the line height as a normal column gap. */<NEW_LINE>getStyle().getFloatPropertyProportionalWidth(CSSName.COLUMN_GAP, getContentWidth(), c);<NEW_LINE>float totalGap = colGap * colGapCount;<NEW_LINE>int colWidth = (int) ((this.getContentWidth() - totalGap) / colCount);<NEW_LINE>_child.<MASK><NEW_LINE>_child.setContentWidth(colWidth);<NEW_LINE>_child.setColumnWidth(colWidth);<NEW_LINE>_child.setAbsX(this.getAbsX());<NEW_LINE>_child.setAbsY(this.getAbsY());<NEW_LINE>c.setIsPrintOverride(false);<NEW_LINE>_child.layout(c, contentStart);<NEW_LINE>c.setIsPrintOverride(null);<NEW_LINE>int height = adjustUnbalanced(c, _child, (int) colGap, colWidth, colCount, this.getLeftMBP() + this.getX());<NEW_LINE>_child.setHeight(0);<NEW_LINE>this.setHeight(height);<NEW_LINE>c.popBFC();<NEW_LINE>} | setContainingLayer(this.getContainingLayer()); |
1,701,897 | protected void createTask(com.android.build.gradle.api.BaseVariant variant, TaskProvider<?> parentTask, com.android.build.gradle.api.BaseVariantOutput output, Consumer<LegacyGeneratePackageTreeTask> applyInputConfiguration) {<NEW_LINE>String slug = StringUtils.capitalize(variant.getName());<NEW_LINE>String path = String.format("%s/outputs/dexcount/%s", getProject().getBuildDir(), variant.getName());<NEW_LINE>String outputName;<NEW_LINE>if (variant.getOutputs().size() > 1) {<NEW_LINE>slug += StringUtils.capitalize(output.getName());<NEW_LINE>path += "/" + output.getName();<NEW_LINE>outputName = output.getName();<NEW_LINE>} else {<NEW_LINE>outputName = variant.getName();<NEW_LINE>}<NEW_LINE>final String finalPath = path;<NEW_LINE>String treeTaskName = String.format("generate%sPackageTree", slug);<NEW_LINE>String treePath = path.replace("outputs", "intermediates") + "/tree.compact.gz";<NEW_LINE>TaskProvider<LegacyGeneratePackageTreeTask> gen = getProject().getTasks().register(treeTaskName, LegacyGeneratePackageTreeTask.class, t -> {<NEW_LINE>t.setDescription("Generates dex method count for " + variant.getName() + ".");<NEW_LINE>t.setGroup("Reporting");<NEW_LINE>t.getConfigProperty(<MASK><NEW_LINE>t.getOutputFileNameProperty().set(outputName);<NEW_LINE>t.getMappingFileProvider().set(getMappingFile(variant));<NEW_LINE>t.getOutputDirectoryProperty().set(getProject().file(finalPath));<NEW_LINE>t.getPackageTreeFileProperty().set(getProject().getLayout().getBuildDirectory().file(treePath));<NEW_LINE>t.getWorkerClasspath().from(getWorkerConfiguration());<NEW_LINE>applyInputConfiguration.accept(t);<NEW_LINE>// Depending on the runtime AGP version, inputFileProperty (as provided in applyInputConfiguration)<NEW_LINE>// may or may not carry task-dependency information with it. We need to set that up manually here.<NEW_LINE>t.dependsOn(parentTask);<NEW_LINE>});<NEW_LINE>registerOutputTask(gen, slug, true);<NEW_LINE>} | ).set(getExt()); |
924,886 | public ListResourcesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListResourcesResult listResourcesResult = new ListResourcesResult();<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 listResourcesResult;<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("TypeName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listResourcesResult.setTypeName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ResourceDescriptions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listResourcesResult.setResourceDescriptions(new ListUnmarshaller<ResourceDescription>(ResourceDescriptionJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listResourcesResult.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 listResourcesResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,811,896 | public static TypeSpecDataHolder generateDelegates(SpecModel specModel, Map<Class<? extends Annotation>, DelegateMethodDescription> delegateMethodsMap, EnumSet<RunMode> runMode) {<NEW_LINE>TypeSpecDataHolder.Builder typeSpecDataHolder = TypeSpecDataHolder.newBuilder();<NEW_LINE>boolean hasAttachDetachCallback = false;<NEW_LINE>for (SpecMethodModel<DelegateMethod, Void> delegateMethodModel : specModel.getDelegateMethods()) {<NEW_LINE>for (Annotation annotation : delegateMethodModel.annotations) {<NEW_LINE>final Class<? extends Annotation> annotationType = annotation.annotationType();<NEW_LINE>if (annotationType.equals(OnAttached.class) || annotationType.equals(OnDetached.class)) {<NEW_LINE>hasAttachDetachCallback = true;<NEW_LINE>}<NEW_LINE>if (delegateMethodsMap.containsKey(annotation.annotationType())) {<NEW_LINE>final DelegateMethodDescription delegateMethodDescription = delegateMethodsMap.get(annotation.annotationType());<NEW_LINE>typeSpecDataHolder.addMethod(generateDelegate(specModel, delegateMethodDescription, delegateMethodModel, runMode));<NEW_LINE>for (MethodSpec methodSpec : delegateMethodDescription.extraMethods) {<NEW_LINE>typeSpecDataHolder.addMethod(methodSpec);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasAttachDetachCallback) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return typeSpecDataHolder.build();<NEW_LINE>} | typeSpecDataHolder.addMethod(generateHasAttachDetachCallback()); |
856,539 | private static int shop(int money, int g) {<NEW_LINE>// fail, return a large negative number (1B)<NEW_LINE>if (money < 0)<NEW_LINE>return -1000000000;<NEW_LINE>// we have bought last garment, done<NEW_LINE>if (g == C)<NEW_LINE>return M - money;<NEW_LINE>// this state has been visited before<NEW_LINE>if (memo[money][g] != -1)<NEW_LINE>return memo[money][g];<NEW_LINE>int ans = -1000000000;<NEW_LINE>for (// try all possible models<NEW_LINE>// try all possible models<NEW_LINE>int model = 1; // try all possible models<NEW_LINE>model <= price[g][0]; model++) ans = Math.max(ans, shop(money - price[g][model], g + 1));<NEW_LINE>// assign ans to dp table + return it!<NEW_LINE>return memo<MASK><NEW_LINE>} | [money][g] = ans; |
1,845,302 | public static void main(String[] args) {<NEW_LINE>EdgeWeightedDigraph edgeWeightedDigraph = new EdgeWeightedDigraph(8);<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(4, 5, 0.35));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(5, 4, 0.35));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(4, 7, 0.37));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(5, 7, 0.28));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(7, 5, 0.28));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(5, 1, 0.32));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(0, 4, 0.38));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(0, 2, 0.26));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(7, 3, 0.39));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(1, 3, 0.29));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(2, 7, 0.34));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(6, 2, 0.40));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(3, 6, 0.52));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(6, 0, 0.58));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(6, 4, 0.93));<NEW_LINE>HashSet<Integer> sources = new HashSet<>();<NEW_LINE>sources.add(0);<NEW_LINE>sources.add(1);<NEW_LINE>sources.add(7);<NEW_LINE>DijkstraMultisourceSP dijkstraMultisourceSP = new Exercise24_MultisourceShortestPaths().new DijkstraMultisourceSP(edgeWeightedDigraph, sources);<NEW_LINE>StdOut.println("Distance to 5: " + dijkstraMultisourceSP.distTo(5) + " Expected: 0.28");<NEW_LINE>StdOut.println("Has path to 5: " + dijkstraMultisourceSP.hasPathTo(5) + " Expected: true");<NEW_LINE>StdOut.print("Path to 5: ");<NEW_LINE>for (DirectedEdge edge : dijkstraMultisourceSP.pathTo(5)) {<NEW_LINE>StdOut.print(edge.from() + "->" + edge.to() + " ");<NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected: 8->7 7->5");<NEW_LINE>StdOut.println("\nDistance to 6: " + dijkstraMultisourceSP.distTo(6) + " Expected: 0.81");<NEW_LINE>StdOut.println("Has path to 6: " + dijkstraMultisourceSP.hasPathTo(6) + " Expected: true");<NEW_LINE>StdOut.print("Path to 6: ");<NEW_LINE>for (DirectedEdge edge : dijkstraMultisourceSP.pathTo(6)) {<NEW_LINE>StdOut.print(edge.from() + "->" + <MASK><NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected: 8->1 1->3 3->6");<NEW_LINE>} | edge.to() + " "); |
1,757,217 | protected JComponent createCenterPanel() {<NEW_LINE>JPanel panel = <MASK><NEW_LINE>JLabel nameLabel = new JLabel(IdeBundle.message("label.todo.filter.name"));<NEW_LINE>panel.add(nameLabel, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 10), 0, 0));<NEW_LINE>panel.add(myNameField, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0));<NEW_LINE>JPanel patternsPanel = new JPanel(new GridBagLayout());<NEW_LINE>Border border = IdeBorderFactory.createTitledBorder(IdeBundle.message("group.todo.filter.patterns"), false);<NEW_LINE>patternsPanel.setBorder(border);<NEW_LINE>myTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);<NEW_LINE>JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTable);<NEW_LINE>scrollPane.setPreferredSize(new Dimension(550, myTable.getRowHeight() * 10));<NEW_LINE>patternsPanel.add(scrollPane, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));<NEW_LINE>// Column "Available"<NEW_LINE>int width = new JCheckBox().getPreferredSize().width;<NEW_LINE>TableColumn availableColumn = myTable.getColumnModel().getColumn(0);<NEW_LINE>availableColumn.setPreferredWidth(width);<NEW_LINE>availableColumn.setMaxWidth(width);<NEW_LINE>availableColumn.setMinWidth(width);<NEW_LINE>//<NEW_LINE>panel.add(patternsPanel, new GridBagConstraints(0, 1, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));<NEW_LINE>return panel;<NEW_LINE>} | new JPanel(new GridBagLayout()); |
371,645 | public static GetStackResponse unmarshall(GetStackResponse getStackResponse, UnmarshallerContext _ctx) {<NEW_LINE>getStackResponse.setRequestId(_ctx.stringValue("GetStackResponse.RequestId"));<NEW_LINE>List<StackInfoItem> stackInfo = new ArrayList<StackInfoItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetStackResponse.StackInfo.Length"); i++) {<NEW_LINE>StackInfoItem stackInfoItem = new StackInfoItem();<NEW_LINE>stackInfoItem.setStartTime(_ctx.longValue("GetStackResponse.StackInfo[" + i + "].StartTime"));<NEW_LINE>stackInfoItem.setException(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].Exception"));<NEW_LINE>stackInfoItem.setApi(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].Api"));<NEW_LINE>stackInfoItem.setLine(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].Line"));<NEW_LINE>stackInfoItem.setDuration(_ctx.longValue("GetStackResponse.StackInfo[" + i + "].Duration"));<NEW_LINE>stackInfoItem.setRpcId(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].RpcId"));<NEW_LINE>stackInfoItem.setServiceName(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].ServiceName"));<NEW_LINE>ExtInfo extInfo = new ExtInfo();<NEW_LINE>extInfo.setType(_ctx.stringValue<MASK><NEW_LINE>extInfo.setInfo(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].ExtInfo.Info"));<NEW_LINE>stackInfoItem.setExtInfo(extInfo);<NEW_LINE>stackInfo.add(stackInfoItem);<NEW_LINE>}<NEW_LINE>getStackResponse.setStackInfo(stackInfo);<NEW_LINE>return getStackResponse;<NEW_LINE>} | ("GetStackResponse.StackInfo[" + i + "].ExtInfo.Type")); |
243,755 | public Boolean update(TransformRequest request, String operator) {<NEW_LINE>LOGGER.info("begin to update transform info: {}", request);<NEW_LINE>this.checkParams(request);<NEW_LINE>// Check whether the transform can be modified<NEW_LINE>String groupId = request.getInlongGroupId();<NEW_LINE>groupCheckService.checkGroupStatus(groupId, operator);<NEW_LINE>Preconditions.checkNotNull(request.getId(), ErrorCodeEnum.ID_IS_EMPTY.getMessage());<NEW_LINE>StreamTransformEntity exist = transformMapper.selectById(request.getId());<NEW_LINE>if (exist == null) {<NEW_LINE>LOGGER.error("transform not found by id={}", request.getId());<NEW_LINE>throw new BusinessException(ErrorCodeEnum.TRANSFORM_NOT_FOUND);<NEW_LINE>}<NEW_LINE>String msg = String.format("transform has already updated with groupId=%s, streamId=%s, name=%s, curVersion=%s", request.getInlongGroupId(), request.getInlongStreamId(), request.getTransformName(), request.getVersion());<NEW_LINE>if (!exist.getVersion().equals(request.getVersion())) {<NEW_LINE>LOGGER.error(msg);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>StreamTransformEntity transformEntity = CommonBeanUtils.copyProperties(request, StreamTransformEntity::new);<NEW_LINE>transformEntity.setModifier(operator);<NEW_LINE>int rowCount = transformMapper.updateByIdSelective(transformEntity);<NEW_LINE>if (rowCount != InlongConstants.AFFECTED_ONE_ROW) {<NEW_LINE>LOGGER.error(msg);<NEW_LINE>throw new BusinessException(ErrorCodeEnum.CONFIG_EXPIRED);<NEW_LINE>}<NEW_LINE>updateFieldOpt(transformEntity, request.getFieldList());<NEW_LINE>return true;<NEW_LINE>} | throw new BusinessException(ErrorCodeEnum.CONFIG_EXPIRED); |
992,475 | public I_M_HU_PI_Item_Product retrieveM_HU_PI_Item_Product() {<NEW_LINE>if (getQtyTypeToUse().isOnlyUseToDeliver() && (shipmentScheduleQtyPicked == null || shipmentScheduleQtyPicked.isAnonymousHuPickedOnTheFly())) {<NEW_LINE>return retrievePiipForReferencedRecord();<NEW_LINE>}<NEW_LINE>final I_M_HU topLevelHU = getTopLevelHU();<NEW_LINE>if (topLevelHU == null) {<NEW_LINE>return retrievePiipForReferencedRecord();<NEW_LINE>}<NEW_LINE>if (topLevelHU.getM_HU_PI_Item_Product_ID() > 0) {<NEW_LINE>return IHandlingUnitsBL.extractPIItemProductOrNull(topLevelHU);<NEW_LINE>}<NEW_LINE>final ImmutableList<I_M_HU_Item> huMaterialItems = Services.get(IHandlingUnitsDAO.class).retrieveItems(topLevelHU).stream().filter(item -> X_M_HU_Item.ITEMTYPE_Material.equals(item.getItemType())).collect(ImmutableList.toImmutableList());<NEW_LINE>if (huMaterialItems.isEmpty()) {<NEW_LINE>return retrievePiipForReferencedRecord();<NEW_LINE>}<NEW_LINE>Check.assume(huMaterialItems.size() == 1, "Each hu has just one M_HU_Item with type={}; hu={}; huMaterialItems={}", X_M_HU_Item.ITEMTYPE_Material, topLevelHU, huMaterialItems);<NEW_LINE>final I_M_HU_Item huMaterialItem = huMaterialItems.get(0);<NEW_LINE>final IShipmentScheduleEffectiveBL shipmentScheduleEffectiveBL = Services.get(IShipmentScheduleEffectiveBL.class);<NEW_LINE>final BPartnerId bpartnerId = shipmentScheduleEffectiveBL.getBPartnerId(shipmentSchedule);<NEW_LINE>final ZonedDateTime preparationDate = shipmentScheduleEffectiveBL.getPreparationDate(shipmentSchedule);<NEW_LINE>final IHUPIItemProductDAO hupiItemProductDAO = Services.get(IHUPIItemProductDAO.class);<NEW_LINE>final I_M_HU_PI_Item huPIItem = Services.get(IHandlingUnitsBL.class).getPIItem(huMaterialItem);<NEW_LINE>if (huPIItem == null) {<NEW_LINE>return hupiItemProductDAO.retrieveVirtualPIMaterialItemProduct(Env.getCtx());<NEW_LINE>}<NEW_LINE>final I_M_HU_PI_Item_Product matchingPiip = hupiItemProductDAO.retrievePIMaterialItemProduct(huPIItem, bpartnerId, getProductId(), preparationDate);<NEW_LINE>if (matchingPiip != null) {<NEW_LINE>return matchingPiip;<NEW_LINE>}<NEW_LINE>// could not find a packing instruction; return "No Packing Item"<NEW_LINE>return hupiItemProductDAO.<MASK><NEW_LINE>} | retrieveVirtualPIMaterialItemProduct(Env.getCtx()); |
1,354,451 | private void removePropertiesDeclaredInComposedClass(String className, List<CodegenModel> allModels, CodegenModel cm) {<NEW_LINE>CodegenModel otherModel = allModels.stream().filter(m -> m.classname.equals(className)).findFirst().orElse(null);<NEW_LINE>if (otherModel == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>otherModel.readWriteVars.stream().filter(v -> cm.readWriteVars.stream().anyMatch(cmV -> cmV.baseName.equals(v.baseName))).collect(Collectors.toList()).forEach(v -> {<NEW_LINE>cm.readWriteVars.removeIf(item -> item.baseName.equals(v.baseName));<NEW_LINE>cm.vars.removeIf(item -> item.baseName<MASK><NEW_LINE>cm.readOnlyVars.removeIf(item -> item.baseName.equals(v.baseName));<NEW_LINE>cm.requiredVars.removeIf(item -> item.baseName.equals(v.baseName));<NEW_LINE>cm.allVars.removeIf(item -> item.baseName.equals(v.baseName));<NEW_LINE>});<NEW_LINE>} | .equals(v.baseName)); |
1,695,036 | public UploadStatistics loadIcd10cm(List<FileDescriptor> theFiles, RequestDetails theRequestDetails) {<NEW_LINE>ourLog.info("Beginning ICD-10-cm processing");<NEW_LINE>CodeSystem cs = new CodeSystem();<NEW_LINE>cs.setUrl(ICD10CM_URI);<NEW_LINE>cs.setName("ICD-10-CM");<NEW_LINE>cs.setContent(CodeSystem.CodeSystemContentMode.NOTPRESENT);<NEW_LINE>cs.setStatus(Enumerations.PublicationStatus.ACTIVE);<NEW_LINE>TermCodeSystemVersion codeSystemVersion = new TermCodeSystemVersion();<NEW_LINE>int count = 0;<NEW_LINE>try (LoadedFileDescriptors compressedDescriptors = getLoadedFileDescriptors(theFiles)) {<NEW_LINE>for (FileDescriptor nextDescriptor : compressedDescriptors.getUncompressedFileDescriptors()) {<NEW_LINE>if (nextDescriptor.getFilename().toLowerCase(Locale.US).endsWith(".xml")) {<NEW_LINE>try (InputStream inputStream = nextDescriptor.getInputStream();<NEW_LINE>InputStreamReader reader = new InputStreamReader(inputStream, Charsets.UTF_8)) {<NEW_LINE>Icd10CmLoader loader = new Icd10CmLoader(codeSystemVersion);<NEW_LINE>loader.load(reader);<NEW_LINE>count += loader.getConceptCount();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException | SAXException e) {<NEW_LINE>throw new InternalErrorException(Msg.code(865) + e);<NEW_LINE>}<NEW_LINE>cs.setVersion(codeSystemVersion.getCodeSystemVersionId());<NEW_LINE>IIdType target = storeCodeSystem(theRequestDetails, <MASK><NEW_LINE>return new UploadStatistics(count, target);<NEW_LINE>} | codeSystemVersion, cs, null, null); |
18,943 | private void checkName(String tName) throws SQLException {<NEW_LINE>if (StringUtils.isEmptyOrWhitespaceOnly(tName)) {<NEW_LINE>throw new SQLException("tableName should not be empty", "S1009");<NEW_LINE>} else {<NEW_LINE>boolean needsHexEscape = false;<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < trimmedTableName.length(); ++i) {<NEW_LINE>char c = trimmedTableName.charAt(i);<NEW_LINE>switch(c) {<NEW_LINE>case '\u0000':<NEW_LINE>needsHexEscape = true;<NEW_LINE>break;<NEW_LINE>case '\n':<NEW_LINE>needsHexEscape = true;<NEW_LINE>break;<NEW_LINE>case '\r':<NEW_LINE>needsHexEscape = true;<NEW_LINE>break;<NEW_LINE>case '\u001a':<NEW_LINE>needsHexEscape = true;<NEW_LINE>break;<NEW_LINE>case ' ':<NEW_LINE>needsHexEscape = true;<NEW_LINE>break;<NEW_LINE>case '"':<NEW_LINE>needsHexEscape = true;<NEW_LINE>break;<NEW_LINE>case '\'':<NEW_LINE>needsHexEscape = true;<NEW_LINE>break;<NEW_LINE>case '\\':<NEW_LINE>needsHexEscape = true;<NEW_LINE>}<NEW_LINE>if (needsHexEscape) {<NEW_LINE>throw new SQLException("tableName format error: " + this.tableName, "S1009");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String trimmedTableName = tName.trim(); |
730,119 | void unroll(T x) {<NEW_LINE>Optional<? extends Iterable<? extends T>> splitX = split(x);<NEW_LINE>if (splitX.isPresent()) {<NEW_LINE>for (T part : splitX.get()) {<NEW_LINE>unroll(part);<NEW_LINE>}<NEW_LINE>} else if (specialJoinableType.isInstance(x)) {<NEW_LINE>// We shouldn't implement special joinable for AttributePolicies<NEW_LINE>// without implementing the properly parameterized variant.<NEW_LINE>SJ sj = specialJoinableType.cast(x);<NEW_LINE>JoinStrategy<SJ> strategy = sj.getJoinStrategy();<NEW_LINE>if (requireSpecialJoining == null) {<NEW_LINE>requireSpecialJoining = Maps.newLinkedHashMap();<NEW_LINE>}<NEW_LINE>Set<SJ> toJoinTogether = requireSpecialJoining.get(strategy);<NEW_LINE>if (toJoinTogether == null) {<NEW_LINE>toJoinTogether = Sets.newLinkedHashSet();<NEW_LINE>requireSpecialJoining.put(strategy, toJoinTogether);<NEW_LINE>}<NEW_LINE>toJoinTogether.add(sj);<NEW_LINE>} else {<NEW_LINE>uniq.add<MASK><NEW_LINE>}<NEW_LINE>} | (Preconditions.checkNotNull(x)); |
185,977 | public List<PrelinkMap> parse(TaskMonitor monitor) throws IOException, JDOMException, NoPreLinkSectionException {<NEW_LINE>InputStream inputStream = findPrelinkInputStream();<NEW_LINE>monitor.setMessage("Parsing prelink plist...");<NEW_LINE>SAXBuilder sax = XmlUtilities.createSecureSAXBuilder(false, false);<NEW_LINE>Document doc = sax.build(inputStream);<NEW_LINE>Element root = doc.getRootElement();<NEW_LINE>List<PrelinkMap> list = new ArrayList<PrelinkMap>();<NEW_LINE>if (root.getName().equals(TAG_ARRAY)) {<NEW_LINE>// iOS version before 4.x<NEW_LINE>process(root.getChildren(), list, monitor);<NEW_LINE>} else {<NEW_LINE>Iterator<?> iterator = root.getChildren().iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>if (monitor.isCancelled()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Element element = (Element) iterator.next();<NEW_LINE>if (element.getName().equals(TAG_DICT)) {<NEW_LINE>// top level is <dict> entry<NEW_LINE>processTopDict(monitor, list, element);<NEW_LINE>} else if (element.getName().equals(TAG_KEY)) {<NEW_LINE>processKey(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} | monitor, list, iterator, element); |
360,739 | private void checkAndSwapLog() {<NEW_LINE>if (!bLogToFile) {<NEW_LINE>if (logFilePrinter != null) {<NEW_LINE>logFilePrinter.close();<NEW_LINE>logFilePrinter = null;<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long lMaxBytes = (iLogFileMaxMB * 1024L * 1024L) / 2;<NEW_LINE>File logFile = FileUtil.newFile(sLogDir, LOG_FILE_NAME);<NEW_LINE>if (logFile.length() > lMaxBytes && logFilePrinter != null) {<NEW_LINE>File back_name = <MASK><NEW_LINE>logFilePrinter.close();<NEW_LINE>logFilePrinter = null;<NEW_LINE>if ((!back_name.exists()) || back_name.delete()) {<NEW_LINE>if (!logFile.renameTo(back_name)) {<NEW_LINE>// rename failed, just have to trash the existing one<NEW_LINE>logFile.delete();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// failed to delete existing backup, just have to trash existing log<NEW_LINE>logFile.delete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (logFilePrinter == null) {<NEW_LINE>try {<NEW_LINE>logFileOS = FileUtil.newFileOutputStream(logFile, true);<NEW_LINE>if (logFile.length() == 0) {<NEW_LINE>// UTF-8 BOM<NEW_LINE>logFileOS.write(new byte[] { (byte) 239, (byte) 187, (byte) 191 });<NEW_LINE>}<NEW_LINE>OutputStreamWriter osw = new OutputStreamWriter(logFileOS, "UTF-8");<NEW_LINE>logFilePrinter = new PrintWriter(osw);<NEW_LINE>} catch (IOException e) {<NEW_LINE>if (!bLogToFileErrorPrinted) {<NEW_LINE>// don't just log errors, as it would cause infinite recursion<NEW_LINE>bLogToFileErrorPrinted = true;<NEW_LINE>Debug.out("Unable to write to log file: " + logFile);<NEW_LINE>Debug.printStackTrace(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | FileUtil.newFile(sLogDir, BAK_FILE_NAME); |
297,365 | protected IStatus run(IProgressMonitor monitor) {<NEW_LINE>final List<MapPack> values = new ArrayList<MapPack>();<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("stime", stime);<NEW_LINE>param.put("etime", etime);<NEW_LINE>param.put("objType", objType);<NEW_LINE>param.put("counter", counter);<NEW_LINE>tcp.process(RequestCmd.COUNTER_PAST_TIME_ALL, param, new INetReader() {<NEW_LINE><NEW_LINE>public void process(DataInputX in) throws IOException {<NEW_LINE>MapPack mpack = (MapPack) in.readPack();<NEW_LINE>values.add(mpack);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Throwable t) {<NEW_LINE>ConsoleProxy.errorSafe(t.toString());<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>ExUtil.exec(canvas, new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>double max = 0;<NEW_LINE>for (MapPack mpack : values) {<NEW_LINE>int objHash = mpack.getInt("objHash");<NEW_LINE>ListValue time = mpack.getList("time");<NEW_LINE>ListValue <MASK><NEW_LINE>TracePair tp = getTracePair(objType, objHash, (int) ((etime - stime) / (DateUtil.MILLIS_PER_SECOND * 2)));<NEW_LINE>CircularBufferDataProvider maxProvider = (CircularBufferDataProvider) tp.totalTrace.getDataProvider();<NEW_LINE>CircularBufferDataProvider valueProvider = (CircularBufferDataProvider) tp.activeTrace.getDataProvider();<NEW_LINE>maxProvider.clearTrace();<NEW_LINE>valueProvider.clearTrace();<NEW_LINE>for (int i = 0; time != null && i < time.size(); i++) {<NEW_LINE>long x = time.getLong(i);<NEW_LINE>Value v = value.get(i);<NEW_LINE>if (v != null && v.getValueType() == ValueEnum.LIST) {<NEW_LINE>ListValue lv = (ListValue) v;<NEW_LINE>maxProvider.addSample(new Sample(x, lv.getDouble(0)));<NEW_LINE>valueProvider.addSample(new Sample(x, lv.getDouble(1)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>max = Math.max(ChartUtil.getMax(maxProvider.iterator()), max);<NEW_LINE>}<NEW_LINE>if (CounterUtil.isPercentValue(objType, counter)) {<NEW_LINE>xyGraph.primaryYAxis.setRange(0, 100);<NEW_LINE>} else {<NEW_LINE>xyGraph.primaryYAxis.setRange(0, max);<NEW_LINE>}<NEW_LINE>redraw();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>} | value = mpack.getList("value"); |
343,803 | public void update(RowBasedPartition partition, int factor, double[] scalars) {<NEW_LINE>double gamma = scalars[0];<NEW_LINE>double epsilon = scalars[1];<NEW_LINE>double beta = scalars[2];<NEW_LINE>double lr = scalars[3];<NEW_LINE>double regParam = scalars[4];<NEW_LINE>double epoch = scalars[5];<NEW_LINE>double batchSize = scalars[6];<NEW_LINE>if (epoch == 0) {<NEW_LINE>epoch = 1;<NEW_LINE>}<NEW_LINE>double powBeta = Math.pow(beta, epoch);<NEW_LINE>double powGamma = Math.pow(gamma, epoch);<NEW_LINE>for (int f = 0; f < factor; f++) {<NEW_LINE>ServerRow gradientServerRow = partition.getRow(f + 3 * factor);<NEW_LINE>try {<NEW_LINE>gradientServerRow.startWrite();<NEW_LINE>Vector weight = ServerRowUtils.getVector(partition.getRow(f));<NEW_LINE>Vector velocity = ServerRowUtils.getVector(partition.getRow(f + factor));<NEW_LINE>Vector square = ServerRowUtils.getVector(partition.getRow(f + 2 * factor));<NEW_LINE>Vector <MASK><NEW_LINE>if (batchSize > 1) {<NEW_LINE>gradient.idiv(batchSize);<NEW_LINE>}<NEW_LINE>if (regParam != 0.0) {<NEW_LINE>gradient.iaxpy(weight, regParam);<NEW_LINE>}<NEW_LINE>OptFuncs.iexpsmoothing(velocity, gradient, beta);<NEW_LINE>OptFuncs.iexpsmoothing2(square, gradient, gamma);<NEW_LINE>Vector delta = OptFuncs.adamdelta(velocity, square, powBeta, powGamma);<NEW_LINE>weight.iaxpy(delta, -lr);<NEW_LINE>gradient.clear();<NEW_LINE>} finally {<NEW_LINE>gradientServerRow.endWrite();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | gradient = ServerRowUtils.getVector(gradientServerRow); |
183,362 | public Void run() {<NEW_LINE>synchronized (modifiedMetadataPaths) {<NEW_LINE>Element root = getConfigurationDataRoot(shared);<NEW_LINE>Element existing = XMLUtil.findElement(root, fragment.getLocalName(), fragment.getNamespaceURI());<NEW_LINE>// XXX first compare to existing and return if the same<NEW_LINE>if (existing != null) {<NEW_LINE>root.removeChild(existing);<NEW_LINE>}<NEW_LINE>// the children are alphabetize: find correct place to insert new node<NEW_LINE>Node ref = null;<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < list.getLength(); i++) {<NEW_LINE>Node node = list.item(i);<NEW_LINE>if (node.getNodeType() != Node.ELEMENT_NODE) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int comparison = node.getNodeName().compareTo(fragment.getNodeName());<NEW_LINE>if (comparison == 0) {<NEW_LINE>comparison = node.getNamespaceURI().compareTo(fragment.getNamespaceURI());<NEW_LINE>}<NEW_LINE>if (comparison > 0) {<NEW_LINE>ref = node;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>root.insertBefore(root.getOwnerDocument().importNode(fragment, true), ref);<NEW_LINE>modifying(shared ? PROJECT_XML_PATH : PRIVATE_XML_PATH);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | NodeList list = root.getChildNodes(); |
1,472,751 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>final View v = inflater.inflate(R.layout.fingerprint_dialog, container, false);<NEW_LINE>final TextView mFingerprintDescription = (TextView) v.findViewById(R.id.fingerprint_description);<NEW_LINE>mFingerprintDescription.setText(this.authReason);<NEW_LINE>this.mFingerprintImage = (ImageView) v.findViewById(R.id.fingerprint_icon);<NEW_LINE>if (this.imageColor != 0) {<NEW_LINE>this.mFingerprintImage.setColorFilter(this.imageColor);<NEW_LINE>}<NEW_LINE>this.mFingerprintSensorDescription = (TextView) v.findViewById(R.id.fingerprint_sensor_description);<NEW_LINE>this.mFingerprintSensorDescription.setText(this.sensorDescription);<NEW_LINE>this.mFingerprintError = (TextView) v.findViewById(R.id.fingerprint_error);<NEW_LINE>this.mFingerprintError.setText(this.errorText);<NEW_LINE>final Button mCancelButton = (Button) v.findViewById(R.id.cancel_button);<NEW_LINE>mCancelButton.setText(this.cancelText);<NEW_LINE>mCancelButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>onCancelled();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>getDialog(<MASK><NEW_LINE>getDialog().setOnKeyListener(new DialogInterface.OnKeyListener() {<NEW_LINE><NEW_LINE>public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {<NEW_LINE>if (keyCode != KeyEvent.KEYCODE_BACK || mFingerprintHandler == null) {<NEW_LINE>// pass on to be processed as normal<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>onCancelled();<NEW_LINE>// pretend we've processed it<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return v;<NEW_LINE>} | ).setTitle(this.dialogTitle); |
568,951 | public static MemberSignatureParts fromBytecodeSignature(String fqClassName, String toParse) {<NEW_LINE>if (signatureHasGenerics(toParse)) {<NEW_LINE>toParse = isolateGenericsTag(toParse);<NEW_LINE>}<NEW_LINE>MemberSignatureParts msp = new MemberSignatureParts();<NEW_LINE>msp.fullyQualifiedClassName = fqClassName;<NEW_LINE>if (isStaticInitialiser(toParse)) {<NEW_LINE>msp.memberName = S_STATIC_INIT;<NEW_LINE>msp.returnType = Void.TYPE.getName();<NEW_LINE>return msp;<NEW_LINE>}<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>builder.append("^[ ]*");<NEW_LINE>for (String mod : modifierMap.keySet()) {<NEW_LINE>builder.append(S_OPEN_PARENTHESES).append(mod).append(S_SPACE).append(S_CLOSE_PARENTHESES).append(C_QUESTION);<NEW_LINE>}<NEW_LINE>String regexGenerics = "(\\{.*\\} )?";<NEW_LINE>// optional could be constructor<NEW_LINE>String regexReturnType = "(.* )?";<NEW_LINE>String regexMethodName = ParseUtil.METHOD_NAME_REGEX_GROUP;<NEW_LINE>String regexParams = "(\\(.*\\))";<NEW_LINE>String regexRest = "(.*)";<NEW_LINE>builder.append(regexGenerics);<NEW_LINE>builder.append(regexReturnType);<NEW_LINE>builder.append(regexMethodName);<NEW_LINE>builder.append(regexParams);<NEW_LINE>builder.append(regexRest);<NEW_LINE>// logger.info("\n{}\n{}", toParse, builder);<NEW_LINE>final Pattern patternBytecodeSignature = Pattern.<MASK><NEW_LINE>Matcher matcher = patternBytecodeSignature.matcher(toParse);<NEW_LINE>int modifierCount = modifierMap.size();<NEW_LINE>if (matcher.find()) {<NEW_LINE>int count = matcher.groupCount();<NEW_LINE>for (int i = 1; i < count; i++) {<NEW_LINE>String group = matcher.group(i);<NEW_LINE>if (group != null) {<NEW_LINE>group = group.trim();<NEW_LINE>}<NEW_LINE>if (group != null && i <= modifierCount) {<NEW_LINE>msp.modifierList.add(group);<NEW_LINE>// add bitset value for this modifier<NEW_LINE>msp.modifier += modifierMap.get(group);<NEW_LINE>}<NEW_LINE>if (i == modifierCount + 1) {<NEW_LINE>if (group != null) {<NEW_LINE>msp.buildGenerics(group);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (i == modifierCount + 2) {<NEW_LINE>if (group != null) {<NEW_LINE>msp.returnType = group;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (i == modifierCount + 3) {<NEW_LINE>if (group != null) {<NEW_LINE>msp.memberName = group;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (i == modifierCount + 4) {<NEW_LINE>if (group != null) {<NEW_LINE>msp.buildParamTypes(group);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>completeSignature(toParse, msp);<NEW_LINE>return msp;<NEW_LINE>} | compile(builder.toString()); |
874,201 | void generate() throws IOException {<NEW_LINE>try (Writer libRs = outputManager.createOutput("lib")) {<NEW_LINE>indent(libRs, 0, "#![forbid(unsafe_code)]\n");<NEW_LINE>indent(libRs, 0, "#![allow(clippy::upper_case_acronyms)]\n");<NEW_LINE><MASK><NEW_LINE>indent(libRs, 0, "use ::core::{convert::TryInto};\n\n");<NEW_LINE>final ArrayList<String> modules = new ArrayList<>();<NEW_LINE>Files.walk(outputManager.getSrcDirPath()).filter(Files::isRegularFile).map((path) -> path.getFileName().toString()).filter((fileName) -> fileName.endsWith(".rs")).filter((fileName) -> !fileName.equals("lib.rs")).map((fileName) -> fileName.substring(0, fileName.length() - 3)).forEach(modules::add);<NEW_LINE>// add modules<NEW_LINE>for (final String mod : modules) {<NEW_LINE>indent(libRs, 0, "pub mod %s;\n", toLowerSnakeCase(mod));<NEW_LINE>}<NEW_LINE>indent(libRs, 0, "\n");<NEW_LINE>// add re-export of modules<NEW_LINE>for (final String module : modules) {<NEW_LINE>indent(libRs, 0, "pub use %s::*;\n", toLowerSnakeCase(module));<NEW_LINE>}<NEW_LINE>indent(libRs, 0, "\n");<NEW_LINE>generateSbeErrorEnum(libRs);<NEW_LINE>generateEitherEnum(libRs);<NEW_LINE>generateEncoderTraits(libRs);<NEW_LINE>generateDecoderTraits(libRs);<NEW_LINE>generateReadBuf(libRs, byteOrder);<NEW_LINE>generateWriteBuf(libRs, byteOrder);<NEW_LINE>}<NEW_LINE>} | indent(libRs, 0, "#![allow(non_camel_case_types)]\n"); |
1,816,455 | public static void main(String[] args) throws Exception {<NEW_LINE>Properties properties = Utils.readPropertiesFile(ExampleConstants.CONFIG_FILE_NAME);<NEW_LINE>final String eventMeshIp = properties.getProperty(ExampleConstants.EVENTMESH_IP);<NEW_LINE>final int eventMeshTcpPort = Integer.parseInt(properties.getProperty(ExampleConstants.EVENTMESH_TCP_PORT));<NEW_LINE>UserAgent userAgent = EventMeshTestUtils.generateClient1();<NEW_LINE>EventMeshTCPClientConfig eventMeshTcpClientConfig = EventMeshTCPClientConfig.builder().host(eventMeshIp).port(eventMeshTcpPort).userAgent(userAgent).build();<NEW_LINE>try (final EventMeshTCPClient<EventMeshMessage> client = EventMeshTCPClientFactory.createEventMeshTCPClient(eventMeshTcpClientConfig, EventMeshMessage.class)) {<NEW_LINE>client.init();<NEW_LINE>EventMeshMessage eventMeshMessage = EventMeshTestUtils.generateBroadcastMqMsg();<NEW_LINE>logger.info("begin send broadcast msg: {}", eventMeshMessage);<NEW_LINE>client.broadcast(eventMeshMessage, EventMeshCommon.DEFAULT_TIME_OUT_MILLS);<NEW_LINE>Thread.sleep(2000);<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | logger.warn("AsyncPublishBroadcast failed", e); |
1,426,258 | public static void fontToWidgetHeight(Text text, Runnable runOnFontSizeChange) {<NEW_LINE>text.addListener(SWT.Resize, new Listener() {<NEW_LINE><NEW_LINE>Font lastFont = null;<NEW_LINE><NEW_LINE>int lastHeight = -1;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event event) {<NEW_LINE>Text text = (Text) event.widget;<NEW_LINE>if (text == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// getLineHeight doesn't take into account zoom on GTK3?<NEW_LINE>// GTK3 source gets height from fontHeight, which is<NEW_LINE>// PANGO_PIXELS(pango_font_metrics_get_ascent + pango_font_metrics_get_decent)<NEW_LINE>// Tested: Zoom 200; getLineHeight=36; getFontHeightInPX=18<NEW_LINE>//<NEW_LINE>// On Windows, getLineHeight uses DPIUtil.autoScaleDown(px)<NEW_LINE>// On Mac, who knows, but it doesn't call DPIUtil.<NEW_LINE>// int lineHeightPX = text.getLineHeight();<NEW_LINE>int lineHeightPX = getFontHeightInPX(text.getFont());<NEW_LINE>int h = text.getClientArea().height - (text.getBorderWidth() * 2);<NEW_LINE>if (h <= 4) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (h > 10 && (Utils.isGTK3 || (Constants.isOSX && Utils.isDarkAppearanceNative()))) {<NEW_LINE>// GTK3 and OSX dark mode has border included in clientArea<NEW_LINE>h -= 6;<NEW_LINE>}<NEW_LINE>// System.out.println("h=" + h + ";lh=" + lineHeightPX + ";" + getFontHeightInPX(text.getFont()) );<NEW_LINE>if (h == lastHeight) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float <MASK><NEW_LINE>// System.out.println("h=" + h + ";lh=" + lineHeightPX + "; " + pctAdjust);<NEW_LINE>lastHeight = h;<NEW_LINE>Font font = FontUtils.getFontPercentOf(text.getFont(), pctAdjust);<NEW_LINE>font = cache(ensureFontFitsHeight(font, h));<NEW_LINE>text.setFont(font);<NEW_LINE>if (lastFont == null) {<NEW_LINE>text.addDisposeListener(new DisposeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetDisposed(DisposeEvent e) {<NEW_LINE>Text text = (Text) e.widget;<NEW_LINE>if (text != null) {<NEW_LINE>text.setFont(null);<NEW_LINE>}<NEW_LINE>uncache(lastFont);<NEW_LINE>lastFont = null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>uncache(lastFont);<NEW_LINE>}<NEW_LINE>if (runOnFontSizeChange != null) {<NEW_LINE>try {<NEW_LINE>runOnFontSizeChange.run();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastFont = font;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | pctAdjust = h / (float) lineHeightPX; |
1,687,810 | public Recommendation unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Recommendation recommendation = new Recommendation();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Url", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>recommendation.setUrl(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("text", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>recommendation.setText(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 recommendation;<NEW_LINE>} | class).unmarshall(context)); |
1,213,184 | public Message readEntity(Cursor cursor, int offset) {<NEW_LINE>Message entity = new //<NEW_LINE>// id<NEW_LINE>Message(// entityID<NEW_LINE>cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // date<NEW_LINE>cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // type<NEW_LINE>cursor.isNull(offset + 2) ? null : new java.util.Date(cursor.getLong(offset + 2)), // status<NEW_LINE>cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3), // senderId<NEW_LINE>cursor.isNull(offset + 4) ? null : cursor.getInt(offset + 4), // threadId<NEW_LINE>cursor.isNull(offset + 5) ? null : cursor.getLong(offset + 5), // nextMessageId<NEW_LINE>cursor.isNull(offset + 6) ? null : cursor.getLong(offset + 6), // previousMessageId<NEW_LINE>cursor.isNull(offset + 7) ? null : cursor.getLong(offset + 7), // encryptedText<NEW_LINE>cursor.isNull(offset + 8) ? null : cursor.getLong(offset + 8), cursor.isNull(offset + 9) ? null : cursor<MASK><NEW_LINE>return entity;<NEW_LINE>} | .getString(offset + 9)); |
510,979 | public net.osmand.binary.OsmandOdb.OsmAndPoiBox buildPartial() {<NEW_LINE>net.osmand.binary.OsmandOdb.OsmAndPoiBox result = new net.osmand.binary.OsmandOdb.OsmAndPoiBox(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.zoom_ = zoom_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>result.left_ = left_;<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>result.top_ = top_;<NEW_LINE>if (((from_bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>to_bitField0_ |= 0x00000008;<NEW_LINE>}<NEW_LINE>if (categoriesBuilder_ == null) {<NEW_LINE>result.categories_ = categories_;<NEW_LINE>} else {<NEW_LINE>result.categories_ = categoriesBuilder_.build();<NEW_LINE>}<NEW_LINE>if (subBoxesBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>subBoxes_ = java.util.Collections.unmodifiableList(subBoxes_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000010);<NEW_LINE>}<NEW_LINE>result.subBoxes_ = subBoxes_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>to_bitField0_ |= 0x00000010;<NEW_LINE>}<NEW_LINE>result.shiftToData_ = shiftToData_;<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | .subBoxes_ = subBoxesBuilder_.build(); |
662,818 | public UpdateDomainAssociationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateDomainAssociationResult updateDomainAssociationResult = new UpdateDomainAssociationResult();<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 updateDomainAssociationResult;<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("domainAssociation", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateDomainAssociationResult.setDomainAssociation(DomainAssociationJsonUnmarshaller.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 updateDomainAssociationResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
635,086 | public Template copy(final Template sourceTemplate, final Host destination, final boolean forceOverwrite, final List<ContainerRemapTuple> containerMappings, final User user, final boolean respectFrontendRoles) throws DotDataException, DotSecurityException {<NEW_LINE>Logger.debug(this, () -> "Calling copy template for the user: " + user.getUserId() + ", sourceTemplate: " + sourceTemplate.getIdentifier() + ", destination: " + destination.getHostname());<NEW_LINE>if (Template.SYSTEM_TEMPLATE.equals(sourceTemplate.getIdentifier())) {<NEW_LINE>Logger.error(this, "System template can not be copied");<NEW_LINE>throw new IllegalArgumentException("System template can not be copied");<NEW_LINE>}<NEW_LINE>if (!permissionAPI.doesUserHavePermission(sourceTemplate, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles)) {<NEW_LINE>Logger.error(this, "The user: " + user.getUserId() + " does not have Permissions to READ the source template");<NEW_LINE>throw new DotSecurityException("You don't have permission to read the source template");<NEW_LINE>}<NEW_LINE>if (!permissionAPI.doesUserHavePermission(destination, PermissionAPI.PERMISSION_WRITE, user, respectFrontendRoles)) {<NEW_LINE>Logger.error(this, "The user: " + user.getUserId() + " does not have Permissions to WRITE in the destination site");<NEW_LINE>throw new DotSecurityException("You don't have permission to write in the destination site.");<NEW_LINE>}<NEW_LINE>boolean isNew = false;<NEW_LINE>Template newTemplate;<NEW_LINE>if (forceOverwrite) {<NEW_LINE>newTemplate = FactoryLocator.getTemplateFactory().findWorkingTemplateByName(sourceTemplate.getTitle(), destination);<NEW_LINE>if (newTemplate == null) {<NEW_LINE>isNew = true;<NEW_LINE>newTemplate = templateFactory.copyTemplate(sourceTemplate, destination);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>isNew = true;<NEW_LINE>newTemplate = templateFactory.copyTemplate(sourceTemplate, destination);<NEW_LINE>}<NEW_LINE>newTemplate.setModDate(new Date());<NEW_LINE>newTemplate.setModUser(user.getUserId());<NEW_LINE>if (isNew) {<NEW_LINE>// creates new identifier for this webasset and persists it<NEW_LINE>Identifier newIdentifier = com.dotmarketing.business.APILocator.getIdentifierAPI().createNew(newTemplate, destination);<NEW_LINE>Logger.debug(TemplateFactory.class, "Parent newIdentifier=" + newIdentifier.getId());<NEW_LINE>newTemplate.setIdentifier(newIdentifier.getId());<NEW_LINE>// persists the webasset<NEW_LINE>save(newTemplate);<NEW_LINE>// Copy the host again<NEW_LINE>newIdentifier.setHostId(destination.getIdentifier());<NEW_LINE>} else {<NEW_LINE>saveTemplate(<MASK><NEW_LINE>}<NEW_LINE>APILocator.getVersionableAPI().setWorking(newTemplate);<NEW_LINE>if (sourceTemplate.isLive()) {<NEW_LINE>APILocator.getVersionableAPI().setLive(newTemplate);<NEW_LINE>} else if (sourceTemplate.isArchived()) {<NEW_LINE>APILocator.getVersionableAPI().setDeleted(newTemplate, true);<NEW_LINE>}<NEW_LINE>// Copy permissions<NEW_LINE>permissionAPI.copyPermissions(sourceTemplate, newTemplate);<NEW_LINE>ActivityLogger.logInfo(this.getClass(), "Copied Template", "User " + user.getPrimaryKey() + " copied template" + newTemplate.getTitle(), destination.getTitle() != null ? destination.getTitle() : "default");<NEW_LINE>return newTemplate;<NEW_LINE>} | newTemplate, destination, user, respectFrontendRoles); |
664,895 | public Request<CreatePlatformApplicationRequest> marshall(CreatePlatformApplicationRequest createPlatformApplicationRequest) {<NEW_LINE>if (createPlatformApplicationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<CreatePlatformApplicationRequest> request = new DefaultRequest<CreatePlatformApplicationRequest>(createPlatformApplicationRequest, "AmazonSNS");<NEW_LINE>request.addParameter("Action", "CreatePlatformApplication");<NEW_LINE>request.addParameter("Version", "2010-03-31");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (createPlatformApplicationRequest.getName() != null) {<NEW_LINE>request.addParameter("Name", StringUtils.fromString(createPlatformApplicationRequest.getName()));<NEW_LINE>}<NEW_LINE>if (createPlatformApplicationRequest.getPlatform() != null) {<NEW_LINE>request.addParameter("Platform", StringUtils.fromString(createPlatformApplicationRequest.getPlatform()));<NEW_LINE>}<NEW_LINE>java.util.Map<String, String> attributes = createPlatformApplicationRequest.getAttributes();<NEW_LINE>int attributesListIndex = 1;<NEW_LINE>for (Map.Entry<String, String> entry : attributes.entrySet()) {<NEW_LINE>if (entry != null && entry.getKey() != null) {<NEW_LINE>request.addParameter("Attributes.entry." + attributesListIndex + ".key", StringUtils.fromString(entry.getKey()));<NEW_LINE>}<NEW_LINE>if (entry != null && entry.getValue() != null) {<NEW_LINE>request.addParameter("Attributes.entry." + attributesListIndex + ".value", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>attributesListIndex++;<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (entry.getValue())); |
275,183 | private void validateAddressPool(IpRangeInventory ipr) {<NEW_LINE>L3NetworkVO l3Vo = Q.New(L3NetworkVO.class).eq(L3NetworkVO_.uuid, ipr.getL3NetworkUuid()).find();<NEW_LINE>List<String> l3Uuids = Q.New(L3NetworkVO.class).eq(L3NetworkVO_.l2NetworkUuid, l3Vo.getL2NetworkUuid()).select(L3NetworkVO_.uuid).listValues();<NEW_LINE>SimpleQuery<AddressPoolVO> q = dbf.createQuery(AddressPoolVO.class);<NEW_LINE>q.add(AddressPoolVO_.l3NetworkUuid, Op.IN, l3Uuids);<NEW_LINE>q.add(AddressPoolVO_.ipVersion, Op.EQ, IPv6Constants.IPv4);<NEW_LINE>List<AddressPoolVO> ranges = q.list();<NEW_LINE>for (AddressPoolVO r : ranges) {<NEW_LINE>if (NetworkUtils.isIpv4RangeOverlap(ipr.getStartIp(), ipr.getEndIp(), r.getStartIp(), r.getEndIp())) {<NEW_LINE>throw new ApiMessageInterceptionException(argerr("overlap with ip range[uuid:%s, start ip:%s, end ip: %s]", r.getUuid(), r.getStartIp()<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , r.getEndIp())); |
995,419 | public BLangNode transform(FunctionTypeDescriptorNode functionTypeDescriptorNode) {<NEW_LINE>BLangFunctionTypeNode functionTypeNode = (BLangFunctionTypeNode) TreeBuilder.createFunctionTypeNode();<NEW_LINE>functionTypeNode.pos = getPosition(functionTypeDescriptorNode);<NEW_LINE>functionTypeNode.returnsKeywordExists = true;<NEW_LINE>if (functionTypeDescriptorNode.functionSignature().isPresent()) {<NEW_LINE>FunctionSignatureNode funcSignature = functionTypeDescriptorNode.functionSignature().get();<NEW_LINE>// Set Parameters<NEW_LINE>for (ParameterNode child : funcSignature.parameters()) {<NEW_LINE>SimpleVariableNode param = (<MASK><NEW_LINE>if (child.kind() == SyntaxKind.REST_PARAM) {<NEW_LINE>functionTypeNode.restParam = (BLangSimpleVariable) param;<NEW_LINE>} else {<NEW_LINE>functionTypeNode.params.add((BLangVariable) param);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Set Return Type<NEW_LINE>Optional<ReturnTypeDescriptorNode> retNode = funcSignature.returnTypeDesc();<NEW_LINE>if (retNode.isPresent()) {<NEW_LINE>ReturnTypeDescriptorNode returnType = retNode.get();<NEW_LINE>functionTypeNode.returnTypeNode = createTypeNode(returnType.type());<NEW_LINE>} else {<NEW_LINE>BLangValueType bLValueType = (BLangValueType) TreeBuilder.createValueTypeNode();<NEW_LINE>bLValueType.pos = symTable.builtinPos;<NEW_LINE>bLValueType.typeKind = TypeKind.NIL;<NEW_LINE>functionTypeNode.returnTypeNode = bLValueType;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>functionTypeNode.flagSet.add(Flag.ANY_FUNCTION);<NEW_LINE>}<NEW_LINE>functionTypeNode.flagSet.add(Flag.PUBLIC);<NEW_LINE>for (Token token : functionTypeDescriptorNode.qualifierList()) {<NEW_LINE>if (token.kind() == SyntaxKind.ISOLATED_KEYWORD) {<NEW_LINE>functionTypeNode.flagSet.add(Flag.ISOLATED);<NEW_LINE>} else if (token.kind() == SyntaxKind.TRANSACTIONAL_KEYWORD) {<NEW_LINE>functionTypeNode.flagSet.add(Flag.TRANSACTIONAL);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return functionTypeNode;<NEW_LINE>} | SimpleVariableNode) child.apply(this); |
1,813,806 | public <T> void create(String modelPathString, Class<T> type, Closure<?> closure) {<NEW_LINE>ModelPath modelPath = ModelPath.path(modelPathString);<NEW_LINE>DeferredModelAction modelAction = ruleFactory.toAction(type, closure);<NEW_LINE>ModelRuleDescriptor descriptor = modelAction.getDescriptor();<NEW_LINE>ModelType<T> modelType = ModelType.of(type);<NEW_LINE>try {<NEW_LINE>NodeInitializerRegistry nodeInitializerRegistry = modelRegistry.realize(DEFAULT_REFERENCE.getPath(), DEFAULT_REFERENCE.getType());<NEW_LINE>NodeInitializer nodeInitializer = nodeInitializerRegistry<MASK><NEW_LINE>modelRegistry.register(ModelRegistrations.of(modelPath, nodeInitializer).descriptor(descriptor).build());<NEW_LINE>} catch (ModelTypeInitializationException e) {<NEW_LINE>throw new InvalidModelRuleDeclarationException(descriptor, e);<NEW_LINE>}<NEW_LINE>registerAction(modelPath, modelType, ModelActionRole.Initialize, modelAction);<NEW_LINE>} | .getNodeInitializer(forType(modelType)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.