idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
148,720 | private void index() throws IOException {<NEW_LINE>IndexWriter indexWriter = new IndexWriter(indexDir, new IndexWriterConfig(new WhitespaceAnalyzer()).setOpenMode(OpenMode.CREATE));<NEW_LINE>// Writes facet ords to a separate directory from the main index<NEW_LINE><MASK><NEW_LINE>Document doc = new Document();<NEW_LINE>doc.add(new FacetField("Author", "Bob"));<NEW_LINE>doc.add(new FacetField("Publish Date", "2010", "10", "15"));<NEW_LINE>indexWriter.addDocument(config.build(taxoWriter, doc));<NEW_LINE>doc = new Document();<NEW_LINE>doc.add(new FacetField("Author", "Lisa"));<NEW_LINE>doc.add(new FacetField("Publish Date", "2010", "10", "20"));<NEW_LINE>indexWriter.addDocument(config.build(taxoWriter, doc));<NEW_LINE>doc = new Document();<NEW_LINE>doc.add(new FacetField("Author", "Lisa"));<NEW_LINE>doc.add(new FacetField("Publish Date", "2012", "1", "1"));<NEW_LINE>indexWriter.addDocument(config.build(taxoWriter, doc));<NEW_LINE>doc = new Document();<NEW_LINE>doc.add(new FacetField("Author", "Susan"));<NEW_LINE>doc.add(new FacetField("Publish Date", "2012", "1", "7"));<NEW_LINE>indexWriter.addDocument(config.build(taxoWriter, doc));<NEW_LINE>doc = new Document();<NEW_LINE>doc.add(new FacetField("Author", "Frank"));<NEW_LINE>doc.add(new FacetField("Publish Date", "1999", "5", "5"));<NEW_LINE>indexWriter.addDocument(config.build(taxoWriter, doc));<NEW_LINE>indexWriter.close();<NEW_LINE>taxoWriter.close();<NEW_LINE>} | DirectoryTaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir); |
745,658 | public static MNISTReader loadMNIST(String path, boolean training, int depth) {<NEW_LINE>File path2 = new File(path);<NEW_LINE>String imagesFilename;<NEW_LINE>String labelsFilename;<NEW_LINE>if (training) {<NEW_LINE>imagesFilename = "train-images-idx3-ubyte";<NEW_LINE>labelsFilename = "train-labels-idx1-ubyte";<NEW_LINE>} else {<NEW_LINE>imagesFilename = "t10k-images-idx3-ubyte";<NEW_LINE>labelsFilename = "t10k-labels-idx1-ubyte";<NEW_LINE>}<NEW_LINE>File pathImages = new File(path2, imagesFilename);<NEW_LINE>File pathLabels = new File(path2, labelsFilename);<NEW_LINE>if (!pathImages.exists()) {<NEW_LINE>imagesFilename += ".gz";<NEW_LINE>pathImages = new File(path2, imagesFilename);<NEW_LINE>}<NEW_LINE>if (!pathLabels.exists()) {<NEW_LINE>labelsFilename += ".gz";<NEW_LINE>pathLabels = new File(path2, labelsFilename);<NEW_LINE>}<NEW_LINE>if (!pathImages.exists()) {<NEW_LINE>// download<NEW_LINE><MASK><NEW_LINE>FileUtil.downloadFile("http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz", new File(path, "train-images-idx3-ubyte.gz"));<NEW_LINE>FileUtil.downloadFile("http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz", new File(path, "train-labels-idx1-ubyte.gz"));<NEW_LINE>FileUtil.downloadFile("http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz", new File(path, "t10k-images-idx3-ubyte.gz"));<NEW_LINE>FileUtil.downloadFile("http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz", new File(path, "t10k-labels-idx1-ubyte.gz"));<NEW_LINE>}<NEW_LINE>if (!pathImages.exists()) {<NEW_LINE>throw (new AIFHError("Can't open file (with or without .gz): " + pathImages.toString()));<NEW_LINE>}<NEW_LINE>if (!pathLabels.exists()) {<NEW_LINE>throw (new AIFHError("Can't open file (with or without .gz): " + pathLabels.toString()));<NEW_LINE>}<NEW_LINE>return new MNISTReader(pathLabels.toString(), pathImages.toString(), depth);<NEW_LINE>} | System.out.println("Please wait, downloading digits from: http://yann.lecun.com"); |
1,754,594 | public boolean visit(TypeDeclaration node) {<NEW_LINE>handleAnnotations(node.modifiers(), this.options.alignment_for_annotations_on_type);<NEW_LINE>Type superclassType = node.getSuperclassType();<NEW_LINE>if (superclassType != null) {<NEW_LINE>this.wrapParentIndex = this.tm.lastIndexIn(node.getName(), -1);<NEW_LINE>this.wrapGroupEnd = this.tm.lastIndexIn(superclassType, -1);<NEW_LINE>this.wrapIndexes.add(this.tm.firstIndexBefore(superclassType, TokenNameextends));<NEW_LINE>this.wrapIndexes.add(this.tm.firstIndexIn(superclassType, -1));<NEW_LINE>handleWrap(this.options.alignment_for_superclass_in_type_declaration, PREFERRED);<NEW_LINE>}<NEW_LINE>List<Type> superInterfaceTypes = node.superInterfaceTypes();<NEW_LINE>if (!superInterfaceTypes.isEmpty()) {<NEW_LINE>int implementsToken = node.isInterface() ? TokenNameextends : TokenNameimplements;<NEW_LINE>this.wrapParentIndex = this.tm.lastIndexIn(node<MASK><NEW_LINE>this.wrapIndexes.add(this.tm.firstIndexBefore(superInterfaceTypes.get(0), implementsToken));<NEW_LINE>prepareElementsList(superInterfaceTypes, TokenNameCOMMA, -1);<NEW_LINE>handleWrap(this.options.alignment_for_superinterfaces_in_type_declaration, PREFERRED);<NEW_LINE>}<NEW_LINE>prepareElementsList(node.typeParameters(), TokenNameCOMMA, TokenNameLESS);<NEW_LINE>handleWrap(this.options.alignment_for_type_parameters);<NEW_LINE>this.aligner.handleAlign(node.bodyDeclarations());<NEW_LINE>return true;<NEW_LINE>} | .getName(), -1); |
932,824 | static <T extends Annotation> T buildAnnotation(Class<T> annotationClass, @Nullable AnnotationValue<T> annotationValue) {<NEW_LINE>Optional<Constructor<InvocationHandler>> proxyClass = getProxyClass(annotationClass);<NEW_LINE>if (proxyClass.isPresent()) {<NEW_LINE>Map<String, Object> values = new HashMap<>(getDefaultValues(annotationClass));<NEW_LINE>if (annotationValue != null) {<NEW_LINE>final Map<CharSequence, Object> annotationValues = annotationValue.getValues();<NEW_LINE>annotationValues.forEach((key, o) -> values.put(key.toString(), o));<NEW_LINE>}<NEW_LINE>int hashCode = AnnotationUtil.calculateHashCode(values);<NEW_LINE>Optional instantiated = InstantiationUtils.tryInstantiate(proxyClass.get(), (InvocationHandler) new AnnotationProxyHandler(hashCode, annotationClass, annotationValue));<NEW_LINE>if (instantiated.isPresent()) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new AnnotationMetadataException("Failed to build annotation for type: " + annotationClass.getName());<NEW_LINE>} | (T) instantiated.get(); |
1,459,868 | public int compare(AcceptableMediaType o1, AcceptableMediaType o2) {<NEW_LINE>// FIXME what is going on here?<NEW_LINE>boolean q_o1_set = false;<NEW_LINE>int q_o1 = 0;<NEW_LINE>boolean q_o2_set = false;<NEW_LINE>int q_o2 = 0;<NEW_LINE>for (QualitySourceMediaType priorityType : priorityMediaTypes) {<NEW_LINE>if (!q_o1_set && MediaTypes.typeEqual(o1, priorityType)) {<NEW_LINE>q_o1 = o1.getQuality() * priorityType.getQuality();<NEW_LINE>q_o1_set = true;<NEW_LINE>} else if (!q_o2_set && MediaTypes.typeEqual(o2, priorityType)) {<NEW_LINE>q_o2 = o2.getQuality() * priorityType.getQuality();<NEW_LINE>q_o2_set = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int i = q_o2 - q_o1;<NEW_LINE>if (i != 0) {<NEW_LINE>return i;<NEW_LINE>}<NEW_LINE>i = o2.getQuality<MASK><NEW_LINE>if (i != 0) {<NEW_LINE>return i;<NEW_LINE>}<NEW_LINE>return MediaTypes.PARTIAL_ORDER_COMPARATOR.compare(o1, o2);<NEW_LINE>} | () - o1.getQuality(); |
1,108,623 | public void spawnNewTracks() {<NEW_LINE>// mark detected features with no matches as available<NEW_LINE>DogArray_I32 unassociatedDetected = associate.getUnassociatedDestination();<NEW_LINE>// spawn new tracks for unassociated detected features<NEW_LINE>for (int unassociatedIdx = 0; unassociatedIdx < unassociatedDetected.size; unassociatedIdx++) {<NEW_LINE>int detectedIdx = unassociatedDetected.get(unassociatedIdx);<NEW_LINE>Point2D_F64 p = detectedPixels.data[detectedIdx];<NEW_LINE>HybridTrack<TD> track = tracksAll.grow();<NEW_LINE>// KLT track descriptor shape isn't known until after the first image has been processed<NEW_LINE>if (track.trackKlt == null)<NEW_LINE>track.trackKlt = trackerKlt.createNewTrack();<NEW_LINE>// create the descriptor for KLT tracking<NEW_LINE>trackerKlt.setDescription((float) p.x, (float) p.y, track.trackKlt);<NEW_LINE>// set track ID and location<NEW_LINE>track.respawned = false;<NEW_LINE>track.spawnFrameID = track.lastSeenFrameID = frameID;<NEW_LINE>track.featureId = totalTracks++;<NEW_LINE>track.descriptor.setTo(detectedDesc.get(detectedIdx));<NEW_LINE>track.<MASK><NEW_LINE>track.pixel.setTo(p);<NEW_LINE>// update list of active tracks<NEW_LINE>tracksActive.add(track);<NEW_LINE>tracksSpawned.add(track);<NEW_LINE>}<NEW_LINE>} | detectorSetId = detectedSet.get(detectedIdx); |
931,789 | private Playlist parseTrackCharts(ScriptChartsResult chartsResult, String type) {<NEW_LINE>List<Query> queries = new ArrayList<>();<NEW_LINE>for (JsonObject rawTrack : chartsResult.results) {<NEW_LINE>JsonElement artist = rawTrack.get("artist");<NEW_LINE>JsonElement album = rawTrack.get("album");<NEW_LINE>JsonElement track = rawTrack.get("track");<NEW_LINE>if (artist != null && album != null && track != null) {<NEW_LINE>String artistName = artist.getAsString();<NEW_LINE>String albumName = album.getAsString();<NEW_LINE>String trackName = track.getAsString();<NEW_LINE>queries.add(Query.get(trackName<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>String id = mChartsProvider.getScriptAccount().getName() + CHARTS_PLAYLIST_SUFFX + type;<NEW_LINE>String name = mChartsProvider.getScriptAccount().getName() + "_" + type;<NEW_LINE>Playlist pl = Playlist.fromQueryList(id, name, null, queries);<NEW_LINE>pl.setFilled(true);<NEW_LINE>return pl;<NEW_LINE>} | , albumName, artistName, false)); |
325,450 | private static void saveFile() throws CommandSyntaxException {<NEW_LINE>try {<NEW_LINE>NbtCompound rootTag = new NbtCompound();<NEW_LINE>NbtCompound compoundTag = new NbtCompound();<NEW_LINE>groups.forEach((key, value) -> {<NEW_LINE>NbtCompound group = new NbtCompound();<NEW_LINE>group.put("icon", value.getIcon().writeNbt(new NbtCompound()));<NEW_LINE>group.put(<MASK><NEW_LINE>compoundTag.put(key, group);<NEW_LINE>});<NEW_LINE>rootTag.putInt("DataVersion", SharedConstants.getGameVersion().getWorldVersion());<NEW_LINE>rootTag.put("Groups", compoundTag);<NEW_LINE>File newFile = File.createTempFile("groups", ".dat", configPath.toFile());<NEW_LINE>NbtIo.write(rootTag, newFile);<NEW_LINE>File backupFile = new File(configPath.toFile(), "groups.dat_old");<NEW_LINE>File currentFile = new File(configPath.toFile(), "groups.dat");<NEW_LINE>Util.backupAndReplace(currentFile, newFile, backupFile);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw SAVE_FAILED_EXCEPTION.create();<NEW_LINE>}<NEW_LINE>} | "items", value.getItems()); |
33,587 | private static int sendTime(CommandSourceStack cs, ServerLevel dim) throws CommandSyntaxException {<NEW_LINE>long[] times = cs.getServer().getTickTime(dim.dimension());<NEW_LINE>if (// Null means the world is unloaded. Not invalid. That's taken car of by DimensionArgument itself.<NEW_LINE>times == null)<NEW_LINE>times = UNLOADED;<NEW_LINE>final Registry<DimensionType> reg = cs.registryAccess().registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY);<NEW_LINE>double worldTickTime = mean(times) * 1.0E-6D;<NEW_LINE>double worldTPS = Math.<MASK><NEW_LINE>cs.sendSuccess(new TranslatableComponent("commands.forge.tps.summary.named", dim.dimension().location().toString(), reg.getKey(dim.dimensionType()), TIME_FORMATTER.format(worldTickTime), TIME_FORMATTER.format(worldTPS)), false);<NEW_LINE>return 1;<NEW_LINE>} | min(1000.0 / worldTickTime, 20); |
949,406 | private static void runAllExperiments(int initialArrayLength, int experiments) {<NEW_LINE>int arrayLength = initialArrayLength;<NEW_LINE>StdOut.printf("%15s %17s %8s\n", "Sort Type", "Array Length", "Time");<NEW_LINE>StdOut.println("95% sorted and last percent random");<NEW_LINE>for (int experiment = 0; experiment < experiments; experiment++) {<NEW_LINE>Comparable<MASK><NEW_LINE>runExperiments(ninetyFivePercentSortedExceptEndingArray);<NEW_LINE>arrayLength *= 2;<NEW_LINE>}<NEW_LINE>StdOut.println();<NEW_LINE>StdOut.println();<NEW_LINE>arrayLength = initialArrayLength;<NEW_LINE>StdOut.println("All entries within 10 positions of their final place");<NEW_LINE>for (int experiment = 0; experiment < experiments; experiment++) {<NEW_LINE>Comparable[] elementsWithin10PositionsFromFinalPositionArray = generateElementsWithin10PositionsFromFinalPositionArray(arrayLength);<NEW_LINE>runExperiments(elementsWithin10PositionsFromFinalPositionArray);<NEW_LINE>arrayLength *= 2;<NEW_LINE>}<NEW_LINE>StdOut.println();<NEW_LINE>StdOut.println();<NEW_LINE>arrayLength = initialArrayLength;<NEW_LINE>StdOut.println("Sorted except for 5% of entries randomly dispersed");<NEW_LINE>for (int experiment = 0; experiment < experiments; experiment++) {<NEW_LINE>Comparable[] ninetyFivePercentSortedArray = generate95PercentSortedArray(arrayLength);<NEW_LINE>runExperiments(ninetyFivePercentSortedArray);<NEW_LINE>arrayLength *= 2;<NEW_LINE>}<NEW_LINE>} | [] ninetyFivePercentSortedExceptEndingArray = generate95PercentSortedExceptEndingArray(arrayLength); |
343,297 | private static void sendData(ObjectNode data) throws Exception {<NEW_LINE>if (data == null) {<NEW_LINE>throw new IllegalArgumentException("Data cannot be null!");<NEW_LINE>}<NEW_LINE>HttpsURLConnection connection = (HttpsURLConnection) new URL(URL).openConnection();<NEW_LINE>// Compress the data to save bandwidth<NEW_LINE>byte[] compressedData = compress(data.toString());<NEW_LINE>// Add headers<NEW_LINE>connection.setRequestMethod("POST");<NEW_LINE>connection.addRequestProperty("Accept", "application/json");<NEW_LINE>connection.addRequestProperty("Connection", "close");<NEW_LINE>// We gzip our request<NEW_LINE>connection.addRequestProperty("Content-Encoding", "gzip");<NEW_LINE>connection.addRequestProperty("Content-Length", String.valueOf(compressedData.length));<NEW_LINE>// We send our data in JSON format<NEW_LINE>connection.setRequestProperty("Content-Type", "application/json");<NEW_LINE>connection.setRequestProperty("User-Agent", "MC-Server/" + B_STATS_VERSION);<NEW_LINE>// Send data<NEW_LINE>connection.setDoOutput(true);<NEW_LINE>DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream());<NEW_LINE>outputStream.write(compressedData);<NEW_LINE>outputStream.flush();<NEW_LINE>outputStream.close();<NEW_LINE>// We don't care about the response - Just send our data :)<NEW_LINE>connection<MASK><NEW_LINE>} | .getInputStream().close(); |
1,785,932 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller != null) {<NEW_LINE>UUID cardId = this.getTargetPointer().getFirst(game, source);<NEW_LINE>Card card = controller.getGraveyard().get(cardId, game);<NEW_LINE>if (card != null) {<NEW_LINE>Counters counters = new Counters();<NEW_LINE>counters.addCounter(CounterType.MANNEQUIN.createInstance());<NEW_LINE>game.setEnterWithCounters(cardId, counters);<NEW_LINE>if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {<NEW_LINE>Permanent permanent = game.getPermanent(cardId);<NEW_LINE>if (permanent != null) {<NEW_LINE>ContinuousEffect gainedEffect = new MakeshiftMannequinGainAbilityEffect();<NEW_LINE>// Bug #6885 Fixed when owner/controller leaves the game the effect still applies<NEW_LINE>SimpleStaticAbility gainAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, gainedEffect);<NEW_LINE>gainAbility.setSourceId(cardId);<NEW_LINE>gainAbility.getTargets().add(source.getTargets().get(0));<NEW_LINE><MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | game.addEffect(gainedEffect, gainAbility); |
1,243,961 | public ShareAttributes unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ShareAttributes shareAttributes = new ShareAttributes();<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("shareIdentifier", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>shareAttributes.setShareIdentifier(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("weightFactor", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>shareAttributes.setWeightFactor(context.getUnmarshaller(Float.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return shareAttributes;<NEW_LINE>} | class).unmarshall(context)); |
1,011,846 | public static ListCoursesResponse unmarshall(ListCoursesResponse listCoursesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listCoursesResponse.setRequestId(_ctx.stringValue("ListCoursesResponse.RequestId"));<NEW_LINE>listCoursesResponse.setSuccess(_ctx.booleanValue("ListCoursesResponse.Success"));<NEW_LINE>listCoursesResponse.setCode(_ctx.longValue("ListCoursesResponse.Code"));<NEW_LINE>listCoursesResponse.setMessage(_ctx.stringValue("ListCoursesResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPage(_ctx.longValue("ListCoursesResponse.Data.Page"));<NEW_LINE>data.setPageSize(_ctx.longValue("ListCoursesResponse.Data.PageSize"));<NEW_LINE>data.setTotal(_ctx.longValue("ListCoursesResponse.Data.Total"));<NEW_LINE>List<Course> list = new ArrayList<Course>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListCoursesResponse.Data.List.Length"); i++) {<NEW_LINE>Course course = new Course();<NEW_LINE>course.setCourseId(_ctx.stringValue<MASK><NEW_LINE>course.setTitle(_ctx.stringValue("ListCoursesResponse.Data.List[" + i + "].Title"));<NEW_LINE>course.setIntroduce(_ctx.stringValue("ListCoursesResponse.Data.List[" + i + "].Introduce"));<NEW_LINE>course.setPictureUrl(_ctx.stringValue("ListCoursesResponse.Data.List[" + i + "].PictureUrl"));<NEW_LINE>course.setCategory(_ctx.stringValue("ListCoursesResponse.Data.List[" + i + "].Category"));<NEW_LINE>course.setTags(_ctx.stringValue("ListCoursesResponse.Data.List[" + i + "].Tags"));<NEW_LINE>course.setLessonNum(_ctx.longValue("ListCoursesResponse.Data.List[" + i + "].LessonNum"));<NEW_LINE>list.add(course);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>listCoursesResponse.setData(data);<NEW_LINE>return listCoursesResponse;<NEW_LINE>} | ("ListCoursesResponse.Data.List[" + i + "].CourseId")); |
234,330 | private static void walkCFG(final CFG cfg, LongRangeSet subRange, Map<Edge, Branch> edges, final BitSet reachedBlocks) {<NEW_LINE>class WalkState {<NEW_LINE><NEW_LINE>Set<Long> numbers;<NEW_LINE><NEW_LINE>BasicBlock target;<NEW_LINE><NEW_LINE>WalkState(Set<Long> numbers, BasicBlock target) {<NEW_LINE>reachedBlocks.set(target.getLabel());<NEW_LINE>this.target = target;<NEW_LINE>this.numbers = numbers;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Deque<WalkState> walkStates = new ArrayDeque<>();<NEW_LINE>walkStates.push(new WalkState(new HashSet<Long>(), cfg.getEntry()));<NEW_LINE>while (!walkStates.isEmpty()) {<NEW_LINE>WalkState walkState = walkStates.removeLast();<NEW_LINE>Set<MASK><NEW_LINE>for (Iterator<Edge> iterator = cfg.outgoingEdgeIterator(walkState.target); iterator.hasNext(); ) {<NEW_LINE>Edge edge = iterator.next();<NEW_LINE>Branch branch = edges.get(edge);<NEW_LINE>if (branch != null) {<NEW_LINE>branch.numbers.addAll(numbers);<NEW_LINE>numbers = new HashSet<>(numbers);<NEW_LINE>numbers.add(branch.number.longValue());<NEW_LINE>if (branch.trueSet.intersects(subRange)) {<NEW_LINE>branch.trueReachedSet.add(subRange);<NEW_LINE>} else {<NEW_LINE>branch.falseReachedSet.add(subRange);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BasicBlock target = edge.getTarget();<NEW_LINE>if (!reachedBlocks.get(target.getLabel())) {<NEW_LINE>walkStates.push(new WalkState(numbers, target));<NEW_LINE>}<NEW_LINE>if (branch != null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | <Long> numbers = walkState.numbers; |
1,832,180 | public void handle(Object obj, HttpRequest<?> request, MutableHttpResponse<?> response, ChannelHandlerContext context) {<NEW_LINE>NettyFileCustomizableResponseType type;<NEW_LINE>if (obj instanceof File) {<NEW_LINE>type = new NettySystemFileCustomizableResponseType((File) obj);<NEW_LINE>} else if (obj instanceof NettyFileCustomizableResponseType) {<NEW_LINE>type = (NettyFileCustomizableResponseType) obj;<NEW_LINE>} else if (obj instanceof StreamedFile) {<NEW_LINE>type = new NettyStreamedFileCustomizableResponseType((StreamedFile) obj);<NEW_LINE>} else if (obj instanceof SystemFile) {<NEW_LINE>type = new NettySystemFileCustomizableResponseType((SystemFile) obj);<NEW_LINE>} else {<NEW_LINE>throw new CustomizableResponseTypeException("FileTypeHandler only supports File or FileCustomizableResponseType types");<NEW_LINE>}<NEW_LINE>long lastModified = type.getLastModified();<NEW_LINE>// Cache Validation<NEW_LINE>ZonedDateTime ifModifiedSince = request.getHeaders().getDate(HttpHeaders.IF_MODIFIED_SINCE);<NEW_LINE>if (ifModifiedSince != null) {<NEW_LINE>// Only compare up to the second because the datetime format we send to the client<NEW_LINE>// does not have milliseconds<NEW_LINE><MASK><NEW_LINE>long fileLastModifiedSeconds = lastModified / 1000;<NEW_LINE>if (ifModifiedSinceDateSeconds == fileLastModifiedSeconds) {<NEW_LINE>FullHttpResponse nettyResponse = notModified(response);<NEW_LINE>if (request instanceof NettyHttpRequest) {<NEW_LINE>((NettyHttpRequest<?>) request).prepareHttp2ResponseIfNecessary(nettyResponse);<NEW_LINE>}<NEW_LINE>context.writeAndFlush(nettyResponse);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!response.getHeaders().contains(HttpHeaders.CONTENT_TYPE)) {<NEW_LINE>response.header(HttpHeaders.CONTENT_TYPE, type.getMediaType().toString());<NEW_LINE>}<NEW_LINE>setDateAndCacheHeaders(response, lastModified);<NEW_LINE>type.process(response);<NEW_LINE>type.write(request, response, context);<NEW_LINE>context.read();<NEW_LINE>} | long ifModifiedSinceDateSeconds = ifModifiedSince.toEpochSecond(); |
502,450 | private void processCDATA() throws IOException, JspCoreException {<NEW_LINE>boolean endFound = false;<NEW_LINE>StringBuffer cdataText = new StringBuffer();<NEW_LINE>int character = 0;<NEW_LINE>while (endFound == false) {<NEW_LINE>character = readCharacter();<NEW_LINE>switch(character) {<NEW_LINE>case -1:<NEW_LINE>{<NEW_LINE>throw new JspCoreException("jsp.error.end.of.file.reached", new Object[] { "cdata", "Line: " <MASK><NEW_LINE>}<NEW_LINE>case ']':<NEW_LINE>{<NEW_LINE>int[] chars = readAhead(2);<NEW_LINE>if (chars[0] == ']' && chars[1] == '>') {<NEW_LINE>endFound = true;<NEW_LINE>skip(2);<NEW_LINE>} else {<NEW_LINE>cdataText.append((char) character);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>cdataText.append((char) character);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>templateText.append(cdataText.toString());<NEW_LINE>} | + jspSyntaxLineNum + " Col: " + jspSyntaxColNum }); |
304,794 | public static boolean isSelfAccess(final ExpressionTree tree) {<NEW_LINE>ExpressionTree tr = TreeUtils.withoutParens(tree);<NEW_LINE>// If method invocation check the method select<NEW_LINE>if (tr.getKind() == Tree.Kind.ARRAY_ACCESS) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (tree.getKind() == Tree.Kind.METHOD_INVOCATION) {<NEW_LINE>tr = ((MethodInvocationTree) tree).getMethodSelect();<NEW_LINE>}<NEW_LINE>tr = TreeUtils.withoutParens(tr);<NEW_LINE>if (tr.getKind() == Tree.Kind.TYPE_CAST) {<NEW_LINE>tr = ((TypeCastTree) tr).getExpression();<NEW_LINE>}<NEW_LINE>tr = TreeUtils.withoutParens(tr);<NEW_LINE>if (tr.getKind() == Tree.Kind.IDENTIFIER) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (tr.getKind() == Tree.Kind.MEMBER_SELECT) {<NEW_LINE>tr = ((MemberSelectTree) tr).getExpression();<NEW_LINE>if (tr.getKind() == Tree.Kind.IDENTIFIER) {<NEW_LINE>Name ident = ((<MASK><NEW_LINE>return ident.contentEquals("this") || ident.contentEquals("super");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | IdentifierTree) tr).getName(); |
399,238 | public void run() {<NEW_LINE>final List<ChangesCacheFile<MASK><NEW_LINE>final RefreshResultConsumer notifyConsumer = new RefreshResultConsumer() {<NEW_LINE><NEW_LINE>private VcsException myError = null;<NEW_LINE><NEW_LINE>private int myCount = 0;<NEW_LINE><NEW_LINE>private int totalChangesCount = 0;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void receivedChanges(List<CommittedChangeList> changes) {<NEW_LINE>totalChangesCount += changes.size();<NEW_LINE>checkDone();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void receivedError(VcsException ex) {<NEW_LINE>myError = ex;<NEW_LINE>checkDone();<NEW_LINE>}<NEW_LINE><NEW_LINE>private void checkDone() {<NEW_LINE>myCount++;<NEW_LINE>if (myCount == files.size()) {<NEW_LINE>myTaskQueue.run(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>if (totalChangesCount > 0) {<NEW_LINE>notifyReloadIncomingChanges();<NEW_LINE>} else {<NEW_LINE>myProject.getMessageBus().syncPublisher(CommittedChangesTreeBrowser.ITEMS_RELOADED).emptyRefresh();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>notifyRefreshError(myError);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>for (ChangesCacheFile file : files) {<NEW_LINE>if ((!inBackground) || file.getVcs().isVcsBackgroundOperationsAllowed(file.getRootPath().getVirtualFile())) {<NEW_LINE>refreshCacheAsync(file, initIfEmpty, notifyConsumer, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > files = myCachesHolder.getAllCaches(); |
439,122 | private void addJaxProviders() {<NEW_LINE>addSimpleComponent(com.yahoo.container.xml.providers.DatatypeFactoryProvider.class);<NEW_LINE>addSimpleComponent(com.yahoo.container.<MASK><NEW_LINE>addSimpleComponent(com.yahoo.container.xml.providers.SAXParserFactoryProvider.class);<NEW_LINE>addSimpleComponent(com.yahoo.container.xml.providers.SchemaFactoryProvider.class);<NEW_LINE>addSimpleComponent(com.yahoo.container.xml.providers.TransformerFactoryProvider.class);<NEW_LINE>addSimpleComponent(com.yahoo.container.xml.providers.XMLEventFactoryProvider.class);<NEW_LINE>addSimpleComponent(com.yahoo.container.xml.providers.XMLInputFactoryProvider.class);<NEW_LINE>addSimpleComponent(com.yahoo.container.xml.providers.XMLOutputFactoryProvider.class);<NEW_LINE>addSimpleComponent(com.yahoo.container.xml.providers.XPathFactoryProvider.class);<NEW_LINE>} | xml.providers.DocumentBuilderFactoryProvider.class); |
5,686 | public void calculateResultCounts(XmlSuite xmlSuite, SuiteRunnerMap suiteRunnerMap) {<NEW_LINE>ISuite iSuite = suiteRunnerMap.get(xmlSuite);<NEW_LINE>if (iSuite == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, ISuiteResult> results = iSuite.getResults();<NEW_LINE>if (results == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Collection<ISuiteResult> tempSuiteResult = results.values();<NEW_LINE>for (ISuiteResult isr : tempSuiteResult) {<NEW_LINE>ITestContext ctx = isr.getTestContext();<NEW_LINE>int passes = ctx.getPassedTests().size();<NEW_LINE>Map<String, Integer> seggregated = seggregateSkippedTests(ctx);<NEW_LINE>int skipped = seggregated.get(SKIPPED);<NEW_LINE>m_skipped += skipped;<NEW_LINE>int retried = seggregated.get(RETRIED);<NEW_LINE>m_retries += retried;<NEW_LINE>int failed = ctx.getFailedTests().size() + ctx<MASK><NEW_LINE>m_failed += failed;<NEW_LINE>m_confFailures += ctx.getFailedConfigurations().size();<NEW_LINE>m_confSkips += ctx.getSkippedConfigurations().size();<NEW_LINE>m_passes += passes;<NEW_LINE>m_total += passes + failed + skipped + retried;<NEW_LINE>}<NEW_LINE>for (XmlSuite childSuite : xmlSuite.getChildSuites()) {<NEW_LINE>calculateResultCounts(childSuite, suiteRunnerMap);<NEW_LINE>}<NEW_LINE>} | .getFailedButWithinSuccessPercentageTests().size(); |
1,608,362 | public List<Graph> generate(List<? extends Summary> results) {<NEW_LINE>List<Graph> graphs = new ArrayList<>();<NEW_LINE>List<IOTaskSummary> summaries = results.stream().map(x -> (IOTaskSummary) x).collect(Collectors.toList());<NEW_LINE>if (summaries.isEmpty()) {<NEW_LINE>LOG.info("No summaries to generate.");<NEW_LINE>return graphs;<NEW_LINE>}<NEW_LINE>// first() is the list of common field names, second() is the list of unique field names<NEW_LINE>Pair<List<String>, List<String>> fieldNames = Parameters.partitionFieldNames(summaries.stream().map(x -> x.mParameters).collect(Collectors.toList()));<NEW_LINE>// Split up common description into 100 character chunks, for the sub title<NEW_LINE>List<String> subTitle = new ArrayList<>(Splitter.fixedLength(100).splitToList(summaries.get(0).mParameters.getDescription(fieldNames.getFirst())));<NEW_LINE>for (IOTaskSummary summary : summaries) {<NEW_LINE>String series = summary.mParameters.getDescription(fieldNames.getSecond());<NEW_LINE>subTitle.add(series);<NEW_LINE>}<NEW_LINE>BarGraph speedGraph = new BarGraph("Read/Write speed", subTitle, "Avg speed in MB/s");<NEW_LINE>BarGraph stdDevGraph = new BarGraph("Read/Write speed standard deviation", subTitle, "Standard deviation in speed");<NEW_LINE>for (IOTaskSummary summary : summaries) {<NEW_LINE>String series = summary.mParameters.getDescription(fieldNames.getSecond());<NEW_LINE>// read stat<NEW_LINE>BarGraph.Data readSpeed = new BarGraph.Data();<NEW_LINE>BarGraph.Data readStdDev = new BarGraph.Data();<NEW_LINE>SpeedStat readStat = summary.getReadSpeedStat();<NEW_LINE>readSpeed.addData(readStat.mAvgSpeedMbps);<NEW_LINE>readStdDev.addData(readStat.mStdDev);<NEW_LINE>speedGraph.addDataSeries("Read " + series, readSpeed);<NEW_LINE>stdDevGraph.addDataSeries("Read " + series, readStdDev);<NEW_LINE>// write stat<NEW_LINE>BarGraph.Data <MASK><NEW_LINE>BarGraph.Data writeStdDev = new BarGraph.Data();<NEW_LINE>SpeedStat writeStat = summary.getWriteSpeedStat();<NEW_LINE>writeSpeed.addData(writeStat.mAvgSpeedMbps);<NEW_LINE>writeStdDev.addData(writeStat.mStdDev);<NEW_LINE>speedGraph.addDataSeries("Write " + series, writeSpeed);<NEW_LINE>stdDevGraph.addDataSeries("Write " + series, writeStdDev);<NEW_LINE>}<NEW_LINE>graphs.add(speedGraph);<NEW_LINE>graphs.add(stdDevGraph);<NEW_LINE>return graphs;<NEW_LINE>} | writeSpeed = new BarGraph.Data(); |
465,426 | private static TimeSeriesCollection createTimeSeriesDataset() {<NEW_LINE>// TimeSeries series1 = new TimeSeries("Series 1", Day.class);<NEW_LINE>// series1.add(new Day(1, 1, 2003), 54.3);<NEW_LINE>// series1.add(new Day(2, 1, 2003), 20.3);<NEW_LINE>// series1.add(new Day(3, 1, 2003), 43.4);<NEW_LINE>// series1.add(new Day(4, 1, 2003), -12.0);<NEW_LINE>//<NEW_LINE>// TimeSeries series2 = new TimeSeries("Series 2", Day.class);<NEW_LINE>// series2.add(new Day(1, 1, 2003), 8.0);<NEW_LINE>// series2.add(new Day(2, 1, 2003), 16.0);<NEW_LINE>// series2.add(new Day(3, 1, 2003), 21.0);<NEW_LINE>// series2.add(new Day(4, 1, 2003), 5.0);<NEW_LINE>//<NEW_LINE>// TimeSeriesCollection dataset = new TimeSeriesCollection();<NEW_LINE>// dataset.addSeries(series1);<NEW_LINE>// dataset.addSeries(series2);<NEW_LINE>// return dataset;<NEW_LINE>if (sampleTimeSeriesDataset == null) {<NEW_LINE>TimeSeriesCollection dataset = new TimeSeriesCollection();<NEW_LINE>TimeSeries series = new TimeSeries("First", "Year", "Count");<NEW_LINE>series.add(new Year(1976), 0);<NEW_LINE>series.add(new Year(1977), 1);<NEW_LINE>series.add(new Year(1978), 0);<NEW_LINE>series.add(new Year(1979), 2);<NEW_LINE>series.add(new Year(1980), 0);<NEW_LINE>series.add(new Year(1981), 1);<NEW_LINE>series.add(new Year(1982), 2);<NEW_LINE>series.add(new Year(1983), 5);<NEW_LINE>series.add(new Year(1984), 21);<NEW_LINE>series.add(new Year(1985), 18);<NEW_LINE>series.add(<MASK><NEW_LINE>series.add(new Year(1987), 25);<NEW_LINE>series.add(new Year(1988), 11);<NEW_LINE>series.add(new Year(1989), 16);<NEW_LINE>series.add(new Year(1990), 23);<NEW_LINE>series.add(new Year(1991), 14);<NEW_LINE>series.add(new Year(1992), 31);<NEW_LINE>series.add(new Year(1993), 38);<NEW_LINE>series.add(new Year(1994), 31);<NEW_LINE>series.add(new Year(1995), 56);<NEW_LINE>series.add(new Year(1996), 45);<NEW_LINE>series.add(new Year(1997), 74);<NEW_LINE>series.add(new Year(1998), 68);<NEW_LINE>series.add(new Year(1999), 98);<NEW_LINE>series.add(new Year(2000), 85);<NEW_LINE>series.add(new Year(2001), 66);<NEW_LINE>series.add(new Year(2002), 71);<NEW_LINE>series.add(new Year(2003), 65);<NEW_LINE>series.add(new Year(2004), 59);<NEW_LINE>series.add(new Year(2005), 60);<NEW_LINE>dataset.addSeries(series);<NEW_LINE>sampleTimeSeriesDataset = dataset;<NEW_LINE>}<NEW_LINE>return sampleTimeSeriesDataset;<NEW_LINE>} | new Year(1986), 18); |
973,350 | private void copyAvg(int[] src, int[] dst, int width, int height) {<NEW_LINE>int offSrc = 0, offDst = 0;<NEW_LINE>for (int y = 0; y < (height >> 1); y++) {<NEW_LINE>for (int x = 0; x < width; x += 2, offDst++, offSrc += 2) {<NEW_LINE>int a = ((src[offSrc] - 128) * Y_COEFF >> 13) + 128;<NEW_LINE>int b = ((src[offSrc + 1] - 128) * Y_COEFF >> 13) + 128;<NEW_LINE>int c = ((src[offSrc + width] - 128) * Y_COEFF >> 13) + 128;<NEW_LINE>int d = ((src[offSrc + width + 1] - 128) * Y_COEFF >> 13) + 128;<NEW_LINE>dst[offDst] = (a + b + c <MASK><NEW_LINE>}<NEW_LINE>offSrc += width;<NEW_LINE>}<NEW_LINE>} | + d + 2) >> 2; |
1,322,699 | public static void signedMul(final long offset, final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions, final OperandSize firstOperandSize, final String firstOperand, final OperandSize secondOperandSize, final String secondOperand, final OperandSize resultOperandSize, final String resultOperand) {<NEW_LINE>final String xoredResult = environment.getNextVariableString();<NEW_LINE>final String multResult = environment.getNextVariableString();<NEW_LINE>final String toggleMask = environment.getNextVariableString();<NEW_LINE>final String xoredSigns = environment.getNextVariableString();<NEW_LINE>long baseOffset = offset;<NEW_LINE>// get the absolute Value of the operands<NEW_LINE>final Pair<String, String> abs1 = generateAbs(environment, baseOffset, firstOperand, firstOperandSize, instructions);<NEW_LINE>baseOffset = ReilHelpers.nextReilAddress(instruction, instructions);<NEW_LINE>final Pair<String, String> abs2 = generateAbs(environment, baseOffset, secondOperand, secondOperandSize, instructions);<NEW_LINE>baseOffset = ReilHelpers.nextReilAddress(instruction, instructions);<NEW_LINE>final String firstAbs = abs1.second();<NEW_LINE>final String secondAbs = abs2.second();<NEW_LINE>// compute the multiplication<NEW_LINE>instructions.add(ReilHelpers.createMul(baseOffset++, firstOperandSize, firstAbs, secondOperandSize, secondAbs, resultOperandSize, multResult));<NEW_LINE>// Find out if the two operands had different signs and adjust the result accordingly<NEW_LINE>instructions.add(ReilHelpers.createXor(baseOffset++, firstOperandSize, abs1.first(), secondOperandSize, abs2.first(), firstOperandSize, xoredSigns));<NEW_LINE>instructions.add(ReilHelpers.createSub(baseOffset++, firstOperandSize, "0", firstOperandSize, xoredSigns, resultOperandSize, toggleMask));<NEW_LINE>instructions.add(ReilHelpers.createXor(baseOffset++, resultOperandSize, toggleMask, resultOperandSize<MASK><NEW_LINE>instructions.add(ReilHelpers.createAdd(baseOffset++, resultOperandSize, xoredResult, firstOperandSize, xoredSigns, resultOperandSize, resultOperand));<NEW_LINE>} | , multResult, resultOperandSize, xoredResult)); |
1,493,487 | public void init(ServletConfig config) throws ServletException {<NEW_LINE>super.init(config);<NEW_LINE>// load properties<NEW_LINE>Properties props = loadPropertiesFromClassPath("duke.properties");<NEW_LINE>if (props == null)<NEW_LINE>throw new DukeException("Cannot find 'duke.properties' on classpath");<NEW_LINE>check_interval = Integer.parseInt(get(props, "duke.check-interval"));<NEW_LINE>// instantiate main objects<NEW_LINE>this.controller = new DukeController(props);<NEW_LINE>String val = get(props, "duke.timer-implementation", DEFAULT_TIMER);<NEW_LINE>this.timer = (<MASK><NEW_LINE>timer.init(props);<NEW_LINE>// start thread automatically if configured to do so<NEW_LINE>String autostart = get(props, "duke.autostart", "false");<NEW_LINE>if (autostart.trim().equalsIgnoreCase("true"))<NEW_LINE>timer.spawnThread(controller, check_interval);<NEW_LINE>} | DukeTimer) ObjectUtils.instantiate(val); |
1,723,608 | private void stateChangedImpl(List<FileObject> currentFiles) {<NEW_LINE>LOG.log(Level.FINEST, BEFORE_ADDING_REMOVING_TASKS);<NEW_LINE>synchronized (this.filesLock) {<NEW_LINE>List<FileObject> addedFiles = new ArrayList<FileObject>(currentFiles);<NEW_LINE>List<FileObject> removedFiles = new ArrayList<FileObject>(file2Task.keySet());<NEW_LINE>addedFiles.removeAll(file2Task.keySet());<NEW_LINE>removedFiles.removeAll(currentFiles);<NEW_LINE>// remove old tasks:<NEW_LINE>for (FileObject r : removedFiles) {<NEW_LINE>JavaSource <MASK><NEW_LINE>if (source == null) {<NEW_LINE>// TODO: log<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ACCESSOR2.removePhaseCompletionTask(source, file2Task.remove(r));<NEW_LINE>}<NEW_LINE>// add new tasks:<NEW_LINE>for (FileObject a : addedFiles) {<NEW_LINE>if (a == null)<NEW_LINE>continue;<NEW_LINE>if (!a.isValid()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>JavaSource js = JavaSource.forFileObject(a);<NEW_LINE>if (js != null) {<NEW_LINE>CancellableTask<CompilationInfo> task = createTask(a);<NEW_LINE>if (task == null) {<NEW_LINE>throw new IllegalStateException("createTask(FileObject) returned null for factory: " + getClass().getName());<NEW_LINE>}<NEW_LINE>ACCESSOR2.addPhaseCompletionTask(js, task, phase, priority, taskIndexingMode);<NEW_LINE>file2Task.put(a, task);<NEW_LINE>file2JS.put(a, js);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | source = file2JS.remove(r); |
1,091,805 | public void buildErrorCodeDoc(ApiConfig config, JavaProjectBuilder javaProjectBuilder, List<ApiDoc> apiDocList, String template, String outPutFileName, String indexAlias) {<NEW_LINE>List<ApiErrorCode> errorCodeList = DocUtil.errorCodeDictToList(config);<NEW_LINE>String strTime = DateTimeUtil.long2Str(now, DateTimeUtil.DATE_FORMAT_SECOND);<NEW_LINE>Template errorTemplate = BeetlTemplateUtil.getByName(template);<NEW_LINE>errorTemplate.binding(TemplateVariable.PROJECT_NAME.getVariable(), config.getProjectName());<NEW_LINE>String style = config.getStyle();<NEW_LINE>errorTemplate.binding(TemplateVariable.HIGH_LIGHT_CSS_LINK.getVariable(), config.getHighlightStyleLink());<NEW_LINE>errorTemplate.binding(TemplateVariable.STYLE.getVariable(), style);<NEW_LINE>if (CollectionUtil.isEmpty(errorCodeList)) {<NEW_LINE>errorTemplate.binding(TemplateVariable.DICT_ORDER.getVariable(), apiDocList.size() + 1);<NEW_LINE>} else {<NEW_LINE>errorTemplate.binding(TemplateVariable.DICT_ORDER.getVariable(), apiDocList.size() + 2);<NEW_LINE>}<NEW_LINE>// set css cdn<NEW_LINE>setCssCDN(config, errorTemplate);<NEW_LINE>List<ApiDocDict> apiDocDictList = DocUtil.buildDictionary(config, javaProjectBuilder);<NEW_LINE>errorTemplate.binding(TemplateVariable.CREATE_TIME.getVariable(), strTime);<NEW_LINE>errorTemplate.binding(TemplateVariable.VERSION.getVariable(), now);<NEW_LINE>errorTemplate.binding(TemplateVariable.DICT_LIST.getVariable(), apiDocDictList);<NEW_LINE>errorTemplate.binding(TemplateVariable.INDEX_ALIAS.getVariable(), indexAlias);<NEW_LINE>errorTemplate.binding(TemplateVariable.API_DOC_LIST.getVariable(), apiDocList);<NEW_LINE>errorTemplate.binding(TemplateVariable.BACKGROUND.getVariable(), HighlightStyle.getBackgroundColor(style));<NEW_LINE>errorTemplate.binding(TemplateVariable.ERROR_CODE_LIST.getVariable(), errorCodeList);<NEW_LINE>setDirectoryLanguageVariable(config, errorTemplate);<NEW_LINE>FileUtil.nioWriteFile(errorTemplate.render(), config.<MASK><NEW_LINE>} | getOutPath() + FILE_SEPARATOR + outPutFileName); |
871,245 | protected static boolean checkIfBlockBreaksSigns(final Block block) {<NEW_LINE>final Block sign = block.getRelative(BlockFace.UP);<NEW_LINE>if (MaterialUtil.isSignPost(sign.getType()) && isValidSign(new BlockSign(sign))) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>final BlockFace[] directions = new BlockFace[] { BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST };<NEW_LINE>for (final BlockFace blockFace : directions) {<NEW_LINE>final Block <MASK><NEW_LINE>if (MaterialUtil.isWallSign(signBlock.getType())) {<NEW_LINE>try {<NEW_LINE>if (getWallSignFacing(signBlock) == blockFace && isValidSign(new BlockSign(signBlock))) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (final NullPointerException ex) {<NEW_LINE>// Sometimes signs enter a state of being semi broken, having no text or state data, usually while burning.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | signBlock = block.getRelative(blockFace); |
1,807,396 | final DeleteHealthCheckResult executeDeleteHealthCheck(DeleteHealthCheckRequest deleteHealthCheckRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteHealthCheckRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteHealthCheckRequest> request = null;<NEW_LINE>Response<DeleteHealthCheckResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteHealthCheckRequestMarshaller().marshall(super.beforeMarshalling(deleteHealthCheckRequest));<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, "Route 53");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteHealthCheck");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteHealthCheckResult> responseHandler = new StaxResponseHandler<<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>} | DeleteHealthCheckResult>(new DeleteHealthCheckResultStaxUnmarshaller()); |
1,260,512 | void addHistoryItem(@NonNull WikivoyageSearchHistoryItem item) {<NEW_LINE>String <MASK><NEW_LINE>if (travelBook == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SQLiteConnection conn = openConnection(false);<NEW_LINE>if (conn != null) {<NEW_LINE>try {<NEW_LINE>conn.execSQL("INSERT INTO " + HISTORY_TABLE_NAME + "(" + HISTORY_COL_ARTICLE_TITLE + ", " + HISTORY_COL_LANG + ", " + HISTORY_COL_IS_PART_OF + ", " + HISTORY_COL_LAST_ACCESSED + ", " + HISTORY_COL_TRAVEL_BOOK + ") VALUES (?, ?, ?, ?, ?)", new Object[] { item.articleTitle, item.lang, item.isPartOf, item.lastAccessed, travelBook });<NEW_LINE>} finally {<NEW_LINE>conn.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | travelBook = item.getTravelBook(context); |
861,454 | public void onRender(MatrixStack matrixStack, float partialTicks) {<NEW_LINE>if (fakePlayer == null || !tracer.isChecked())<NEW_LINE>return;<NEW_LINE>// GL settings<NEW_LINE>GL11.glEnable(GL11.GL_BLEND);<NEW_LINE>GL11.glBlendFunc(<MASK><NEW_LINE>GL11.glEnable(GL11.GL_LINE_SMOOTH);<NEW_LINE>GL11.glDisable(GL11.GL_DEPTH_TEST);<NEW_LINE>matrixStack.push();<NEW_LINE>RenderUtils.applyRenderOffset(matrixStack);<NEW_LINE>float[] colorF = color.getColorF();<NEW_LINE>RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F);<NEW_LINE>// box<NEW_LINE>matrixStack.push();<NEW_LINE>matrixStack.translate(fakePlayer.getX(), fakePlayer.getY(), fakePlayer.getZ());<NEW_LINE>matrixStack.scale(fakePlayer.getWidth() + 0.1F, fakePlayer.getHeight() + 0.1F, fakePlayer.getWidth() + 0.1F);<NEW_LINE>Box bb = new Box(-0.5, 0, -0.5, 0.5, 1, 0.5);<NEW_LINE>RenderUtils.drawOutlinedBox(bb, matrixStack);<NEW_LINE>matrixStack.pop();<NEW_LINE>// line<NEW_LINE>Vec3d start = RotationUtils.getClientLookVec().add(RenderUtils.getCameraPos());<NEW_LINE>Vec3d end = fakePlayer.getBoundingBox().getCenter();<NEW_LINE>Matrix4f matrix = matrixStack.peek().getPositionMatrix();<NEW_LINE>BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();<NEW_LINE>RenderSystem.setShader(GameRenderer::getPositionShader);<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION);<NEW_LINE>bufferBuilder.vertex(matrix, (float) start.x, (float) start.y, (float) start.z).next();<NEW_LINE>bufferBuilder.vertex(matrix, (float) end.x, (float) end.y, (float) end.z).next();<NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>matrixStack.pop();<NEW_LINE>// GL resets<NEW_LINE>GL11.glEnable(GL11.GL_DEPTH_TEST);<NEW_LINE>GL11.glDisable(GL11.GL_BLEND);<NEW_LINE>GL11.glDisable(GL11.GL_LINE_SMOOTH);<NEW_LINE>} | GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); |
7,789 | private void addToWindowsSystemPath(File fLibsFolder) {<NEW_LINE>String syspath = SysJNA.WinKernel32.getEnvironmentVariable("PATH");<NEW_LINE>if (syspath == null) {<NEW_LINE>terminate(1, "addToWindowsSystemPath: cannot access system path");<NEW_LINE>} else {<NEW_LINE>String libsPath = (fLibsFolder.getAbsolutePath()).replaceAll("/", "\\");<NEW_LINE>if (!syspath.toUpperCase().contains(libsPath.toUpperCase())) {<NEW_LINE>if (SysJNA.WinKernel32.setEnvironmentVariable("PATH", libsPath + ";" + syspath)) {<NEW_LINE>syspath = SysJNA.WinKernel32.getEnvironmentVariable("PATH");<NEW_LINE>if (!syspath.toUpperCase().contains(libsPath.toUpperCase())) {<NEW_LINE>log<MASK><NEW_LINE>terminate(1, "addToWindowsSystemPath: did not work - see error");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log(lvl, "addToWindowsSystemPath: added to systempath:\n%s", libsPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (-1, "addToWindowsSystemPath: adding to system path did not work:\n%s", syspath); |
1,250,802 | static PersistentQueryMetadata findMaterializingQuery(final EngineContext engineContext, final ImmutableAnalysis analysis) {<NEW_LINE>final DataSource source = analysis.getFrom().getDataSource();<NEW_LINE>final SourceName sourceName = source.getName();<NEW_LINE>final Set<QueryId> queries = engineContext.getQueryRegistry().getQueriesWithSink(sourceName);<NEW_LINE>if (source.getDataSourceType() != DataSourceType.KTABLE) {<NEW_LINE>throw new KsqlException("Unexpected data source type for table pull query: " + source.getDataSourceType(<MASK><NEW_LINE>}<NEW_LINE>if (queries.isEmpty()) {<NEW_LINE>throw notMaterializedException(sourceName);<NEW_LINE>}<NEW_LINE>if (queries.size() > 1) {<NEW_LINE>throw new IllegalStateException("Tables do not support multiple queries writing into them, yet somehow this happened. " + "Source Name: " + sourceName + " Queries: " + queries + ". Please submit " + "a GitHub issue with the queries that were run.");<NEW_LINE>}<NEW_LINE>final QueryId queryId = Iterables.getOnlyElement(queries);<NEW_LINE>return engineContext.getQueryRegistry().getPersistentQuery(queryId).orElseThrow(() -> new KsqlException("Materializing query has been stopped"));<NEW_LINE>} | ) + " " + PullQueryValidator.PULL_QUERY_SYNTAX_HELP); |
1,783,377 | private static void migrate_config(File oldConfig, File newConfig) throws IOException {<NEW_LINE>System.out.println("Migrating old configuration...");<NEW_LINE>for (String line : Files.readAllLines(oldConfig.toPath())) {<NEW_LINE>if (line.startsWith("#"))<NEW_LINE>continue;<NEW_LINE>if (line.indexOf('=') != -1) {<NEW_LINE>line = line.trim();<NEW_LINE>String val = line.split("=")[1];<NEW_LINE>if (line.startsWith("use_alternative_chat_mixin"))<NEW_LINE><MASK><NEW_LINE>if (line.startsWith("mixin_force_disable")) {<NEW_LINE>if (val.startsWith("org.cardboardpowered.mixin."))<NEW_LINE>disabledMixins.add(val);<NEW_LINE>else<NEW_LINE>disabledMixins.add("org.cardboardpowered.mixin." + val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String con = "";<NEW_LINE>for (String line : Files.readAllLines(newConfig.toPath())) {<NEW_LINE>con += line + "\n";<NEW_LINE>}<NEW_LINE>con = con.replace("use_alternative_chat_mixin: false", "use_alternative_chat_mixin: " + ALT_CHAT);<NEW_LINE>Files.write(newConfig.toPath(), con.getBytes());<NEW_LINE>oldConfig.delete();<NEW_LINE>} | ALT_CHAT = Boolean.valueOf(val); |
1,075,928 | public String changeSessionId() {<NEW_LINE>String oldId = delegate.getId();<NEW_LINE>String id = delegate.changeSessionId();<NEW_LINE>RBatch batch = redisson.createBatch(BatchOptions.defaults());<NEW_LINE>batch.getBucket(getExpiredKey(oldId)).remainTimeToLiveAsync();<NEW_LINE>batch.getBucket(getExpiredKey(oldId)).deleteAsync();<NEW_LINE>batch.getMap(map.getName(), map.<MASK><NEW_LINE>batch.getMap(map.getName()).deleteAsync();<NEW_LINE>BatchResult<?> res = batch.execute();<NEW_LINE>List<?> list = res.getResponses();<NEW_LINE>Long remainTTL = (Long) list.get(0);<NEW_LINE>Map<String, Object> oldState = (Map<String, Object>) list.get(2);<NEW_LINE>if (remainTTL == -2) {<NEW_LINE>// Either:<NEW_LINE>// - a parallel request also invoked changeSessionId() on this session, and the<NEW_LINE>// expiredKey for oldId had been deleted<NEW_LINE>// - sessions do not expire<NEW_LINE>remainTTL = delegate.getMaxInactiveInterval().toMillis();<NEW_LINE>}<NEW_LINE>RBatch batchNew = redisson.createBatch();<NEW_LINE>batchNew.getMap(keyPrefix + id, map.getCodec()).putAllAsync(oldState);<NEW_LINE>if (remainTTL > 0) {<NEW_LINE>batchNew.getBucket(getExpiredKey(id)).setAsync("", remainTTL, TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>batchNew.execute();<NEW_LINE>map = redisson.getMap(keyPrefix + id, map.getCodec());<NEW_LINE>return id;<NEW_LINE>} | getCodec()).readAllMapAsync(); |
532,011 | Stateful doConvertDateTime(VirtualFrame frame, Object state, UnresolvedSymbol symbol, Object self, Object[] arguments, @CachedLibrary(limit = "10") TypesLibrary types, @CachedLibrary(limit = "10") InteropLibrary interop, @Cached MethodResolverNode methodResolverNode) {<NEW_LINE>var ctx = Context.get(this);<NEW_LINE>try {<NEW_LINE>var hostLocalDate = interop.asDate(self);<NEW_LINE>var hostLocalTime = interop.asTime(self);<NEW_LINE>var hostZonedDateTime = hostLocalDate.atTime(hostLocalTime).atZone(ZoneId.systemDefault());<NEW_LINE>var dateTime = new EnsoDateTime(hostZonedDateTime);<NEW_LINE>Function function = methodResolverNode.expectNonNull(dateTime, ctx.getBuiltins(<MASK><NEW_LINE>arguments[0] = dateTime;<NEW_LINE>return invokeFunctionNode.execute(function, frame, state, arguments);<NEW_LINE>} catch (UnsupportedMessageException e) {<NEW_LINE>throw new PanicException(ctx.getBuiltins().error().makeNoSuchMethodError(self, symbol), this);<NEW_LINE>}<NEW_LINE>} | ).dateTime(), symbol); |
461,625 | public static ClassTree addMethod(WorkingCopy copy, ClassTree tree, Modifier[] modifiers, String[] annotations, Object[] annotationAttrs, String name, Object returnType, String[] parameters, Object[] paramTypes, Object[] paramAnnotationsArray, Object[] paramAnnotationAttrsArray, String bodyText, String comment) {<NEW_LINE>TreeMaker maker = copy.getTreeMaker();<NEW_LINE>ModifiersTree modifiersTree = createModifiersTree(copy, modifiers, annotations, annotationAttrs);<NEW_LINE>Tree returnTypeTree = createTypeTree(copy, returnType);<NEW_LINE>List<VariableTree> paramTrees = new ArrayList<VariableTree>();<NEW_LINE>if (parameters != null) {<NEW_LINE>for (int i = 0; i < parameters.length; i++) {<NEW_LINE>ModifiersTree paramModTree = maker.Modifiers(Collections.<Modifier>emptySet());<NEW_LINE>String[] paramAnnotations = null;<NEW_LINE>Object[] paramAnnotationAttrs = null;<NEW_LINE>if (paramAnnotationsArray != null && paramAnnotationsArray.length > 0) {<NEW_LINE>if (paramAnnotationsArray[i] instanceof String) {<NEW_LINE>paramAnnotations = new String[] { (String) paramAnnotationsArray[i] };<NEW_LINE>paramAnnotationAttrs = new Object[] { paramAnnotationAttrsArray[i] };<NEW_LINE>} else {<NEW_LINE>paramAnnotations = (String[]) paramAnnotationsArray[i];<NEW_LINE>paramAnnotationAttrs = (Object[]) paramAnnotationAttrsArray[i];<NEW_LINE>}<NEW_LINE>if (paramAnnotations != null) {<NEW_LINE>paramModTree = createModifiersTree(copy, new Modifier[] {}, paramAnnotations, paramAnnotationAttrs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>paramTrees.add(maker.Variable(paramModTree, parameters[i], createTypeTree(copy, paramTypes[i]), null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MethodTree methodTree = maker.Method(modifiersTree, name, returnTypeTree, Collections.<TypeParameterTree>emptyList(), paramTrees, Collections.<ExpressionTree><MASK><NEW_LINE>if (comment != null) {<NEW_LINE>maker.addComment(methodTree, createJavaDocComment(comment), true);<NEW_LINE>}<NEW_LINE>return maker.addClassMember(tree, methodTree);<NEW_LINE>} | emptyList(), bodyText, null); |
1,001,691 | public void processMessageResult() {<NEW_LINE>List<SyncUrl> syncUrlList = mWebServiceDataSource.get(SyncUrl.Status.ENABLED);<NEW_LINE>for (SyncUrl syncUrl : syncUrlList) {<NEW_LINE>MessagesUUIDSResponse response = sendMessageResultGETRequest(syncUrl);<NEW_LINE>if ((response != null) && (response.isSuccess()) && (response.hasUUIDs())) {<NEW_LINE>final List<MessageResult> messageResults = new ArrayList<>();<NEW_LINE>for (String uuid : response.getUuids()) {<NEW_LINE>Message message = mMessageDataSource.fetchPendingByUuid(uuid);<NEW_LINE>if (message != null) {<NEW_LINE>MessageResult messageResult = new MessageResult();<NEW_LINE>messageResult.setMessageUUID(message.getMessageUuid());<NEW_LINE>messageResult.setSentResultMessage(message.getSentResultMessage());<NEW_LINE>messageResult.setDeliveryResultCode(message.getDeliveryResultCode());<NEW_LINE>messageResult.setSentTimeStamp(message.getMessageDate());<NEW_LINE>messageResult.setDeliveredTimeStamp(message.getDeliveredDate());<NEW_LINE>messageResult.<MASK><NEW_LINE>messageResults.add(messageResult);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sendMessageResultPOSTRequest(syncUrl, messageResults);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setDeliveryResultCode(message.getDeliveryResultCode()); |
689,177 | private I_C_Invoice_Candidate createCandidateForOrderLine(final I_C_OrderLine orderLine) {<NEW_LINE>final Properties ctx = InterfaceWrapperHelper.getCtx(orderLine);<NEW_LINE>final String trxName = InterfaceWrapperHelper.getTrxName(orderLine);<NEW_LINE>Check.assume(Env.getAD_Client_ID(ctx) == orderLine.getAD_Client_ID(), "AD_Client_ID of " + orderLine + " and of its Ctx are the same");<NEW_LINE>final I_C_Invoice_Candidate icRecord = InterfaceWrapperHelper.create(ctx, I_C_Invoice_Candidate.class, trxName);<NEW_LINE>icRecord.setAD_Org_ID(orderLine.getAD_Org_ID());<NEW_LINE>icRecord.setC_ILCandHandler(getHandlerRecord());<NEW_LINE>icRecord.setAD_Table_ID(tableDAO.retrieveTableId(org.compiere.model.I_C_OrderLine.Table_Name));<NEW_LINE>icRecord.setRecord_ID(orderLine.getC_OrderLine_ID());<NEW_LINE>icRecord.setC_OrderLine(orderLine);<NEW_LINE>final int productRecordId = orderLine.getM_Product_ID();<NEW_LINE>icRecord.setM_Product_ID(productRecordId);<NEW_LINE>final boolean isFreightCostProduct = productBL.getProductType(ProductId.ofRepoId(productRecordId)).isFreightCost();<NEW_LINE>icRecord.setIsFreightCost(isFreightCostProduct);<NEW_LINE>icRecord.setIsPackagingMaterial(orderLine.isPackagingMaterial());<NEW_LINE>icRecord.setC_Charge_ID(orderLine.getC_Charge_ID());<NEW_LINE>setOrderedData(icRecord, orderLine);<NEW_LINE>// to be computed<NEW_LINE>icRecord.setQtyToInvoice(BigDecimal.ZERO);<NEW_LINE>// 03439<NEW_LINE>icRecord.setDescription(orderLine.getDescription());<NEW_LINE>final I_C_Order order = InterfaceWrapperHelper.create(orderLine.getC_Order(), I_C_Order.class);<NEW_LINE>setBPartnerData(icRecord, orderLine);<NEW_LINE>setGroupCompensationData(icRecord, orderLine);<NEW_LINE>//<NEW_LINE>// Invoice Rule(s)<NEW_LINE>icRecord.setInvoiceRule(order.getInvoiceRule());<NEW_LINE>// If we are dealing with a non-receivable service set the InvoiceRule_Override to Immediate<NEW_LINE>// because we want to invoice those right away (08408)<NEW_LINE>if (isNotReceivebleService(icRecord)) {<NEW_LINE>// immediate<NEW_LINE>icRecord.setInvoiceRule_Override(X_C_Invoice_Candidate.INVOICERULE_OVERRIDE_Immediate);<NEW_LINE>}<NEW_LINE>// 05265<NEW_LINE>icRecord.setIsSOTrx(orderLine.getC_Order().isSOTrx());<NEW_LINE>icRecord.setQtyOrderedOverUnder(orderLine.getQtyOrderedOverUnder());<NEW_LINE>// prices and tax<NEW_LINE>final PriceAndTax priceAndTax = calculatePriceAndTax(icRecord);<NEW_LINE>IInvoiceCandInvalidUpdater.updatePriceAndTax(icRecord, priceAndTax);<NEW_LINE>//<NEW_LINE>// Dimension<NEW_LINE>final Dimension orderLineDimension = extractDimension(orderLine);<NEW_LINE>dimensionService.updateRecord(icRecord, orderLineDimension);<NEW_LINE>// DocType<NEW_LINE>final DocTypeId orderDocTypeId = CoalesceUtil.coalesceSuppliersNotNull(() -> DocTypeId.ofRepoIdOrNull(order.getC_DocType_ID()), () -> DocTypeId.ofRepoId(order.getC_DocTypeTarget_ID()));<NEW_LINE>final I_C_DocType orderDocType = docTypeBL.getById(orderDocTypeId);<NEW_LINE>final DocTypeId invoiceDocTypeId = DocTypeId.ofRepoIdOrNull(orderDocType.getC_DocTypeInvoice_ID());<NEW_LINE>if (invoiceDocTypeId != null) {<NEW_LINE>icRecord.setC_DocTypeInvoice_ID(invoiceDocTypeId.getRepoId());<NEW_LINE>}<NEW_LINE>final AttributeSetInstanceId asiId = AttributeSetInstanceId.ofRepoIdOrNone(orderLine.getM_AttributeSetInstance_ID());<NEW_LINE>final ImmutableAttributeSet attributes = Services.get(IAttributeDAO.class).getImmutableAttributeSetById(asiId);<NEW_LINE>invoiceCandBL.setQualityDiscountPercent_Override(icRecord, attributes);<NEW_LINE>icRecord.<MASK><NEW_LINE>icRecord.setC_Async_Batch_ID(order.getC_Async_Batch_ID());<NEW_LINE>// external identifiers<NEW_LINE>icRecord.setExternalLineId(orderLine.getExternalId());<NEW_LINE>icRecord.setExternalHeaderId(order.getExternalId());<NEW_LINE>// Don't save.<NEW_LINE>// That's done by the invoking API-impl, because we want to avoid C_Invoice_Candidate.invalidateCandidates() from being called on every single IC that is created here.<NEW_LINE>// Because it's a performance nightmare for orders with a lot of lines<NEW_LINE>// InterfaceWrapperHelper.save(ic);<NEW_LINE>return icRecord;<NEW_LINE>} | setEMail(order.getEMail()); |
1,769,710 | public View initView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>View view = getActivity().getLayoutInflater().inflate(R.layout.dash_common_fragment, container, false);<NEW_LINE>TextView header = (TextView) view.findViewById(R.id.fav_text);<NEW_LINE>header.setText(TITLE_ID);<NEW_LINE>((Button) view.findViewById(R.id.show_all)<MASK><NEW_LINE>LinearLayout tracks = (LinearLayout) view.findViewById(R.id.items);<NEW_LINE>View item = inflater.inflate(R.layout.dash_simulate_item, null, false);<NEW_LINE>tracks.addView(item);<NEW_LINE>final OsmAndLocationProvider loc = getMyApplication().getLocationProvider();<NEW_LINE>OnClickListener listener = new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>loc.getLocationSimulation().startStopGpxAnimation(getActivity());<NEW_LINE>dashboard.hideDashboard();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>item.setOnClickListener(listener);<NEW_LINE>ImageButton actionButton = (ImageButton) item.findViewById(R.id.stop);<NEW_LINE>actionButton.setOnClickListener(listener);<NEW_LINE>actionButton.setContentDescription(getString(R.string.animate_route));<NEW_LINE>((TextView) item.findViewById(R.id.name)).setText(R.string.animate_route);<NEW_LINE>item.findViewById(R.id.divider).setVisibility(View.VISIBLE);<NEW_LINE>return view;<NEW_LINE>} | ).setVisibility(View.GONE); |
242,602 | private static void upgradeInternal(Document document) throws ConfigurationException {<NEW_LINE>Element top = document.getDocumentElement();<NEW_LINE>if (!top.getNodeName().equals("esper-configuration")) {<NEW_LINE>throw new ConfigurationException("Expected root node 'esper-configuration'");<NEW_LINE>}<NEW_LINE>trimWhitespace(top);<NEW_LINE>Element common = createIfNotFound("common", top, document);<NEW_LINE>Element compiler = createIfNotFound("compiler", top, document);<NEW_LINE>Element runtime = createIfNotFound("runtime", top, document);<NEW_LINE>removeNodes("revision-event-type", top);<NEW_LINE>removeNodes("plugin-event-representation", top);<NEW_LINE>removeNodes("plugin-event-type", top);<NEW_LINE>removeNodes("plugin-event-type-name-resolution", top);<NEW_LINE>removeNodes("bytecodegen", top);<NEW_LINE>moveNodes("event-type-auto-name", top, common);<NEW_LINE>moveNodes("event-type", top, common);<NEW_LINE>moveNodes("variant-stream", top, common);<NEW_LINE>moveNodes("auto-import", top, common);<NEW_LINE>moveNodes("auto-import-annotations", top, common);<NEW_LINE>moveNodes("method-reference", top, common);<NEW_LINE>moveNodes("database-reference", top, common);<NEW_LINE>moveNodes("variable", top, common);<NEW_LINE>List<Node> views = moveNodes("plugin-view", top, compiler);<NEW_LINE>List<Node> vdw = moveNodes("plugin-virtualdw", top, compiler);<NEW_LINE>List<Node> aggs = moveNodes("plugin-aggregation-function", top, compiler);<NEW_LINE>List<Node> aggsMF = moveNodes("plugin-aggregation-multifunction", top, compiler);<NEW_LINE>moveNodes("plugin-singlerow-function", top, compiler);<NEW_LINE>List<Node> guards = moveNodes("plugin-pattern-guard", top, compiler);<NEW_LINE>List<Node> observers = <MASK><NEW_LINE>updateAttributeName("factory-class", "forge-class", views, vdw, aggs, aggsMF, guards, observers);<NEW_LINE>moveNodes("plugin-loader", top, runtime);<NEW_LINE>handleSettings(top, common, compiler, runtime);<NEW_LINE>} | moveNodes("plugin-pattern-observer", top, compiler); |
659,415 | void showSummary() {<NEW_LINE>addLabel(getString("Host"));<NEW_LINE>final JLabel hostLabel = new JLabel(javaInformations.getHost());<NEW_LINE>hostLabel.setFont(hostLabel.getFont().deriveFont(Font.BOLD));<NEW_LINE>addJLabel(hostLabel);<NEW_LINE>final MemoryInformations memoryInformations = javaInformations.getMemoryInformations();<NEW_LINE>final long usedMemory = memoryInformations.getUsedMemory();<NEW_LINE>final long maxMemory = memoryInformations.getMaxMemory();<NEW_LINE>addLabel(getString("memoire_utilisee"));<NEW_LINE>// writeGraph("usedMemory", integerFormat.format(usedMemory / 1024 / 1024));<NEW_LINE>final String divide = " / ";<NEW_LINE>addJLabel(toBarWithAlert(integerFormat.format(usedMemory / 1024 / 1024) + ' ' + getString("Mo") + divide + integerFormat.format(maxMemory / 1024 / 1024) + ' ' + getString("Mo"), memoryInformations.getUsedMemoryPercentage(), "-Xmx"));<NEW_LINE>if (javaInformations.getSessionCount() >= 0) {<NEW_LINE>addLabel(getString("nb_sessions_http"));<NEW_LINE>// writeGraph("httpSessions", integerFormat.format(javaInformations.getSessionCount()));<NEW_LINE>addValue(integerFormat.format(javaInformations.getSessionCount()));<NEW_LINE>}<NEW_LINE>addLabel(getString("nb_threads_actifs") + "\n(" + getString("Requetes_http_en_cours") + ')');<NEW_LINE>// writeGraph("activeThreads", integerFormat.format(javaInformations.getActiveThreadCount()));<NEW_LINE>addValue(integerFormat.format(javaInformations.getActiveThreadCount()));<NEW_LINE>if (!noDatabase) {<NEW_LINE>addLabel(getString("nb_connexions_actives"));<NEW_LINE>// writeGraph("activeConnections", integerFormat.format(javaInformations.getActiveConnectionCount()));<NEW_LINE>addValue(integerFormat.format(javaInformations.getActiveConnectionCount()));<NEW_LINE>final <MASK><NEW_LINE>final int maxConnectionCount = javaInformations.getMaxConnectionCount();<NEW_LINE>addLabel(getString("nb_connexions_utilisees") + "\n(" + getString("ouvertes") + ')');<NEW_LINE>// writeGraph("usedConnections", integerFormat.format(usedConnectionCount));<NEW_LINE>if (maxConnectionCount > 0) {<NEW_LINE>addJLabel(toBarWithAlert(integerFormat.format(usedConnectionCount), javaInformations.getUsedConnectionPercentage(), null));<NEW_LINE>} else {<NEW_LINE>addValue(integerFormat.format(usedConnectionCount) + divide + integerFormat.format(maxConnectionCount));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (javaInformations.getSystemLoadAverage() >= 0) {<NEW_LINE>addLabel(getString("Charge_systeme"));<NEW_LINE>// writeGraph("systemLoad", decimalFormat.format(javaInformations.getSystemLoadAverage()));<NEW_LINE>addValue(decimalFormat.format(javaInformations.getSystemLoadAverage()));<NEW_LINE>}<NEW_LINE>if (javaInformations.getSystemCpuLoad() >= 0) {<NEW_LINE>addLabel(getString("systemCpuLoad"));<NEW_LINE>// writeGraph("systemCpuLoad", decimalFormat.format(javaInformations.getSystemCpuLoad()));<NEW_LINE>addJLabel(toBarWithAlert(decimalFormat.format(javaInformations.getSystemCpuLoad()), javaInformations.getSystemCpuLoad(), null));<NEW_LINE>}<NEW_LINE>makeGrid();<NEW_LINE>} | int usedConnectionCount = javaInformations.getUsedConnectionCount(); |
1,038,790 | public MergingContext toRootId(String rootId, Set<ComparisonCondition> comparisonConditions, Set<String> allowedParameters) {<NEW_LINE>Set<String> localSeenModels = new HashSet<>(this.seenModels);<NEW_LINE>localSeenModels.add(rootId);<NEW_LINE>Map<String, ComparisonCondition> globalComparisonConditions = copyMap(this.globalComparisonConditions);<NEW_LINE>comparisonConditions.forEach(condition -> globalComparisonConditions.put(condition.getModelFor(), condition));<NEW_LINE>Map<String, Set<String>> circleParameters = copyMap(this.circleParameters);<NEW_LINE>circleParameters.put(this.rootId, new HashSet<>(allowedParameters));<NEW_LINE>Map<String, Set<String>> circlePath = copyMap(this.circlePath);<NEW_LINE>circlePath.forEach((k, v) -> v.add(rootId));<NEW_LINE>circlePath.put(this.rootId, new HashSet<>(<MASK><NEW_LINE>return new MergingContext(rootId, localSeenModels, circlePath, circleParameters, globalComparisonConditions, this);<NEW_LINE>} | Collections.singletonList(rootId))); |
522,112 | public static int NFD_OpenDialog(@Nullable @NativeType("nfdchar_t const *") CharSequence filterList, @Nullable @NativeType("nfdchar_t const *") CharSequence defaultPath, @NativeType("nfdchar_t **") PointerBuffer outPath) {<NEW_LINE>if (CHECKS) {<NEW_LINE>check(outPath, 1);<NEW_LINE>}<NEW_LINE>MemoryStack stack = stackGet();<NEW_LINE>int stackPointer = stack.getPointer();<NEW_LINE>try {<NEW_LINE>stack.nUTF8Safe(filterList, true);<NEW_LINE>long filterListEncoded = filterList == null <MASK><NEW_LINE>stack.nUTF8Safe(defaultPath, true);<NEW_LINE>long defaultPathEncoded = defaultPath == null ? NULL : stack.getPointerAddress();<NEW_LINE>return nNFD_OpenDialog(filterListEncoded, defaultPathEncoded, memAddress(outPath));<NEW_LINE>} finally {<NEW_LINE>stack.setPointer(stackPointer);<NEW_LINE>}<NEW_LINE>} | ? NULL : stack.getPointerAddress(); |
488,138 | public static JReleaserModel loadConfig(Path configFile) {<NEW_LINE>ServiceLoader<JReleaserConfigParser> parsers = ServiceLoader.load(JReleaserConfigParser.class, <MASK><NEW_LINE>for (JReleaserConfigParser parser : parsers) {<NEW_LINE>if (parser.supports(configFile)) {<NEW_LINE>try {<NEW_LINE>parser.validate(configFile);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new JReleaserException(RB.$("ERROR_invalid_config_file", configFile), e);<NEW_LINE>}<NEW_LINE>try (InputStream inputStream = configFile.toUri().toURL().openStream()) {<NEW_LINE>return parser.parse(inputStream);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new JReleaserException(RB.$("ERROR_parsing_config_file", configFile), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new JReleaserException(RB.$("ERROR_unsupported_config_format", configFile));<NEW_LINE>} | JReleaserConfigParser.class.getClassLoader()); |
469,694 | private static boolean isWordInWordSearchInner(char[][] wordSearch, String word, int x, int y) {<NEW_LINE>if (word.isEmpty()) {<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>boolean firstLetter = matches(wordSearch, x, y, word.charAt(0));<NEW_LINE>if (firstLetter) {<NEW_LINE>boolean left = isWordInWordSearchInner(wordSearch, word.substring(1), x - 1, y);<NEW_LINE>boolean right = isWordInWordSearchInner(wordSearch, word.substring(1), x + 1, y);<NEW_LINE>boolean bottom = isWordInWordSearchInner(wordSearch, word.substring(1), x, y + 1);<NEW_LINE>boolean top = isWordInWordSearchInner(wordSearch, word.substring(1), x, y - 1);<NEW_LINE>boolean topLeft = isWordInWordSearchInner(wordSearch, word.substring(1), x - 1, y - 1);<NEW_LINE>boolean topRight = isWordInWordSearchInner(wordSearch, word.substring(1), x + 1, y - 1);<NEW_LINE>boolean bottomLeft = isWordInWordSearchInner(wordSearch, word.substring(1), x - 1, y + 1);<NEW_LINE>boolean bottomRight = isWordInWordSearchInner(wordSearch, word.substring(1), <MASK><NEW_LINE>return left || right || bottom || top || topLeft || topRight || bottomLeft || bottomRight;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | x + 1, y + 1); |
673,013 | private String formatAttributeValue(Object attributeValue) {<NEW_LINE>try {<NEW_LINE>if (attributeValue instanceof List) {<NEW_LINE>final StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append('[');<NEW_LINE>boolean first = true;<NEW_LINE>for (final Object value : (List<?>) attributeValue) {<NEW_LINE>if (first) {<NEW_LINE>first = false;<NEW_LINE>} else {<NEW_LINE>sb.append(",\n");<NEW_LINE>}<NEW_LINE>if (attributeValue instanceof Number) {<NEW_LINE>sb.append(I18N.createIntegerFormat().format(attributeValue));<NEW_LINE>} else {<NEW_LINE>sb.append(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(']');<NEW_LINE>return sb.toString();<NEW_LINE>} else if (attributeValue instanceof Map) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Map<Object, Object> map = (Map<Object, Object>) attributeValue;<NEW_LINE>final LinkedHashMap<Object, Object> mapToString = new LinkedHashMap<>();<NEW_LINE>for (final Entry<Object, Object> e : map.entrySet()) {<NEW_LINE>final <MASK><NEW_LINE>if (v instanceof Number) {<NEW_LINE>mapToString.put(e.getKey(), I18N.createIntegerFormat().format(v));<NEW_LINE>} else {<NEW_LINE>mapToString.put(e.getKey(), attributeValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return mapToString.toString();<NEW_LINE>} else if (attributeValue instanceof Number) {<NEW_LINE>return I18N.createIntegerFormat().format(attributeValue);<NEW_LINE>}<NEW_LINE>return String.valueOf(attributeValue);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>return e.toString();<NEW_LINE>}<NEW_LINE>} | Object v = e.getValue(); |
767,809 | public final CommandOutputExpressionWithExpressionSubstitution commandOutputWithExpressionSubstituation(AST _t) throws RecognitionException {<NEW_LINE>CommandOutputExpressionWithExpressionSubstitution e;<NEW_LINE>AST commandOutputWithExpressionSubstituation_AST_in = (_t == ASTNULL<MASK><NEW_LINE>AST b = null;<NEW_LINE>AST m = null;<NEW_LINE>AST a = null;<NEW_LINE>AST __t157 = _t;<NEW_LINE>b = _t == ASTNULL ? null : (AST) _t;<NEW_LINE>match(_t, COMMAND_OUTPUT_BEFORE_EXPRESSION_SUBSTITUTION);<NEW_LINE>_t = _t.getFirstChild();<NEW_LINE>e = new CommandOutputExpressionWithExpressionSubstitution(b.getText());<NEW_LINE>{<NEW_LINE>if (_t == null)<NEW_LINE>_t = ASTNULL;<NEW_LINE>switch(_t.getType()) {<NEW_LINE>case COMPSTMT:<NEW_LINE>case GLOBAL_VARIABLE:<NEW_LINE>case INSTANCE_VARIABLE:<NEW_LINE>case CLASS_VARIABLE:<NEW_LINE>{<NEW_LINE>expression_substituation(_t, e);<NEW_LINE>_t = _retTree;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case STRING_BETWEEN_EXPRESSION_SUBSTITUTION:<NEW_LINE>case STRING_AFTER_EXPRESSION_SUBSTITUTION:<NEW_LINE>{<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new NoViableAltException(_t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>{<NEW_LINE>_loop161: do {<NEW_LINE>if (_t == null)<NEW_LINE>_t = ASTNULL;<NEW_LINE>if ((_t.getType() == STRING_BETWEEN_EXPRESSION_SUBSTITUTION)) {<NEW_LINE>m = (AST) _t;<NEW_LINE>match(_t, STRING_BETWEEN_EXPRESSION_SUBSTITUTION);<NEW_LINE>_t = _t.getNextSibling();<NEW_LINE>e.addString(m.getText());<NEW_LINE>{<NEW_LINE>if (_t == null)<NEW_LINE>_t = ASTNULL;<NEW_LINE>switch(_t.getType()) {<NEW_LINE>case COMPSTMT:<NEW_LINE>case GLOBAL_VARIABLE:<NEW_LINE>case INSTANCE_VARIABLE:<NEW_LINE>case CLASS_VARIABLE:<NEW_LINE>{<NEW_LINE>expression_substituation(_t, e);<NEW_LINE>_t = _retTree;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case STRING_BETWEEN_EXPRESSION_SUBSTITUTION:<NEW_LINE>case STRING_AFTER_EXPRESSION_SUBSTITUTION:<NEW_LINE>{<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new NoViableAltException(_t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>break _loop161;<NEW_LINE>}<NEW_LINE>} while (true);<NEW_LINE>}<NEW_LINE>a = (AST) _t;<NEW_LINE>match(_t, STRING_AFTER_EXPRESSION_SUBSTITUTION);<NEW_LINE>_t = _t.getNextSibling();<NEW_LINE>e.addString(a.getText());<NEW_LINE>_t = __t157;<NEW_LINE>_t = _t.getNextSibling();<NEW_LINE>_retTree = _t;<NEW_LINE>return e;<NEW_LINE>} | ) ? null : (AST) _t; |
1,786,120 | public okhttp3.Call readNamespaceStatusCall(String name, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api/v1/namespaces/{name}/status".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));<NEW_LINE>List<Pair> localVarQueryParams <MASK><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 localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<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>} | = new ArrayList<Pair>(); |
1,274,723 | public Parent createContent() {<NEW_LINE>final Pane root = new Pane();<NEW_LINE>root.setPrefSize(245, 100);<NEW_LINE>root.setMinSize(Pane.USE_PREF_SIZE, Pane.USE_PREF_SIZE);<NEW_LINE>root.setMaxSize(Pane.USE_PREF_SIZE, Pane.USE_PREF_SIZE);<NEW_LINE>// create rectangle<NEW_LINE>Rectangle rect = new Rectangle(-25, -25, 50, 50);<NEW_LINE>rect.setArcHeight(15);<NEW_LINE>rect.setArcWidth(15);<NEW_LINE>rect.setFill(Color.CRIMSON);<NEW_LINE>rect.setTranslateX(50);<NEW_LINE>rect.setTranslateY(75);<NEW_LINE>root.getChildren().add(rect);<NEW_LINE>Duration time = Duration.seconds(2);<NEW_LINE>TranslateTransition translate1 = new TranslateTransition(time);<NEW_LINE>translate1.setFromX(50);<NEW_LINE>translate1.setToX(150);<NEW_LINE>PauseTransition pause = new PauseTransition(time);<NEW_LINE>TranslateTransition translate2 = new TranslateTransition(time);<NEW_LINE>translate2.setFromX(150);<NEW_LINE>translate2.setToX(200);<NEW_LINE>animation = new SequentialTransition(<MASK><NEW_LINE>animation.setCycleCount(Timeline.INDEFINITE);<NEW_LINE>animation.setAutoReverse(true);<NEW_LINE>return root;<NEW_LINE>} | rect, translate1, pause, translate2); |
1,106,643 | final ListContactFlowsResult executeListContactFlows(ListContactFlowsRequest listContactFlowsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listContactFlowsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListContactFlowsRequest> request = null;<NEW_LINE>Response<ListContactFlowsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListContactFlowsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listContactFlowsRequest));<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, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListContactFlows");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListContactFlowsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListContactFlowsResultJsonUnmarshaller());<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()); |
686,266 | public Observable<ServiceResponse<PersistedFace>> addFaceFromStreamWithServiceResponseAsync(String faceListId, byte[] image, String userData, List<Integer> targetFace) {<NEW_LINE>if (this.client.azureRegion() == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (faceListId == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter faceListId is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (image == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter image is required and cannot be null.");<NEW_LINE>}<NEW_LINE>Validator.validate(targetFace);<NEW_LINE>String parameterizedHost = Joiner.on(", ").join("{AzureRegion}", <MASK><NEW_LINE>String targetFaceConverted = this.client.serializerAdapter().serializeList(targetFace, CollectionFormat.CSV);<NEW_LINE>RequestBody imageConverted = RequestBody.create(MediaType.parse("application/octet-stream"), image);<NEW_LINE>return service.addFaceFromStream(faceListId, userData, targetFaceConverted, imageConverted, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<PersistedFace>>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Observable<ServiceResponse<PersistedFace>> call(Response<ResponseBody> response) {<NEW_LINE>try {<NEW_LINE>ServiceResponse<PersistedFace> clientResponse = addFaceFromStreamDelegate(response);<NEW_LINE>return Observable.just(clientResponse);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>return Observable.error(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | this.client.azureRegion()); |
438,338 | public void afterPropertiesSet() throws ParseException {<NEW_LINE>Assert.notNull(this.cronExpression, "Property 'cronExpression' is required");<NEW_LINE>if (this.name == null) {<NEW_LINE>this.name = this.beanName;<NEW_LINE>}<NEW_LINE>if (this.group == null) {<NEW_LINE>this.group = Scheduler.DEFAULT_GROUP;<NEW_LINE>}<NEW_LINE>if (this.jobDetail != null) {<NEW_LINE>this.jobDataMap.put("jobDetail", this.jobDetail);<NEW_LINE>}<NEW_LINE>if (this.startDelay > 0 || this.startTime == null) {<NEW_LINE>this.startTime = new Date(System.currentTimeMillis() + this.startDelay);<NEW_LINE>}<NEW_LINE>if (this.timeZone == null) {<NEW_LINE>this<MASK><NEW_LINE>}<NEW_LINE>CronTriggerImpl cti = new CronTriggerImpl();<NEW_LINE>cti.setName(this.name != null ? this.name : toString());<NEW_LINE>cti.setGroup(this.group);<NEW_LINE>if (this.jobDetail != null) {<NEW_LINE>cti.setJobKey(this.jobDetail.getKey());<NEW_LINE>}<NEW_LINE>cti.setJobDataMap(this.jobDataMap);<NEW_LINE>cti.setStartTime(this.startTime);<NEW_LINE>cti.setCronExpression(this.cronExpression);<NEW_LINE>cti.setTimeZone(this.timeZone);<NEW_LINE>cti.setCalendarName(this.calendarName);<NEW_LINE>cti.setPriority(this.priority);<NEW_LINE>cti.setMisfireInstruction(this.misfireInstruction);<NEW_LINE>cti.setDescription(this.description);<NEW_LINE>this.cronTrigger = cti;<NEW_LINE>} | .timeZone = TimeZone.getDefault(); |
758,435 | final DeleteBackupResult executeDeleteBackup(DeleteBackupRequest deleteBackupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteBackupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteBackupRequest> request = null;<NEW_LINE>Response<DeleteBackupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteBackupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteBackupRequest));<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, "OpsWorksCM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteBackup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteBackupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteBackupResultJsonUnmarshaller());<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); |
74,760 | protected void storeTo(Device device, JsonWriter writer) {<NEW_LINE>ImageReaderExtension ext = device.getDeviceExtension(ImageReaderExtension.class);<NEW_LINE>if (ext == null)<NEW_LINE>return;<NEW_LINE>writer.writeStartArray("dcmImageReader");<NEW_LINE>for (Map.Entry<String, ImageReaderFactory.ImageReaderParam> entry : ext.getImageReaderFactory().getEntries()) {<NEW_LINE>writer.writeStartObject();<NEW_LINE><MASK><NEW_LINE>ImageReaderFactory.ImageReaderParam param = entry.getValue();<NEW_LINE>writer.writeNotNullOrDef("dicomTransferSyntax", tsuid, null);<NEW_LINE>writer.writeNotNullOrDef("dcmIIOFormatName", param.formatName, null);<NEW_LINE>writer.writeNotNullOrDef("dcmJavaClassName", param.className, null);<NEW_LINE>writer.writeNotNullOrDef("dcmPatchJPEGLS", param.patchJPEGLS, null);<NEW_LINE>writer.writeNotEmpty("dcmImageReadParam", param.imageReadParams);<NEW_LINE>writer.writeEnd();<NEW_LINE>}<NEW_LINE>writer.writeEnd();<NEW_LINE>} | String tsuid = entry.getKey(); |
1,626,357 | void handleBlockingSubQuery() {<NEW_LINE>if (node.getSubQueries().size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ReentrantLock lock = new ReentrantLock();<NEW_LINE>final Condition finishSubQuery = lock.newCondition();<NEW_LINE>final AtomicBoolean finished = new AtomicBoolean(false);<NEW_LINE>final AtomicInteger subNodes = new AtomicInteger(node.getSubQueries().size());<NEW_LINE>final CopyOnWriteArrayList<ErrorPacket> errorPackets = new CopyOnWriteArrayList<>();<NEW_LINE>for (ItemSubQuery itemSubQuery : node.getSubQueries()) {<NEW_LINE>if (itemSubQuery instanceof ItemSingleRowSubQuery) {<NEW_LINE>final SubQueryHandler tempHandler = new SingleRowSubQueryHandler(getSequenceId(), session, (ItemSingleRowSubQuery) itemSubQuery, false);<NEW_LINE>handleSubQuery(lock, finishSubQuery, finished, subNodes, errorPackets, itemSubQuery.getPlanNode(), tempHandler);<NEW_LINE>} else if (itemSubQuery instanceof ItemInSubQuery) {<NEW_LINE>final SubQueryHandler tempHandler = new InSubQueryHandler(getSequenceId(), session, (ItemInSubQuery) itemSubQuery, false);<NEW_LINE>handleSubQuery(lock, finishSubQuery, finished, subNodes, errorPackets, itemSubQuery.getPlanNode(), tempHandler);<NEW_LINE>} else if (itemSubQuery instanceof ItemAllAnySubQuery) {<NEW_LINE>final SubQueryHandler tempHandler = new AllAnySubQueryHandler(getSequenceId(), session, (ItemAllAnySubQuery) itemSubQuery, false);<NEW_LINE>handleSubQuery(lock, finishSubQuery, finished, subNodes, errorPackets, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>lock.lock();<NEW_LINE>try {<NEW_LINE>while (!finished.get()) {<NEW_LINE>finishSubQuery.await();<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>LOGGER.info("execute ScalarSubQuery " + e);<NEW_LINE>ErrorPacket errorPackage = new ErrorPacket();<NEW_LINE>errorPackage.setErrNo(ErrorCode.ER_UNKNOWN_ERROR);<NEW_LINE>String errorMsg = e.getMessage() == null ? e.toString() : e.getMessage();<NEW_LINE>errorPackage.setMessage(errorMsg.getBytes(StandardCharsets.UTF_8));<NEW_LINE>errorPackets.add(errorPackage);<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>if (errorPackets.size() > 0) {<NEW_LINE>throw new MySQLOutPutException(errorPackets.get(0).getErrNo(), "", new String(errorPackets.get(0).getMessage(), StandardCharsets.UTF_8));<NEW_LINE>}<NEW_LINE>} | itemSubQuery.getPlanNode(), tempHandler); |
469,442 | public Connection connect(JdbcConfiguration config) throws SQLException {<NEW_LINE>final int connectRetryTimes = sourceConfig.getConnectMaxRetries();<NEW_LINE>final ConnectionPoolId connectionPoolId = new ConnectionPoolId(sourceConfig.getHostname(), sourceConfig.getPort());<NEW_LINE>HikariDataSource dataSource = JdbcConnectionPools.getInstance(jdbcConnectionPoolFactory).getOrCreateConnectionPool(connectionPoolId, sourceConfig);<NEW_LINE>int i = 0;<NEW_LINE>while (i < connectRetryTimes) {<NEW_LINE>try {<NEW_LINE>return dataSource.getConnection();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>if (i < connectRetryTimes - 1) {<NEW_LINE>try {<NEW_LINE>Thread.sleep(300);<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>throw new FlinkRuntimeException("Failed to get connection, interrupted while doing another attempt", ie);<NEW_LINE>}<NEW_LINE>LOG.<MASK><NEW_LINE>} else {<NEW_LINE>LOG.error("Get connection failed after retry {} times", i + 1);<NEW_LINE>throw new FlinkRuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>return dataSource.getConnection();<NEW_LINE>} | warn("Get connection failed, retry times {}", i + 1); |
895,675 | public static void removeImplClass(Project project, String implClass) {<NEW_LINE>Sources sources = project.getLookup().lookup(Sources.class);<NEW_LINE>// NOI18N<NEW_LINE>String resource = implClass.replace('.', '/') + ".java";<NEW_LINE>if (sources != null) {<NEW_LINE>SourceGroup[] srcGroup = <MASK><NEW_LINE>for (int i = 0; i < srcGroup.length; i++) {<NEW_LINE>final FileObject srcRoot = srcGroup[i].getRootFolder();<NEW_LINE>final FileObject implClassFo = srcRoot.getFileObject(resource);<NEW_LINE>if (implClassFo != null) {<NEW_LINE>try {<NEW_LINE>FileSystem fs = implClassFo.getFileSystem();<NEW_LINE>fs.runAtomicAction(new AtomicAction() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>deleteFile(implClassFo);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (IOException ex) {<NEW_LINE>ErrorManager.getDefault().notify(ex);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA); |
1,467,575 | public synchronized void start() {<NEW_LINE>if (running) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOGGER.info("{}Starting server", getTag());<NEW_LINE>if (executor == null) {<NEW_LINE>// sets the central thread pool for the protocol stage over all<NEW_LINE>// endpoints<NEW_LINE>//<NEW_LINE>setExecutors(//<NEW_LINE>ExecutorsUtil.// $NON-NLS-1$<NEW_LINE>newScheduledThreadPool(// $NON-NLS-1$<NEW_LINE>this.config.get(CoapConfig.PROTOCOL_STAGE_THREAD_COUNT), new NamedThreadFactory("CoapServer(main)#")), ExecutorsUtil.newDefaultSecondaryScheduler("CoapServer(secondary)#"), false);<NEW_LINE>}<NEW_LINE>if (endpoints.isEmpty()) {<NEW_LINE>// servers should bind to the configured port (while clients should<NEW_LINE>// use an ephemeral port through the default endpoint)<NEW_LINE>int port = <MASK><NEW_LINE>LOGGER.info("{}no endpoints have been defined for server, setting up server endpoint on default port {}", getTag(), port);<NEW_LINE>CoapEndpoint.Builder builder = new CoapEndpoint.Builder();<NEW_LINE>builder.setPort(port);<NEW_LINE>builder.setConfiguration(config);<NEW_LINE>addEndpoint(builder.build());<NEW_LINE>}<NEW_LINE>int started = 0;<NEW_LINE>for (Endpoint ep : endpoints) {<NEW_LINE>try {<NEW_LINE>ep.start();<NEW_LINE>// only reached on success<NEW_LINE>++started;<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error("{}cannot start server endpoint [{}]", getTag(), ep.getAddress(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (started == 0) {<NEW_LINE>throw new IllegalStateException("None of the server endpoints could be started");<NEW_LINE>} else {<NEW_LINE>running = true;<NEW_LINE>}<NEW_LINE>} | config.get(CoapConfig.COAP_PORT); |
670,031 | public <C, B> Mono<Flux<Message<C, B>>> receiveLater(Iterable<? extends Topic> topics, SerializationPair<C> channelSerializer, SerializationPair<B> messageSerializer) {<NEW_LINE>Assert.notNull(topics, "Topics must not be null!");<NEW_LINE>Assert.notNull(channelSerializer, "Channel serializer must not be null!");<NEW_LINE>Assert.notNull(messageSerializer, "Message serializer must not be null!");<NEW_LINE>verifyConnection();<NEW_LINE>ByteBuffer[] patterns = getTargets(topics, PatternTopic.class);<NEW_LINE>ByteBuffer[] channels = <MASK><NEW_LINE>if (ObjectUtils.isEmpty(patterns) && ObjectUtils.isEmpty(channels)) {<NEW_LINE>throw new InvalidDataAccessApiUsageException("No channels or patterns to subscribe to.");<NEW_LINE>}<NEW_LINE>return Mono.defer(() -> {<NEW_LINE>SubscriptionReadyListener readyListener = SubscriptionReadyListener.create(topics, stringSerializationPair);<NEW_LINE>return doReceiveLater(channelSerializer, messageSerializer, getRequiredConnection().pubSubCommands().createSubscription(readyListener), patterns, channels).delayUntil(it -> readyListener.getTrigger());<NEW_LINE>});<NEW_LINE>} | getTargets(topics, ChannelTopic.class); |
1,044,013 | /*<NEW_LINE>* Compute an 8-byte hash of a byte array of length greater than 64 bytes.<NEW_LINE>*/<NEW_LINE>private static long fullFingerprint(byte[] bytes, int offset, int length) {<NEW_LINE>// For lengths over 64 bytes we hash the end first, and then as we<NEW_LINE>// loop we keep 56 bytes of state: v, w, x, y, and z.<NEW_LINE>long x = load64(bytes, offset);<NEW_LINE>long y = load64(bytes, offset + length - 16) ^ K1;<NEW_LINE>long z = load64(bytes, offset + length - 56) ^ K0;<NEW_LINE>long[] v = new long[2];<NEW_LINE>long[] w = new long[2];<NEW_LINE>weakHashLength32WithSeeds(bytes, offset + length - 64, length, y, v);<NEW_LINE>weakHashLength32WithSeeds(bytes, offset + length - 32, length * K1, K0, w);<NEW_LINE>z += shiftMix(v[1]) * K1;<NEW_LINE>x = rotateRight(z + x, 39) * K1;<NEW_LINE>y = rotateRight(y, 33) * K1;<NEW_LINE>// Decrease length to the nearest multiple of 64, and operate on 64-byte chunks.<NEW_LINE>length = (length - 1) & ~63;<NEW_LINE>do {<NEW_LINE>x = rotateRight(x + y + v[0] + load64(bytes, offset + 16), 37) * K1;<NEW_LINE>y = rotateRight(y + v[1] + load64(bytes, offset + 48), 42) * K1;<NEW_LINE>x ^= w[1];<NEW_LINE>y ^= v[0];<NEW_LINE>z = rotateRight(z ^ w[0], 33);<NEW_LINE>weakHashLength32WithSeeds(bytes, offset, v[1] * K1, x <MASK><NEW_LINE>weakHashLength32WithSeeds(bytes, offset + 32, z + w[1], y, w);<NEW_LINE>long tmp = z;<NEW_LINE>z = x;<NEW_LINE>x = tmp;<NEW_LINE>offset += 64;<NEW_LINE>length -= 64;<NEW_LINE>} while (length != 0);<NEW_LINE>return hash128to64(hash128to64(v[0], w[0]) + shiftMix(y) * K1 + z, hash128to64(v[1], w[1]) + x);<NEW_LINE>} | + w[0], v); |
1,211,358 | public AssociateFileSystemResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AssociateFileSystemResult associateFileSystemResult = new AssociateFileSystemResult();<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 associateFileSystemResult;<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("FileSystemAssociationARN", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>associateFileSystemResult.setFileSystemAssociationARN(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return associateFileSystemResult;<NEW_LINE>} | class).unmarshall(context)); |
228,260 | private double[] computeScoreNumDenom(INDArray labels, INDArray preOutput, IActivation activationFn, INDArray mask, boolean average) {<NEW_LINE>INDArray output = activationFn.getActivation(preOutput.dup(), true);<NEW_LINE>long n = labels.size(1);<NEW_LINE>if (n != 1 && n != 2) {<NEW_LINE>throw new UnsupportedOperationException("For binary classification: expect output size of 1 or 2. Got: " + n);<NEW_LINE>}<NEW_LINE>// First: determine positives and negatives<NEW_LINE>INDArray isPositiveLabel;<NEW_LINE>INDArray isNegativeLabel;<NEW_LINE>INDArray pClass0;<NEW_LINE>INDArray pClass1;<NEW_LINE>if (n == 1) {<NEW_LINE>isPositiveLabel = labels;<NEW_LINE>isNegativeLabel = isPositiveLabel.rsub(1.0);<NEW_LINE>pClass0 = output.rsub(1.0);<NEW_LINE>pClass1 = output;<NEW_LINE>} else {<NEW_LINE>isPositiveLabel = labels.getColumn(1);<NEW_LINE>isNegativeLabel = labels.getColumn(0);<NEW_LINE>pClass0 = output.getColumn(0);<NEW_LINE>pClass1 = output.getColumn(1);<NEW_LINE>}<NEW_LINE>if (mask != null) {<NEW_LINE><MASK><NEW_LINE>isNegativeLabel = isNegativeLabel.mulColumnVector(mask);<NEW_LINE>}<NEW_LINE>double tp = isPositiveLabel.mul(pClass1).sumNumber().doubleValue();<NEW_LINE>double fp = isNegativeLabel.mul(pClass1).sumNumber().doubleValue();<NEW_LINE>double fn = isPositiveLabel.mul(pClass0).sumNumber().doubleValue();<NEW_LINE>double numerator = (1.0 + beta * beta) * tp;<NEW_LINE>double denominator = (1.0 + beta * beta) * tp + beta * beta * fn + fp;<NEW_LINE>return new double[] { numerator, denominator };<NEW_LINE>} | isPositiveLabel = isPositiveLabel.mulColumnVector(mask); |
630,114 | private static void validateFieldValue(SameCountryValidator vatValidator, Errors errors, String prefixForLambda, TicketFieldConfiguration fieldConf, List<String> values, int i) {<NEW_LINE>String formValue = values.get(i);<NEW_LINE>if (fieldConf.isMaxLengthDefined()) {<NEW_LINE>validateMaxLength(formValue, prefixForLambda + ADDITIONAL_PREFIX + fieldConf.getName() + "][" + i + "]", "error.tooLong", <MASK><NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(formValue) && fieldConf.isMinLengthDefined() && StringUtils.length(formValue) < fieldConf.getMinLength()) {<NEW_LINE>errors.rejectValue(prefixForLambda + ADDITIONAL_PREFIX + fieldConf.getName() + "][" + i + "]", "error.tooShort", new Object[] { fieldConf.getMinLength() }, null);<NEW_LINE>}<NEW_LINE>if (!fieldConf.getRestrictedValues().isEmpty()) {<NEW_LINE>validateRestrictedValue(formValue, prefixForLambda + ADDITIONAL_PREFIX + fieldConf.getName() + "][" + i + "]", "error.restrictedValue", fieldConf.getRestrictedValues(), errors);<NEW_LINE>}<NEW_LINE>if (fieldConf.isRequired() && fieldConf.getCount() == 1 && StringUtils.isBlank(formValue)) {<NEW_LINE>errors.rejectValue(prefixForLambda + ADDITIONAL_PREFIX + fieldConf.getName() + "][" + i + "]", ErrorsCode.EMPTY_FIELD);<NEW_LINE>}<NEW_LINE>if (fieldConf.hasDisabledValues() && fieldConf.getDisabledValues().contains(formValue)) {<NEW_LINE>errors.rejectValue(prefixForLambda + ADDITIONAL_PREFIX + fieldConf.getName() + "][" + i + "]", "error.disabledValue", null, null);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (fieldConf.isEuVat() && !vatValidator.test(formValue)) {<NEW_LINE>errors.rejectValue(prefixForLambda + ADDITIONAL_PREFIX + fieldConf.getName() + "][" + i + "]", ErrorsCode.STEP_2_INVALID_VAT);<NEW_LINE>}<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>errors.rejectValue(prefixForLambda + ADDITIONAL_PREFIX + fieldConf.getName() + "][" + i + "]", ErrorsCode.VIES_IS_DOWN);<NEW_LINE>}<NEW_LINE>} | fieldConf.getMaxLength(), errors); |
918,433 | private IEditorPart createUntitledFile(String editorType, String fileExtension, InputStream initialContent) {<NEW_LINE>FileOutputStream output = null;<NEW_LINE>try {<NEW_LINE>File file = // $NON-NLS-1$<NEW_LINE>File.// $NON-NLS-1$<NEW_LINE>createTempFile(// $NON-NLS-1$<NEW_LINE>Messages.NewUntitledFileTemplateMenuContributor_TempSuffix, "." + fileExtension);<NEW_LINE>output = new FileOutputStream(file);<NEW_LINE>IOUtil.pipe(initialContent, output);<NEW_LINE>file.deleteOnExit();<NEW_LINE>IEditorDescriptor editorDescriptor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(file.getName());<NEW_LINE>String editorId = (editorDescriptor == null) ? ITextConstants.EDITOR_ID : editorDescriptor.getId();<NEW_LINE>IWorkbenchPage page = UIUtils.getActivePage();<NEW_LINE>if (page != null) {<NEW_LINE>String editorName;<NEW_LINE>Integer value = countByFileType.get(editorType);<NEW_LINE>if (value == null) {<NEW_LINE>editorName = MessageFormat.format(Messages.NewUntitledFileTemplateMenuContributor_DefaultName, editorType);<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>editorName = MessageFormat.format(Messages.NewUntitledFileTemplateMenuContributor_DefaultName_2, editorType, value);<NEW_LINE>countByFileType.put(editorType, ++value);<NEW_LINE>}<NEW_LINE>return page.openEditor(new UntitledFileStorageEditorInput(file.toURI(), editorName, initialContent), editorId);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IdeLog.logError(IOUIPlugin.getDefault(), "Failed to create new file from selected template", e);<NEW_LINE>} finally {<NEW_LINE>if (output != null) {<NEW_LINE>try {<NEW_LINE>output.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>// ignores the exception<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | countByFileType.put(editorType, 1); |
249,848 | private Array createArrayOf(Object implObject, Method createArrayOf, Object[] args) throws SQLException {<NEW_LINE>final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.entry(this, tc, "createArrayOf", args[0]);<NEW_LINE>Array ra;<NEW_LINE>try {<NEW_LINE>activate();<NEW_LINE>ra = (Array) createArrayOf.invoke(implObject, args);<NEW_LINE>if (freeResourcesOnClose)<NEW_LINE>arrays.add(ra);<NEW_LINE>} catch (SQLException sqlX) {<NEW_LINE>FFDCFilter.processException(sqlX, getClass().getName() + ".createArrayOf", "661", this);<NEW_LINE>throw proccessSQLException(sqlX);<NEW_LINE>} catch (NullPointerException nullX) {<NEW_LINE>// No FFDC code needed; we might be closed.<NEW_LINE>throw runtimeXIfNotClosed(nullX);<NEW_LINE>} catch (AbstractMethodError | IllegalAccessException | InvocationTargetException methError) {<NEW_LINE>// No FFDC code needed; wrong JDBC level or wrong driver<NEW_LINE>throw <MASK><NEW_LINE>} catch (RuntimeException runX) {<NEW_LINE>FFDCFilter.processException(runX, getClass().getName() + ".createArrayOf", "671", this);<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "createArrayOf", runX);<NEW_LINE>throw runX;<NEW_LINE>} catch (Error err) {<NEW_LINE>FFDCFilter.processException(err, getClass().getName() + ".createArrayOf", "677", this);<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "createArrayOf", err);<NEW_LINE>throw err;<NEW_LINE>}<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "createArrayOf", AdapterUtil.toString(ra));<NEW_LINE>return ra;<NEW_LINE>} | AdapterUtil.notSupportedX("Connection.createArrayOf", methError); |
614,987 | protected void updateContent() {<NEW_LINE>view.getViewTreeObserver().addOnScrollChangedListener(() -> {<NEW_LINE>boolean bottomScrollAvailable = view.canScrollVertically(1);<NEW_LINE>if (bottomScrollAvailable) {<NEW_LINE>target.showShadowButton();<NEW_LINE>} else {<NEW_LINE>target.hideShadowButton();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ViewGroup cardsContainer = ((ViewGroup) view.findViewById(R.id.cards_container));<NEW_LINE>cardsContainer.removeAllViews();<NEW_LINE>TrackEditCard importTrackCard = new TrackEditCard(mapActivity, gpxFile);<NEW_LINE>importTrackCard.setListener(target);<NEW_LINE>cardsContainer.addView(importTrackCard.build(mapActivity));<NEW_LINE>SelectTrackCard selectTrackCard = new SelectTrackCard(mapActivity);<NEW_LINE>selectTrackCard.setListener(target);<NEW_LINE>cardsContainer.addView(selectTrackCard.build(mapActivity));<NEW_LINE>ApplicationMode mode = app.getRoutingHelper().getAppMode();<NEW_LINE>RoutingHelper routingHelper = app.getRoutingHelper();<NEW_LINE><MASK><NEW_LINE>boolean osmandRouter = mode.getRouteService() == RouteService.OSMAND;<NEW_LINE>if (rparams != null && osmandRouter) {<NEW_LINE>cardsContainer.addView(buildDividerView(cardsContainer, false));<NEW_LINE>ReverseTrackCard reverseTrackCard = new ReverseTrackCard(mapActivity, rparams.isReverse());<NEW_LINE>reverseTrackCard.setListener(target);<NEW_LINE>cardsContainer.addView(reverseTrackCard.build(mapActivity));<NEW_LINE>cardsContainer.addView(buildDividerView(cardsContainer, true));<NEW_LINE>AttachTrackToRoadsCard attachTrackCard = new AttachTrackToRoadsCard(mapActivity);<NEW_LINE>attachTrackCard.setListener(target);<NEW_LINE>cardsContainer.addView(attachTrackCard.build(mapActivity));<NEW_LINE>setupNavigateOptionsCard(cardsContainer, rparams);<NEW_LINE>}<NEW_LINE>} | GPXRouteParamsBuilder rparams = routingHelper.getCurrentGPXRoute(); |
1,850,060 | protected JRTemplateGenericPrintElement createGenericPrintElement() {<NEW_LINE>JRComponentElement element = fillContext.getComponentElement();<NEW_LINE>JRTemplateGenericElement template = new JRTemplateGenericElement(fillContext.getElementOrigin(), fillContext.getDefaultStyleProvider(), fillContext.getComponentElement(), CVPrintElement.CV_ELEMENT_TYPE);<NEW_LINE>template = deduplicate(template);<NEW_LINE>JRTemplateGenericPrintElement printElement = new JRTemplateGenericPrintElement(template, printElementOriginator);<NEW_LINE>printElement.setUUID(element.getUUID());<NEW_LINE>printElement.setX(element.getX());<NEW_LINE>printElement.<MASK><NEW_LINE>printElement.setWidth(element.getWidth());<NEW_LINE>printElement.setHeight(element.getHeight());<NEW_LINE>if (element.hasProperties()) {<NEW_LINE>if (element.getPropertiesMap().getProperty("cv.keepTemporaryFiles") != null && element.getPropertiesMap().getProperty("cv.keepTemporaryFiles").equals("true")) {<NEW_LINE>printElement.getPropertiesMap().setProperty("cv.keepTemporaryFiles", "true");<NEW_LINE>}<NEW_LINE>// We also want to transfer to the component all the properties starting with CV_PREFIX<NEW_LINE>// FIXME transfer standard print properties?<NEW_LINE>for (String ownPropName : element.getPropertiesMap().getOwnPropertyNames()) {<NEW_LINE>if (ownPropName.startsWith(CVConstants.CV_PREFIX)) {<NEW_LINE>printElement.getPropertiesMap().setProperty(ownPropName, element.getPropertiesMap().getProperty(ownPropName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String elementId = CVUtils.generateElementId();<NEW_LINE>printElement.setParameterValue(CVPrintElement.PARAMETER_ELEMENT_ID, elementId);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("generating element " + elementId);<NEW_LINE>}<NEW_LINE>return printElement;<NEW_LINE>} | setY(fillContext.getElementPrintY()); |
1,644,141 | public void marshall(CreateActivationRequest createActivationRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createActivationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createActivationRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createActivationRequest.getDefaultInstanceName(), DEFAULTINSTANCENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createActivationRequest.getIamRole(), IAMROLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createActivationRequest.getExpirationDate(), EXPIRATIONDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createActivationRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createActivationRequest.getRegistrationMetadata(), REGISTRATIONMETADATA_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createActivationRequest.getRegistrationLimit(), REGISTRATIONLIMIT_BINDING); |
1,217,602 | private void loadNode1114() throws IOException, SAXException {<NEW_LINE>DataTypeDescriptionTypeNode node = new DataTypeDescriptionTypeNode(this.context, Identifiers.OpcUa_BinarySchema_BuildInfo, new QualifiedName(0, "BuildInfo"), new LocalizedText("en", "BuildInfo"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.String, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.OpcUa_BinarySchema_BuildInfo, Identifiers.HasTypeDefinition, Identifiers.DataTypeDescriptionType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OpcUa_BinarySchema_BuildInfo, Identifiers.HasComponent, Identifiers.OpcUa_BinarySchema.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<String xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\">BuildInfo</String>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | (1), 0.0, false); |
119,734 | private List<FileObject> jdbcDriversToDeploy(Set<Datasource> datasources) {<NEW_LINE>List<FileObject> jdbcDriverFiles = new ArrayList<FileObject>();<NEW_LINE>Collection<MASK><NEW_LINE>for (Datasource datasource : datasources) {<NEW_LINE>String className = datasource.getDriverClassName();<NEW_LINE>boolean exists = false;<NEW_LINE>try {<NEW_LINE>exists = ClasspathUtil.containsClass(driverCP, className);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.log(Level.INFO, null, e);<NEW_LINE>}<NEW_LINE>if (!exists) {<NEW_LINE>for (DatabaseConnection databaseConnection : DatasourceHelper.findDatabaseConnections(datasource)) {<NEW_LINE>JDBCDriver[] jdbcDrivers;<NEW_LINE>JDBCDriver connDriver = databaseConnection.getJDBCDriver();<NEW_LINE>if (connDriver != null) {<NEW_LINE>jdbcDrivers = new JDBCDriver[] { connDriver };<NEW_LINE>} else {<NEW_LINE>// old fashioned way - fallback<NEW_LINE>String driverClass = databaseConnection.getDriverClass();<NEW_LINE>jdbcDrivers = JDBCDriverManager.getDefault().getDrivers(driverClass);<NEW_LINE>}<NEW_LINE>for (JDBCDriver jdbcDriver : jdbcDrivers) {<NEW_LINE>for (URL url : jdbcDriver.getURLs()) {<NEW_LINE>FileObject file = URLMapper.findFileObject(url);<NEW_LINE>if (file != null) {<NEW_LINE>jdbcDriverFiles.add(file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return jdbcDriverFiles;<NEW_LINE>} | <File> driverCP = getJDBCDriverClasspath(); |
724,430 | public ProcessInstanceResult startProcess(@NonNull final ProcessExecutionContext context) {<NEW_LINE>assertNotExecuted();<NEW_LINE>//<NEW_LINE>// Validate parameters, if any<NEW_LINE>if (parametersDocument != null) {<NEW_LINE>final <MASK><NEW_LINE>if (!validStatus.isValid()) {<NEW_LINE>throw new AdempiereException(validStatus.getReason());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Execute view action's method<NEW_LINE>final IView view = getView();<NEW_LINE>final Method viewActionMethod = viewActionDescriptor.getViewActionMethod();<NEW_LINE>final Object[] viewActionParams = viewActionDescriptor.extractMethodArguments(view, parametersDocument, selectedDocumentIds);<NEW_LINE>try {<NEW_LINE>final Object targetObject = Modifier.isStatic(viewActionMethod.getModifiers()) ? null : view;<NEW_LINE>final Object resultActionObj = viewActionMethod.invoke(targetObject, viewActionParams);<NEW_LINE>final ResultAction resultAction = viewActionDescriptor.convertReturnType(resultActionObj);<NEW_LINE>final ResultAction resultActionProcessed = processResultAction(resultAction, context.getViewsRepo());<NEW_LINE>final ProcessInstanceResult result = ProcessInstanceResult.builder(pinstanceId).action(resultActionProcessed).build();<NEW_LINE>this.result = result;<NEW_LINE>return result;<NEW_LINE>} catch (final Throwable ex) {<NEW_LINE>throw AdempiereException.wrapIfNeeded(ex);<NEW_LINE>}<NEW_LINE>} | DocumentValidStatus validStatus = parametersDocument.checkAndGetValidStatus(); |
64,296 | public static void main(String[] args) {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>System.out.println("Enter Size of Queue.");<NEW_LINE>int size = sc.nextInt();<NEW_LINE>Queue q = new Queue(size);<NEW_LINE>boolean flag = true;<NEW_LINE>int val = 0;<NEW_LINE>while (flag) {<NEW_LINE>System.out.println("1. Enqueue()");<NEW_LINE>System.out.println("2. Dequeue()");<NEW_LINE><MASK><NEW_LINE>System.out.println("4. Peek()");<NEW_LINE>System.out.println("5. View queue");<NEW_LINE>System.out.println("6. Exit");<NEW_LINE>System.out.println("Enter Choice");<NEW_LINE>int choice = sc.nextInt();<NEW_LINE>switch(choice) {<NEW_LINE>case 1:<NEW_LINE>System.out.println("Enter value");<NEW_LINE>val = sc.nextInt();<NEW_LINE>q.enqueue(val);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>System.out.println(q.dequeue());<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>System.out.println(q.count());<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>System.out.println(q.peek());<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>q.viewQ();<NEW_LINE>break;<NEW_LINE>case 6:<NEW_LINE>flag = false;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>System.out.println("Invalid Choice");<NEW_LINE>}<NEW_LINE>// switch<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>// while<NEW_LINE>} | System.out.println("3. Current Size of Queue"); |
1,025,627 | public void render(@Nonnull RevolvershotEntity entity, float entityYaw, float partialTicks, PoseStack matrixStackIn, MultiBufferSource bufferIn, int packedLightIn) {<NEW_LINE>matrixStackIn.pushPose();<NEW_LINE>VertexConsumer builder = bufferIn.getBuffer(IERenderTypes.getPositionTex(getTextureLocation(entity)));<NEW_LINE>matrixStackIn.mulPose(new Quaternion(0, entity.yRotO + (entity.yRot - entity.yRotO) * partialTicks - 90.0F, 0, true));<NEW_LINE>matrixStackIn.mulPose(new Quaternion(0.0F, 0.0F, entity.xRotO + (entity.xRot - entity.xRotO) * partialTicks, true));<NEW_LINE>matrixStackIn.scale(0.25F, 0.25F, 0.25F);<NEW_LINE>Matrix4f mat = matrixStackIn<MASK><NEW_LINE>builder.vertex(mat, 0, 0, -.25f).uv(5 / 32f, 10 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, 0, 0, .25f).uv(0 / 32f, 10 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, 0, .5f, .25f).uv(0 / 32f, 5 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, 0, .5f, -.25f).uv(5 / 32f, 5 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, .375f, .125f, 0).uv(8 / 32f, 5 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, 0, .125f, 0).uv(0 / 32f, 5 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, 0, .375f, 0).uv(0 / 32f, 0 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, .375f, .375f, 0).uv(8 / 32f, 0 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, .375f, .25f, -.25f).uv(8 / 32f, 5 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, 0, .25f, -.25f).uv(0 / 32f, 5 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, 0, .25f, .25f).uv(0 / 32f, 0 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, .375f, .25f, .25f).uv(8 / 32f, 0 / 32f).endVertex();<NEW_LINE>matrixStackIn.popPose();<NEW_LINE>} | .last().pose(); |
333,622 | private String createMethodName(String fullName, String prefix, String shortName) {<NEW_LINE>HashMap methodNumbers = (HashMap) persistentData.get("methodNumbers");<NEW_LINE>if (methodNumbers == null) {<NEW_LINE>methodNumbers = new HashMap();<NEW_LINE>persistentData.put("methodNumbers", methodNumbers);<NEW_LINE>}<NEW_LINE>if (prefix.indexOf('-') >= 0)<NEW_LINE>prefix = GeneratorUtils.replace(prefix, '-', "$1");<NEW_LINE>if (prefix.indexOf('.') >= 0)<NEW_LINE>prefix = GeneratorUtils.<MASK><NEW_LINE>if (shortName.indexOf('-') >= 0)<NEW_LINE>shortName = GeneratorUtils.replace(shortName, '-', "$1");<NEW_LINE>if (shortName.indexOf('.') >= 0)<NEW_LINE>shortName = GeneratorUtils.replace(shortName, '.', "$2");<NEW_LINE>if (shortName.indexOf(':') >= 0)<NEW_LINE>shortName = GeneratorUtils.replace(shortName, ':', "$3");<NEW_LINE>String methodName = "_jspx_meth_" + prefix + "_" + shortName + "_";<NEW_LINE>if (methodNumbers.get(fullName) != null) {<NEW_LINE>Integer i = (Integer) methodNumbers.get(fullName);<NEW_LINE>methodName = methodName + i.intValue();<NEW_LINE>methodNumbers.put(fullName, new Integer(i.intValue() + 1));<NEW_LINE>return methodName;<NEW_LINE>} else {<NEW_LINE>methodNumbers.put(fullName, new Integer(1));<NEW_LINE>return methodName + "0";<NEW_LINE>}<NEW_LINE>} | replace(prefix, '.', "$2"); |
1,695,032 | private static Map<AirbyteStreamNameNamespacePair, CursorInfo> createCursorInfoMap(final DbState serialized, final ConfiguredAirbyteCatalog catalog) {<NEW_LINE>final Set<AirbyteStreamNameNamespacePair> allStreamNames = catalog.getStreams().stream().map(ConfiguredAirbyteStream::getStream).map(AirbyteStreamNameNamespacePair::fromAirbyteSteam).collect(Collectors.toSet());<NEW_LINE>allStreamNames.addAll(serialized.getStreams().stream().map(StateManager::toAirbyteStreamNameNamespacePair).collect(Collectors.toSet()));<NEW_LINE>final Map<AirbyteStreamNameNamespacePair, CursorInfo> localMap = new HashMap<>();<NEW_LINE>final Map<AirbyteStreamNameNamespacePair, DbStreamState> pairToState = serialized.getStreams().stream().collect(Collectors.toMap(StateManager::toAirbyteStreamNameNamespacePair, a -> a));<NEW_LINE>final Map<AirbyteStreamNameNamespacePair, ConfiguredAirbyteStream> pairToConfiguredAirbyteStream = catalog.getStreams().stream().collect(Collectors.toMap(AirbyteStreamNameNamespacePair::fromConfiguredAirbyteSteam, s -> s));<NEW_LINE>for (final AirbyteStreamNameNamespacePair pair : allStreamNames) {<NEW_LINE>final Optional<DbStreamState> stateOptional = Optional.ofNullable(pairToState.get(pair));<NEW_LINE>final Optional<ConfiguredAirbyteStream> streamOptional = Optional.ofNullable<MASK><NEW_LINE>localMap.put(pair, createCursorInfoForStream(pair, stateOptional, streamOptional));<NEW_LINE>}<NEW_LINE>return localMap;<NEW_LINE>} | (pairToConfiguredAirbyteStream.get(pair)); |
493,912 | public void applyChanges() {<NEW_LINE>if (security == null)<NEW_LINE>throw new UnsupportedOperationException(Messages.MsgMissingSecurity);<NEW_LINE>if (sourcePortfolio == null)<NEW_LINE>throw new UnsupportedOperationException(Messages.MsgPortfolioFromMissing);<NEW_LINE>if (targetPortfolio == null)<NEW_LINE><MASK><NEW_LINE>PortfolioTransferEntry t;<NEW_LINE>if (source != null && sourcePortfolio.equals(source.getOwner(source.getSourceTransaction())) && targetPortfolio.equals(source.getOwner(source.getTargetTransaction()))) {<NEW_LINE>// transaction stays in same accounts<NEW_LINE>t = source;<NEW_LINE>} else {<NEW_LINE>if (source != null) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>TransactionOwner<Transaction> owner = (TransactionOwner<Transaction>) source.getOwner(source.getSourceTransaction());<NEW_LINE>owner.deleteTransaction(source.getSourceTransaction(), client);<NEW_LINE>source = null;<NEW_LINE>}<NEW_LINE>t = new PortfolioTransferEntry(sourcePortfolio, targetPortfolio);<NEW_LINE>t.insert();<NEW_LINE>}<NEW_LINE>t.setSecurity(security);<NEW_LINE>t.setDate(LocalDateTime.of(date, time));<NEW_LINE>t.setShares(shares);<NEW_LINE>t.setAmount(amount);<NEW_LINE>t.setCurrencyCode(security.getCurrencyCode());<NEW_LINE>t.setNote(note);<NEW_LINE>} | throw new UnsupportedOperationException(Messages.MsgPortfolioToMissing); |
1,248,134 | private //<NEW_LINE>void writeKeyEvent(int keysym, boolean down) {<NEW_LINE>if (viewOnly)<NEW_LINE>return;<NEW_LINE>GeneralUtils.debugLog(this.debugLogging, TAG, <MASK><NEW_LINE>eventBuf[eventBufLen++] = (byte) KeyboardEvent;<NEW_LINE>eventBuf[eventBufLen++] = (byte) (down ? 1 : 0);<NEW_LINE>eventBuf[eventBufLen++] = (byte) 0;<NEW_LINE>eventBuf[eventBufLen++] = (byte) 0;<NEW_LINE>eventBuf[eventBufLen++] = (byte) ((keysym >> 24) & 0xff);<NEW_LINE>eventBuf[eventBufLen++] = (byte) ((keysym >> 16) & 0xff);<NEW_LINE>eventBuf[eventBufLen++] = (byte) ((keysym >> 8) & 0xff);<NEW_LINE>eventBuf[eventBufLen++] = (byte) (keysym & 0xff);<NEW_LINE>} | "writeKeyEvent, sending keysym:" + keysym + ", down: " + down); |
862,824 | public Builder mergeRequiredDuringSchedulingIgnoredDuringExecution(io.kubernetes.client.proto.V1.NodeSelector value) {<NEW_LINE>if (requiredDuringSchedulingIgnoredDuringExecutionBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001) && requiredDuringSchedulingIgnoredDuringExecution_ != null && requiredDuringSchedulingIgnoredDuringExecution_ != io.kubernetes.client.proto.V1.NodeSelector.getDefaultInstance()) {<NEW_LINE>requiredDuringSchedulingIgnoredDuringExecution_ = io.kubernetes.client.proto.V1.NodeSelector.newBuilder(requiredDuringSchedulingIgnoredDuringExecution_).<MASK><NEW_LINE>} else {<NEW_LINE>requiredDuringSchedulingIgnoredDuringExecution_ = value;<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>} else {<NEW_LINE>requiredDuringSchedulingIgnoredDuringExecutionBuilder_.mergeFrom(value);<NEW_LINE>}<NEW_LINE>bitField0_ |= 0x00000001;<NEW_LINE>return this;<NEW_LINE>} | mergeFrom(value).buildPartial(); |
1,173,792 | public IStatus uninstall(String packageName, String displayName, boolean global, char[] password, IPath workingDirectory, IProgressMonitor monitor) throws CoreException {<NEW_LINE>try {<NEW_LINE>IStatus status = runNpmInstaller(packageName, displayName, global, <MASK><NEW_LINE>if (status.getSeverity() == IStatus.CANCEL) {<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}<NEW_LINE>if (!status.isOK()) {<NEW_LINE>String message = status.getMessage();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String logMsg = MessageFormat.format("Failed to uninstall {0}.\n{1}", packageName, message);<NEW_LINE>IdeLog.logError(JSCorePlugin.getDefault(), logMsg);<NEW_LINE>return new Status(IStatus.ERROR, JSCorePlugin.PLUGIN_ID, logMsg);<NEW_LINE>}<NEW_LINE>return status;<NEW_LINE>} catch (CoreException e) {<NEW_LINE>return e.getStatus();<NEW_LINE>} catch (Exception e) {<NEW_LINE>return new Status(IStatus.ERROR, JSCorePlugin.PLUGIN_ID, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | password, workingDirectory, REMOVE, monitor); |
1,333,378 | public AnalyticsMetadataType unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AnalyticsMetadataType analyticsMetadataType = new AnalyticsMetadataType();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("AnalyticsEndpointId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>analyticsMetadataType.setAnalyticsEndpointId(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 analyticsMetadataType;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,091,009 | public static void updateLanguage(CommandSourceStack source) {<NEW_LINE>if (CarpetSettings.language.equalsIgnoreCase("none")) {<NEW_LINE>translationMap = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, String> translations = new HashMap<>();<NEW_LINE>Map<String, String> trans = getTranslationFromResourcePath(String.format("assets/carpet/lang/%s.json", CarpetSettings.language));<NEW_LINE>if (trans != null)<NEW_LINE>trans.forEach(translations::put);<NEW_LINE>for (CarpetExtension ext : CarpetServer.extensions) {<NEW_LINE>Map<String, String> extMappings = <MASK><NEW_LINE>if (extMappings != null) {<NEW_LINE>extMappings.forEach((key, value) -> {<NEW_LINE>if (!translations.containsKey(key))<NEW_LINE>translations.put(key, value);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>translations.entrySet().removeIf(e -> e.getKey().startsWith("//"));<NEW_LINE>if (translations.isEmpty()) {<NEW_LINE>translationMap = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>translationMap = translations;<NEW_LINE>} | ext.canHasTranslations(CarpetSettings.language); |
1,376,422 | public final Value withOverrides(Value overrides) {<NEW_LINE>if ((overrides == null) || (overrides == EMPTY) || (overrides == this)) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>if (this == EMPTY) {<NEW_LINE>// cheesy, but probably common enough<NEW_LINE>return overrides;<NEW_LINE>}<NEW_LINE>String p = overrides._pattern;<NEW_LINE>if ((p == null) || p.isEmpty()) {<NEW_LINE>p = _pattern;<NEW_LINE>}<NEW_LINE>Shape sh = overrides._shape;<NEW_LINE>if (sh == Shape.ANY) {<NEW_LINE>sh = _shape;<NEW_LINE>}<NEW_LINE>Locale l = overrides._locale;<NEW_LINE>if (l == null) {<NEW_LINE>l = _locale;<NEW_LINE>}<NEW_LINE>Features f = _features;<NEW_LINE>if (f == null) {<NEW_LINE>f = overrides._features;<NEW_LINE>} else {<NEW_LINE>f = f.withOverrides(overrides._features);<NEW_LINE>}<NEW_LINE>Boolean lenient = overrides._lenient;<NEW_LINE>if (lenient == null) {<NEW_LINE>lenient = _lenient;<NEW_LINE>}<NEW_LINE>// timezone not merged, just choose one<NEW_LINE>String tzStr = overrides._timezoneStr;<NEW_LINE>TimeZone tz;<NEW_LINE>if ((tzStr == null) || tzStr.isEmpty()) {<NEW_LINE>// no overrides, use space<NEW_LINE>tzStr = _timezoneStr;<NEW_LINE>tz = _timezone;<NEW_LINE>} else {<NEW_LINE>tz = overrides._timezone;<NEW_LINE>}<NEW_LINE>return new Value(p, sh, l, <MASK><NEW_LINE>} | tzStr, tz, f, lenient); |
860,278 | public ServiceResponse serviceImpl(Query call, HttpServletResponse response, Authorization rights, final JsonObjectWithDefault permissions) throws APIException {<NEW_LINE>JSONObject result = new JSONObject(true);<NEW_LINE>result.put("accepted", false);<NEW_LINE>result.put("message", "Error: Unable to reset Password");<NEW_LINE>String newpass = call.get("newpass", null);<NEW_LINE>ClientCredential credential = new ClientCredential(ClientCredential.Type.resetpass_token, call.get("token", null));<NEW_LINE>Authentication authentication = new Authentication(credential, DAO.passwordreset);<NEW_LINE>ClientCredential emailcred = new ClientCredential(ClientCredential.Type.passwd_login, authentication.getIdentity().getName());<NEW_LINE>String passwordPattern = <MASK><NEW_LINE>Pattern pattern = Pattern.compile(passwordPattern);<NEW_LINE>if ((authentication.getIdentity().getName()).equals(newpass) || !new TimeoutMatcher(pattern.matcher(newpass)).matches()) {<NEW_LINE>// password can't equal email and regex should match<NEW_LINE>throw new APIException(422, "invalid password");<NEW_LINE>}<NEW_LINE>if (DAO.hasAuthentication(emailcred)) {<NEW_LINE>Authentication emailauth = DAO.getAuthentication(emailcred);<NEW_LINE>String salt = createRandomString(20);<NEW_LINE>emailauth.remove("salt");<NEW_LINE>emailauth.remove("passwordHash");<NEW_LINE>emailauth.put("salt", salt);<NEW_LINE>emailauth.put("passwordHash", getHash(newpass, salt));<NEW_LINE>}<NEW_LINE>if (authentication.has("one_time") && authentication.getBoolean("one_time")) {<NEW_LINE>authentication.delete();<NEW_LINE>}<NEW_LINE>String subject = "Password Reset";<NEW_LINE>try {<NEW_LINE>EmailHandler.sendEmail(authentication.getIdentity().getName(), subject, "Your password has been reset successfully!");<NEW_LINE>result.put("accepted", true);<NEW_LINE>result.put("message", "Your password has been changed!");<NEW_LINE>} catch (Exception e) {<NEW_LINE>result.put("message", e.getMessage());<NEW_LINE>}<NEW_LINE>return new ServiceResponse(result);<NEW_LINE>} | DAO.getConfig("users.password.regex", "^((?=.*\\d)(?=.*[A-Z])(?=.*\\W).{8,64})$"); |
64,967 | private CompletableFuture<?> triggerDeferredExecutions() {<NEW_LINE>switch(deferredExecutionsByStmt.size()) {<NEW_LINE>case 0:<NEW_LINE>LOGGER.debug("method=sync deferredExecutions=0");<NEW_LINE>return CompletableFuture.completedFuture(null);<NEW_LINE>case 1:<NEW_LINE>{<NEW_LINE>var entry = deferredExecutionsByStmt.entrySet().iterator().next();<NEW_LINE>deferredExecutionsByStmt.clear();<NEW_LINE>return exec(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>// sequentiallize execution to ensure client receives row counts in correct order<NEW_LINE>CompletableFuture<?> allCompleted = null;<NEW_LINE>for (var entry : deferredExecutionsByStmt.entrySet()) {<NEW_LINE>var statement = entry.getKey();<NEW_LINE>var deferredExecutions = entry.getValue();<NEW_LINE>if (allCompleted == null) {<NEW_LINE>allCompleted = exec(statement, deferredExecutions);<NEW_LINE>} else {<NEW_LINE>allCompleted = // individual rowReceiver will receive failure; must not break execution chain due to failures.<NEW_LINE>allCompleted.exceptionally(swallowException -> null).thenCompose(ignored <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>deferredExecutionsByStmt.clear();<NEW_LINE>return allCompleted;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | -> exec(statement, deferredExecutions)); |
943,789 | private Mono<Response<Void>> deleteWithResponseAsync(String resourceUri, String recommendationId, String name, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceUri == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (recommendationId == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter recommendationId is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.delete(this.client.getEndpoint(), resourceUri, recommendationId, name, this.client.getApiVersion(), accept, context);<NEW_LINE>} | this.client.mergeContext(context); |
1,808,619 | void save(IGanttProject project, TransformerHandler handler) throws SAXException {<NEW_LINE>AttributesImpl attrs = new AttributesImpl();<NEW_LINE>addAttribute("base-id", project.getActiveCalendar().getBaseCalendarID(), attrs);<NEW_LINE>startElement("calendars", attrs, handler);<NEW_LINE><MASK><NEW_LINE>addAttribute("id", "0", attrs);<NEW_LINE>emptyElement("day-type", attrs, handler);<NEW_LINE>addAttribute("id", "1", attrs);<NEW_LINE>emptyElement("day-type", attrs, handler);<NEW_LINE>addAttribute("id", "1", attrs);<NEW_LINE>addAttribute("name", "default", attrs);<NEW_LINE>for (int i = 1; i <= 7; i++) {<NEW_LINE>boolean holiday = project.getActiveCalendar().getWeekDayType(i) == GPCalendar.DayType.WEEKEND;<NEW_LINE>addAttribute(getShortDayName(i), holiday ? "1" : "0", attrs);<NEW_LINE>}<NEW_LINE>emptyElement("default-week", attrs, handler);<NEW_LINE>addAttribute("value", project.getActiveCalendar().getOnlyShowWeekends(), attrs);<NEW_LINE>emptyElement("only-show-weekends", attrs, handler);<NEW_LINE>emptyElement("overriden-day-types", attrs, handler);<NEW_LINE>emptyElement("days", attrs, handler);<NEW_LINE>endElement("day-types", handler);<NEW_LINE>for (CalendarEvent holiday : project.getActiveCalendar().getPublicHolidays()) {<NEW_LINE>Date d = holiday.myDate;<NEW_LINE>if (holiday.isRecurring) {<NEW_LINE>addAttribute("year", "", attrs);<NEW_LINE>} else {<NEW_LINE>addAttribute("year", String.valueOf(d.getYear() + 1900), attrs);<NEW_LINE>}<NEW_LINE>addAttribute("month", String.valueOf(d.getMonth() + 1), attrs);<NEW_LINE>addAttribute("date", String.valueOf(d.getDate()), attrs);<NEW_LINE>addAttribute("type", holiday.getType().name(), attrs);<NEW_LINE>if (holiday.getColor() != null) {<NEW_LINE>addAttribute("color", ColorConvertion.getColor(holiday.getColor()), attrs);<NEW_LINE>}<NEW_LINE>if (Strings.isNullOrEmpty(holiday.getTitle())) {<NEW_LINE>emptyElement("date", attrs, handler);<NEW_LINE>} else {<NEW_LINE>cdataElement("date", holiday.getTitle(), attrs, handler);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>endElement("calendars", handler);<NEW_LINE>} | startElement("day-types", attrs, handler); |
1,136,881 | public SService convertToSObject(Service input) {<NEW_LINE>if (input == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SService result = new SService();<NEW_LINE>result.setOid(input.getOid());<NEW_LINE>result.setUuid(input.getUuid());<NEW_LINE>result.setRid(input.getRid());<NEW_LINE>result.setName(input.getName());<NEW_LINE>result.setServiceName(input.getServiceName());<NEW_LINE>result.setServiceIdentifier(input.getServiceIdentifier());<NEW_LINE>result.setProviderName(input.getProviderName());<NEW_LINE>result.setUrl(input.getUrl());<NEW_LINE>result.setToken(input.getToken());<NEW_LINE>result.setNotificationProtocol(SAccessMethod.values()[input.getNotificationProtocol().ordinal()]);<NEW_LINE>result.setDescription(input.getDescription());<NEW_LINE>result.setTrigger(STrigger.values()[input.getTrigger().ordinal()]);<NEW_LINE>result.setReadRevision(input.isReadRevision());<NEW_LINE>result.setProfileIdentifier(input.getProfileIdentifier());<NEW_LINE>result.setProfileName(input.getProfileName());<NEW_LINE>result.setProfileDescription(input.getProfileDescription());<NEW_LINE>result.setProfilePublic(input.isProfilePublic());<NEW_LINE>ExtendedDataSchema readExtendedDataVal = input.getReadExtendedData();<NEW_LINE>result.setReadExtendedDataId(readExtendedDataVal == null ? -1 : readExtendedDataVal.getOid());<NEW_LINE>Project writeRevisionVal = input.getWriteRevision();<NEW_LINE>result.setWriteRevisionId(writeRevisionVal == null ? -1 : writeRevisionVal.getOid());<NEW_LINE>ExtendedDataSchema writeExtendedDataVal = input.getWriteExtendedData();<NEW_LINE>result.setWriteExtendedDataId(writeExtendedDataVal == null ? -1 : writeExtendedDataVal.getOid());<NEW_LINE>Project projectVal = input.getProject();<NEW_LINE>result.setProjectId(projectVal == null ? -1 : projectVal.getOid());<NEW_LINE>User userVal = input.getUser();<NEW_LINE>result.setUserId(userVal == null ? -1 : userVal.getOid());<NEW_LINE><MASK><NEW_LINE>result.setInternalServiceId(internalServiceVal == null ? -1 : internalServiceVal.getOid());<NEW_LINE>List<Long> listmodelCheckers = new ArrayList<Long>();<NEW_LINE>for (ModelCheckerInstance v : input.getModelCheckers()) {<NEW_LINE>listmodelCheckers.add(v.getOid());<NEW_LINE>}<NEW_LINE>result.setModelCheckers(listmodelCheckers);<NEW_LINE>return result;<NEW_LINE>} | InternalServicePluginConfiguration internalServiceVal = input.getInternalService(); |
1,131,597 | public static String toLowerCase(Locale locale, String s, char[] value, int offset, int count) {<NEW_LINE>char[] newValue = null;<NEW_LINE>int newCount = 0;<NEW_LINE>for (int i = offset, end = offset + count; i < end; ++i) {<NEW_LINE>char ch = value[i];<NEW_LINE>char newCh;<NEW_LINE>if (ch == LATIN_CAPITAL_I_WITH_DOT || Character.isHighSurrogate(ch)) {<NEW_LINE>// Punt these hard cases.<NEW_LINE>throw new RuntimeException("Unsupported");<NEW_LINE>} else if (ch == GREEK_CAPITAL_SIGMA && isFinalSigma(value, offset, count, i)) {<NEW_LINE>newCh = GREEK_SMALL_FINAL_SIGMA;<NEW_LINE>} else {<NEW_LINE>newCh = charToLowerCase(ch);<NEW_LINE>}<NEW_LINE>if (newValue == null && ch != newCh) {<NEW_LINE>// The result can't be longer than the input.<NEW_LINE>newValue = new char[count];<NEW_LINE>newCount = i - offset;<NEW_LINE>System.arraycopy(value, <MASK><NEW_LINE>}<NEW_LINE>if (newValue != null) {<NEW_LINE>newValue[newCount++] = newCh;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newValue != null ? new String(0, newCount, newValue) : s;<NEW_LINE>} | offset, newValue, 0, newCount); |
1,220,536 | public void marshall(Experiment experiment, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (experiment == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(experiment.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(experiment.getExperimentTemplateId(), EXPERIMENTTEMPLATEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(experiment.getRoleArn(), ROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(experiment.getState(), STATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(experiment.getTargets(), TARGETS_BINDING);<NEW_LINE>protocolMarshaller.marshall(experiment.getActions(), ACTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(experiment.getStopConditions(), STOPCONDITIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(experiment.getCreationTime(), CREATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(experiment.getStartTime(), STARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(experiment.getEndTime(), ENDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(experiment.getLogConfiguration(), LOGCONFIGURATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | experiment.getTags(), TAGS_BINDING); |
998,278 | public boolean pushMsg(Msg msg) {<NEW_LINE>switch(state) {<NEW_LINE>case GROUP:<NEW_LINE>if (!msg.hasMore()) {<NEW_LINE>errno.set(ZError.EFAULT);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (msg.size() > Msg.MAX_GROUP_LENGTH) {<NEW_LINE>errno.set(ZError.EFAULT);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>group = new String(msg.data(), StandardCharsets.US_ASCII);<NEW_LINE>state = State.BODY;<NEW_LINE>return true;<NEW_LINE>case BODY:<NEW_LINE>// Set the message group<NEW_LINE>msg.setGroup(group);<NEW_LINE>// Thread safe socket doesn't support multipart messages<NEW_LINE>if (msg.hasMore()) {<NEW_LINE>errno.set(ZError.EFAULT);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Push message to dish socket<NEW_LINE>boolean <MASK><NEW_LINE>if (rc) {<NEW_LINE>state = State.GROUP;<NEW_LINE>}<NEW_LINE>return rc;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>} | rc = super.pushMsg(msg); |
121,780 | public void configure(Binder binder) {<NEW_LINE>// Instantiate eagerly so that we get everything registered and put into the Lifecycle as early as possible<NEW_LINE>// Lifecycle scope is INIT to ensure stop runs in the last phase of lifecycle stop.<NEW_LINE>try {<NEW_LINE>ClassLoader loader = Thread.currentThread().getContextClassLoader();<NEW_LINE>if (loader == null) {<NEW_LINE>loader = getClass().getClassLoader();<NEW_LINE>}<NEW_LINE>// Reflection to try and allow non Log4j2 stuff to run. This acts as a gateway to stop errors in the next few lines<NEW_LINE>// In log4j api<NEW_LINE>Class.forName("org.apache.logging.log4j.LogManager", false, loader);<NEW_LINE>// In log4j core<NEW_LINE>Class.forName("org.apache.logging.log4j.core.util.ShutdownCallbackRegistry", false, loader);<NEW_LINE>final LoggerContextFactory contextFactory = LogManager.getFactory();<NEW_LINE>if (!(contextFactory instanceof Log4jContextFactory)) {<NEW_LINE>log.warn("Expected [%s] found [%s]. Unknown class for context factory. Not logging shutdown", Log4jContextFactory.class.getName(), contextFactory.getClass().getName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ShutdownCallbackRegistry registry = ((<MASK><NEW_LINE>if (!(registry instanceof Log4jShutdown)) {<NEW_LINE>log.warn("Shutdown callback registry expected class [%s] found [%s]. Skipping shutdown registry", Log4jShutdown.class.getName(), registry.getClass().getName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>binder.bind(Log4jShutdown.class).toInstance((Log4jShutdown) registry);<NEW_LINE>binder.bind(Key.get(Log4jShutterDowner.class, Names.named("ForTheEagerness"))).to(Log4jShutterDowner.class).asEagerSingleton();<NEW_LINE>} catch (ClassNotFoundException | ClassCastException | LinkageError e) {<NEW_LINE>log.warn(e, "Not registering log4j shutdown hooks. Not using log4j?");<NEW_LINE>}<NEW_LINE>} | Log4jContextFactory) contextFactory).getShutdownCallbackRegistry(); |
1,685,427 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see com.ibm.ws.messaging.security.beans.Permission#addUsersAndGroupsToAllActions(java.util.Set, java.util.Set)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void addUsersAndGroupsToAllActions(Set<String> users, Set<String> groups) {<NEW_LINE>Set<String> tempUsers = new HashSet<String>();<NEW_LINE>Set<String> tempGroups = new HashSet<String>();<NEW_LINE>tempUsers.addAll(users);<NEW_LINE>tempGroups.addAll(groups);<NEW_LINE>addAllUsersToRole(tempUsers, MessagingSecurityConstants.OPERATION_TYPE_BROWSE);<NEW_LINE>addAllGroupsToRole(tempGroups, MessagingSecurityConstants.OPERATION_TYPE_BROWSE);<NEW_LINE>addAllUsersToRole(tempUsers, MessagingSecurityConstants.OPERATION_TYPE_SEND);<NEW_LINE>addAllGroupsToRole(tempGroups, MessagingSecurityConstants.OPERATION_TYPE_SEND);<NEW_LINE><MASK><NEW_LINE>addAllGroupsToRole(tempGroups, MessagingSecurityConstants.OPERATION_TYPE_RECEIVE);<NEW_LINE>} | addAllUsersToRole(tempUsers, MessagingSecurityConstants.OPERATION_TYPE_RECEIVE); |
718,238 | // ================================== Edit Tab Functions =======================================<NEW_LINE>// Starting up MTV, or user clicked Create New Event from edit menu<NEW_LINE>@Action<NEW_LINE>public void edit_new_event() {<NEW_LINE>if (edit_not_saved) {<NEW_LINE>Object[] options = { "Yes, Forget current edits!", "Cancel" };<NEW_LINE>int answer = JOptionPane.showOptionDialog(editPanel, "You have not saved the event to a file. Do you wish to lose the current edits you've made?", "Current Edit Not Saved", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[1]);<NEW_LINE>if (answer != JOptionPane.OK_OPTION) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>edit_table_rows.removeAllElements();<NEW_LINE>edit_condition_count = 1;<NEW_LINE>edit_action_count = 1;<NEW_LINE>edit_event_name = "put_new_event_name_here";<NEW_LINE>eventTextField.setText(edit_event_name);<NEW_LINE>Vector<Object> row;<NEW_LINE>row = new Vector<Object>(Arrays.asList("### Event Configuration"<MASK><NEW_LINE>edit_table_rows.addElement(row);<NEW_LINE>row = new Vector<Object>(Arrays.asList(edit_event_name + " = trick.new_event", "(\"", edit_event_name, "\")"));<NEW_LINE>edit_table_rows.addElement(row);<NEW_LINE>row = new Vector<Object>(Arrays.asList(edit_event_name + ".cycle = ", "", "0.5", ""));<NEW_LINE>edit_table_rows.addElement(row);<NEW_LINE>row = new Vector<Object>(Arrays.asList(edit_event_name + ".activate", "(", "", " )"));<NEW_LINE>edit_table_rows.addElement(row);<NEW_LINE>row = new Vector<Object>(Arrays.asList("trick.add_event", "(", edit_event_name, " )"));<NEW_LINE>edit_table_rows.addElement(row);<NEW_LINE>row = new Vector<Object>(Arrays.asList("### Conditions", "", "", ""));<NEW_LINE>edit_table_rows.addElement(row);<NEW_LINE>row = new Vector<Object>(Arrays.asList(edit_event_name + ".condition", "(0,\"\"\"", "False", "\"\"\")"));<NEW_LINE>edit_table_rows.addElement(row);<NEW_LINE>row = new Vector<Object>(Arrays.asList("### Actions", "", "", ""));<NEW_LINE>edit_table_rows.addElement(row);<NEW_LINE>row = new Vector<Object>(Arrays.asList(edit_event_name + ".action", "(0,\"\"\"", "print \"ACTION0\"", "\"\"\")"));<NEW_LINE>edit_table_rows.addElement(row);<NEW_LINE>// disable table and edit menu until user sets event name<NEW_LINE>edit_table.setEnabled(false);<NEW_LINE>editMenu.setEnabled(false);<NEW_LINE>// redraw table so rows are shown grayed out<NEW_LINE>TableModelEvent tme = new TableModelEvent(edit_table.getModel());<NEW_LINE>edit_table.tableChanged(tme);<NEW_LINE>} | , "", "", "")); |
908,421 | private void initEnterpriseApplications() {<NEW_LINE>// TODO: AB: add to bundle<NEW_LINE>jComboBoxEnterprise.addItem(NbBundle.getMessage(ProjectServerPanel.class, "LBL_NWP1_AddToEnterprise_None"));<NEW_LINE>jComboBoxEnterprise.setSelectedIndex(0);<NEW_LINE>Project[] allProjects = OpenProjects.getDefault().getOpenProjects();<NEW_LINE>earProjects = new ArrayList<Project>();<NEW_LINE>for (int i = 0; i < allProjects.length; i++) {<NEW_LINE>J2eeApplicationProvider j2eeAppProvider = allProjects[i].getLookup().lookup(J2eeApplicationProvider.class);<NEW_LINE>if (j2eeAppProvider == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (AntArtifactQuery.findArtifactsByType(allProjects[i], "ear").length == 0) {<NEW_LINE>// NOI18N<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>J2eeApplication j2eeApplication = (J2eeApplication) j2eeAppProvider.getJ2eeModule();<NEW_LINE>ProjectInformation projectInfo = ProjectUtils<MASK><NEW_LINE>if (j2eeApplication != null) {<NEW_LINE>earProjects.add(projectInfo.getProject());<NEW_LINE>jComboBoxEnterprise.addItem(projectInfo.getDisplayName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (earProjects.size() <= 0) {<NEW_LINE>jComboBoxEnterprise.setEnabled(false);<NEW_LINE>}<NEW_LINE>} | .getInformation(allProjects[i]); |
726,639 | public Future<Integer> show(@NullAllowed PhpModule phpModule, String name, final OutputProcessor<String> outputProcessor) {<NEW_LINE>PhpExecutable composer = getComposerExecutable(phpModule, false);<NEW_LINE>if (composer == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// params<NEW_LINE>List<String> defaultParams = new ArrayList<>(DEFAULT_PARAMS);<NEW_LINE>defaultParams.remove(ANSI_PARAM);<NEW_LINE>defaultParams.add(NO_ANSI_PARAM);<NEW_LINE>composer = // avoid parser confusion<NEW_LINE>composer.additionalParameters(mergeParameters(SHOW_COMMAND, defaultParams, Arrays.asList(ALL_PARAM, name))).redirectErrorStream(false);<NEW_LINE>// descriptor<NEW_LINE>ExecutionDescriptor descriptor = getDescriptor(phpModule).frontWindow(false);<NEW_LINE>// run<NEW_LINE>return composer.run(descriptor, new ExecutionDescriptor.InputProcessorFactory2() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public InputProcessor newInputProcessor(InputProcessor defaultProcessor) {<NEW_LINE>return new OutputProcessorImpl(new OutputParser() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void parse(char[] chars) {<NEW_LINE><MASK><NEW_LINE>if (!isValidOutput(chunk)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>outputProcessor.process(chunk);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | String chunk = new String(chars); |
1,379,396 | public String treeString() {<NEW_LINE>Function<Object, String> toString = obj -> {<NEW_LINE>if (obj instanceof Group) {<NEW_LINE>return obj.toString();<NEW_LINE>} else if (obj instanceof GroupExpression) {<NEW_LINE>return ((GroupExpression) obj).getPlan().toString();<NEW_LINE>} else if (obj instanceof Pair) {<NEW_LINE>// print logicalExpressions or physicalExpressions<NEW_LINE>// first is name, second is group expressions<NEW_LINE>return ((Pair<?, ?>) <MASK><NEW_LINE>} else {<NEW_LINE>return obj.toString();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Function<Object, List<Object>> getChildren = obj -> {<NEW_LINE>if (obj instanceof Group) {<NEW_LINE>Group group = (Group) obj;<NEW_LINE>List children = new ArrayList<>();<NEW_LINE>// to <name, children> pair<NEW_LINE>if (!group.getLogicalExpressions().isEmpty()) {<NEW_LINE>children.add(Pair.of("logicalExpressions", group.getLogicalExpressions()));<NEW_LINE>}<NEW_LINE>if (!group.getPhysicalExpressions().isEmpty()) {<NEW_LINE>children.add(Pair.of("physicalExpressions", group.getLogicalExpressions()));<NEW_LINE>}<NEW_LINE>return children;<NEW_LINE>} else if (obj instanceof GroupExpression) {<NEW_LINE>return (List) ((GroupExpression) obj).children();<NEW_LINE>} else if (obj instanceof Pair) {<NEW_LINE>return (List) ((Pair<String, List<GroupExpression>>) obj).second;<NEW_LINE>} else {<NEW_LINE>return ImmutableList.of();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return TreeStringUtils.treeString(this, toString, getChildren);<NEW_LINE>} | obj).first.toString(); |
981,864 | public static Socket createSocket(String host, int port) throws HostUnreachableException {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>Socket sock = new Socket();<NEW_LINE>sock.setSoTimeout(Config.getInstance().getNetworkTimeout() * 1000);<NEW_LINE>sock.setTcpNoDelay(true);<NEW_LINE>if (config.getTcpWindowSize() > 0) {<NEW_LINE>try {<NEW_LINE>sock.setReceiveBufferSize(config.getTcpWindowSize() * 1024);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.log(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Logger.log("Tcp RWin: " + sock.getReceiveBufferSize());<NEW_LINE>// sock.setReceiveBufferSize(tcpBufSize);<NEW_LINE>sock.setSoLinger(false, 0);<NEW_LINE>sock.connect(new InetSocketAddress(host, port));<NEW_LINE>return sock;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new HostUnreachableException("Unable to connect to: " + host + ":" + port);<NEW_LINE>}<NEW_LINE>} | Config config = Config.getInstance(); |
1,646,651 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String applicationFlag) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>File file = emc.flag(flag, File.class);<NEW_LINE>if (null == file) {<NEW_LINE>throw new ExceptionEntityNotExist(flag, File.class);<NEW_LINE>}<NEW_LINE>Application application = emc.find(file.getApplication(), Application.class);<NEW_LINE>if (null == application) {<NEW_LINE>throw new ExceptionEntityNotExist(file.getApplication(), Application.class);<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, application)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson.getDistinguishedName());<NEW_LINE>}<NEW_LINE>Application toApplication = emc.flag(applicationFlag, Application.class);<NEW_LINE>if (null == toApplication) {<NEW_LINE>throw new ExceptionEntityNotExist(applicationFlag, Application.class);<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, toApplication)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson.getDistinguishedName());<NEW_LINE>}<NEW_LINE>File toFile = new File();<NEW_LINE>toFile.setName(this.getName(business, file.getName(), toFile.getId(), toApplication.getId()));<NEW_LINE>toFile.setApplication(toApplication.getId());<NEW_LINE>toFile.setDescription(file.getDescription());<NEW_LINE>toFile.setData(file.getData());<NEW_LINE>toFile.<MASK><NEW_LINE>toFile.setLastUpdatePerson(file.getLastUpdatePerson());<NEW_LINE>toFile.setLastUpdateTime(new Date());<NEW_LINE>toFile.setLength(file.getLength());<NEW_LINE>emc.beginTransaction(File.class);<NEW_LINE>emc.persist(toFile, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(File.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(toFile.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | setFileName(file.getFileName()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.