idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
962,223 | public void baseline(Blackhole blackHole) {<NEW_LINE>blackHole.consume(baselineInstance.method(booleanValue));<NEW_LINE>blackHole.consume(baselineInstance.method(byteValue));<NEW_LINE>blackHole.consume(baselineInstance.method(shortValue));<NEW_LINE>blackHole.consume(baselineInstance.method(intValue));<NEW_LINE>blackHole.consume(baselineInstance.method(charValue));<NEW_LINE>blackHole.consume(baselineInstance.method(intValue));<NEW_LINE>blackHole.consume(baselineInstance.method(longValue));<NEW_LINE>blackHole.consume(baselineInstance.method(floatValue));<NEW_LINE>blackHole.consume(baselineInstance.method(doubleValue));<NEW_LINE>blackHole.consume(baselineInstance.method(stringValue));<NEW_LINE>blackHole.consume(baselineInstance.method(booleanValue, booleanValue, booleanValue));<NEW_LINE>blackHole.consume(baselineInstance.method(byteValue, byteValue, byteValue));<NEW_LINE>blackHole.consume(baselineInstance.method(shortValue, shortValue, shortValue));<NEW_LINE>blackHole.consume(baselineInstance.method(intValue, intValue, intValue));<NEW_LINE>blackHole.consume(baselineInstance.method(charValue, charValue, charValue));<NEW_LINE>blackHole.consume(baselineInstance.method<MASK><NEW_LINE>blackHole.consume(baselineInstance.method(longValue, longValue, longValue));<NEW_LINE>blackHole.consume(baselineInstance.method(floatValue, floatValue, floatValue));<NEW_LINE>blackHole.consume(baselineInstance.method(doubleValue, doubleValue, doubleValue));<NEW_LINE>blackHole.consume(baselineInstance.method(stringValue, stringValue, stringValue));<NEW_LINE>} | (intValue, intValue, intValue)); |
499,678 | public void run(RegressionEnvironment env) {<NEW_LINE>String stmtText = "@name('s0') select count(*) as cnt from SupportBean#time(10 seconds) output every 10 seconds";<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>sendTimer(env, 0);<NEW_LINE>sendTimer(env, 10000);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendTimer(env, 20000);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendEvent(env, "e1");<NEW_LINE>sendTimer(env, 30000);<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>EventBean[<MASK><NEW_LINE>assertEquals(2, newEvents.length);<NEW_LINE>assertEquals(1L, newEvents[0].get("cnt"));<NEW_LINE>assertEquals(0L, newEvents[1].get("cnt"));<NEW_LINE>});<NEW_LINE>sendTimer(env, 31000);<NEW_LINE>sendEvent(env, "e2");<NEW_LINE>sendEvent(env, "e3");<NEW_LINE>sendTimer(env, 40000);<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>EventBean[] newEvents = listener.getAndResetLastNewData();<NEW_LINE>assertEquals(2, newEvents.length);<NEW_LINE>assertEquals(1L, newEvents[0].get("cnt"));<NEW_LINE>assertEquals(2L, newEvents[1].get("cnt"));<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>} | ] newEvents = listener.getAndResetLastNewData(); |
882,860 | public DescribeDefaultParametersResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeDefaultParametersResult describeDefaultParametersResult = new DescribeDefaultParametersResult();<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 describeDefaultParametersResult;<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("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeDefaultParametersResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Parameters", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeDefaultParametersResult.setParameters(new ListUnmarshaller<Parameter>(ParameterJsonUnmarshaller.getInstance(<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 describeDefaultParametersResult;<NEW_LINE>} | )).unmarshall(context)); |
1,709,721 | private void replaceExpressionsWithConstant() throws JavaModelException {<NEW_LINE>ASTRewrite astRewrite = fCuRewrite.getASTRewrite();<NEW_LINE>AST ast = astRewrite.getAST();<NEW_LINE>IASTFragment[] fragmentsToReplace = getFragmentsToReplace();<NEW_LINE>for (int i = 0; i < fragmentsToReplace.length; i++) {<NEW_LINE>IASTFragment fragment = fragmentsToReplace[i];<NEW_LINE>ASTNode node = fragment.getAssociatedNode();<NEW_LINE>boolean inTypeDeclarationAnnotation = isInTypeDeclarationAnnotation(node);<NEW_LINE>if (inTypeDeclarationAnnotation && JdtFlags.VISIBILITY_STRING_PRIVATE == getVisibility()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>SimpleName ref = ast.newSimpleName(fConstantName);<NEW_LINE>Name replacement = ref;<NEW_LINE>boolean qualifyReference = qualifyReferencesWithDeclaringClassName();<NEW_LINE>if (!qualifyReference) {<NEW_LINE>qualifyReference = inTypeDeclarationAnnotation;<NEW_LINE>}<NEW_LINE>if (qualifyReference) {<NEW_LINE>replacement = ast.newQualifiedName(ast.newSimpleName(getContainingTypeBinding()<MASK><NEW_LINE>}<NEW_LINE>TextEditGroup description = fCuRewrite.createGroupDescription(RefactoringCoreMessages.ExtractConstantRefactoring_replace);<NEW_LINE>fragment.replace(astRewrite, replacement, description);<NEW_LINE>if (fLinkedProposalModel != null) {<NEW_LINE>fLinkedProposalModel.getPositionGroup(KEY_NAME, true).addPosition(astRewrite.track(ref), false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getName()), ref); |
413,136 | public int doMain(String[] args) throws InvocationTargetException, InterruptedException {<NEW_LINE>GCViewerArgsParser argsParser = gcViewerArgsParser;<NEW_LINE>try {<NEW_LINE>argsParser.parseArguments(args);<NEW_LINE>} catch (GCViewerArgsParserException e) {<NEW_LINE>usage();<NEW_LINE>LOGGER.log(Level.SEVERE, e.getMessage(), e);<NEW_LINE>return EXIT_ARGS_PARSE_FAILED;<NEW_LINE>}<NEW_LINE>if (argsParser.getArgumentCount() > 3) {<NEW_LINE>usage();<NEW_LINE>return EXIT_TOO_MANY_ARGS;<NEW_LINE>} else if (argsParser.getArgumentCount() >= 2) {<NEW_LINE>LOGGER.info("GCViewer command line mode");<NEW_LINE>GCResource gcResource = argsParser.getGcResource();<NEW_LINE>String summaryFilePath = argsParser.getSummaryFilePath();<NEW_LINE>String chartFilePath = argsParser.getChartFilePath();<NEW_LINE>DataWriterType type = argsParser.getType();<NEW_LINE>// export summary:<NEW_LINE>try {<NEW_LINE>export(gcResource, summaryFilePath, chartFilePath, type);<NEW_LINE>LOGGER.info("export completed successfully");<NEW_LINE>return EXIT_OK;<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.log(<MASK><NEW_LINE>return EXIT_EXPORT_FAILED;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>gcViewerGuiController.startGui(argsParser.getArgumentCount() == 1 ? argsParser.getGcResource() : null);<NEW_LINE>return EXIT_OK;<NEW_LINE>}<NEW_LINE>} | Level.SEVERE, "Error during report generation", e); |
103,748 | private String findParts(String input) {<NEW_LINE>ArrayList<String> lastParts = new ArrayList<>();<NEW_LINE>int <MASK><NEW_LINE>if (afterAuthorsIndex == -1) {<NEW_LINE>return input;<NEW_LINE>} else {<NEW_LINE>afterAuthorsIndex += AUTHOR_TAG.length();<NEW_LINE>}<NEW_LINE>int delimiterIndex = input.lastIndexOf("//");<NEW_LINE>if (delimiterIndex != -1) {<NEW_LINE>lastParts.add(input.substring(afterAuthorsIndex, delimiterIndex).replace(YEAR_TAG, "").replace(PAGES_TAG, ""));<NEW_LINE>lastParts.addAll(Arrays.asList(input.substring(delimiterIndex + 2).split(",|\\.")));<NEW_LINE>} else {<NEW_LINE>lastParts.addAll(Arrays.asList(input.substring(afterAuthorsIndex).split(",|\\.")));<NEW_LINE>}<NEW_LINE>int nonDigitParts = 0;<NEW_LINE>for (String part : lastParts) {<NEW_LINE>if (part.matches(".*\\d.*")) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>nonDigitParts++;<NEW_LINE>}<NEW_LINE>if (nonDigitParts > 0) {<NEW_LINE>title = lastParts.get(0);<NEW_LINE>}<NEW_LINE>if (nonDigitParts > 1) {<NEW_LINE>journalOrPublisher = lastParts.get(1);<NEW_LINE>}<NEW_LINE>if (nonDigitParts > 2) {<NEW_LINE>isArticle = false;<NEW_LINE>}<NEW_LINE>return fixSpaces(input);<NEW_LINE>} | afterAuthorsIndex = input.lastIndexOf(AUTHOR_TAG); |
1,538,996 | public static void forwardBackWardDemo() {<NEW_LINE>System.out.println("DEMO: Forward-BackWard");<NEW_LINE>System.out.println("======================");<NEW_LINE>System.out.println("Umbrella World");<NEW_LINE>System.out.println("--------------");<NEW_LINE>ForwardBackward uw = new ForwardBackward(GenericTemporalModelFactory.getUmbrellaWorldTransitionModel(), GenericTemporalModelFactory.getUmbrellaWorld_Xt_to_Xtm1_Map(), GenericTemporalModelFactory.getUmbrellaWorldSensorModel());<NEW_LINE>CategoricalDistribution prior = new ProbabilityTable(new double[] { 0.5, 0.5 }, ExampleRV.RAIN_t_RV);<NEW_LINE>// Day 1<NEW_LINE>List<List<AssignmentProposition>> evidence = new ArrayList<List<AssignmentProposition>>();<NEW_LINE>List<AssignmentProposition> e1 = new ArrayList<AssignmentProposition>();<NEW_LINE>e1.add(new AssignmentProposition(ExampleRV.UMBREALLA_t_RV, Boolean.TRUE));<NEW_LINE>evidence.add(e1);<NEW_LINE>List<CategoricalDistribution> smoothed = uw.forwardBackward(evidence, prior);<NEW_LINE>System.out.println("Day 1 (Umbrealla_t=true) smoothed:\nday 1 = " + smoothed.get(0));<NEW_LINE>// Day 2<NEW_LINE>List<AssignmentProposition> e2 = new ArrayList<AssignmentProposition>();<NEW_LINE>e2.add(new AssignmentProposition(ExampleRV.UMBREALLA_t_RV, Boolean.TRUE));<NEW_LINE>evidence.add(e2);<NEW_LINE>smoothed = uw.forwardBackward(evidence, prior);<NEW_LINE>System.out.println("Day 2 (Umbrealla_t=true) smoothed:\nday 1 = " + smoothed.get(0) + "\nday 2 = " + smoothed.get(1));<NEW_LINE>// Day 3<NEW_LINE>List<AssignmentProposition> e3 <MASK><NEW_LINE>e3.add(new AssignmentProposition(ExampleRV.UMBREALLA_t_RV, Boolean.FALSE));<NEW_LINE>evidence.add(e3);<NEW_LINE>smoothed = uw.forwardBackward(evidence, prior);<NEW_LINE>System.out.println("Day 3 (Umbrealla_t=false) smoothed:\nday 1 = " + smoothed.get(0) + "\nday 2 = " + smoothed.get(1) + "\nday 3 = " + smoothed.get(2));<NEW_LINE>System.out.println("======================");<NEW_LINE>} | = new ArrayList<AssignmentProposition>(); |
1,055,433 | private void storeResult(JavaCompileSpec spec, WorkResult result) {<NEW_LINE>ClassSetAnalysisData outputSnapshot = classpathSnapshotter.analyzeOutputFolder(spec.getDestinationDir());<NEW_LINE>ClassSetAnalysisData classpathSnapshot = classpathSnapshotter.getClasspathSnapshot(Iterables.concat(spec.getCompileClasspath(), spec.getModulePath()));<NEW_LINE>AnnotationProcessingData annotationProcessingData = getAnnotationProcessingData(spec, result);<NEW_LINE>CompilerApiData compilerApiData = getCompilerApiData(spec, result);<NEW_LINE>ClassSetAnalysisData minimizedClasspathSnapshot = classpathSnapshot.reduceToTypesAffecting(outputSnapshot, compilerApiData);<NEW_LINE>PreviousCompilationData data = new PreviousCompilationData(outputSnapshot, annotationProcessingData, minimizedClasspathSnapshot, compilerApiData);<NEW_LINE>File previousCompilationDataFile = Objects.requireNonNull(spec.<MASK><NEW_LINE>previousCompilationAccess.writePreviousCompilationData(data, previousCompilationDataFile);<NEW_LINE>} | getCompileOptions().getPreviousCompilationDataFile()); |
439,770 | public void kmeans(int numClusters) {<NEW_LINE>init(numClusters);<NEW_LINE>int loop = 0;<NEW_LINE>do {<NEW_LINE>membershipChanges.reset();<NEW_LINE>mapToNearestCluster(data, numPoints, numFeatures, clusters, numClusters, membership, membershipChanges);<NEW_LINE>// graph.schedule().waitOn();<NEW_LINE>updateClusters(data, numPoints, numFeatures, membership, newClusters, newClusterSizes);<NEW_LINE>calculateClusters(numFeatures, numClusters, clusters, clusterSizes, newClusters, newClusterSizes);<NEW_LINE>// assume delta should be percentage of points<NEW_LINE>// changing membership this iteration...?<NEW_LINE>delta = ((float) membershipChanges.value) / numPoints;<NEW_LINE>System.out.<MASK><NEW_LINE>loop++;<NEW_LINE>} while ((delta > threshold) && (loop < 500));<NEW_LINE>System.out.printf("Iterated %d times\n", loop);<NEW_LINE>} | printf("loop: id=%d, delta=%f\n", loop, delta); |
1,109,974 | private void populateArgs(JSONObject headers) throws JSONException, UnsupportedEncodingException {<NEW_LINE>if (headers != null) {<NEW_LINE>// add headers. Handles headers with multiple values.<NEW_LINE>Iterator<String> headerKeys = headers.keys();<NEW_LINE>while (headerKeys.hasNext()) {<NEW_LINE>String headerKey = headerKeys.next();<NEW_LINE>Object headerValue = JSONObject.NULL.equals(headers.get(headerKey)) ? null : headers.get(headerKey);<NEW_LINE>addOrUpdateArg(headerKey, headerValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// decode parameters in the URI. Handles parameters without values and multiple values for the same parameter.<NEW_LINE>if (uri != null && uri.getQuery() != null) {<NEW_LINE>for (String parameterValue : uri.getQuery().split("&")) {<NEW_LINE>int idx = parameterValue.indexOf("=");<NEW_LINE>String key = idx > 0 ? parameterValue.substring(0, idx) : parameterValue;<NEW_LINE>String value = idx > 0 ? parameterValue.substring(idx + 1) : null;<NEW_LINE>addOrUpdateArg(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// convert all StringBuilders to String<NEW_LINE>for (Map.Entry<String, Object> e : args.entrySet()) {<NEW_LINE><MASK><NEW_LINE>if (value != null && value instanceof StringBuilder) {<NEW_LINE>args.put(e.getKey(), (e.getValue()).toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Object value = e.getValue(); |
1,707,230 | public static void main(String[] args) {<NEW_LINE>var surfFast = new ConfigDenseSurfFast(new DenseSampling(8, 8));<NEW_LINE>// ConfigDenseSurfStable surfStable = new ConfigDenseSurfStable(new DenseSampling(8,8));<NEW_LINE>// ConfigDenseSift sift = new ConfigDenseSift(new DenseSampling(6,6));<NEW_LINE>// ConfigDenseHoG hog = new ConfigDenseHoG();<NEW_LINE>DescribeImageDense<GrayU8, TupleDesc_F64> desc = FactoryDescribeImageDense.surfFast(surfFast, GrayU8.class);<NEW_LINE>// FactoryDescribeImageDense.surfStable(surfStable, GrayU8.class);<NEW_LINE>// FactoryDescribeImageDense.sift(sift, GrayU8.class);<NEW_LINE>// FactoryDescribeImageDense.hog(hog, ImageType.single(GrayU8.class));<NEW_LINE>var configKMeans = new ConfigKMeans();<NEW_LINE>configKMeans.maxIterations = MAX_KNN_ITERATIONS;<NEW_LINE>configKMeans.reseedAfterIterations = 20;<NEW_LINE>ComputeClusters<double[]> clusterer = FactoryClustering.kMeans_MT(configKMeans, desc.createDescription().size(), 200, double[].class);<NEW_LINE>clusterer.setVerbose(true);<NEW_LINE>// The _MT tells it to use the threaded version. This can run MUCH faster.<NEW_LINE>int pointDof = desc<MASK><NEW_LINE>NearestNeighbor<HistogramScene> nn = FactoryNearestNeighbor.exhaustive(new KdTreeHistogramScene_F64(pointDof));<NEW_LINE>ExampleClassifySceneKnn example = new ExampleClassifySceneKnn(desc, clusterer, nn);<NEW_LINE>var trainingDir = new File(UtilIO.pathExample("learning/scene/train"));<NEW_LINE>var testingDir = new File(UtilIO.pathExample("learning/scene/test"));<NEW_LINE>if (!trainingDir.exists() || !testingDir.exists()) {<NEW_LINE>String addressSrc = "http://boofcv.org/notwiki/largefiles/bow_data_v001.zip";<NEW_LINE>File dst = new File(trainingDir.getParentFile(), "bow_data_v001.zip");<NEW_LINE>try {<NEW_LINE>DeepBoofDataBaseOps.download(addressSrc, dst);<NEW_LINE>DeepBoofDataBaseOps.decompressZip(dst, dst.getParentFile(), true);<NEW_LINE>System.out.println("Download complete!");<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.out.println("Delete and download again if there are file not found errors");<NEW_LINE>System.out.println(" " + trainingDir);<NEW_LINE>System.out.println(" " + testingDir);<NEW_LINE>}<NEW_LINE>example.loadSets(trainingDir, null, testingDir);<NEW_LINE>// train the classifier<NEW_LINE>example.learnAndSave();<NEW_LINE>// now load it for evaluation purposes from the files<NEW_LINE>example.loadAndCreateClassifier();<NEW_LINE>// test the classifier on the test set<NEW_LINE>Confusion confusion = example.evaluateTest();<NEW_LINE>confusion.getMatrix().print();<NEW_LINE>System.out.println("Accuracy = " + confusion.computeAccuracy());<NEW_LINE>// Show confusion matrix<NEW_LINE>// Not the best coloration scheme... perfect = red diagonal and blue elsewhere.<NEW_LINE>ShowImages.showWindow(new ConfusionMatrixPanel(confusion.getMatrix(), example.getScenes(), 400, true), "Confusion Matrix", true);<NEW_LINE>// For SIFT descriptor the accuracy is 54.0%<NEW_LINE>// For "fast" SURF descriptor the accuracy is 52.2%<NEW_LINE>// For "stable" SURF descriptor the accuracy is 49.4%<NEW_LINE>// For HOG 53.3%<NEW_LINE>// SURF results are interesting. "Stable" is significantly better than "fast"!<NEW_LINE>// One explanation is that the descriptor for "fast" samples a smaller region than "stable", by a<NEW_LINE>// couple of pixels at scale of 1. Thus there is less overlap between the features.<NEW_LINE>// Reducing the size of "stable" to 0.95 does slightly improve performance to 50.5%, can't scale it down<NEW_LINE>// much more without performance going down<NEW_LINE>} | .createDescription().size(); |
574,935 | private static void fetchLatestInfo() throws IOException {<NEW_LINE>URL updateURL = new URL(API);<NEW_LINE>String content = IOUtils.toString(updateURL.openStream(), StandardCharsets.UTF_8);<NEW_LINE>JsonObject updateJson = Json.parse(content).asObject();<NEW_LINE>// compare versions<NEW_LINE>latestVersion = updateJson.getString("tag_name", "2.0.0");<NEW_LINE>latestPatchnotes = updateJson.getString("body", "#Error\nCould not fetch update notes.");<NEW_LINE>if (isOutdated()) {<NEW_LINE>Log.info(LangUtil.translate("update.outdated"));<NEW_LINE>JsonArray assets = updateJson.get("assets").asArray();<NEW_LINE>for (JsonValue assetValue : assets.values()) {<NEW_LINE>JsonObject assetObj = assetValue.asObject();<NEW_LINE>String file = <MASK><NEW_LINE>// Skip non-jars<NEW_LINE>if (!file.endsWith(".jar")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Find the largest jar<NEW_LINE>int size = assetObj.getInt("size", 0);<NEW_LINE>if (size > latestArtifactSize) {<NEW_LINE>latestArtifactSize = size;<NEW_LINE>String fileURL = assetObj.getString("browser_download_url", null);<NEW_LINE>if (fileURL != null)<NEW_LINE>latestArtifact = fileURL;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String date = updateJson.getString("published_at", null);<NEW_LINE>if (date != null)<NEW_LINE>latestVersionDate = Instant.parse(date);<NEW_LINE>} catch (DateTimeParseException ex) {<NEW_LINE>Log.warn("Failed to parse timestamp for latest release");<NEW_LINE>}<NEW_LINE>if (latestArtifact == null)<NEW_LINE>Log.warn(LangUtil.translate("update.fail.nodownload"));<NEW_LINE>}<NEW_LINE>} | assetObj.getString("name", "invalid"); |
708,236 | public void visitCode() {<NEW_LINE>mv.<MASK><NEW_LINE>mv.visitMethodInsn(Opcodes.INVOKESTATIC, CONNECT_CLASS, "getString", "(Ljava/net/SocketAddress;)Ljava/lang/String;", false);<NEW_LINE>mv.visitVarInsn(Opcodes.ASTORE, 2);<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, 0);<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, 1);<NEW_LINE>mv.visitMethodInsn(Opcodes.INVOKESTATIC, CONNECT_CLASS, "getAddress", "(Ljava/lang/Object;Ljava/net/SocketAddress;)Ljava/net/SocketAddress;", false);<NEW_LINE>mv.visitVarInsn(Opcodes.ASTORE, 1);<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, 2);<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, 1);<NEW_LINE>mv.visitMethodInsn(Opcodes.INVOKESTATIC, CONNECT_CLASS, "getString", "(Ljava/net/SocketAddress;)Ljava/lang/String;", false);<NEW_LINE>mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z", false);<NEW_LINE>Label label = new Label();<NEW_LINE>mv.visitJumpInsn(Opcodes.IFNE, label);<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, 0);<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, 1);<NEW_LINE>mv.visitMethodInsn(Opcodes.INVOKESTATIC, CONNECT_CLASS, "connectToProxy", "(Ljava/nio/channels/SocketChannel;Ljava/net/SocketAddress;)Z", false);<NEW_LINE>mv.visitInsn(Opcodes.IRETURN);<NEW_LINE>mv.visitLabel(label);<NEW_LINE>} | visitVarInsn(Opcodes.ALOAD, 1); |
853,854 | Set<SinkRecordField> missingFields(Collection<SinkRecordField> fields, Set<String> dbColumnNames) {<NEW_LINE>final Set<SinkRecordField> missingFields = new HashSet<>();<NEW_LINE>for (SinkRecordField field : fields) {<NEW_LINE>if (!dbColumnNames.contains(field.name())) {<NEW_LINE><MASK><NEW_LINE>missingFields.add(field);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (missingFields.isEmpty()) {<NEW_LINE>return missingFields;<NEW_LINE>}<NEW_LINE>// check if the missing fields can be located by ignoring case<NEW_LINE>Set<String> columnNamesLowerCase = new HashSet<>();<NEW_LINE>for (String columnName : dbColumnNames) {<NEW_LINE>columnNamesLowerCase.add(columnName.toLowerCase());<NEW_LINE>}<NEW_LINE>if (columnNamesLowerCase.size() != dbColumnNames.size()) {<NEW_LINE>log.warn("Table has column names that differ only by case. Original columns={}", dbColumnNames);<NEW_LINE>}<NEW_LINE>final Set<SinkRecordField> missingFieldsIgnoreCase = new HashSet<>();<NEW_LINE>for (SinkRecordField missing : missingFields) {<NEW_LINE>if (!columnNamesLowerCase.contains(missing.name().toLowerCase())) {<NEW_LINE>missingFieldsIgnoreCase.add(missing);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (missingFieldsIgnoreCase.size() > 0) {<NEW_LINE>log.info("Unable to find fields {} among column names {}", missingFieldsIgnoreCase, dbColumnNames);<NEW_LINE>}<NEW_LINE>return missingFieldsIgnoreCase;<NEW_LINE>} | log.debug("Found missing field: {}", field); |
713,657 | public Expression expression(TableSchema<?> tableSchema, String indexName) {<NEW_LINE>String partitionKey = tableSchema.tableMetadata().indexPartitionKey(indexName);<NEW_LINE>AttributeValue partitionValue = key.partitionKeyValue();<NEW_LINE>if (partitionValue == null || partitionValue.equals(nullAttributeValue())) {<NEW_LINE>throw new IllegalArgumentException("Partition key must be a valid scalar value to execute a query " + "against. The provided partition key was set to null.");<NEW_LINE>}<NEW_LINE>Optional<AttributeValue<MASK><NEW_LINE>if (sortKeyValue.isPresent()) {<NEW_LINE>Optional<String> sortKey = tableSchema.tableMetadata().indexSortKey(indexName);<NEW_LINE>if (!sortKey.isPresent()) {<NEW_LINE>throw new IllegalArgumentException("A sort key was supplied as part of a query conditional " + "against an index that does not support a sort key. Index: " + indexName);<NEW_LINE>}<NEW_LINE>return partitionAndSortExpression(partitionKey, sortKey.get(), partitionValue, sortKeyValue.get());<NEW_LINE>} else {<NEW_LINE>return partitionOnlyExpression(partitionKey, partitionValue);<NEW_LINE>}<NEW_LINE>} | > sortKeyValue = key.sortKeyValue(); |
1,705,111 | public void handleCommit(ApplyCommitRequest applyCommit) {<NEW_LINE>if (applyCommit.getTerm() != getCurrentTerm()) {<NEW_LINE>logger.debug("handleCommit: ignored commit request due to term mismatch " + "(expected: [term {} version {}], actual: [term {} version {}])", getLastAcceptedTerm(), getLastAcceptedVersion(), applyCommit.getTerm(), applyCommit.getVersion());<NEW_LINE>throw new CoordinationStateRejectedException("incoming term " + applyCommit.getTerm(<MASK><NEW_LINE>}<NEW_LINE>if (applyCommit.getTerm() != getLastAcceptedTerm()) {<NEW_LINE>logger.debug("handleCommit: ignored commit request due to term mismatch " + "(expected: [term {} version {}], actual: [term {} version {}])", getLastAcceptedTerm(), getLastAcceptedVersion(), applyCommit.getTerm(), applyCommit.getVersion());<NEW_LINE>throw new CoordinationStateRejectedException("incoming term " + applyCommit.getTerm() + " does not match last accepted term " + getLastAcceptedTerm());<NEW_LINE>}<NEW_LINE>if (applyCommit.getVersion() != getLastAcceptedVersion()) {<NEW_LINE>logger.debug("handleCommit: ignored commit request due to version mismatch (term {}, expected: [{}], actual: [{}])", getLastAcceptedTerm(), getLastAcceptedVersion(), applyCommit.getVersion());<NEW_LINE>throw new CoordinationStateRejectedException("incoming version " + applyCommit.getVersion() + " does not match current version " + getLastAcceptedVersion());<NEW_LINE>}<NEW_LINE>logger.trace("handleCommit: applying commit request for term [{}] and version [{}]", applyCommit.getTerm(), applyCommit.getVersion());<NEW_LINE>persistedState.markLastAcceptedStateAsCommitted();<NEW_LINE>assert getLastCommittedConfiguration().equals(getLastAcceptedConfiguration());<NEW_LINE>} | ) + " does not match current term " + getCurrentTerm()); |
1,319,202 | protected void handleIterator(String[] args) {<NEW_LINE>Iterator it = null;<NEW_LINE>String iteratorStr = args[0];<NEW_LINE>if (iteratorStr.startsWith("s.")) {<NEW_LINE>it = getSet().iterator();<NEW_LINE>} else if (iteratorStr.startsWith("m.")) {<NEW_LINE>it = getMap().keySet().iterator();<NEW_LINE>} else if (iteratorStr.startsWith("mm.")) {<NEW_LINE>it = getMultiMap().keySet().iterator();<NEW_LINE>} else if (iteratorStr.startsWith("q.")) {<NEW_LINE>it <MASK><NEW_LINE>} else if (iteratorStr.startsWith("l.")) {<NEW_LINE>it = getList().iterator();<NEW_LINE>}<NEW_LINE>if (it != null) {<NEW_LINE>boolean remove = false;<NEW_LINE>if (args.length > 1) {<NEW_LINE>String removeStr = args[1];<NEW_LINE>remove = removeStr.equals("remove");<NEW_LINE>}<NEW_LINE>int count = 1;<NEW_LINE>while (it.hasNext()) {<NEW_LINE>print(count++ + " " + it.next());<NEW_LINE>if (remove) {<NEW_LINE>it.remove();<NEW_LINE>print(" removed");<NEW_LINE>}<NEW_LINE>println("");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = getQueue().iterator(); |
377,889 | public static ListInboundOrderSKUTagsResponse unmarshall(ListInboundOrderSKUTagsResponse listInboundOrderSKUTagsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listInboundOrderSKUTagsResponse.setRequestId(_ctx.stringValue("ListInboundOrderSKUTagsResponse.RequestId"));<NEW_LINE>listInboundOrderSKUTagsResponse.setPageSize(_ctx.integerValue("ListInboundOrderSKUTagsResponse.PageSize"));<NEW_LINE>listInboundOrderSKUTagsResponse.setTotalCount(_ctx.integerValue("ListInboundOrderSKUTagsResponse.TotalCount"));<NEW_LINE>listInboundOrderSKUTagsResponse.setPageNumber(_ctx.integerValue("ListInboundOrderSKUTagsResponse.PageNumber"));<NEW_LINE>listInboundOrderSKUTagsResponse.setSuccess(_ctx.booleanValue("ListInboundOrderSKUTagsResponse.Success"));<NEW_LINE>List<InboundOrderSkuTagBiz> skuTags <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListInboundOrderSKUTagsResponse.SkuTags.Length"); i++) {<NEW_LINE>InboundOrderSkuTagBiz inboundOrderSkuTagBiz = new InboundOrderSkuTagBiz();<NEW_LINE>inboundOrderSkuTagBiz.setBarcode(_ctx.stringValue("ListInboundOrderSKUTagsResponse.SkuTags[" + i + "].Barcode"));<NEW_LINE>inboundOrderSkuTagBiz.setCaseId(_ctx.stringValue("ListInboundOrderSKUTagsResponse.SkuTags[" + i + "].CaseId"));<NEW_LINE>inboundOrderSkuTagBiz.setTagValue(_ctx.stringValue("ListInboundOrderSKUTagsResponse.SkuTags[" + i + "].TagValue"));<NEW_LINE>inboundOrderSkuTagBiz.setCaseCode(_ctx.stringValue("ListInboundOrderSKUTagsResponse.SkuTags[" + i + "].CaseCode"));<NEW_LINE>inboundOrderSkuTagBiz.setSKUId(_ctx.stringValue("ListInboundOrderSKUTagsResponse.SkuTags[" + i + "].SKUId"));<NEW_LINE>inboundOrderSkuTagBiz.setSKUName(_ctx.stringValue("ListInboundOrderSKUTagsResponse.SkuTags[" + i + "].SKUName"));<NEW_LINE>inboundOrderSkuTagBiz.setStyleId(_ctx.stringValue("ListInboundOrderSKUTagsResponse.SkuTags[" + i + "].StyleId"));<NEW_LINE>inboundOrderSkuTagBiz.setStyleCode(_ctx.stringValue("ListInboundOrderSKUTagsResponse.SkuTags[" + i + "].StyleCode"));<NEW_LINE>inboundOrderSkuTagBiz.setStyleName(_ctx.stringValue("ListInboundOrderSKUTagsResponse.SkuTags[" + i + "].StyleName"));<NEW_LINE>inboundOrderSkuTagBiz.setSizeId(_ctx.stringValue("ListInboundOrderSKUTagsResponse.SkuTags[" + i + "].SizeId"));<NEW_LINE>inboundOrderSkuTagBiz.setSizeCode(_ctx.stringValue("ListInboundOrderSKUTagsResponse.SkuTags[" + i + "].SizeCode"));<NEW_LINE>inboundOrderSkuTagBiz.setSizeName(_ctx.stringValue("ListInboundOrderSKUTagsResponse.SkuTags[" + i + "].SizeName"));<NEW_LINE>inboundOrderSkuTagBiz.setColorId(_ctx.stringValue("ListInboundOrderSKUTagsResponse.SkuTags[" + i + "].ColorId"));<NEW_LINE>inboundOrderSkuTagBiz.setColorCode(_ctx.stringValue("ListInboundOrderSKUTagsResponse.SkuTags[" + i + "].ColorCode"));<NEW_LINE>inboundOrderSkuTagBiz.setColorName(_ctx.stringValue("ListInboundOrderSKUTagsResponse.SkuTags[" + i + "].ColorName"));<NEW_LINE>skuTags.add(inboundOrderSkuTagBiz);<NEW_LINE>}<NEW_LINE>listInboundOrderSKUTagsResponse.setSkuTags(skuTags);<NEW_LINE>return listInboundOrderSKUTagsResponse;<NEW_LINE>} | = new ArrayList<InboundOrderSkuTagBiz>(); |
1,387,162 | // ------------------------------------------------------------------------<NEW_LINE>// Implementation of EjbResourceConfiguration<NEW_LINE>// ------------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public String findJndiNameForEjb(String ejbName) throws ConfigurationException {<NEW_LINE>// validation<NEW_LINE>if (Utils.strEmpty(ejbName)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String jndiName = null;<NEW_LINE>try {<NEW_LINE>RootInterface sunDDRoot = getSunDDRoot(false);<NEW_LINE>if (sunDDRoot instanceof SunEjbJar) {<NEW_LINE>SunEjbJar sunEjbJar = (SunEjbJar) sunDDRoot;<NEW_LINE>EnterpriseBeans eb = sunEjbJar.getEnterpriseBeans();<NEW_LINE>if (eb != null) {<NEW_LINE>Ejb ejb = findNamedBean(eb, ejbName, EnterpriseBeans.EJB, Ejb.EJB_NAME);<NEW_LINE>if (ejb != null) {<NEW_LINE>// get jndi name of existing reference.<NEW_LINE>assert ejbName.<MASK><NEW_LINE>jndiName = ejb.getJndiName();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// This is a legitimate exception that could occur, such as a problem<NEW_LINE>// writing the changed descriptor to disk.<NEW_LINE>String message = // NOI18N<NEW_LINE>NbBundle.// NOI18N<NEW_LINE>getMessage(// NOI18N<NEW_LINE>GlassfishConfiguration.class, // NOI18N<NEW_LINE>"ERR_ExceptionReadingEjb", ex.getClass().getSimpleName());<NEW_LINE>throw new ConfigurationException(message, ex);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>// This would probably be a runtime exception due to a bug, but we<NEW_LINE>// must trap it here so it doesn't cause trouble upstream.<NEW_LINE>// We handle it the same as above for now.<NEW_LINE>String message = // NOI18N<NEW_LINE>NbBundle.// NOI18N<NEW_LINE>getMessage(// NOI18N<NEW_LINE>GlassfishConfiguration.class, // NOI18N<NEW_LINE>"ERR_ExceptionReadingEjb", ex.getClass().getSimpleName());<NEW_LINE>throw new ConfigurationException(message, ex);<NEW_LINE>}<NEW_LINE>return jndiName;<NEW_LINE>} | equals(ejb.getEjbName()); |
538,432 | String generate() {<NEW_LINE>String generatedClassName = "io.quarkus.spring.web.mappers." + exceptionDotName.withoutPackagePrefix() + "_Mapper_" + HashUtil.sha1(exceptionDotName.toString());<NEW_LINE>String exceptionClassName = exceptionDotName.toString();<NEW_LINE>try (ClassCreator cc = ClassCreator.builder().classOutput(classOutput).className(generatedClassName).interfaces(ExceptionMapper.class).signature(String.format("Ljava/lang/Object;L" + ExceptionMapper.class.getName().replace(".", "/") + "<L%s;>;", exceptionClassName.replace('.', '/'))).build()) {<NEW_LINE>preGenerateMethodBody(cc);<NEW_LINE>try (MethodCreator toResponse = cc.getMethodCreator("toResponse", Response.class.getName(), exceptionClassName)) {<NEW_LINE>generateMethodBody(toResponse);<NEW_LINE>}<NEW_LINE>// bridge method<NEW_LINE>try (MethodCreator bridgeToResponse = cc.getMethodCreator("toResponse", Response.class, Throwable.class)) {<NEW_LINE>MethodDescriptor toResponse = MethodDescriptor.ofMethod(generatedClassName, "toResponse", Response.class.getName(), exceptionClassName);<NEW_LINE>ResultHandle castedObject = bridgeToResponse.checkCast(bridgeToResponse<MASK><NEW_LINE>ResultHandle result = bridgeToResponse.invokeVirtualMethod(toResponse, bridgeToResponse.getThis(), castedObject);<NEW_LINE>bridgeToResponse.returnValue(result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isResteasyClassic) {<NEW_LINE>String generatedSubtypeClassName = "io.quarkus.spring.web.mappers.Subtype" + exceptionDotName.withoutPackagePrefix() + "Mapper_" + HashUtil.sha1(exceptionDotName.toString());<NEW_LINE>// additionally generate a dummy subtype to get past the RESTEasy's ExceptionMapper check for synthetic classes<NEW_LINE>try (ClassCreator cc = ClassCreator.builder().classOutput(classOutput).className(generatedSubtypeClassName).superClass(generatedClassName).build()) {<NEW_LINE>cc.addAnnotation(Provider.class);<NEW_LINE>}<NEW_LINE>return generatedSubtypeClassName;<NEW_LINE>}<NEW_LINE>return generatedClassName;<NEW_LINE>} | .getMethodParam(0), exceptionClassName); |
327,076 | public AddCartResponse addToCart(AddCartRequest request) {<NEW_LINE>AddCartResponse response = new AddCartResponse();<NEW_LINE>response.setCode(ShoppingRetCode.SUCCESS.getCode());<NEW_LINE>response.setMsg(ShoppingRetCode.SUCCESS.getMessage());<NEW_LINE>try {<NEW_LINE>request.requestCheck();<NEW_LINE>boolean exists = redissonClient.getMap(generatorCartItemKey(request.getUserId())).<MASK><NEW_LINE>if (exists) {<NEW_LINE>String cartItemJson = redissonClient.getMap(generatorCartItemKey(request.getUserId())).get(request.getItemId()).toString();<NEW_LINE>CartProductDto cartProductDto = JSON.parseObject(cartItemJson, CartProductDto.class);<NEW_LINE>cartProductDto.setProductNum(cartProductDto.getProductNum().longValue() + request.getNum().longValue());<NEW_LINE>redissonClient.getMap(generatorCartItemKey(request.getUserId())).put(request.getItemId(), JSON.toJSON(cartProductDto).toString());<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>Item item = itemMapper.selectByPrimaryKey(request.getItemId().longValue());<NEW_LINE>if (item != null) {<NEW_LINE>CartProductDto cartProductDto = CartItemConverter.item2Dto(item);<NEW_LINE>cartProductDto.setChecked("true");<NEW_LINE>cartProductDto.setProductNum(request.getNum().longValue());<NEW_LINE>redissonClient.getMap(generatorCartItemKey(request.getUserId())).put(request.getItemId(), JSON.toJSON(cartProductDto).toString());<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>response.setCode(ShoppingRetCode.SYSTEM_ERROR.getCode());<NEW_LINE>response.setMsg(ShoppingRetCode.SYSTEM_ERROR.getMessage());<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("CartServiceImpl.addToCart Occur Exception :" + e);<NEW_LINE>ExceptionProcessorUtils.wrapperHandlerException(response, e);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | containsKey(request.getItemId()); |
1,474,822 | LookupSubTable readLookupSubTable(TTFDataStream data, long offset) throws IOException {<NEW_LINE>data.seek(offset);<NEW_LINE>int substFormat = data.readUnsignedShort();<NEW_LINE>switch(substFormat) {<NEW_LINE>case 1:<NEW_LINE>{<NEW_LINE>LookupTypeSingleSubstFormat1 lookupSubTable = new LookupTypeSingleSubstFormat1();<NEW_LINE>lookupSubTable.substFormat = substFormat;<NEW_LINE><MASK><NEW_LINE>lookupSubTable.deltaGlyphID = data.readSignedShort();<NEW_LINE>lookupSubTable.coverageTable = readCoverageTable(data, offset + coverageOffset);<NEW_LINE>return lookupSubTable;<NEW_LINE>}<NEW_LINE>case 2:<NEW_LINE>{<NEW_LINE>LookupTypeSingleSubstFormat2 lookupSubTable = new LookupTypeSingleSubstFormat2();<NEW_LINE>lookupSubTable.substFormat = substFormat;<NEW_LINE>int coverageOffset = data.readUnsignedShort();<NEW_LINE>int glyphCount = data.readUnsignedShort();<NEW_LINE>lookupSubTable.substituteGlyphIDs = new int[glyphCount];<NEW_LINE>for (int i = 0; i < glyphCount; i++) {<NEW_LINE>lookupSubTable.substituteGlyphIDs[i] = data.readUnsignedShort();<NEW_LINE>}<NEW_LINE>lookupSubTable.coverageTable = readCoverageTable(data, offset + coverageOffset);<NEW_LINE>return lookupSubTable;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new IOException("Unknown substFormat: " + substFormat);<NEW_LINE>}<NEW_LINE>} | int coverageOffset = data.readUnsignedShort(); |
712,533 | private void processEEPs(EnoceanBindingProvider enoceanBindingProvider, String itemName) {<NEW_LINE>EnoceanParameterAddress parameterAddress = enoceanBindingProvider.getParameterAddress(itemName);<NEW_LINE>EEPId eep = enoceanBindingProvider.getEEP(itemName);<NEW_LINE>esp3Host.addDeviceProfile(parameterAddress.getEnoceanDeviceId(), eep);<NEW_LINE>Item item = enoceanBindingProvider.getItem(itemName);<NEW_LINE>if (profiles.containsKey(parameterAddress.getAsString())) {<NEW_LINE>Profile profile = profiles.get(parameterAddress.getAsString());<NEW_LINE>profile.removeItem(item);<NEW_LINE>}<NEW_LINE>Class<Profile> customProfileClass = enoceanBindingProvider.getCustomProfile(itemName);<NEW_LINE>if (customProfileClass != null) {<NEW_LINE>Constructor<Profile> constructor;<NEW_LINE>Profile profile;<NEW_LINE>try {<NEW_LINE>constructor = customProfileClass.getConstructor(Item.class, EventPublisher.class);<NEW_LINE>profile = <MASK><NEW_LINE>addProfile(item, parameterAddress, profile);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Could not create class for profile " + customProfileClass, e);<NEW_LINE>}<NEW_LINE>} else if (EEPId.EEP_F6_02_01.equals(eep) || EEPId.EEP_F6_10_00.equals(eep)) {<NEW_LINE>if (item.getClass().equals(RollershutterItem.class)) {<NEW_LINE>RollershutterProfile profile = new RollershutterProfile(item, eventPublisher);<NEW_LINE>addProfile(item, parameterAddress, profile);<NEW_LINE>}<NEW_LINE>if (item.getClass().equals(DimmerItem.class)) {<NEW_LINE>DimmerOnOffProfile profile = new DimmerOnOffProfile(item, eventPublisher);<NEW_LINE>addProfile(item, parameterAddress, profile);<NEW_LINE>}<NEW_LINE>if (item.getClass().equals(SwitchItem.class) && parameterAddress.getParameterId() == null) {<NEW_LINE>SwitchOnOffProfile profile = new SwitchOnOffProfile(item, eventPublisher);<NEW_LINE>addProfile(item, parameterAddress, profile);<NEW_LINE>}<NEW_LINE>if (item.getClass().equals(StringItem.class) && EEPId.EEP_F6_10_00.equals(eep)) {<NEW_LINE>WindowHandleProfile profile = new WindowHandleProfile(item, eventPublisher);<NEW_LINE>addProfile(item, parameterAddress, profile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | constructor.newInstance(item, eventPublisher); |
1,854,475 | public static String findParameterType(ParameterContext parameterContext) {<NEW_LINE>ResolvedMethodParameter resolvedMethodParameter = parameterContext.resolvedMethodParameter();<NEW_LINE>ResolvedType parameterType = resolvedMethodParameter.getParameterType();<NEW_LINE>parameterType = parameterContext.alternateFor(parameterType);<NEW_LINE>// Multi-part file trumps any other annotations<NEW_LINE>if (isFileType(parameterType) || isListOfFiles(parameterType)) {<NEW_LINE>if (resolvedMethodParameter.hasParameterAnnotation(RequestPart.class)) {<NEW_LINE>parameterContext.requestParameterBuilder().accepts(Collections.singleton(MediaType.MULTIPART_FORM_DATA));<NEW_LINE>return "formData";<NEW_LINE>}<NEW_LINE>parameterContext.requestParameterBuilder().accepts(Collections.singleton(MediaType.APPLICATION_OCTET_STREAM));<NEW_LINE>return "body";<NEW_LINE>}<NEW_LINE>if (resolvedMethodParameter.hasParameterAnnotation(PathVariable.class)) {<NEW_LINE>return "path";<NEW_LINE>} else if (resolvedMethodParameter.hasParameterAnnotation(RequestBody.class)) {<NEW_LINE>return "body";<NEW_LINE>} else if (resolvedMethodParameter.hasParameterAnnotation(RequestPart.class)) {<NEW_LINE>parameterContext.requestParameterBuilder().accepts(Collections.singleton(MediaType.MULTIPART_FORM_DATA));<NEW_LINE>return "formData";<NEW_LINE>} else if (resolvedMethodParameter.hasParameterAnnotation(RequestParam.class)) {<NEW_LINE>return determineScalarParameterType(parameterContext.getOperationContext().consumes(), parameterContext.<MASK><NEW_LINE>} else if (resolvedMethodParameter.hasParameterAnnotation(RequestHeader.class)) {<NEW_LINE>return "header";<NEW_LINE>} else if (resolvedMethodParameter.hasParameterAnnotation(ModelAttribute.class)) {<NEW_LINE>parameterContext.requestParameterBuilder().accepts(Collections.singleton(MediaType.APPLICATION_FORM_URLENCODED));<NEW_LINE>LOGGER.warn("@ModelAttribute annotated parameters should have already been expanded via " + "the ExpandedParameterBuilderPlugin");<NEW_LINE>}<NEW_LINE>if (!resolvedMethodParameter.hasParameterAnnotations()) {<NEW_LINE>return determineScalarParameterType(parameterContext.getOperationContext().consumes(), parameterContext.getOperationContext().httpMethod());<NEW_LINE>}<NEW_LINE>return QUERY_ONLY_HTTP_METHODS.contains(parameterContext.getOperationContext().httpMethod()) ? "query" : "body";<NEW_LINE>} | getOperationContext().httpMethod()); |
632,373 | public void save() {<NEW_LINE>settings.setVerboseOutputEnabled(verboseConsoleOutput.getValue());<NEW_LINE>settings.setUseZStepSize(useZStepSize.getValue());<NEW_LINE>settings.setSingleStepMode(singleStepMode.getValue());<NEW_LINE>settings.setSafetyHeight((int) safetyHeight.getValue());<NEW_LINE>settings.setStatusUpdatesEnabled(statusPollingEnabled.getValue());<NEW_LINE>settings.setStatusUpdateRate((int) statusPollRate.getValue());<NEW_LINE>// settings.setAutoConnectEnabled(autoConnect.getValue());<NEW_LINE>settings.setShowNightlyWarning(showNightlyWarning.getValue());<NEW_LINE>settings.setAutoStartPendant(autoStartPendant.getValue());<NEW_LINE>settings.setLanguage(((Language) languageCombo.getSelectedItem()).getLanguageCode());<NEW_LINE>settings.setConnectionDriver(ConnectionDriver.prettyNameToEnum(connectionDriver.getSelectedItem().toString()));<NEW_LINE>settings.<MASK><NEW_LINE>SettingsFactory.saveSettings(settings);<NEW_LINE>} | setWorkspaceDirectory(workspaceDirectory.getText()); |
1,664,879 | public static SearchRequest<Amenity> buildSearchPoiRequest(List<Location> route, double radius, SearchPoiTypeFilter poiTypeFilter, ResultMatcher<Amenity> resultMatcher) {<NEW_LINE>SearchRequest<Amenity> request = new SearchRequest<Amenity>();<NEW_LINE>float coeff = (float) (radius / MapUtils.getTileDistanceWidth(SearchRequest.ZOOM_TO_SEARCH_POI));<NEW_LINE>TLongObjectHashMap<List<Location>> zooms = new TLongObjectHashMap<List<Location>>();<NEW_LINE>for (int i = 1; i < route.size(); i++) {<NEW_LINE>Location cr = route.get(i);<NEW_LINE>Location pr = route.get(i - 1);<NEW_LINE>double tx = MapUtils.getTileNumberX(SearchRequest.ZOOM_TO_SEARCH_POI, cr.getLongitude());<NEW_LINE>double ty = MapUtils.getTileNumberY(SearchRequest.ZOOM_TO_SEARCH_POI, cr.getLatitude());<NEW_LINE>double px = MapUtils.getTileNumberX(SearchRequest.ZOOM_TO_SEARCH_POI, pr.getLongitude());<NEW_LINE>double py = MapUtils.getTileNumberY(SearchRequest.ZOOM_TO_SEARCH_POI, pr.getLatitude());<NEW_LINE>double topLeftX = Math.min(tx, px) - coeff;<NEW_LINE>double topLeftY = Math.min(ty, py) - coeff;<NEW_LINE>double bottomRightX = Math.max(tx, px) + coeff;<NEW_LINE>double bottomRightY = Math.max(ty, py) + coeff;<NEW_LINE>for (int x = (int) topLeftX; x <= bottomRightX; x++) {<NEW_LINE>for (int y = (int) topLeftY; y <= bottomRightY; y++) {<NEW_LINE>long hash = (((long) x) << SearchRequest.ZOOM_TO_SEARCH_POI) + y;<NEW_LINE>if (!zooms.containsKey(hash)) {<NEW_LINE>zooms.put(hash, new LinkedList<Location>());<NEW_LINE>}<NEW_LINE>List<Location> ll = zooms.get(hash);<NEW_LINE>ll.add(pr);<NEW_LINE>ll.add(cr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int sleft = Integer.MAX_VALUE, sright = 0, stop = Integer.MAX_VALUE, sbottom = 0;<NEW_LINE>for (long vl : zooms.keys()) {<NEW_LINE>long x = (vl >> SearchRequest.ZOOM_TO_SEARCH_POI) << (31 - SearchRequest.ZOOM_TO_SEARCH_POI);<NEW_LINE>long y = (vl & ((1 << SearchRequest.ZOOM_TO_SEARCH_POI) - 1)) << (31 - SearchRequest.ZOOM_TO_SEARCH_POI);<NEW_LINE>sleft = (int) Math.min(x, sleft);<NEW_LINE>stop = (int) Math.min(y, stop);<NEW_LINE>sbottom = (int) <MASK><NEW_LINE>sright = (int) Math.max(x, sright);<NEW_LINE>}<NEW_LINE>request.radius = radius;<NEW_LINE>request.left = sleft;<NEW_LINE>request.zoom = -1;<NEW_LINE>request.right = sright;<NEW_LINE>request.top = stop;<NEW_LINE>request.bottom = sbottom;<NEW_LINE>request.tiles = zooms;<NEW_LINE>request.poiTypeFilter = poiTypeFilter;<NEW_LINE>request.resultMatcher = resultMatcher;<NEW_LINE>return request;<NEW_LINE>} | Math.max(y, sbottom); |
1,622,180 | private void assemble() throws Exception {<NEW_LINE>File tf1 = new File(folder, "T1");<NEW_LINE>File tf2 = new File(folder, "T2");<NEW_LINE>File outFile = null;<NEW_LINE>XDMUtils.mkdirs(getOutputFolder());<NEW_LINE>try {<NEW_LINE>assembleFinished = false;<NEW_LINE>ArrayList<Segment> list1 = new ArrayList<>();<NEW_LINE>ArrayList<Segment> list2 = new ArrayList<>();<NEW_LINE>for (Segment sc : chunks) {<NEW_LINE>if (sc.getTag().equals("T1")) {<NEW_LINE>list1.add(sc);<NEW_LINE>} else {<NEW_LINE>list2.add(sc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assemblePart(tf1, list1);<NEW_LINE>if (stopFlag) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>assemblePart(tf2, list2);<NEW_LINE>if (stopFlag) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> inputFiles = new ArrayList<>();<NEW_LINE>inputFiles.add(tf1.getAbsolutePath());<NEW_LINE>inputFiles.add(tf2.getAbsolutePath());<NEW_LINE>this.converting = true;<NEW_LINE>outFile = new File(getOutputFolder(), UUID.randomUUID() + "_" + getOutputFileName(true));<NEW_LINE>this.ffmpeg = new FFmpeg(inputFiles, outFile.getAbsolutePath(), this, MediaFormats.getSupportedFormats()[outputFormat], outputFormat == 0);<NEW_LINE>int ret = ffmpeg.convert();<NEW_LINE>Logger.log("FFmpeg exit code: " + ret);<NEW_LINE>if (ret != 0) {<NEW_LINE>throw new IOException("FFmpeg failed");<NEW_LINE>} else {<NEW_LINE>long length = outFile.length();<NEW_LINE>if (length > 0) {<NEW_LINE>this.length = length;<NEW_LINE>}<NEW_LINE>setLastModifiedDate(outFile);<NEW_LINE>}<NEW_LINE>// delete the original file if exists and rename the temp file to original<NEW_LINE>File realFile = new File(getOutputFolder<MASK><NEW_LINE>if (realFile.exists()) {<NEW_LINE>realFile.delete();<NEW_LINE>}<NEW_LINE>outFile.renameTo(realFile);<NEW_LINE>assembleFinished = true;<NEW_LINE>} finally {<NEW_LINE>if (!assembleFinished) {<NEW_LINE>tf1.delete();<NEW_LINE>tf2.delete();<NEW_LINE>if (outFile != null) {<NEW_LINE>outFile.delete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (), getOutputFileName(true)); |
280,168 | public void handleElementEnd(String localName, HandlerState state) {<NEW_LINE>if (state.getContentBuf() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String content = state.getContentBuf().toString();<NEW_LINE>String contentFromHtml = HtmlCompat.fromHtml(content, HtmlCompat.FROM_HTML_MODE_COMPACT).toString();<NEW_LINE>if (TextUtils.isEmpty(content)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (AUTHOR.equals(localName) && state.getFeed() != null && state.getTagstack().size() <= 3) {<NEW_LINE>state.getFeed().setAuthor(contentFromHtml);<NEW_LINE>} else if (DURATION.equals(localName)) {<NEW_LINE>try {<NEW_LINE>long durationMs = DurationParser.inMillis(content);<NEW_LINE>state.getTempObjects().put(DURATION, (int) durationMs);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>Log.e(NSTAG, String.format("Duration '%s' could not be parsed", content));<NEW_LINE>}<NEW_LINE>} else if (SUBTITLE.equals(localName)) {<NEW_LINE>if (state.getCurrentItem() != null && TextUtils.isEmpty(state.getCurrentItem().getDescription())) {<NEW_LINE>state.<MASK><NEW_LINE>} else if (state.getFeed() != null && TextUtils.isEmpty(state.getFeed().getDescription())) {<NEW_LINE>state.getFeed().setDescription(content);<NEW_LINE>}<NEW_LINE>} else if (SUMMARY.equals(localName)) {<NEW_LINE>if (state.getCurrentItem() != null) {<NEW_LINE>state.getCurrentItem().setDescriptionIfLonger(content);<NEW_LINE>} else if (Rss20.CHANNEL.equals(state.getSecondTag().getName()) && state.getFeed() != null) {<NEW_LINE>state.getFeed().setDescription(content);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getCurrentItem().setDescriptionIfLonger(content); |
1,850,556 | final DescribeServicesResult executeDescribeServices(DescribeServicesRequest describeServicesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeServicesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeServicesRequest> request = null;<NEW_LINE>Response<DescribeServicesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeServicesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeServicesRequest));<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, "ECS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeServices");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeServicesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeServicesResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
897,013 | public Optional<Layout> resolveLayout(final HttpServletRequest request) {<NEW_LINE>Layout layout = Try.of(() -> loadLayout(request.getParameter("p_l_id"))).getOrNull();<NEW_LINE>if (layout == null || UtilMethods.isNotSet(layout.getId())) {<NEW_LINE>final String <MASK><NEW_LINE>if (referer != null && referer.indexOf("?") > -1) {<NEW_LINE>for (String x : Splitter.on('&').trimResults().split(referer.split("\\?")[1])) {<NEW_LINE>if (x.startsWith("p_l_id=")) {<NEW_LINE>layout = Try.of(() -> loadLayout(x.replace("p_l_id=", ""))).getOrNull();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (layout == null) {<NEW_LINE>final String lastLayout = (String) request.getSession().getAttribute(WebKeys.LAYOUT_PREVIOUS);<NEW_LINE>layout = Try.of(() -> loadLayout(lastLayout)).getOrNull();<NEW_LINE>}<NEW_LINE>if (layout != null) {<NEW_LINE>request.getSession().setAttribute(WebKeys.LAYOUT_PREVIOUS, layout.getId());<NEW_LINE>}<NEW_LINE>return Optional.ofNullable(layout);<NEW_LINE>} | referer = request.getHeader("referer"); |
1,113,456 | void processEntry(Map<String, ?> entry, ConfigurationSet configurationSet) {<NEW_LINE>boolean invalidResult = Boolean.FALSE.equals(entry.get("result"));<NEW_LINE>ConfigurationCondition condition = ConfigurationCondition.alwaysTrue();<NEW_LINE>if (invalidResult) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String function = (String) entry.get("function");<NEW_LINE>List<?> args = (List<?<MASK><NEW_LINE>SerializationConfiguration serializationConfiguration = configurationSet.getSerializationConfiguration();<NEW_LINE>if ("ObjectStreamClass.<init>".equals(function)) {<NEW_LINE>expectSize(args, 2);<NEW_LINE>if (advisor.shouldIgnore(LazyValueUtils.lazyValue((String) args.get(0)), LazyValueUtils.lazyValue(null))) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String className = (String) args.get(0);<NEW_LINE>if (className.contains(LambdaUtils.LAMBDA_CLASS_NAME_SUBSTRING)) {<NEW_LINE>serializationConfiguration.registerLambdaCapturingClass(condition, className);<NEW_LINE>} else {<NEW_LINE>serializationConfiguration.registerWithTargetConstructorClass(condition, className, (String) args.get(1));<NEW_LINE>}<NEW_LINE>} else if ("SerializedLambda.readResolve".equals(function)) {<NEW_LINE>expectSize(args, 1);<NEW_LINE>if (advisor.shouldIgnore(LazyValueUtils.lazyValue((String) args.get(0)), LazyValueUtils.lazyValue(null))) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>serializationConfiguration.registerLambdaCapturingClass(condition, (String) args.get(0));<NEW_LINE>}<NEW_LINE>} | >) entry.get("args"); |
1,111,121 | private void handleResolvedMedia(Intent intent) {<NEW_LINE>int chatId = intent.getIntExtra(EXTRA_CHAT_ID, -1);<NEW_LINE>String shortcutId = intent.getStringExtra(ShortcutManagerCompat.EXTRA_SHORTCUT_ID);<NEW_LINE>if (chatId == -1 && shortcutId != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>String[] extraEmail = getIntent().getStringArrayExtra(Intent.EXTRA_EMAIL);<NEW_LINE>if (chatId == -1 && extraEmail != null && extraEmail.length > 0) {<NEW_LINE>final String addr = extraEmail[0];<NEW_LINE>int contactId = dcContext.lookupContactIdByAddr(addr);<NEW_LINE>if (contactId == 0) {<NEW_LINE>contactId = dcContext.createContact(null, addr);<NEW_LINE>}<NEW_LINE>chatId = dcContext.createChatByContactId(contactId);<NEW_LINE>}<NEW_LINE>Intent composeIntent;<NEW_LINE>if (chatId != -1) {<NEW_LINE>composeIntent = getBaseShareIntent(ConversationActivity.class);<NEW_LINE>composeIntent.putExtra(EXTRA_CHAT_ID, chatId);<NEW_LINE>RelayUtil.setSharedUris(composeIntent, resolvedExtras);<NEW_LINE>startActivity(composeIntent);<NEW_LINE>} else {<NEW_LINE>composeIntent = getBaseShareIntent(ConversationListRelayingActivity.class);<NEW_LINE>RelayUtil.setSharedUris(composeIntent, resolvedExtras);<NEW_LINE>ConversationListRelayingActivity.start(this, composeIntent);<NEW_LINE>}<NEW_LINE>// We use startActivityForResult() here so that the conversations list is correctly updated. (hide "Device messages", ...)a<NEW_LINE>// With startActivity() the list was not always updated before and after sharing and incorrectly showed or did not show the device talk.<NEW_LINE>finish();<NEW_LINE>} | chatId = Integer.parseInt(shortcutId); |
1,516,529 | final DeleteReceiptFilterResult executeDeleteReceiptFilter(DeleteReceiptFilterRequest deleteReceiptFilterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteReceiptFilterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteReceiptFilterRequest> request = null;<NEW_LINE>Response<DeleteReceiptFilterResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteReceiptFilterRequestMarshaller().marshall(super.beforeMarshalling(deleteReceiptFilterRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SES");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteReceiptFilter");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteReceiptFilterResult> responseHandler = new StaxResponseHandler<DeleteReceiptFilterResult>(new DeleteReceiptFilterResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,698,110 | protected void usage(PrintWriter w) {<NEW_LINE>if (MainLookup.isStarted()) {<NEW_LINE>Lookup clis = Lookup.getDefault();<NEW_LINE>Collection<? extends CLIHandler> handlers = <MASK><NEW_LINE>showHelp(w, handlers, WHEN_EXTRA);<NEW_LINE>w.flush();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CLIOptions.fallbackToMemory();<NEW_LINE>ModuleSystem moduleSystem;<NEW_LINE>try {<NEW_LINE>moduleSystem = new ModuleSystem(FileUtil.getConfigRoot().getFileSystem());<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>// System will be screwed up.<NEW_LINE>// NOI18N<NEW_LINE>throw new IllegalStateException("Module system cannot be created", ioe);<NEW_LINE>}<NEW_LINE>// moduleSystem.loadBootModules();<NEW_LINE>moduleSystem.readList();<NEW_LINE>ArrayList<URL> urls = new ArrayList<URL>();<NEW_LINE>for (Module m : moduleSystem.getManager().getModules()) {<NEW_LINE>for (File f : m.getAllJars()) {<NEW_LINE>try {<NEW_LINE>urls.add(BaseUtilities.toURI(f).toURL());<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>URLClassLoader loader = new URLClassLoader(urls.toArray(new URL[urls.size()]), getClass().getClassLoader());<NEW_LINE>MainLookup.systemClassLoaderChanged(loader);<NEW_LINE>try {<NEW_LINE>final List<URL> layers = ModuleLayeredFileSystem.collectLayers(loader);<NEW_LINE>XMLFileSystem xfs = new XMLFileSystem();<NEW_LINE>xfs.setXmlUrls(layers.toArray(new URL[layers.size()]));<NEW_LINE>MainLookup.register(xfs);<NEW_LINE>// NOI18N<NEW_LINE>MainLookup.modulesClassPathInitialized(Lookups.forPath("Services/OptionProcessors"));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>Lookup clis = Lookup.getDefault();<NEW_LINE>Collection<? extends CLIHandler> handlers = clis.lookupAll(CLIHandler.class);<NEW_LINE>showHelp(w, handlers, WHEN_EXTRA);<NEW_LINE>w.flush();<NEW_LINE>} | clis.lookupAll(CLIHandler.class); |
1,613,180 | private boolean modifyLanguage(DomainFile df, DBHandle dbh) throws IOException, ImproperUseException {<NEW_LINE>// TODO: Check for address map and overlay entries which could break from<NEW_LINE>// changing the memory model !!<NEW_LINE>Table table = dbh.getTable(TABLE_NAME);<NEW_LINE>if (table == null) {<NEW_LINE>Msg.showError(getClass(), null, "Script Error", "Bad program database!!");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>DBRecord record = table.getRecord(new StringField(LANGUAGE_ID));<NEW_LINE>if (record == null) {<NEW_LINE>// must be in old style combined language/compiler spec format<NEW_LINE>Msg.showError(getClass(), null, "Script Error", "Old program file! Language fix is not appropriate.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String langId = record.getString(0);<NEW_LINE>LanguageDescription desc = null;<NEW_LINE>List<LanguageDescription> descriptions = DefaultLanguageService.getLanguageService().getLanguageDescriptions(true);<NEW_LINE>List<String> choices = new ArrayList<>(descriptions.size());<NEW_LINE>for (int i = 0; i < descriptions.size(); i++) {<NEW_LINE>choices.add(descriptions.get(i).<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>langId = askChoice("Select New Language", "Language ID:", choices, null);<NEW_LINE>if (langId != null) {<NEW_LINE>Msg.warn(this, "Changing language ID from '" + record.getString(0) + "' to '" + langId + "' for program: " + df.getName());<NEW_LINE>desc = DefaultLanguageService.getLanguageService().getLanguageDescription(new LanguageID(langId));<NEW_LINE>long txId = dbh.startTransaction();<NEW_LINE>try {<NEW_LINE>record.setString(0, langId);<NEW_LINE>table.putRecord(record);<NEW_LINE>record = table.getSchema().createRecord(new StringField(LANGUAGE_VERSION));<NEW_LINE>record.setString(0, desc.getVersion() + "." + desc.getMinorVersion());<NEW_LINE>table.putRecord(record);<NEW_LINE>} finally {<NEW_LINE>dbh.endTransaction(txId, true);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (CancelledException e) {<NEW_LINE>// just return false<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | getLanguageID().getIdAsString()); |
1,366,490 | private void showConfigPanelForCustomizer(WebModule webModule) {<NEW_LINE>Project enclosingProject = Util.getEnclosingProjectFromWebModule(webModule);<NEW_LINE>HibernateEnvironment he = enclosingProject.getLookup(<MASK><NEW_LINE>List<FileObject> configFileObjects = he.getAllHibernateConfigFileObjects();<NEW_LINE>for (FileObject configFile : configFileObjects) {<NEW_LINE>if (configFile.getName().equals(DEFAULT_CONFIG_FILENAME)) {<NEW_LINE>try {<NEW_LINE>HibernateCfgDataObject hibernateDO = (HibernateCfgDataObject) DataObject.find(configFile);<NEW_LINE>SessionFactory sessionFactory = hibernateDO.getHibernateConfiguration().getSessionFactory();<NEW_LINE>int index = 0;<NEW_LINE>for (String propValue : sessionFactory.getProperty2()) {<NEW_LINE>// NOI18N<NEW_LINE>String propName = sessionFactory.getAttributeValue(SessionFactory.PROPERTY2, index++, "name");<NEW_LINE>if (dialect.contains(propName)) {<NEW_LINE>configPanel.setDialect(propValue);<NEW_LINE>}<NEW_LINE>if (url.contains(propName)) {<NEW_LINE>configPanel.setDatabaseConnection(propValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (DataObjectNotFoundException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>configPanel.disable();<NEW_LINE>}<NEW_LINE>} | ).lookup(HibernateEnvironment.class); |
1,336,841 | public void render(TurretTileEntity tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) {<NEW_LINE>if (tile.isDummy() || !tile.getWorldNonnull().hasChunkAt(tile.getBlockPos()))<NEW_LINE>return;<NEW_LINE>// Grab model + correct eextended state<NEW_LINE>final BlockRenderDispatcher blockRenderer = Minecraft.getInstance().getBlockRenderer();<NEW_LINE>BlockPos blockPos = tile.getBlockPos();<NEW_LINE>BlockState state = tile.getLevel().getBlockState(blockPos);<NEW_LINE>if (state.getBlock() != MetalDevices.turretChem && state.getBlock() != MetalDevices.turretGun)<NEW_LINE>return;<NEW_LINE>BakedModel model = blockRenderer.getBlockModelShaper().getBlockModel(state);<NEW_LINE>// Outer GL Wrapping, initial translation<NEW_LINE>matrixStack.pushPose();<NEW_LINE>matrixStack.translate(.5, .5, .5);<NEW_LINE>matrixStack.mulPose(new Quaternion(new Vector3f(0, 1, 0), tile.rotationYaw, true));<NEW_LINE>matrixStack.mulPose(new Quaternion(new Vector3f(tile.getFacing().getStepZ(), 0, -tile.getFacing().getStepX()), tile.rotationPitch, true));<NEW_LINE>renderModelPart(bufferIn, matrixStack, tile.getWorldNonnull(), state, model, tile.getBlockPos(), true, combinedLightIn, "gun");<NEW_LINE>if (tile instanceof TurretGunTileEntity) {<NEW_LINE>if (((TurretGunTileEntity) tile).cycleRender > 0) {<NEW_LINE>float cycle = 0;<NEW_LINE>if (((TurretGunTileEntity) tile).cycleRender > 3)<NEW_LINE>cycle = (5 - ((TurretGunTileEntity) tile).cycleRender) / 2f;<NEW_LINE>else<NEW_LINE>cycle = ((<MASK><NEW_LINE>matrixStack.translate(-tile.getFacing().getStepX() * cycle * .3125, 0, -tile.getFacing().getStepZ() * cycle * .3125);<NEW_LINE>}<NEW_LINE>renderModelPart(bufferIn, matrixStack, tile.getWorldNonnull(), state, model, tile.getBlockPos(), false, combinedLightIn, "action");<NEW_LINE>}<NEW_LINE>matrixStack.popPose();<NEW_LINE>} | TurretGunTileEntity) tile).cycleRender / 3f; |
1,687,497 | private void checkAliases(Class<?> parent, String classname, String[] parts) {<NEW_LINE>Class<?> c = ELKIServiceRegistry.findImplementation((Class<Object>) parent, classname);<NEW_LINE>if (c == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Alias ann = c.getAnnotation(Alias.class);<NEW_LINE>if (ann == null) {<NEW_LINE>if (parts.length > 1) {<NEW_LINE>//<NEW_LINE>StringBuilder //<NEW_LINE>buf = //<NEW_LINE>new StringBuilder(100).append("Class ").//<NEW_LINE>append(classname).append(//<NEW_LINE>" in ").//<NEW_LINE>append(parent.getCanonicalName()).append(" has the following extraneous aliases:");<NEW_LINE>for (int i = 1; i < parts.length; i++) {<NEW_LINE>buf.append(' ').append(parts[i]);<NEW_LINE>}<NEW_LINE>LOG.warning(buf);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HashSet<String> aliases = new HashSet<>();<NEW_LINE>for (int i = 1; i < parts.length; i++) {<NEW_LINE>aliases.add(parts[i]);<NEW_LINE>}<NEW_LINE>StringBuilder buf = null;<NEW_LINE>for (String a : ann.value()) {<NEW_LINE>if (!aliases.remove(a)) {<NEW_LINE>if (buf == null) {<NEW_LINE>//<NEW_LINE>buf = //<NEW_LINE>new StringBuilder(100).append("Class ").//<NEW_LINE>append(classname).append(//<NEW_LINE>" in ").//<NEW_LINE>append(parent.getCanonicalName()).append(" is missing the following aliases:");<NEW_LINE>}<NEW_LINE>buf.append<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!aliases.isEmpty()) {<NEW_LINE>//<NEW_LINE>buf = //<NEW_LINE>(buf == null ? new StringBuilder() : buf.append(FormatUtil.NEWLINE)).append("Class ").//<NEW_LINE>append(classname).append(//<NEW_LINE>" in ").//<NEW_LINE>append(parent.getCanonicalName()).append(" has the following extraneous aliases:");<NEW_LINE>for (String a : aliases) {<NEW_LINE>buf.append(' ').append(a);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (buf != null) {<NEW_LINE>LOG.warning(buf);<NEW_LINE>}<NEW_LINE>} | (' ').append(a); |
1,415,039 | private void statInit() throws Exception {<NEW_LINE>final int p_WindowNo = getWindowNo();<NEW_LINE>lDocumentNo.setLabelFor(fDocumentNo);<NEW_LINE>fDocumentNo.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fDocumentNo.addActionListener(this);<NEW_LINE>lDescription.setLabelFor(fDescription);<NEW_LINE>fDescription.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fDescription.addActionListener(this);<NEW_LINE>// lPOReference.setLabelFor(lPOReference);<NEW_LINE>// fPOReference.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>// fPOReference.addActionListener(this);<NEW_LINE>fIsPaid.setSelected(false);<NEW_LINE>fIsPaid.addActionListener(this);<NEW_LINE>fIsSOTrx.setSelected(!"N".equals(Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx")));<NEW_LINE>fIsSOTrx.addActionListener(this);<NEW_LINE>//<NEW_LINE>// fOrg_ID = new VLookup("AD_Org_ID", false, false, true,<NEW_LINE>// MLookupFactory.create(Env.getCtx(), 3486, m_WindowNo, DisplayType.TableDir, false),<NEW_LINE>// DisplayType.TableDir, m_WindowNo);<NEW_LINE>// lOrg_ID.setLabelFor(fOrg_ID);<NEW_LINE>// fOrg_ID.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>// C_Invoice.C_BPartner_ID<NEW_LINE>fBPartner_ID = new VLookup("C_BPartner_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, 3499, DisplayType.Search));<NEW_LINE>lBPartner_ID.setLabelFor(fBPartner_ID);<NEW_LINE>fBPartner_ID.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>// C_Invoice.C_Order_ID<NEW_LINE>fOrder_ID = new VLookup("C_Order_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, 4247, DisplayType.Search));<NEW_LINE>lOrder_ID.setLabelFor(fOrder_ID);<NEW_LINE>fOrder_ID.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>//<NEW_LINE>lDateFrom.setLabelFor(fDateFrom);<NEW_LINE>fDateFrom.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fDateFrom.setToolTipText(Msg.translate(Env.getCtx(), "DateFrom"));<NEW_LINE>lDateTo.setLabelFor(fDateTo);<NEW_LINE>fDateTo.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fDateTo.setToolTipText(Msg.translate(Env.getCtx(), "DateTo"));<NEW_LINE>lAmtFrom.setLabelFor(fAmtFrom);<NEW_LINE>fAmtFrom.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fAmtFrom.setToolTipText(Msg.translate(Env.getCtx(), "AmtFrom"));<NEW_LINE>lAmtTo.setLabelFor(fAmtTo);<NEW_LINE>fAmtTo.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fAmtTo.setToolTipText(Msg.translate(Env.getCtx(), "AmtTo"));<NEW_LINE>//<NEW_LINE>parameterPanel.setLayout(new ALayout());<NEW_LINE>// First Row<NEW_LINE>parameterPanel.add(lDocumentNo, new ALayoutConstraint(0, 0));<NEW_LINE>parameterPanel.add(fDocumentNo, null);<NEW_LINE>parameterPanel.add(lBPartner_ID, null);<NEW_LINE>parameterPanel.add(fBPartner_ID, null);<NEW_LINE>parameterPanel.add(fIsSOTrx, new ALayoutConstraint(0, 5));<NEW_LINE>parameterPanel.add(fIsPaid, null);<NEW_LINE>// 2nd Row<NEW_LINE>parameterPanel.add(lDescription, new ALayoutConstraint(1, 0));<NEW_LINE>parameterPanel.add(fDescription, null);<NEW_LINE><MASK><NEW_LINE>parameterPanel.add(fDateFrom, null);<NEW_LINE>parameterPanel.add(lDateTo, null);<NEW_LINE>parameterPanel.add(fDateTo, null);<NEW_LINE>// 3rd Row<NEW_LINE>parameterPanel.add(lOrder_ID, new ALayoutConstraint(2, 0));<NEW_LINE>parameterPanel.add(fOrder_ID, null);<NEW_LINE>parameterPanel.add(lAmtFrom, null);<NEW_LINE>parameterPanel.add(fAmtFrom, null);<NEW_LINE>parameterPanel.add(lAmtTo, null);<NEW_LINE>parameterPanel.add(fAmtTo, null);<NEW_LINE>// parameterPanel.add(lOrg_ID, null);<NEW_LINE>// parameterPanel.add(fOrg_ID, null);<NEW_LINE>} | parameterPanel.add(lDateFrom, null); |
1,579,142 | public void marshall(UpdateLocationSmbRequest updateLocationSmbRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateLocationSmbRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateLocationSmbRequest.getSubdirectory(), SUBDIRECTORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationSmbRequest.getUser(), USER_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationSmbRequest.getDomain(), DOMAIN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationSmbRequest.getPassword(), PASSWORD_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationSmbRequest.getAgentArns(), AGENTARNS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationSmbRequest.getMountOptions(), MOUNTOPTIONS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | updateLocationSmbRequest.getLocationArn(), LOCATIONARN_BINDING); |
1,643,710 | public void evaluate(Evaluation evaluation) {<NEW_LINE>AuthorizationProvider authorization = evaluation.getAuthorizationProvider();<NEW_LINE>DefaultEvaluation defaultEvaluation = DefaultEvaluation.class.cast(evaluation);<NEW_LINE>Map<Policy, Map<Object, Decision.Effect>> decisionCache = defaultEvaluation.getDecisionCache();<NEW_LINE>Policy policy = evaluation.getPolicy();<NEW_LINE><MASK><NEW_LINE>for (Policy associatedPolicy : policy.getAssociatedPolicies()) {<NEW_LINE>Map<Object, Decision.Effect> decisions = decisionCache.computeIfAbsent(associatedPolicy, p -> new HashMap<>());<NEW_LINE>Decision.Effect effect = decisions.get(permission);<NEW_LINE>defaultEvaluation.setPolicy(associatedPolicy);<NEW_LINE>if (effect == null) {<NEW_LINE>PolicyProvider policyProvider = authorization.getProvider(associatedPolicy.getType());<NEW_LINE>if (policyProvider == null) {<NEW_LINE>throw new RuntimeException("No policy provider found for policy [" + associatedPolicy.getType() + "]");<NEW_LINE>}<NEW_LINE>policyProvider.evaluate(defaultEvaluation);<NEW_LINE>evaluation.denyIfNoEffect();<NEW_LINE>decisions.put(permission, defaultEvaluation.getEffect());<NEW_LINE>} else {<NEW_LINE>defaultEvaluation.setEffect(effect);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ResourcePermission permission = evaluation.getPermission(); |
142,801 | public final boolean isBundleLocallyBranded(String bundlepath, String codenamebase) {<NEW_LINE>// in modified keys?<NEW_LINE>if (inModifiedLocalizedKeysBundle(bundlepath, codenamebase))<NEW_LINE>return true;<NEW_LINE>// in branded but not modified keys?<NEW_LINE>Set<BundleKey> bundleKeys = getBranding().getLocalizedBrandedBundleKeys();<NEW_LINE>for (BundleKey bundleKey : bundleKeys) {<NEW_LINE>String bundleFilePath = bundleKey.getBundleFilePath();<NEW_LINE>String localizedBundlepath = bundlepath;<NEW_LINE>if (bundleFilePath.endsWith("_" + this.locale.toString() + ".properties"))<NEW_LINE>localizedBundlepath = bundlepath.replace(".properties", "_" + this.<MASK><NEW_LINE>if (backslashesToSlashes(bundleFilePath).endsWith(localizedBundlepath) && codenamebase.equals(bundleKey.getModuleEntry().getCodeNameBase()))<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | locale.toString() + ".properties"); |
1,805,876 | public ComponentPreset extractRailButton() {<NEW_LINE>TypedPropertyMap props = new TypedPropertyMap();<NEW_LINE>try {<NEW_LINE>props.put(ComponentPreset.<MASK><NEW_LINE>props.put(ComponentPreset.OUTER_DIAMETER, rbOuterDia.getValue());<NEW_LINE>props.put(ComponentPreset.INNER_DIAMETER, rbInnerDia.getValue());<NEW_LINE>props.put(ComponentPreset.STANDOFF_HEIGHT, rbStandoffHeight.getValue());<NEW_LINE>props.put(ComponentPreset.FLANGE_HEIGHT, rbFlangeHeight.getValue());<NEW_LINE>props.put(ComponentPreset.DESCRIPTION, rbDescTextField.getText());<NEW_LINE>props.put(ComponentPreset.PARTNO, rbPartNoTextField.getText());<NEW_LINE>props.put(ComponentPreset.MANUFACTURER, Manufacturer.getManufacturer(mfgTextField.getText()));<NEW_LINE>props.put(ComponentPreset.HEIGHT, rbHeight.getValue());<NEW_LINE>final Material material = (Material) materialChooser.getSelectedItem();<NEW_LINE>if (material != null) {<NEW_LINE>props.put(ComponentPreset.MATERIAL, material);<NEW_LINE>} else {<NEW_LINE>JOptionPane.showMessageDialog(null, "A material must be selected.", "Error", JOptionPane.ERROR_MESSAGE);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>props.put(ComponentPreset.MASS, rbMass.getValue());<NEW_LINE>if (llImage != null) {<NEW_LINE>props.put(ComponentPreset.IMAGE, imageToByteArray(rbImage.getImage()));<NEW_LINE>}<NEW_LINE>return ComponentPresetFactory.create(props);<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>JOptionPane.showMessageDialog(null, "Could not convert rail button attribute.", "Error", JOptionPane.ERROR_MESSAGE);<NEW_LINE>} catch (InvalidComponentPresetException e) {<NEW_LINE>JOptionPane.showMessageDialog(null, craftErrorMessage(e, "Mandatory rail button attribute not set."), "Error", JOptionPane.ERROR_MESSAGE);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | TYPE, ComponentPreset.Type.RAIL_BUTTON); |
996,164 | public void updateEntityAfterFallOn(BlockGetter worldIn, Entity entityIn) {<NEW_LINE>super.updateEntityAfterFallOn(worldIn, entityIn);<NEW_LINE>if (entityIn.level.isClientSide)<NEW_LINE>return;<NEW_LINE>if (!(entityIn instanceof ItemEntity))<NEW_LINE>return;<NEW_LINE>if (!entityIn.isAlive())<NEW_LINE>return;<NEW_LINE>MillstoneTileEntity millstone = null;<NEW_LINE>for (BlockPos pos : Iterate.hereAndBelow(entityIn.blockPosition())) if (millstone == null)<NEW_LINE>millstone = getTileEntity(worldIn, pos);<NEW_LINE>if (millstone == null)<NEW_LINE>return;<NEW_LINE>ItemEntity itemEntity = (ItemEntity) entityIn;<NEW_LINE>LazyOptional<IItemHandler> capability = <MASK><NEW_LINE>if (!capability.isPresent())<NEW_LINE>return;<NEW_LINE>ItemStack remainder = capability.orElse(new ItemStackHandler()).insertItem(0, itemEntity.getItem(), false);<NEW_LINE>if (remainder.isEmpty())<NEW_LINE>itemEntity.discard();<NEW_LINE>if (remainder.getCount() < itemEntity.getItem().getCount())<NEW_LINE>itemEntity.setItem(remainder);<NEW_LINE>} | millstone.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY); |
836,303 | private SingularityDeployResult checkLbRevertToActiveTasks(SingularityRequest request, SingularityDeploy deploy, SingularityPendingDeploy pendingDeploy, SingularityDeployProgress updatedProgress, DeployState acceptanceHookDeployState, Collection<SingularityTaskId> deployActiveTasks, Collection<SingularityTaskId> otherActiveTasks) {<NEW_LINE>final SingularityLoadBalancerUpdate lbUpdate = lbClient.getState(pendingDeploy.getDeployProgress().getPendingLbUpdate().get().getLoadBalancerRequestId());<NEW_LINE>DeployProgressLbUpdateHolder lbUpdateHolder = updatedProgress.getLbUpdates().get(lbUpdate.getLoadBalancerRequestId().toString());<NEW_LINE>if (lbUpdateHolder == null) {<NEW_LINE>return new SingularityDeployResult(DeployState.FAILED_INTERNAL_STATE, "Load balancer update metadata not found");<NEW_LINE>}<NEW_LINE>updateLoadBalancerStateForTasks(lbUpdateHolder.getAdded(), LoadBalancerRequestType.ADD, lbUpdate);<NEW_LINE>switch(lbUpdate.getLoadBalancerState()) {<NEW_LINE>case SUCCESS:<NEW_LINE>LOG.info("LB revert succeeded, continuing with original deploy status");<NEW_LINE>updatePendingDeploy(pendingDeploy, acceptanceHookDeployState, updatedProgress.withFinishedLbUpdate(lbUpdate, lbUpdateHolder));<NEW_LINE>return new SingularityDeployResult(acceptanceHookDeployState, String.join(", ", updatedProgress.getAcceptanceResultMessageHistory()));<NEW_LINE>case WAITING:<NEW_LINE><MASK><NEW_LINE>default:<NEW_LINE>// Keep trying until we time out, since abandoning here would leave nothing in the LB<NEW_LINE>if (deployCheckHelper.isDeployOverdue(pendingDeploy, deploy)) {<NEW_LINE>LOG.error("Unable to revert load balancer for deploy failure");<NEW_LINE>return new SingularityDeployResult(DeployState.FAILED_INTERNAL_STATE, "Unable to revert load balancer for deploy failure");<NEW_LINE>} else {<NEW_LINE>LOG.warn("Retrying failed LB revert for {} {}", pendingDeploy.getDeployMarker().getRequestId(), pendingDeploy.getDeployMarker().getDeployId());<NEW_LINE>return enqueueLbRevertToActiveTasks(request, pendingDeploy, updatedProgress, deployActiveTasks, otherActiveTasks);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | return new SingularityDeployResult(DeployState.WAITING); |
208,392 | public boolean onBackKey() {<NEW_LINE>// Convert to a string here to ensure that no other state associated with the text field<NEW_LINE>// gets saved.<NEW_LINE>String newTitle = mFolderName.getText().toString();<NEW_LINE>if (DEBUG) {<NEW_LINE>Log.<MASK><NEW_LINE>}<NEW_LINE>mInfo.setTitle(newTitle, mLauncherDelegate.getModelWriter());<NEW_LINE>mLauncher.getModelWriter().updateItemInDatabase(mInfo);<NEW_LINE>mFolderIcon.onTitleChanged(newTitle);<NEW_LINE>if (TextUtils.isEmpty(mInfo.title)) {<NEW_LINE>mFolderName.setHint(R.string.folder_hint_text);<NEW_LINE>mFolderName.setText("");<NEW_LINE>} else {<NEW_LINE>mFolderName.setHint(null);<NEW_LINE>}<NEW_LINE>sendCustomAccessibilityEvent(this, AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED, getContext().getString(R.string.folder_renamed, newTitle));<NEW_LINE>// This ensures that focus is gained every time the field is clicked, which selects all<NEW_LINE>// the text and brings up the soft keyboard if necessary.<NEW_LINE>mFolderName.clearFocus();<NEW_LINE>Selection.setSelection(mFolderName.getText(), 0, 0);<NEW_LINE>mIsEditingName = false;<NEW_LINE>return true;<NEW_LINE>} | d(TAG, "onBackKey newTitle=" + newTitle); |
488,220 | protected FullHttpRequest newHandshakeRequest() {<NEW_LINE>URI wsURL = uri();<NEW_LINE>// Get 16 bit nonce and base 64 encode it<NEW_LINE>byte[] nonce = WebSocketUtil.randomBytes(16);<NEW_LINE>String key = WebSocketUtil.base64(nonce);<NEW_LINE>String acceptSeed = key + MAGIC_GUID;<NEW_LINE>byte[] sha1 = WebSocketUtil.sha1(acceptSeed.getBytes(CharsetUtil.US_ASCII));<NEW_LINE>expectedChallengeResponseString = WebSocketUtil.base64(sha1);<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("WebSocket version 07 client handshake key: {}, expected response: {}", key, expectedChallengeResponseString);<NEW_LINE>}<NEW_LINE>// Format request<NEW_LINE>FullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, upgradeUrl(wsURL), Unpooled.EMPTY_BUFFER);<NEW_LINE>HttpHeaders headers = request.headers();<NEW_LINE>if (customHeaders != null) {<NEW_LINE>headers.add(customHeaders);<NEW_LINE>if (!headers.contains(HttpHeaderNames.HOST)) {<NEW_LINE>// Only add HOST header if customHeaders did not contain it.<NEW_LINE>//<NEW_LINE>// See https://github.com/netty/netty/issues/10101<NEW_LINE>headers.set(HttpHeaderNames.HOST, websocketHostValue(wsURL));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>headers.set(HttpHeaderNames.HOST, websocketHostValue(wsURL));<NEW_LINE>}<NEW_LINE>headers.set(HttpHeaderNames.UPGRADE, HttpHeaderValues.WEBSOCKET).set(HttpHeaderNames.CONNECTION, HttpHeaderValues.UPGRADE).set(HttpHeaderNames.SEC_WEBSOCKET_KEY, key);<NEW_LINE>if (!headers.contains(HttpHeaderNames.SEC_WEBSOCKET_ORIGIN)) {<NEW_LINE>headers.set(HttpHeaderNames<MASK><NEW_LINE>}<NEW_LINE>String expectedSubprotocol = expectedSubprotocol();<NEW_LINE>if (expectedSubprotocol != null && !expectedSubprotocol.isEmpty()) {<NEW_LINE>headers.set(HttpHeaderNames.SEC_WEBSOCKET_PROTOCOL, expectedSubprotocol);<NEW_LINE>}<NEW_LINE>headers.set(HttpHeaderNames.SEC_WEBSOCKET_VERSION, version().toAsciiString());<NEW_LINE>return request;<NEW_LINE>} | .SEC_WEBSOCKET_ORIGIN, websocketOriginValue(wsURL)); |
1,167,510 | private void registerMetrics() {<NEW_LINE>try {<NEW_LINE>KafkaUReplicatorMetricsReporter.get(<MASK><NEW_LINE>KafkaUReplicatorMetricsReporter.get().registerMetric("kafkaAndIdealstatesDiscrepancy.mismatched.topics", _numMismatchedTopics);<NEW_LINE>KafkaUReplicatorMetricsReporter.get().registerMetric("kafkaAndIdealstatesDiscrepancy.mismatched.topicPartitions", _numMismatchedTopicPartitions);<NEW_LINE>KafkaUReplicatorMetricsReporter.get().registerMetric("kafkaAndIdealstatesDiscrepancy.autoExpansion.topics", _numAutoExpandedTopics);<NEW_LINE>KafkaUReplicatorMetricsReporter.get().registerMetric("kafkaAndIdealstatesDiscrepancy.autoExpansion.topicPartitions", _numAutoExpandedTopicPartitions);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Failed to register metrics to HelixKafkaMirrorMakerMetricsReporter " + e);<NEW_LINE>}<NEW_LINE>} | ).registerMetric("kafkaAndIdealstatesDiscrepancy.missing.topics", _numMissingTopics); |
1,145,909 | public static void main(String[] args) throws Exception {<NEW_LINE>if (!ValidInput(args)) {<NEW_LINE>PrintUsage();<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final String loadname = args[1];<NEW_LINE>final String savename = args[2];<NEW_LINE>final boolean silent = args.length > 3;<NEW_LINE>final byte[] input = LoadFile(loadname);<NEW_LINE>final byte[] output;<NEW_LINE>final long start = System.currentTimeMillis();<NEW_LINE>if (command.equals("p") | command.equals("pp")) {<NEW_LINE>// compress<NEW_LINE>output = APJ.pack(input, command.equals("pp"), silent);<NEW_LINE>final long time = System.currentTimeMillis() - start;<NEW_LINE>// verify compression<NEW_LINE>if (!Arrays.equals(input, APJ.unpack(output, input))) {<NEW_LINE>System.err.println("Error while verifying compression, result data mismatch input data !");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>if (!silent) {<NEW_LINE>System.out.println("Initial size " + input.length + " --> packed to " + output.length + " (" + ((100 * output.length) / input.length) + "%) in " + time + " ms");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>output = APJ.unpack(input, null);<NEW_LINE>final long time = System.currentTimeMillis() - start;<NEW_LINE>if (!silent) {<NEW_LINE>System.out.println("Initial size " + input.length + " --> unpacked to " + output.length + " in " + time + " ms");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// save result file<NEW_LINE>SaveFile(output, savename);<NEW_LINE>// and success exit<NEW_LINE>System.exit(0);<NEW_LINE>} | final String command = args[0]; |
961,077 | private void handleApplyCommit(ApplyCommitRequest applyCommitRequest, ActionListener<Void> applyListener) {<NEW_LINE>synchronized (mutex) {<NEW_LINE>logger.trace("handleApplyCommit: applying commit {}", applyCommitRequest);<NEW_LINE>coordinationState.<MASK><NEW_LINE>final ClusterState committedState = hideStateIfNotRecovered(coordinationState.get().getLastAcceptedState());<NEW_LINE>applierState = mode == Mode.CANDIDATE ? clusterStateWithNoMasterBlock(committedState) : committedState;<NEW_LINE>if (applyCommitRequest.getSourceNode().equals(getLocalNode())) {<NEW_LINE>// master node applies the committed state at the end of the publication process, not here.<NEW_LINE>applyListener.onResponse(null);<NEW_LINE>} else {<NEW_LINE>clusterApplier.onNewClusterState(applyCommitRequest.toString(), () -> applierState, applyListener.map(r -> {<NEW_LINE>onClusterStateApplied();<NEW_LINE>return r;<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | get().handleCommit(applyCommitRequest); |
1,186,082 | public boolean checkTrigger(GameEvent event, Game game) {<NEW_LINE>if (!super.checkTrigger(event, game)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>EntersTheBattlefieldEvent entersEvent = (EntersTheBattlefieldEvent) event;<NEW_LINE>if (entersEvent.getFromZone() == Zone.LIBRARY) {<NEW_LINE>this.getEffects().clear();<NEW_LINE>this.addEffect(new DrawCardSourceControllerEffect(2));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>FblthpTheLostWatcher watcher = game.getState().getWatcher(FblthpTheLostWatcher.class);<NEW_LINE>int zcc = entersEvent.getTarget().getZoneChangeCounter(game) - 1;<NEW_LINE>MageObjectReference mor = new MageObjectReference(entersEvent.getTargetId(), zcc, game);<NEW_LINE>if (watcher != null && watcher.spellWasCastFromLibrary(mor)) {<NEW_LINE>this<MASK><NEW_LINE>this.addEffect(new DrawCardSourceControllerEffect(2));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>this.getEffects().clear();<NEW_LINE>this.addEffect(new DrawCardSourceControllerEffect(1));<NEW_LINE>return true;<NEW_LINE>} | .getEffects().clear(); |
666,578 | public JasperPrint fill(Map<String, Object> parameterValues) throws JRException {<NEW_LINE>// FIXMEBOOK copied from JRBaseFiller<NEW_LINE>if (parameterValues == null) {<NEW_LINE>parameterValues = new HashMap<>();<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Fill " + fillerId + ": filling report");<NEW_LINE>}<NEW_LINE>setParametersToContext(parameterValues);<NEW_LINE>fillingThread = Thread.currentThread();<NEW_LINE>JRResourcesFillUtil.ResourcesFillContext resourcesContext = JRResourcesFillUtil.setResourcesFillContext(parameterValues);<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>createBoundElemementMaps();<NEW_LINE>setParameters(parameterValues);<NEW_LINE>setBookmarkHelper();<NEW_LINE>// loadStyles();<NEW_LINE>jasperPrint.setName(jasperReport.getName());<NEW_LINE>jasperPrint.setPageWidth(jasperReport.getPageWidth());<NEW_LINE>jasperPrint.setPageHeight(jasperReport.getPageHeight());<NEW_LINE>jasperPrint.setTopMargin(jasperReport.getTopMargin());<NEW_LINE>jasperPrint.setLeftMargin(jasperReport.getLeftMargin());<NEW_LINE>jasperPrint.setBottomMargin(jasperReport.getBottomMargin());<NEW_LINE>jasperPrint.setRightMargin(jasperReport.getRightMargin());<NEW_LINE>jasperPrint.setOrientation(jasperReport.getOrientationValue());<NEW_LINE>jasperPrint.setFormatFactoryClass(jasperReport.getFormatFactoryClass());<NEW_LINE>jasperPrint.setLocaleCode(JRDataUtils<MASK><NEW_LINE>jasperPrint.setTimeZoneId(JRDataUtils.getTimeZoneId(getTimeZone()));<NEW_LINE>propertiesUtil.transferProperties(mainDataset, jasperPrint, JasperPrint.PROPERTIES_PRINT_TRANSFER_PREFIX);<NEW_LINE>fillReport();<NEW_LINE>if (bookmarkHelper != null) {<NEW_LINE>jasperPrint.setBookmarks(bookmarkHelper.getRootBookmarks());<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Fill " + fillerId + ": ended");<NEW_LINE>}<NEW_LINE>success = true;<NEW_LINE>return jasperPrint;<NEW_LINE>} finally {<NEW_LINE>mainDataset.closeDatasource();<NEW_LINE>mainDataset.disposeParameterContributors();<NEW_LINE>if (success && parent == null) {<NEW_LINE>// commit the cached data<NEW_LINE>fillContext.cacheDone();<NEW_LINE>}<NEW_LINE>delayedActions.dispose();<NEW_LINE>fillingThread = null;<NEW_LINE>// kill the subreport filler threads<NEW_LINE>// killSubfillerThreads();<NEW_LINE>if (parent == null) {<NEW_LINE>fillContext.dispose();<NEW_LINE>}<NEW_LINE>JRResourcesFillUtil.revertResourcesFillContext(resourcesContext);<NEW_LINE>}<NEW_LINE>} | .getLocaleCode(getLocale())); |
599,246 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) 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>UnitAttribute o = emc.find(id, UnitAttribute.class);<NEW_LINE>if (null == o) {<NEW_LINE>throw new ExceptionUnitAttributeNotExist(id);<NEW_LINE>}<NEW_LINE>Unit unit = business.unit().pick(o.getUnit());<NEW_LINE>if (null == unit) {<NEW_LINE>throw new ExceptionUnitNotExist(o.getUnit());<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, unit)) {<NEW_LINE>throw new ExceptionDenyEditUnit(effectivePerson, unit.getName());<NEW_LINE>}<NEW_LINE>emc.beginTransaction(UnitAttribute.class);<NEW_LINE>o = emc.find(o.getId(), UnitAttribute.class);<NEW_LINE>emc.<MASK><NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(UnitAttribute.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(o.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | remove(o, CheckRemoveType.all); |
515,534 | @PostMapping(value = "/batch-delete")<NEW_LINE>@ResponseStatus(HttpStatus.OK)<NEW_LINE>@ApiException(BATCH_DELETE_PROCESS_DEFINE_BY_CODES_ERROR)<NEW_LINE>@AccessLogAnnotation(ignoreRequestArgs = "loginUser")<NEW_LINE>public Result batchDeleteProcessDefinitionByCodes(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("codes") String codes) {<NEW_LINE>Map<String, Object> result = new HashMap<>();<NEW_LINE>List<String> deleteFailedCodeList = new ArrayList<>();<NEW_LINE>if (!StringUtils.isEmpty(codes)) {<NEW_LINE>String[] <MASK><NEW_LINE>for (String strProcessDefinitionCode : processDefinitionCodeArray) {<NEW_LINE>long code = Long.parseLong(strProcessDefinitionCode);<NEW_LINE>try {<NEW_LINE>Map<String, Object> deleteResult = processDefinitionService.deleteProcessDefinitionByCode(loginUser, projectCode, code);<NEW_LINE>if (!Status.SUCCESS.equals(deleteResult.get(Constants.STATUS))) {<NEW_LINE>deleteFailedCodeList.add(strProcessDefinitionCode);<NEW_LINE>logger.error((String) deleteResult.get(Constants.MSG));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>deleteFailedCodeList.add(strProcessDefinitionCode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!deleteFailedCodeList.isEmpty()) {<NEW_LINE>putMsg(result, BATCH_DELETE_PROCESS_DEFINE_BY_CODES_ERROR, String.join(",", deleteFailedCodeList));<NEW_LINE>} else {<NEW_LINE>putMsg(result, Status.SUCCESS);<NEW_LINE>}<NEW_LINE>return returnDataList(result);<NEW_LINE>} | processDefinitionCodeArray = codes.split(","); |
1,170,148 | public void loadData(final int numVertices, final int numThreads) throws Exception {<NEW_LINE>makeKey("w", Integer.class);<NEW_LINE>PropertyKey time = makeKey("t", Long.class);<NEW_LINE>((StandardEdgeLabelMaker) mgmt.makeEdgeLabel("l")).sortKey(time).make();<NEW_LINE>finishSchema();<NEW_LINE>final int maxQueue = 1000;<NEW_LINE>final int verticesPerTask = 1000;<NEW_LINE>final int maxWeight = 10;<NEW_LINE>final int maxTime = 10000;<NEW_LINE>final BlockingQueue<Runnable> tasks = new ArrayBlockingQueue<>(maxQueue);<NEW_LINE>ExecutorService exe = Executors.newFixedThreadPool(numThreads);<NEW_LINE>for (int i = 0; i < numVertices / verticesPerTask; i++) {<NEW_LINE>while (tasks.size() >= <MASK><NEW_LINE>Preconditions.checkState(tasks.size() < maxQueue);<NEW_LINE>exe.submit(() -> {<NEW_LINE>final JanusGraphTransaction tx = graph.newTransaction();<NEW_LINE>final JanusGraphVertex[] vs = new JanusGraphVertex[verticesPerTask];<NEW_LINE>for (int j = 0; j < verticesPerTask; j++) {<NEW_LINE>vs[j] = tx.addVertex();<NEW_LINE>vs[j].property(VertexProperty.Cardinality.single, "w", random.nextInt(maxWeight));<NEW_LINE>}<NEW_LINE>for (int j = 0; j < verticesPerTask * 10; j++) {<NEW_LINE>final JanusGraphEdge e = vs[random.nextInt(verticesPerTask)].addEdge("l", vs[random.nextInt(verticesPerTask)]);<NEW_LINE>e.property("t", random.nextInt(maxTime));<NEW_LINE>}<NEW_LINE>System.out.print(".");<NEW_LINE>tx.commit();<NEW_LINE>});<NEW_LINE>}<NEW_LINE>exe.shutdown();<NEW_LINE>exe.awaitTermination(numVertices / 1000, TimeUnit.SECONDS);<NEW_LINE>if (!exe.isTerminated())<NEW_LINE>System.err.println("Could not load data in time");<NEW_LINE>System.out.println("Loaded " + numVertices + "vertices");<NEW_LINE>} | maxQueue) Thread.sleep(maxQueue); |
708,871 | public static void main(String[] args) {<NEW_LINE>if (args.length == 0) {<NEW_LINE>args = new String[] { "C:\\temp\\downloads.config", "C:\\temp\\downloads-9-3-05.config", "C:\\temp\\merged.config" };<NEW_LINE>} else if (args.length != 3) {<NEW_LINE>System.out.println("Usage: newer_config_file older_config_file save_config_file");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Map map1 = FileUtil.readResilientFile(FileUtil.newFile(args[0]));<NEW_LINE>Map map2 = FileUtil.readResilientFile(FileUtil.<MASK><NEW_LINE>List downloads1 = (List) map1.get("downloads");<NEW_LINE>List downloads2 = (List) map2.get("downloads");<NEW_LINE>Set torrents = new HashSet();<NEW_LINE>Iterator it1 = downloads1.iterator();<NEW_LINE>while (it1.hasNext()) {<NEW_LINE>Map m = (Map) it1.next();<NEW_LINE>byte[] hash = (byte[]) m.get("torrent_hash");<NEW_LINE>System.out.println("1:" + ByteFormatter.nicePrint(hash));<NEW_LINE>torrents.add(new HashWrapper(hash));<NEW_LINE>}<NEW_LINE>List to_add = new ArrayList();<NEW_LINE>Iterator it2 = downloads2.iterator();<NEW_LINE>while (it2.hasNext()) {<NEW_LINE>Map m = (Map) it2.next();<NEW_LINE>byte[] hash = (byte[]) m.get("torrent_hash");<NEW_LINE>HashWrapper wrapper = new HashWrapper(hash);<NEW_LINE>if (torrents.contains(wrapper)) {<NEW_LINE>System.out.println("-:" + ByteFormatter.nicePrint(hash));<NEW_LINE>} else {<NEW_LINE>System.out.println("2:" + ByteFormatter.nicePrint(hash));<NEW_LINE>to_add.add(m);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>downloads1.addAll(to_add);<NEW_LINE>System.out.println(to_add.size() + " copied from " + args[1] + " to " + args[2]);<NEW_LINE>FileUtil.writeResilientFile(FileUtil.newFile(args[2]), map1);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | newFile(args[1])); |
1,168,283 | @UiThread<NEW_LINE>private static Constructor<? extends Unbinder> findBindingConstructorForClass(Class<?> cls) {<NEW_LINE>Constructor<? extends Unbinder> <MASK><NEW_LINE>if (bindingCtor != null || BINDINGS.containsKey(cls)) {<NEW_LINE>if (debug)<NEW_LINE>Log.d(TAG, "HIT: Cached in binding map.");<NEW_LINE>return bindingCtor;<NEW_LINE>}<NEW_LINE>String clsName = cls.getName();<NEW_LINE>if (clsName.startsWith("android.") || clsName.startsWith("java.") || clsName.startsWith("androidx.")) {<NEW_LINE>if (debug)<NEW_LINE>Log.d(TAG, "MISS: Reached framework class. Abandoning search.");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Class<?> bindingClass = cls.getClassLoader().loadClass(clsName + "_ViewBinding");<NEW_LINE>// noinspection unchecked<NEW_LINE>bindingCtor = (Constructor<? extends Unbinder>) bindingClass.getConstructor(cls, View.class);<NEW_LINE>if (debug)<NEW_LINE>Log.d(TAG, "HIT: Loaded binding class and constructor.");<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>if (debug)<NEW_LINE>Log.d(TAG, "Not found. Trying superclass " + cls.getSuperclass().getName());<NEW_LINE>bindingCtor = findBindingConstructorForClass(cls.getSuperclass());<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>throw new RuntimeException("Unable to find binding constructor for " + clsName, e);<NEW_LINE>}<NEW_LINE>BINDINGS.put(cls, bindingCtor);<NEW_LINE>return bindingCtor;<NEW_LINE>} | bindingCtor = BINDINGS.get(cls); |
124,639 | public boolean process(final I_ESR_ImportLine line, final String message) {<NEW_LINE>Check.assumeNotNull(line.getESR_Payment_Action(), "@" + ESRConstants.ERR_ESR_LINE_WITH_NO_PAYMENT_ACTION + "@");<NEW_LINE>// 08500: allocate when process<NEW_LINE>final I_C_Invoice invoice = line.getC_Invoice();<NEW_LINE>final PaymentId paymentId = PaymentId.ofRepoIdOrNull(line.getC_Payment_ID());<NEW_LINE>final I_C_Payment payment = paymentId == null ? null : paymentDAO.getById(paymentId);<NEW_LINE>if (invoice != null && payment != null) {<NEW_LINE>if (!payment.isAllocated() && !invoice.isPaid()) {<NEW_LINE>payment.setC_Invoice_ID(invoice.getC_Invoice_ID());<NEW_LINE>final BigDecimal invoiceOpenAmt = Services.get(IInvoiceDAO.class).retrieveOpenAmt(invoice);<NEW_LINE>if (payment.getPayAmt().compareTo(invoiceOpenAmt) != 0) {<NEW_LINE>final BigDecimal overUnderAmt = payment.<MASK><NEW_LINE>payment.setOverUnderAmt(overUnderAmt);<NEW_LINE>}<NEW_LINE>InterfaceWrapperHelper.save(payment);<NEW_LINE>Services.get(IESRImportBL.class).linkInvoiceToPayment(line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | getPayAmt().subtract(invoiceOpenAmt); |
426,851 | public Optional<RuleMatch<T>> match(Request message) throws InvalidUriException {<NEW_LINE>final String method = message.method();<NEW_LINE>final String path = getPath(message);<NEW_LINE>if (method == null) {<NEW_LINE>LOG.warn("Invalid request for {} sent without method by service {}", message.uri(), message.service<MASK><NEW_LINE>throw new InvalidUriException();<NEW_LINE>}<NEW_LINE>if (path == null) {<NEW_LINE>// Problem already logged in detail upstream<NEW_LINE>throw new InvalidUriException();<NEW_LINE>}<NEW_LINE>final Router.Result<Rule<T>> result = router.result();<NEW_LINE>router.route(method, path, result);<NEW_LINE>if (!result.isSuccess()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final Rule<T> rule = result.target();<NEW_LINE>final ImmutableMap.Builder<String, String> pathArgs = ImmutableMap.builder();<NEW_LINE>for (int i = 0; i < result.params(); i++) {<NEW_LINE>pathArgs.put(result.paramName(i), readParameterValue(result, i));<NEW_LINE>}<NEW_LINE>return Optional.of(new RuleMatch<T>(rule, pathArgs.build()));<NEW_LINE>} | ().orElse("<unknown>")); |
1,724,194 | public static ExtendedUri parseExtendedUri(final Element element) throws ParseException {<NEW_LINE>try {<NEW_LINE>final URI uri = new URI(getChild(element, "default-uri").getTextContent());<NEW_LINE>final long size = Long.parseLong(element.getAttribute("size"));<NEW_LINE>final String md5 = element.getAttribute("md5");<NEW_LINE>final List<URI> alternates <MASK><NEW_LINE>for (Element alternateElement : XMLUtils.getChildren(element, "alternate-uri")) {<NEW_LINE>alternates.add(new URI(alternateElement.getTextContent()));<NEW_LINE>}<NEW_LINE>if (uri.getScheme().equals("file")) {<NEW_LINE>return new ExtendedUri(uri, alternates, uri, size, md5);<NEW_LINE>} else {<NEW_LINE>return new ExtendedUri(uri, alternates, size, md5);<NEW_LINE>}<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new ParseException("Cannot parse extended URI", e);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new ParseException("Cannot parse extended URI", e);<NEW_LINE>}<NEW_LINE>} | = new LinkedList<URI>(); |
1,356,618 | public Spec process(StringCharReader reader, String contextPath) {<NEW_LINE>String direction = reader.readWord();<NEW_LINE>boolean vertically;<NEW_LINE>if (direction.equals("vertically")) {<NEW_LINE>vertically = true;<NEW_LINE>} else if (direction.equals("horizontally")) {<NEW_LINE>vertically = false;<NEW_LINE>} else {<NEW_LINE>throw new SyntaxException("Incorrect alignment direction. Expected 'vertically' or 'horizontally' but got: " + direction);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>Alignment alignment = Alignment.parse(side);<NEW_LINE>String objectName = reader.readWord();<NEW_LINE>if (objectName.isEmpty()) {<NEW_LINE>throw new SyntaxException(MISSING_OBJECT_NAME);<NEW_LINE>}<NEW_LINE>int errorRate = 0;<NEW_LINE>if (reader.hasMore()) {<NEW_LINE>errorRate = Expectations.errorRate().read(reader);<NEW_LINE>}<NEW_LINE>if (vertically) {<NEW_LINE>return createVerticalSpec(objectName, alignment, errorRate);<NEW_LINE>} else {<NEW_LINE>return createHorizontalSpec(objectName, alignment, errorRate);<NEW_LINE>}<NEW_LINE>} | String side = reader.readWord(); |
1,435,555 | private void compareJSON(String expected, String actual) throws Exception {<NEW_LINE>System.out.println("compareJSON\n\texpected = " + expected + "\n\tactual = " + actual);<NEW_LINE>try {<NEW_LINE>JsonReader jsonReader = Json.createReader(new StringReader(expected));<NEW_LINE>JsonObject exp = jsonReader.readObject();<NEW_LINE>jsonReader = Json.<MASK><NEW_LINE>JsonObject act = jsonReader.readObject();<NEW_LINE>assertTrue("expected=" + expected + ", actual=" + actual, exp.equals(act));<NEW_LINE>} catch (JsonParsingException e) {<NEW_LINE>// Json failed to parse as an object, try array<NEW_LINE>JsonReader jsonReader = Json.createReader(new StringReader(expected));<NEW_LINE>JsonArray exp = jsonReader.readArray();<NEW_LINE>jsonReader = Json.createReader(new StringReader(actual));<NEW_LINE>JsonArray act = jsonReader.readArray();<NEW_LINE>assertTrue("expected=" + expected + ", actual=" + actual, exp.equals(act));<NEW_LINE>}<NEW_LINE>} | createReader(new StringReader(actual)); |
433,806 | public static Collection<RegressionExecution> executions() {<NEW_LINE>ArrayList<RegressionExecution> execs = new ArrayList<>();<NEW_LINE>execs.add(new ResultSetQueryTypePatternNoWindow());<NEW_LINE>execs.add(new ResultSetQueryTypePatternWithWindow());<NEW_LINE>execs.add(new ResultSetQueryTypeOrderByWildcard());<NEW_LINE>execs.add(new ResultSetQueryTypeOrderByProps());<NEW_LINE>execs.add(new ResultSetQueryTypeFilter());<NEW_LINE>execs.add(new ResultSetQueryTypeRowPerGroupOrdered());<NEW_LINE>execs.add(new ResultSetQueryTypeRowPerGroup());<NEW_LINE>execs<MASK><NEW_LINE>execs.add(new ResultSetQueryTypeRowPerGroupComplex());<NEW_LINE>execs.add(new ResultSetQueryTypeAggregateGroupedOrdered());<NEW_LINE>execs.add(new ResultSetQueryTypeAggregateGrouped());<NEW_LINE>execs.add(new ResultSetQueryTypeAggregateGroupedHaving());<NEW_LINE>execs.add(new ResultSetQueryTypeRowPerEvent());<NEW_LINE>execs.add(new ResultSetQueryTypeRowPerEventOrdered());<NEW_LINE>execs.add(new ResultSetQueryTypeRowPerEventHaving());<NEW_LINE>execs.add(new ResultSetQueryTypeRowForAll());<NEW_LINE>execs.add(new ResultSetQueryTypeRowForAllHaving());<NEW_LINE>return execs;<NEW_LINE>} | .add(new ResultSetQueryTypeRowPerGroupHaving()); |
1,777,582 | public void parseLight(IElementType t, PsiBuilder b) {<NEW_LINE>boolean r;<NEW_LINE>b = adapt_builder_(<MASK><NEW_LINE>Marker m = enter_section_(b, 0, _COLLAPSE_, null);<NEW_LINE>if (t == BIT_STRING) {<NEW_LINE>r = bitString(b, 0);<NEW_LINE>} else if (t == FUNCTION_REFERENCE) {<NEW_LINE>r = functionReference(b, 0);<NEW_LINE>} else if (t == LAST_TAIL) {<NEW_LINE>r = lastTail(b, 0);<NEW_LINE>} else if (t == LIST) {<NEW_LINE>r = list(b, 0);<NEW_LINE>} else if (t == MAP) {<NEW_LINE>r = map(b, 0);<NEW_LINE>} else if (t == OPERANDS) {<NEW_LINE>r = operands(b, 0);<NEW_LINE>} else if (t == OPERATION) {<NEW_LINE>r = operation(b, 0);<NEW_LINE>} else if (t == QUALIFIER) {<NEW_LINE>r = qualifier(b, 0);<NEW_LINE>} else if (t == RELATIVE) {<NEW_LINE>r = relative(b, 0);<NEW_LINE>} else if (t == STRUCT) {<NEW_LINE>r = struct(b, 0);<NEW_LINE>} else if (t == TERM) {<NEW_LINE>r = term(b, 0);<NEW_LINE>} else if (t == TUPLE) {<NEW_LINE>r = tuple(b, 0);<NEW_LINE>} else if (t == VALUES) {<NEW_LINE>r = values(b, 0);<NEW_LINE>} else {<NEW_LINE>r = parse_root_(t, b, 0);<NEW_LINE>}<NEW_LINE>exit_section_(b, 0, m, t, r, true, TRUE_CONDITION);<NEW_LINE>} | t, b, this, null); |
868,038 | public static Home find() {<NEW_LINE>// Check if ROBOVM_DEV_ROOT has been set. If set it should be<NEW_LINE>// pointing at the root of a complete RoboVM source tree.<NEW_LINE>if (System.getenv("ROBOVM_DEV_ROOT") != null) {<NEW_LINE>File dir = new File(System.getenv("ROBOVM_DEV_ROOT"));<NEW_LINE>return validateDevRootDir(dir);<NEW_LINE>}<NEW_LINE>if (System.getProperty("ROBOVM_DEV_ROOT") != null) {<NEW_LINE>File dir = new File(System.getProperty("ROBOVM_DEV_ROOT"));<NEW_LINE>return validateDevRootDir(dir);<NEW_LINE>}<NEW_LINE>if (System.getenv("ROBOVM_HOME") != null) {<NEW_LINE>File dir = new File(System.getenv("ROBOVM_HOME"));<NEW_LINE>return new Home(dir);<NEW_LINE>}<NEW_LINE>List<File> candidates <MASK><NEW_LINE>File userHome = new File(System.getProperty("user.home"));<NEW_LINE>candidates.add(new File(userHome, "Applications/robovm"));<NEW_LINE>candidates.add(new File(userHome, ".robovm/home"));<NEW_LINE>candidates.add(new File("/usr/local/lib/robovm"));<NEW_LINE>candidates.add(new File("/opt/robovm"));<NEW_LINE>candidates.add(new File("/usr/lib/robovm"));<NEW_LINE>for (File dir : candidates) {<NEW_LINE>if (dir.exists()) {<NEW_LINE>return new Home(dir);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("ROBOVM_HOME not set and no RoboVM " + "installation found in " + candidates);<NEW_LINE>} | = new ArrayList<File>(); |
828,623 | public Object call(ExecutionContext context) {<NEW_LINE><MASK><NEW_LINE>Arguments argsObj = (Arguments) context.resolve("arguments").getValue(context);<NEW_LINE>int numArgs = (int) argsObj.get(context, "length");<NEW_LINE>int paramsLen = getFormalParameters().length;<NEW_LINE>Object[] args = new Object[numArgs < paramsLen ? paramsLen : numArgs];<NEW_LINE>for (int i = 0; i < numArgs; ++i) {<NEW_LINE>Object v = argsObj.get(context, "" + i);<NEW_LINE>if (v instanceof Reference) {<NEW_LINE>if (((Reference) v).isUnresolvableReference()) {<NEW_LINE>v = Types.UNDEFINED;<NEW_LINE>} else {<NEW_LINE>v = ((Reference) v).getValue(context);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>args[i] = v;<NEW_LINE>}<NEW_LINE>for (int i = numArgs; i < paramsLen; ++i) {<NEW_LINE>args[i] = Types.UNDEFINED;<NEW_LINE>}<NEW_LINE>return call(context, self, args);<NEW_LINE>} | Object self = context.getThisBinding(); |
740,852 | public com.amazonaws.services.shield.model.ResourceAlreadyExistsException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.shield.model.ResourceAlreadyExistsException resourceAlreadyExistsException = new com.amazonaws.services.shield.model.ResourceAlreadyExistsException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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("resourceType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resourceAlreadyExistsException.setResourceType(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 resourceAlreadyExistsException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,746,940 | private String resolveOnClasspathAndSourceFolders(String publicId, String systemId) {<NEW_LINE>ResourceLoader classLoader = loaderCache.getResourceLoader(project, null);<NEW_LINE>Map<String, String> mappings = getSchemaMappings(classLoader);<NEW_LINE>if (mappings != null && systemId != null) {<NEW_LINE>if (mappings.containsKey(systemId)) {<NEW_LINE>String xsdPath = mappings.get(systemId);<NEW_LINE>return resolveXsdPathOnClasspath(xsdPath, classLoader);<NEW_LINE>} else if (mappings.containsKey(systemId.replace("https://", "http://"))) {<NEW_LINE>String xsdPath = mappings.get(systemId<MASK><NEW_LINE>return resolveXsdPathOnClasspath(xsdPath, classLoader);<NEW_LINE>} else if (mappings.containsKey(systemId.replace("http://", "https://"))) {<NEW_LINE>String xsdPath = mappings.get(systemId.replace("http://", "https://"));<NEW_LINE>return resolveXsdPathOnClasspath(xsdPath, classLoader);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | .replace("https://", "http://")); |
1,231,291 | private synchronized void makeVisible(boolean animate, final boolean top, final Item lastTop) {<NEW_LINE>if (animationRunning) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int height = top ? preferredHeight - tapPanelMinimumHeight : preferredHeight;<NEW_LINE>if (!animate) {<NEW_LINE>setTop(top);<NEW_LINE>if (top && lastTop != null) {<NEW_LINE>lastTop.setTop(false);<NEW_LINE>}<NEW_LINE>scrollPane.setPreferredSize(<MASK><NEW_LINE>outerPanel.setPreferredSize(new Dimension(0, height));<NEW_LINE>scrollPane.setVisible(true);<NEW_LINE>separator.setVisible(true);<NEW_LINE>} else {<NEW_LINE>scrollPane.setPreferredSize(new Dimension(0, 1));<NEW_LINE>outerPanel.setPreferredSize(new Dimension(0, height));<NEW_LINE>animationRunning = true;<NEW_LINE>isTop = top;<NEW_LINE>if (isTop && lastTop != null) {<NEW_LINE>lastTop.setTop(false);<NEW_LINE>}<NEW_LINE>topGapPanel.setVisible(!isTop);<NEW_LINE>if (animationRunning) {<NEW_LINE>scrollPane.setVisible(true);<NEW_LINE>separator.setVisible(true);<NEW_LINE>tapPanel.revalidate();<NEW_LINE>}<NEW_LINE>if (isTop) {<NEW_LINE>tapPanel.setBackground(backgroundColor);<NEW_LINE>}<NEW_LINE>int delta = 1;<NEW_LINE>int currHeight = 1;<NEW_LINE>Timer animationTimer = new Timer(20, null);<NEW_LINE>animationTimer.addActionListener(new AnimationTimerListener(animationTimer, delta, currHeight));<NEW_LINE>animationTimer.setCoalesce(false);<NEW_LINE>animationTimer.start();<NEW_LINE>}<NEW_LINE>// else<NEW_LINE>} | new Dimension(0, height)); |
1,517,623 | public void clusterChanged(ClusterChangedEvent changedEvent) {<NEW_LINE>final RestoreInProgress.Entry prevEntry = restoreInProgress(<MASK><NEW_LINE>final RestoreInProgress.Entry newEntry = restoreInProgress(changedEvent.state(), uuid);<NEW_LINE>if (prevEntry == null) {<NEW_LINE>// When there is a master failure after a restore has been started, this listener might not be registered<NEW_LINE>// on the current master and as such it might miss some intermediary cluster states due to batching.<NEW_LINE>// Clean up listener in that case and acknowledge completion of restore operation to client.<NEW_LINE>clusterService.removeListener(this);<NEW_LINE>listener.onResponse(new RestoreSnapshotResponse((RestoreInfo) null));<NEW_LINE>} else if (newEntry == null) {<NEW_LINE>clusterService.removeListener(this);<NEW_LINE>ImmutableOpenMap<ShardId, RestoreInProgress.ShardRestoreStatus> shards = prevEntry.shards();<NEW_LINE>assert prevEntry.state().completed() : "expected completed snapshot state but was " + prevEntry.state();<NEW_LINE>assert RestoreService.completed(shards) : "expected all restore entries to be completed";<NEW_LINE>RestoreInfo ri = new RestoreInfo(prevEntry.snapshot().getSnapshotId().getName(), prevEntry.indices(), shards.size(), shards.size() - RestoreService.failedShards(shards));<NEW_LINE>RestoreSnapshotResponse response = new RestoreSnapshotResponse(ri);<NEW_LINE>logger.debug("restore of [{}] completed", prevEntry.snapshot().getSnapshotId());<NEW_LINE>listener.onResponse(response);<NEW_LINE>} else {<NEW_LINE>// restore not completed yet, wait for next cluster state update<NEW_LINE>}<NEW_LINE>} | changedEvent.previousState(), uuid); |
293,247 | public static Map<String, Object> xmlToMap(NodeList nodelist, Map<String, Object> toMapOrNull) {<NEW_LINE>Map<String, Object> map = toMapOrNull == null ? new HashMap<>() : toMapOrNull;<NEW_LINE>for (int i = 0; i < nodelist.getLength(); i++) {<NEW_LINE>Node node = nodelist.item(i);<NEW_LINE>if (node == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String nodeName = node.getNodeName();<NEW_LINE>boolean hasAttributes = node.hasAttributes();<NEW_LINE>boolean hasChildNodes = node.hasChildNodes();<NEW_LINE>if (!hasAttributes && !hasChildNodes) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Map<MASK><NEW_LINE>if (hasAttributes && ADD_ATTRIBUTES_FIRST) {<NEW_LINE>existing = attributesToMap(map, node, nodeName, null);<NEW_LINE>}<NEW_LINE>if (hasChildNodes) {<NEW_LINE>NodeList childNodes = node.getChildNodes();<NEW_LINE>boolean goDeeper = true;<NEW_LINE>if (childNodes.getLength() == 1) {<NEW_LINE>Node firstChildNode = childNodes.item(0);<NEW_LINE>if (firstChildNode.getNodeType() == Node.TEXT_NODE) {<NEW_LINE>String firstChildNodeVal = firstChildNode.getNodeValue();<NEW_LINE>if (hasAttributes) {<NEW_LINE>Map<String, Object> mapContent = existing == null ? new HashMap<>() : existing;<NEW_LINE>mapContent.put("content", coerseString(firstChildNodeVal));<NEW_LINE>if (existing == null) {<NEW_LINE>addValueToMap(map, nodeName, mapContent);<NEW_LINE>}<NEW_LINE>if (!ADD_ATTRIBUTES_FIRST) {<NEW_LINE>existing = mapContent;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>addValueToMap(map, nodeName, firstChildNodeVal);<NEW_LINE>}<NEW_LINE>goDeeper = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (goDeeper) {<NEW_LINE>Map<String, Object> valMap = xmlToMap(childNodes, existing);<NEW_LINE>if (existing == null) {<NEW_LINE>addValueToMap(map, nodeName, valMap);<NEW_LINE>}<NEW_LINE>if (!ADD_ATTRIBUTES_FIRST) {<NEW_LINE>existing = valMap;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasAttributes && !ADD_ATTRIBUTES_FIRST) {<NEW_LINE>attributesToMap(map, node, nodeName, existing);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>} | <String, Object> existing = null; |
1,419,484 | public List<ValidateError> validate(Map<String, String> values) {<NEW_LINE>List<ValidateError> errors = new ArrayList<>();<NEW_LINE>Validator validator;<NEW_LINE>ValidateError error;<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(values.get("knowledgeId"), convLabelName("Knowledge Id"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(values.get("groupId"), convLabelName("Group Id"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(values.get("groupId"), convLabelName("Group Id"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(values.get("insertUser"), convLabelName("Insert User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = <MASK><NEW_LINE>error = validator.validate(values.get("updateUser"), convLabelName("Update User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(values.get("deleteFlag"), convLabelName("Delete Flag"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>} | ValidatorFactory.getInstance(Validator.INTEGER); |
410,710 | private void createBootNodeInfo(final boolean skipPlugins) throws JsonProcessingException {<NEW_LINE>final <MASK><NEW_LINE>final Iterable<PluginInfo> rawPluginInfo = skipPlugins ? ImmutableList.<PluginInfo>of() : pluginInfoApi.getPluginsInfo();<NEW_LINE>final List<PluginInfo> pluginInfo = rawPluginInfo.iterator().hasNext() ? ImmutableList.<PluginInfo>copyOf(rawPluginInfo) : ImmutableList.<PluginInfo>of();<NEW_LINE>final String kbVersion = org.killbill.billing.util.nodes.KillbillVersions.getKillbillVersion();<NEW_LINE>final String kbApiVersion = org.killbill.billing.util.nodes.KillbillVersions.getApiVersion();<NEW_LINE>final String kbPluginApiVersion = org.killbill.billing.util.nodes.KillbillVersions.getPluginApiVersion();<NEW_LINE>final String kbPlatformVersion = org.killbill.billing.util.nodes.KillbillVersions.getPlatformVersion();<NEW_LINE>final String kbCommonVersion = org.killbill.billing.util.nodes.KillbillVersions.getCommonVersion();<NEW_LINE>final NodeInfoModelJson nodeInfo = new NodeInfoModelJson(CreatorName.get(), bootTime, bootTime, kbVersion, kbApiVersion, kbPluginApiVersion, kbCommonVersion, kbPlatformVersion, ImmutableList.copyOf(Iterables.transform(pluginInfo, new Function<PluginInfo, PluginInfoModelJson>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public PluginInfoModelJson apply(final PluginInfo input) {<NEW_LINE>return new PluginInfoModelJson(input);<NEW_LINE>}<NEW_LINE>})));<NEW_LINE>final String nodeInfoValue = mapper.serializeNodeInfo(nodeInfo);<NEW_LINE>final NodeInfoModelDao bootNodeInfo = new NodeInfoModelDao(CreatorName.get(), clock.getUTCNow(), nodeInfoValue);<NEW_LINE>nodeInfoDao.create(bootNodeInfo);<NEW_LINE>} | DateTime bootTime = clock.getUTCNow(); |
1,005,643 | private Mono<Response<SyncAgentKeyPropertiesInner>> generateKeyWithResponseAsync(String resourceGroupName, String serverName, String syncAgentName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (serverName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (syncAgentName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter syncAgentName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2015-05-01-preview";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.generateKey(this.client.getEndpoint(), resourceGroupName, serverName, syncAgentName, this.client.<MASK><NEW_LINE>} | getSubscriptionId(), apiVersion, context); |
727,535 | public static AbstractProcess execute(String[] tokens, AbstractFile currentDirectory, ProcessListener listener, String encoding) throws IOException {<NEW_LINE>AbstractProcess process;<NEW_LINE>// If currentDirectory is null, use the VM's current directory.<NEW_LINE>if (currentDirectory == null) {<NEW_LINE>currentDirectory = FileFactory.getFile(System.getProperty("user.dir"), true);<NEW_LINE>} else {<NEW_LINE>// If currentDirectory is not on a local filesytem, use the user's home.<NEW_LINE>if (!currentDirectory.hasAncestor(LocalFile.class)) {<NEW_LINE>currentDirectory = FileFactory.getFile(System.getProperty("user.home"), true);<NEW_LINE>} else // If currentDirectory is not a directory (e.g. an archive entry)<NEW_LINE>{<NEW_LINE>while (currentDirectory != null && !currentDirectory.isDirectory()) currentDirectory = currentDirectory.getParent();<NEW_LINE>// This shouldn't normally happen<NEW_LINE>if (currentDirectory == null)<NEW_LINE>currentDirectory = FileFactory.getFile(System<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// // Register a debug process listener.<NEW_LINE>// if(listener == null)<NEW_LINE>// listener = new DebugProcessListener(tokens);<NEW_LINE>// Starts the process.<NEW_LINE>process = new LocalProcess(tokens, (java.io.File) currentDirectory.getUnderlyingFileObject());<NEW_LINE>if (!Arrays.stream(UNMONITORED_COMMANDS).anyMatch(tokens[0]::equals))<NEW_LINE>process.startMonitoring(listener, encoding);<NEW_LINE>return process;<NEW_LINE>} | .getProperty("user.dir"), true); |
569,504 | public void longClickHashtag() {<NEW_LINE>AlertDialog.Builder builder = getBuilder();<NEW_LINE>builder.setItems(R.array.long_click_hashtag, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialogInterface, int i) {<NEW_LINE>switch(i) {<NEW_LINE>case // search hashtag<NEW_LINE>0:<NEW_LINE>TouchableSpan.this.onClick(null);<NEW_LINE>break;<NEW_LINE>case // mute hashtag<NEW_LINE>1:<NEW_LINE>SharedPreferences sharedPreferences = mContext.getSharedPreferences("com.klinker.android.twitter_world_preferences", 0);<NEW_LINE>Toast.makeText(mContext, mContext.getResources().getString(R.string.muted) + " " + full, Toast.LENGTH_SHORT).show();<NEW_LINE>String item = full.replace("#", "") + " ";<NEW_LINE>String current = sharedPreferences.getString("muted_hashtags", "");<NEW_LINE>sharedPreferences.edit().putString("muted_hashtags", current + item).commit();<NEW_LINE>sharedPreferences.edit().putBoolean(<MASK><NEW_LINE>if (mContext instanceof DrawerActivity) {<NEW_LINE>((Activity) mContext).recreate();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case // copy hashtag<NEW_LINE>2:<NEW_LINE>copy();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.create().show();<NEW_LINE>} | "refresh_me", true).commit(); |
143,720 | public void migrate() throws IOException, SAXException, ParserConfigurationException {<NEW_LINE>DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();<NEW_LINE>DocumentBuilder builder = factory.newDocumentBuilder();<NEW_LINE>Document document = builder.parse(settingsFile.toFile());<NEW_LINE>document<MASK><NEW_LINE>var root = document.getDocumentElement();<NEW_LINE>var systemNodeList = root.getElementsByTagName("system");<NEW_LINE>if (systemNodeList.getLength() == 0) {<NEW_LINE>logger.error("root element is empty");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var systemNode = systemNodeList.item(0);<NEW_LINE>var systemChildNodeList = systemNode.getChildNodes();<NEW_LINE>for (int temp = 0; temp < systemChildNodeList.getLength(); temp++) {<NEW_LINE>Node node = systemChildNodeList.item(temp);<NEW_LINE>if (node.getNodeType() == Node.ELEMENT_NODE) {<NEW_LINE>Element element = (Element) node;<NEW_LINE>var nodeName = element.getNodeName();<NEW_LINE>switch(nodeName) {<NEW_LINE>case "Bandwidthmonitor-visible" -><NEW_LINE>migrateBandwidthMonitorVisibility(element);<NEW_LINE>case "Tray-anzeigen" -><NEW_LINE>migrateShowTray(element);<NEW_LINE>case // kein Fehler!!!<NEW_LINE>"system-anz-tage-filmilste" -><NEW_LINE>migrateFilmListAnzTage(element);<NEW_LINE>case "maxDownload" -><NEW_LINE>migrateMaxNumDownloads(element);<NEW_LINE>case "system-panel-videoplayer-anzeigen" -><NEW_LINE>migrateSystemPanelVideoplayerAnzeigen(element);<NEW_LINE>case "Blacklist-Geo-nicht-anzeigen" -><NEW_LINE>migrateDoNotShowGeoFilms(element);<NEW_LINE>case "Groesse-Einstellungen" -><NEW_LINE>migrateSettingsDialogSize(element);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getDocumentElement().normalize(); |
1,686,834 | private // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>sourceLabel = new javax.swing.JLabel();<NEW_LINE>sourceCombo = new javax.swing.JComboBox();<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(sourceLabel, NbBundle.getBundle(AdditionalWizardPanel.class).getString("LBL_Source"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>add(sourceLabel, gridBagConstraints);<NEW_LINE>sourceCombo.setRenderer(new SourceWizardPanel.DataObjectListCellRenderer());<NEW_LINE>sourceCombo.addActionListener(new java.awt.event.ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>sourceComboActionPerformed(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(<MASK><NEW_LINE>add(sourceCombo, gridBagConstraints);<NEW_LINE>} | 0, 11, 0, 0); |
1,280,865 | public Request<ListChannelFlowsRequest> marshall(ListChannelFlowsRequest listChannelFlowsRequest) {<NEW_LINE>if (listChannelFlowsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListChannelFlowsRequest)");<NEW_LINE>}<NEW_LINE>Request<ListChannelFlowsRequest> request = new DefaultRequest<ListChannelFlowsRequest>(listChannelFlowsRequest, "AmazonChimeSDKMessaging");<NEW_LINE><MASK><NEW_LINE>String uriResourcePath = "/channel-flows";<NEW_LINE>if (listChannelFlowsRequest.getAppInstanceArn() != null) {<NEW_LINE>request.addParameter("app-instance-arn", StringUtils.fromString(listChannelFlowsRequest.getAppInstanceArn()));<NEW_LINE>}<NEW_LINE>if (listChannelFlowsRequest.getMaxResults() != null) {<NEW_LINE>request.addParameter("max-results", StringUtils.fromInteger(listChannelFlowsRequest.getMaxResults()));<NEW_LINE>}<NEW_LINE>if (listChannelFlowsRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("next-token", StringUtils.fromString(listChannelFlowsRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>String encodedUriResourcePath = "/channel-flows";<NEW_LINE>request.setEncodedResourcePath(encodedUriResourcePath);<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.0");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.setHttpMethod(HttpMethodName.GET); |
784,338 | public DescribeDetectorResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeDetectorResult describeDetectorResult = new DescribeDetectorResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeDetectorResult;<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("detector", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeDetectorResult.setDetector(DetectorJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeDetectorResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
973,899 | private static void addMenuUnwatched(String id) {<NEW_LINE><MASK><NEW_LINE>UIManager uim = pi.getUIManager();<NEW_LINE>MenuManager menuManager = uim.getMenuManager();<NEW_LINE>MenuItem menuItem = menuManager.addMenuItem("sidebar." + id, "v3.activity.button.watchall");<NEW_LINE>menuItem.setDisposeWithUIDetach(UIInstance.UIT_SWT);<NEW_LINE>menuItem.addListener(new MenuItemListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void selected(MenuItem menu, Object target) {<NEW_LINE>CoreWaiterSWT.waitForCore(TriggerInThread.ANY_THREAD, new CoreRunningListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void coreRunning(Core core) {<NEW_LINE>GlobalManager gm = core.getGlobalManager();<NEW_LINE>List<?> downloadManagers = gm.getDownloadManagers();<NEW_LINE>for (Iterator<?> iter = downloadManagers.iterator(); iter.hasNext(); ) {<NEW_LINE>DownloadManager dm = (DownloadManager) iter.next();<NEW_LINE>if (!PlatformTorrentUtils.getHasBeenOpened(dm) && dm.getAssumedComplete()) {<NEW_LINE>PlatformTorrentUtils.setHasBeenOpened(dm, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | PluginInterface pi = PluginInitializer.getDefaultInterface(); |
1,286,901 | public DataSegment move(DataSegment segment, Map<String, Object> targetLoadSpec) throws SegmentLoadingException {<NEW_LINE>try {<NEW_LINE>Map<String, Object> loadSpec = segment.getLoadSpec();<NEW_LINE>String bucket = MapUtils.getString(loadSpec, "bucket");<NEW_LINE>String key = MapUtils.getString(loadSpec, "key");<NEW_LINE>final String targetBucket = MapUtils.getString(targetLoadSpec, "bucket");<NEW_LINE>final String targetKey = MapUtils.getString(targetLoadSpec, "baseKey");<NEW_LINE>final String targetPath = OssUtils.constructSegmentPath(targetKey, DataSegmentPusher<MASK><NEW_LINE>if (targetBucket.isEmpty()) {<NEW_LINE>throw new SegmentLoadingException("Target OSS bucket is not specified");<NEW_LINE>}<NEW_LINE>if (targetPath.isEmpty()) {<NEW_LINE>throw new SegmentLoadingException("Target OSS baseKey is not specified");<NEW_LINE>}<NEW_LINE>safeMove(bucket, key, targetBucket, targetPath);<NEW_LINE>return segment.withLoadSpec(ImmutableMap.<String, Object>builder().putAll(Maps.filterKeys(loadSpec, new Predicate<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean apply(String input) {<NEW_LINE>return !("bucket".equals(input) || "key".equals(input));<NEW_LINE>}<NEW_LINE>})).put("bucket", targetBucket).put("key", targetPath).build());<NEW_LINE>} catch (OSSException e) {<NEW_LINE>throw new SegmentLoadingException(e, "Unable to move segment[%s]: [%s]", segment.getId(), e);<NEW_LINE>}<NEW_LINE>} | .getDefaultStorageDir(segment, false)); |
1,365,060 | public synchronized void reportStorageEvents(Collection<StatsStorageEvent> events) {<NEW_LINE>for (StatsStorageEvent sse : events) {<NEW_LINE>if (StatsListener.TYPE_ID.equals(sse.getTypeID())) {<NEW_LINE>if (sse.getEventType() == StatsStorageListener.EventType.PostStaticInfo && StatsListener.TYPE_ID.equals(sse.getTypeID()) && !knownSessionIDs.containsKey(sse.getSessionID())) {<NEW_LINE>knownSessionIDs.put(sse.getSessionID(), sse.getStatsStorage());<NEW_LINE>if (VertxUIServer.getInstance().isMultiSession()) {<NEW_LINE>log.info("Adding training session {}/train/{} of StatsStorage instance {}", VertxUIServer.getInstance().getAddress(), sse.getSessionID(), sse.getStatsStorage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Long lastUpdate = lastUpdateForSession.get(sse.getSessionID());<NEW_LINE>if (lastUpdate == null) {<NEW_LINE>lastUpdateForSession.put(sse.getSessionID(), sse.getTimestamp());<NEW_LINE>} else if (sse.getTimestamp() > lastUpdate) {<NEW_LINE>// Should be thread safe - read only elsewhere<NEW_LINE>lastUpdateForSession.put(sse.getSessionID(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (currentSessionID == null)<NEW_LINE>getDefaultSession();<NEW_LINE>} | ), sse.getTimestamp()); |
1,164,753 | public synchronized long prepareForTransmission() {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "prepareForTransmission");<NEW_LINE>checkValid();<NEW_LINE>valid = false;<NEW_LINE>// Get the last buffer and flip it. Then we can simply return the list of buffers<NEW_LINE>if (dataList.size() > 0) {<NEW_LINE>WsByteBuffer buff = dataList.get(dataList.size() - 1);<NEW_LINE>buff.flip();<NEW_LINE>}<NEW_LINE>long sendAmount = 0;<NEW_LINE>for (int x = 0; x < dataList.size(); x++) {<NEW_LINE>WsByteBuffer buff = dataList.get(x);<NEW_LINE>sendAmount += buff.remaining();<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(this, tc, "prepareForTransmission"<MASK><NEW_LINE>return sendAmount;<NEW_LINE>} | , Long.valueOf(sendAmount)); |
1,547,984 | final ListEndpointsResult executeListEndpoints(ListEndpointsRequest listEndpointsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listEndpointsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListEndpointsRequest> request = null;<NEW_LINE>Response<ListEndpointsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListEndpointsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listEndpointsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListEndpoints");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListEndpointsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListEndpointsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,847,553 | private String renderSection(String sectionHeading, List<String> cmdNames, CommandLine.Help help) {<NEW_LINE>TextTable textTable = createTextTable(help);<NEW_LINE>for (String name : cmdNames) {<NEW_LINE>CommandSpec sub = help.commandSpec().subcommands().get(name).getCommandSpec();<NEW_LINE>// create comma-separated list of command name and aliases<NEW_LINE>String names = sub.names().toString();<NEW_LINE>// remove leading '[' and trailing ']'<NEW_LINE>names = names.substring(1, names.length() - 1);<NEW_LINE>// description may contain line separators; use Text::splitLines to handle this<NEW_LINE>String description = description(sub.usageMessage());<NEW_LINE>CommandLine.Help.Ansi.Text[] lines = help.colorScheme().text(description).splitLines();<NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>CommandLine.Help.Ansi.Text cmdNamesText = help.colorScheme().commandText(<MASK><NEW_LINE>textTable.addRowValues(cmdNamesText, lines[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return help.createHeading("%n" + sectionHeading + ":%n") + textTable.toString();<NEW_LINE>} | i == 0 ? names : ""); |
1,029,536 | private Mono<Response<Void>> upgradeWithResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, 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 (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (workspaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (integrationRuntimeName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-06-01-preview";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.upgrade(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
1,407,064 | public void configure(ConfigurableProvider provider) {<NEW_LINE>provider.addAlgorithm("AlgorithmParameters.CAMELLIA", PREFIX + "$AlgParams");<NEW_LINE>provider.addAlgorithm("Alg.Alias.AlgorithmParameters", NTTObjectIdentifiers.id_camellia128_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("Alg.Alias.AlgorithmParameters", NTTObjectIdentifiers.id_camellia192_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("Alg.Alias.AlgorithmParameters", NTTObjectIdentifiers.id_camellia256_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("AlgorithmParameterGenerator.CAMELLIA", PREFIX + "$AlgParamGen");<NEW_LINE>provider.addAlgorithm("Alg.Alias.AlgorithmParameterGenerator", NTTObjectIdentifiers.id_camellia128_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("Alg.Alias.AlgorithmParameterGenerator", NTTObjectIdentifiers.id_camellia192_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("Alg.Alias.AlgorithmParameterGenerator", NTTObjectIdentifiers.id_camellia256_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("Cipher.CAMELLIA", PREFIX + "$ECB");<NEW_LINE>provider.addAlgorithm("Cipher", NTTObjectIdentifiers.id_camellia128_cbc, PREFIX + "$CBC");<NEW_LINE>provider.addAlgorithm("Cipher", NTTObjectIdentifiers.id_camellia192_cbc, PREFIX + "$CBC");<NEW_LINE>provider.addAlgorithm("Cipher", NTTObjectIdentifiers.id_camellia256_cbc, PREFIX + "$CBC");<NEW_LINE>provider.addAlgorithm("Cipher.CAMELLIARFC3211WRAP", PREFIX + "$RFC3211Wrap");<NEW_LINE>provider.addAlgorithm("Cipher.CAMELLIAWRAP", PREFIX + "$Wrap");<NEW_LINE>provider.addAlgorithm("Alg.Alias.Cipher", NTTObjectIdentifiers.id_camellia128_wrap, "CAMELLIAWRAP");<NEW_LINE>provider.addAlgorithm("Alg.Alias.Cipher", NTTObjectIdentifiers.id_camellia192_wrap, "CAMELLIAWRAP");<NEW_LINE>provider.addAlgorithm("Alg.Alias.Cipher", NTTObjectIdentifiers.id_camellia256_wrap, "CAMELLIAWRAP");<NEW_LINE>provider.addAlgorithm("SecretKeyFactory.CAMELLIA", PREFIX + "$KeyFactory");<NEW_LINE>provider.addAlgorithm("Alg.Alias.SecretKeyFactory", NTTObjectIdentifiers.id_camellia128_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("Alg.Alias.SecretKeyFactory", NTTObjectIdentifiers.id_camellia192_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("Alg.Alias.SecretKeyFactory", NTTObjectIdentifiers.id_camellia256_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("KeyGenerator.CAMELLIA", PREFIX + "$KeyGen");<NEW_LINE>provider.addAlgorithm("KeyGenerator", NTTObjectIdentifiers.id_camellia128_wrap, PREFIX + "$KeyGen128");<NEW_LINE>provider.addAlgorithm("KeyGenerator", NTTObjectIdentifiers.id_camellia192_wrap, PREFIX + "$KeyGen192");<NEW_LINE>provider.addAlgorithm("KeyGenerator", NTTObjectIdentifiers.id_camellia256_wrap, PREFIX + "$KeyGen256");<NEW_LINE>provider.addAlgorithm("KeyGenerator", <MASK><NEW_LINE>provider.addAlgorithm("KeyGenerator", NTTObjectIdentifiers.id_camellia192_cbc, PREFIX + "$KeyGen192");<NEW_LINE>provider.addAlgorithm("KeyGenerator", NTTObjectIdentifiers.id_camellia256_cbc, PREFIX + "$KeyGen256");<NEW_LINE>addGMacAlgorithm(provider, "CAMELLIA", PREFIX + "$GMAC", PREFIX + "$KeyGen");<NEW_LINE>addPoly1305Algorithm(provider, "CAMELLIA", PREFIX + "$Poly1305", PREFIX + "$Poly1305KeyGen");<NEW_LINE>} | NTTObjectIdentifiers.id_camellia128_cbc, PREFIX + "$KeyGen128"); |
662,546 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>if (player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>FilterCard filter = new FilterCreatureCard("creature card with mana value X or less");<NEW_LINE>// Set the mana cost one higher to 'emulate' a less than or equal to comparison.<NEW_LINE>filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, source.getManaCostsToPay()<MASK><NEW_LINE>TargetCardInLibrary target = new TargetCardInLibrary(filter);<NEW_LINE>player.searchLibrary(target, source, game);<NEW_LINE>Card card = player.getLibrary().getCard(target.getFirstTarget(), game);<NEW_LINE>if (card != null) {<NEW_LINE>player.revealCards(source, new CardsImpl(card), game);<NEW_LINE>player.moveCards(card, Zone.HAND, source, game);<NEW_LINE>}<NEW_LINE>player.shuffleLibrary(source, game);<NEW_LINE>return true;<NEW_LINE>} | .getX() + 1)); |
442,702 | final UpdateResourceServerResult executeUpdateResourceServer(UpdateResourceServerRequest updateResourceServerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateResourceServerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateResourceServerRequest> request = null;<NEW_LINE>Response<UpdateResourceServerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateResourceServerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateResourceServerRequest));<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, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateResourceServer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateResourceServerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new UpdateResourceServerResultJsonUnmarshaller()); |
887,000 | public void read(DependencyInfo dependencyInfo, Path inPath, KeyValueConsumers consumers) {<NEW_LINE>Stopwatch timer = Stopwatch.createStarted();<NEW_LINE>try (ZipFile zipFile = new ZipFile(inPath.toFile())) {<NEW_LINE>ResourceContainer resourceContainer = readResourceContainer(zipFile, includeFileContentsForValidation);<NEW_LINE>VisibilityRegistry registry = computeResourceVisibility(resourceContainer);<NEW_LINE>for (ResourceTable resourceTable : resourceContainer.resourceTables()) {<NEW_LINE>consumeResourceTable(dependencyInfo, consumers, resourceTable, registry);<NEW_LINE>}<NEW_LINE>for (CompiledFileWithData compiledFile : resourceContainer.compiledFiles()) {<NEW_LINE>consumeCompiledFile(dependencyInfo, consumers, compiledFile, registry);<NEW_LINE>}<NEW_LINE>Enumeration<? extends ZipEntry> resourceFiles = zipFile.entries();<NEW_LINE>while (resourceFiles.hasMoreElements()) {<NEW_LINE>ZipEntry resourceFile = resourceFiles.nextElement();<NEW_LINE>String fileZipPath = resourceFile.getName();<NEW_LINE>try (InputStream resourceFileStream = zipFile.getInputStream(resourceFile)) {<NEW_LINE>if (fileZipPath.endsWith(CompiledResources.ATTRIBUTES_FILE_EXTENSION)) {<NEW_LINE>readAttributesFile(dependencyInfo, resourceFileStream, inPath.getFileSystem(), <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new DeserializationException("Error deserializing " + inPath, e);<NEW_LINE>} finally {<NEW_LINE>logger.fine(String.format("Deserialized in compiled merged in %sms", timer.elapsed(TimeUnit.MILLISECONDS)));<NEW_LINE>}<NEW_LINE>} | consumers.combiningConsumer, consumers.overwritingConsumer); |
806,904 | public com.amazonaws.services.securityhub.model.AccessDeniedException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.securityhub.model.AccessDeniedException accessDeniedException = new com.amazonaws.services.securityhub.model.AccessDeniedException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Code", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>accessDeniedException.setCode(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 accessDeniedException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,843,350 | protected void createSpecificButtons(final Container container) {<NEW_LINE>final AbstractAction replaceAllAction = new AbstractAction(TextUtils.getText("reminder.Replace_All")) {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 1L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(final ActionEvent arg0) {<NEW_LINE>replace(new HolderAccessor(), false);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final JButton replaceAllButton = new JButton(replaceAllAction);<NEW_LINE>final AbstractAction replaceSelectedAction = new AbstractAction(TextUtils.getText("reminder.Replace_Selected")) {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 1L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(final ActionEvent arg0) {<NEW_LINE>replace(new HolderAccessor(), true);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final JButton replaceSelectedButton = new JButton(replaceSelectedAction);<NEW_LINE>replaceSelectedAction.setEnabled(false);<NEW_LINE>container.add(replaceAllButton);<NEW_LINE>container.add(replaceSelectedButton);<NEW_LINE>final <MASK><NEW_LINE>rowSM1.addListSelectionListener(new ListSelectionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void valueChanged(final ListSelectionEvent e) {<NEW_LINE>if (e.getValueIsAdjusting()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ListSelectionModel lsm = (ListSelectionModel) e.getSource();<NEW_LINE>final boolean enable = !(lsm.isSelectionEmpty());<NEW_LINE>replaceSelectedAction.setEnabled(enable);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ListSelectionModel rowSM1 = tableView.getSelectionModel(); |
191,249 | public RouteResultsetNode build(boolean isHaveHintPlan2Inner) throws Exception {<NEW_LINE>TraceManager.TraceObject traceObject = TraceManager.serviceTrace(session.getShardingService(), "build&execute-complex-sql");<NEW_LINE>try {<NEW_LINE>final long startTime = System.nanoTime();<NEW_LINE>BaseHandlerBuilder builder = getBuilder(session, node, false);<NEW_LINE>DMLResponseHandler endHandler = builder.getEndHandler();<NEW_LINE>DMLResponseHandler fh = FinalHandlerFactory.createFinalHandler(session);<NEW_LINE>endHandler.setNextHandler(fh);<NEW_LINE>// set slave only into rrsNode<NEW_LINE>for (DMLResponseHandler startHandler : fh.getMerges()) {<NEW_LINE>MultiNodeMergeHandler mergeHandler = (MultiNodeMergeHandler) startHandler;<NEW_LINE>for (BaseSelectHandler baseHandler : mergeHandler.getExeHandlers()) {<NEW_LINE>baseHandler.getRrss().setRunOnSlave(this.session.getComplexRrs().getRunOnSlave());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>session.endComplexRoute();<NEW_LINE>RouteResultsetNode routeSingleNode = getTryRouteSingleNode(builder, isHaveHintPlan2Inner);<NEW_LINE>if (routeSingleNode != null)<NEW_LINE>return routeSingleNode;<NEW_LINE>HandlerBuilder.startHandler(fh);<NEW_LINE>session.endComplexExecute();<NEW_LINE>long endTime = System.nanoTime();<NEW_LINE>LOGGER.debug("HandlerBuilder.build cost:" + (endTime - startTime));<NEW_LINE>session.setTraceBuilder(builder);<NEW_LINE>} finally {<NEW_LINE>TraceManager.finishSpan(<MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | session.getShardingService(), traceObject); |
39,568 | public static Map<String, RoleDescriptor> parseRoleDescriptors(Path path, Logger logger, boolean resolvePermission, Settings settings, NamedXContentRegistry xContentRegistry) {<NEW_LINE>if (logger == null) {<NEW_LINE>logger = NoOpLogger.INSTANCE;<NEW_LINE>}<NEW_LINE>Map<String, RoleDescriptor> <MASK><NEW_LINE>logger.trace("attempting to read roles file located at [{}]", path.toAbsolutePath());<NEW_LINE>if (Files.exists(path)) {<NEW_LINE>try {<NEW_LINE>List<String> roleSegments = roleSegments(path);<NEW_LINE>for (String segment : roleSegments) {<NEW_LINE>RoleDescriptor rd = parseRoleDescriptor(segment, path, logger, resolvePermission, settings, xContentRegistry);<NEW_LINE>if (rd != null) {<NEW_LINE>roles.put(rd.getName(), rd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>logger.error((Supplier<?>) () -> new ParameterizedMessage("failed to read roles file [{}]. skipping all roles...", path.toAbsolutePath()), ioe);<NEW_LINE>return emptyMap();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return unmodifiableMap(roles);<NEW_LINE>} | roles = new HashMap<>(); |
1,368,253 | synchronized void removeAndShift(int firstParagraph, int lastParagraph, int shift) {<NEW_LINE>if (lastParagraph < firstParagraph || shift == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int i = firstParagraph; i < lastParagraph - shift - 1; i++) {<NEW_LINE>entries.remove(i);<NEW_LINE>}<NEW_LINE>Map<Integer, CacheEntry> tmpEntries = entries;<NEW_LINE>entries = Collections.synchronizedMap(new HashMap<>());<NEW_LINE>synchronized (tmpEntries) {<NEW_LINE>if (shift > 0) {<NEW_LINE>for (int i : tmpEntries.keySet()) {<NEW_LINE>if (i >= firstParagraph) {<NEW_LINE>entries.put(i + shift, tmpEntries.get(i));<NEW_LINE>} else {<NEW_LINE>entries.put(i, tmpEntries.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i : tmpEntries.keySet()) {<NEW_LINE>if (i >= lastParagraph && i + shift >= 0) {<NEW_LINE>entries.put(i + shift<MASK><NEW_LINE>} else if (i < firstParagraph) {<NEW_LINE>entries.put(i, tmpEntries.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , tmpEntries.get(i)); |
1,334,265 | // This method should be invoked with duplicates of dst/src Buffers<NEW_LINE>public void rgbFromBuffer(ByteBuffer dst, ByteBuffer src, int w, int stride, int h) {<NEW_LINE>if (is888()) {<NEW_LINE>// Optimised common case<NEW_LINE>int r, g, b;<NEW_LINE>if (bigEndian) {<NEW_LINE>r = src.position() + (24 - redShift) / 8;<NEW_LINE>g = src.position() + (24 - greenShift) / 8;<NEW_LINE>b = src.position() + (24 - blueShift) / 8;<NEW_LINE>} else {<NEW_LINE>r = src.position() + redShift / 8;<NEW_LINE>g = src.position() + greenShift / 8;<NEW_LINE>b = src.position() + blueShift / 8;<NEW_LINE>}<NEW_LINE>int srcPad = (stride - w) * 4;<NEW_LINE>while (h-- > 0) {<NEW_LINE>int w_ = w;<NEW_LINE>while (w_-- > 0) {<NEW_LINE>dst.put(src.get(r));<NEW_LINE>dst.put(src.get(g));<NEW_LINE>dst.put(src.get(b));<NEW_LINE>r += 4;<NEW_LINE>g += 4;<NEW_LINE>b += 4;<NEW_LINE>}<NEW_LINE>r += srcPad;<NEW_LINE>g += srcPad;<NEW_LINE>b += srcPad;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Generic code<NEW_LINE>int srcPad = (stride - w) * bpp / 8;<NEW_LINE>while (h-- > 0) {<NEW_LINE>int w_ = w;<NEW_LINE>while (w_-- > 0) {<NEW_LINE>int p;<NEW_LINE>byte r, g, b;<NEW_LINE>p = pixelFromBuffer(src.duplicate());<NEW_LINE>r = (byte) getColorModel().getRed(p);<NEW_LINE>g = (byte) <MASK><NEW_LINE>b = (byte) getColorModel().getBlue(p);<NEW_LINE>dst.put(r);<NEW_LINE>dst.put(g);<NEW_LINE>dst.put(b);<NEW_LINE>src.position(src.position() + bpp / 8);<NEW_LINE>}<NEW_LINE>src.position(src.position() + srcPad);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getColorModel().getGreen(p); |
60,267 | public static ListDeviceDetailResponse unmarshall(ListDeviceDetailResponse listDeviceDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDeviceDetailResponse.setRequestId(_ctx.stringValue("ListDeviceDetailResponse.RequestId"));<NEW_LINE>listDeviceDetailResponse.setCode(_ctx.stringValue("ListDeviceDetailResponse.Code"));<NEW_LINE>listDeviceDetailResponse.setMessage(_ctx.stringValue("ListDeviceDetailResponse.Message"));<NEW_LINE>listDeviceDetailResponse.setPageNumber(_ctx.longValue("ListDeviceDetailResponse.PageNumber"));<NEW_LINE>listDeviceDetailResponse.setPageSize(_ctx.longValue("ListDeviceDetailResponse.PageSize"));<NEW_LINE>listDeviceDetailResponse.setTotalCount(_ctx.longValue("ListDeviceDetailResponse.TotalCount"));<NEW_LINE>List<Datas> data <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDeviceDetailResponse.Data.Length"); i++) {<NEW_LINE>Datas datas = new Datas();<NEW_LINE>datas.setDataSourceId(_ctx.stringValue("ListDeviceDetailResponse.Data[" + i + "].DataSourceId"));<NEW_LINE>datas.setCorpId(_ctx.stringValue("ListDeviceDetailResponse.Data[" + i + "].CorpId"));<NEW_LINE>datas.setDataSourceName(_ctx.stringValue("ListDeviceDetailResponse.Data[" + i + "].DataSourceName"));<NEW_LINE>datas.setDataSourcePoi(_ctx.stringValue("ListDeviceDetailResponse.Data[" + i + "].DataSourcePoi"));<NEW_LINE>datas.setNearPoi(_ctx.stringValue("ListDeviceDetailResponse.Data[" + i + "].NearPoi"));<NEW_LINE>datas.setLatitude(_ctx.stringValue("ListDeviceDetailResponse.Data[" + i + "].Latitude"));<NEW_LINE>datas.setLongitude(_ctx.stringValue("ListDeviceDetailResponse.Data[" + i + "].Longitude"));<NEW_LINE>data.add(datas);<NEW_LINE>}<NEW_LINE>listDeviceDetailResponse.setData(data);<NEW_LINE>return listDeviceDetailResponse;<NEW_LINE>} | = new ArrayList<Datas>(); |
426,336 | public static boolean checkFrameHeaderFromPeek(ExtractorInput input, FlacStreamMetadata flacStreamMetadata, int frameStartMarker, SampleNumberHolder sampleNumberHolder) throws IOException, InterruptedException {<NEW_LINE>long originalPeekPosition = input.getPeekPosition();<NEW_LINE>byte[] frameStartBytes = new byte[2];<NEW_LINE>input.peekFully(frameStartBytes, 0, 2);<NEW_LINE>int frameStart = (frameStartBytes[0] & 0xFF) << 8 | (frameStartBytes[1] & 0xFF);<NEW_LINE>if (frameStart != frameStartMarker) {<NEW_LINE>input.resetPeekPosition();<NEW_LINE>input.advancePeekPosition((int) (originalPeekPosition <MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>ParsableByteArray scratch = new ParsableByteArray(FlacConstants.MAX_FRAME_HEADER_SIZE);<NEW_LINE>System.arraycopy(frameStartBytes, /* srcPos= */<NEW_LINE>0, scratch.data, /* destPos= */<NEW_LINE>0, /* length= */<NEW_LINE>2);<NEW_LINE>int totalBytesPeeked = ExtractorUtil.peekToLength(input, scratch.data, 2, FlacConstants.MAX_FRAME_HEADER_SIZE - 2);<NEW_LINE>scratch.setLimit(totalBytesPeeked);<NEW_LINE>input.resetPeekPosition();<NEW_LINE>input.advancePeekPosition((int) (originalPeekPosition - input.getPosition()));<NEW_LINE>return checkAndReadFrameHeader(scratch, flacStreamMetadata, frameStartMarker, sampleNumberHolder);<NEW_LINE>} | - input.getPosition())); |
690,585 | private void parseFromBtcLockSender(BtcLockSender btcLockSender) {<NEW_LINE>this.protocolVersion = 0;<NEW_LINE>this.rskDestinationAddress = btcLockSender.getRskAddress();<NEW_LINE>this.btcRefundAddress = btcLockSender.getBTCAddress();<NEW_LINE>this.senderBtcAddress = btcLockSender.getBTCAddress();<NEW_LINE>this<MASK><NEW_LINE>logger.trace("[parseFromBtcLockSender] Protocol version: {}", this.protocolVersion);<NEW_LINE>logger.trace("[parseFromBtcLockSender] RSK destination address: {}", btcLockSender.getRskAddress());<NEW_LINE>logger.trace("[parseFromBtcLockSender] BTC refund address: {}", btcLockSender.getBTCAddress());<NEW_LINE>logger.trace("[parseFromBtcLockSender] Sender BTC address: {}", btcLockSender.getBTCAddress());<NEW_LINE>logger.trace("[parseFromBtcLockSender] Sender BTC address type: {}", btcLockSender.getTxSenderAddressType());<NEW_LINE>} | .senderBtcAddressType = btcLockSender.getTxSenderAddressType(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.