idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
557,585 | private void loadDefaults(boolean listen) {<NEW_LINE>ClassLoader cl = AntBridge.getMainClassLoader();<NEW_LINE>InputStream taskDefaults = cl.getResourceAsStream("org/apache/tools/ant/taskdefs/defaults.properties");<NEW_LINE>if (taskDefaults != null) {<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>defaults.load(taskDefaults, "task", cl);<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>AntModule.err.log("Could not load default taskdefs");<NEW_LINE>AntModule.err.notify(ioe);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>InputStream typeDefaults = cl.getResourceAsStream("org/apache/tools/ant/types/defaults.properties");<NEW_LINE>if (typeDefaults != null) {<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>defaults.load(typeDefaults, "type", cl);<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>AntModule.err.log("Could not load default typedefs");<NEW_LINE>AntModule.err.notify(ioe);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>AntModule.err.log("Could not open default typedefs");<NEW_LINE>}<NEW_LINE>defaults.loadNetBeansSpecificDefinitions();<NEW_LINE>if (listen) {<NEW_LINE>AntBridge.addChangeListener(WeakListeners.change(antBridgeListener, AntBridge.class));<NEW_LINE>}<NEW_LINE>if (AntModule.err.isLoggable(ErrorManager.INFORMATIONAL)) {<NEW_LINE>AntModule.err.log("IntrospectedInfo.defaults=" + defaults);<NEW_LINE>}<NEW_LINE>} | AntModule.err.log("Could not open default taskdefs"); |
1,708,785 | void decode(Decoder decoder, Instruction instruction) {<NEW_LINE>instruction.setCode(code);<NEW_LINE>int regNum0 = (decoder.state_reg + decoder.state_zs_extraRegisterBase + decoder.state_extraRegisterBaseEVEX);<NEW_LINE>instruction.setOp0Register(regNum0 + baseReg);<NEW_LINE>instruction.setOp1Register(decoder.state_vvvv + baseReg);<NEW_LINE>if (decoder.state_mod == 3) {<NEW_LINE>int regNum2 = (decoder.state_rm + decoder.state_extraBaseRegisterBaseEVEX);<NEW_LINE>instruction.setOp2Register(regNum2 + baseReg);<NEW_LINE>if (decoder.invalidCheckMask != 0 && (regNum0 == decoder.state_vvvv || regNum0 == regNum2))<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>if ((decoder.state_zs_flags & StateFlags.B) != 0) {<NEW_LINE>instruction.setRoundingControl(decoder.state_vectorLength + RoundingControl.ROUND_TO_NEAREST);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (decoder.invalidCheckMask != 0 && regNum0 == decoder.state_vvvv)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>instruction.setOp2Kind(OpKind.MEMORY);<NEW_LINE>if ((decoder.state_zs_flags & StateFlags.B) != 0) {<NEW_LINE>if (canBroadcast)<NEW_LINE>instruction.setBroadcast(true);<NEW_LINE>else if (decoder.invalidCheckMask != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | decoder.readOpMem(instruction, tupleType); |
843,519 | public String handleRequest(SQSEvent event, Context context) {<NEW_LINE>String response = new String();<NEW_LINE>// call Lambda API<NEW_LINE>logger.info("Getting account settings");<NEW_LINE>CompletableFuture<GetAccountSettingsResponse> accountSettings = lambdaClient.getAccountSettings(GetAccountSettingsRequest.builder().build());<NEW_LINE>// log execution details<NEW_LINE>logger.info("ENVIRONMENT VARIABLES: {}", gson.toJson(System.getenv()));<NEW_LINE>logger.info("CONTEXT: {}", gson.toJson(context));<NEW_LINE>logger.info("EVENT: {}", gson.toJson(event));<NEW_LINE>// process event<NEW_LINE>for (SQSMessage msg : event.getRecords()) {<NEW_LINE>logger.<MASK><NEW_LINE>}<NEW_LINE>// process Lambda API response<NEW_LINE>try {<NEW_LINE>GetAccountSettingsResponse settings = accountSettings.get();<NEW_LINE>response = gson.toJson(settings.accountUsage());<NEW_LINE>logger.info("Account usage: {}", response);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.getStackTrace();<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | info(msg.getBody()); |
514,167 | private Mono<Response<Flux<ByteBuffer>>> deletePublicIpWithResponseAsync(String resourceGroupName, String publicIpId, String privateCloudName, 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.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (publicIpId == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (privateCloudName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.deletePublicIp(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), publicIpId, privateCloudName, accept, context);<NEW_LINE>} | this.client.mergeContext(context); |
386,254 | public String putRecordingTextTrack(String recordId, String kind, String lang, File file, String label, String origFilename, String trackId, String contentType, String tempFilename) {<NEW_LINE>Map<String, Object> logData = new HashMap<>();<NEW_LINE>logData.put("recordId", recordId);<NEW_LINE><MASK><NEW_LINE>logData.put("lang", lang);<NEW_LINE>logData.put("label", label);<NEW_LINE>logData.put("origFilename", origFilename);<NEW_LINE>logData.put("contentType", contentType);<NEW_LINE>logData.put("tempFilename", tempFilename);<NEW_LINE>logData.put("logCode", "recording_captions_uploaded");<NEW_LINE>logData.put("description", "Captions for recording uploaded.");<NEW_LINE>Gson gson = new Gson();<NEW_LINE>String logStr = gson.toJson(logData);<NEW_LINE>log.info(" --analytics-- data={}", logStr);<NEW_LINE>UploadedTrack track = new UploadedTrack(recordId, kind, lang, label, origFilename, file, trackId, getCaptionTrackInboxDir(), contentType, tempFilename);<NEW_LINE>return recordingService.putRecordingTextTrack(track);<NEW_LINE>} | logData.put("kind", kind); |
78,686 | private void chooseWorkspacePath() {<NEW_LINE>FileChooserDescriptor descriptor = // Show root project view file<NEW_LINE>new FileChooserDescriptor(true, false, false, false, false, false).// Show root project view file<NEW_LINE>withShowHiddenFiles(true).withHideIgnored(false).withTitle("Select Project View File").withDescription("Select a project view file to import.").withFileFilter(virtualFile -> ProjectViewStorageManager.isProjectViewFile(new File(virtualFile.getPath())));<NEW_LINE>// File filters are broken for the native Mac file chooser.<NEW_LINE>descriptor.setForcedToUseIdeaFileChooser(true);<NEW_LINE>FileChooserDialog chooser = FileChooserFactory.getInstance().createFileChooser(descriptor, null, null);<NEW_LINE>WorkspacePathResolver workspacePathResolver = builder.getWorkspaceData().workspacePathResolver();<NEW_LINE>File fileBrowserRoot = builder.getWorkspaceData().fileBrowserRoot();<NEW_LINE>File startingLocation = fileBrowserRoot;<NEW_LINE>String projectViewPath = getProjectViewPath();<NEW_LINE>if (!projectViewPath.isEmpty()) {<NEW_LINE>// If the user has typed part of the path then clicked the '...', try to start from the<NEW_LINE>// partial state<NEW_LINE>projectViewPath = StringUtil.trimEnd(projectViewPath, '/');<NEW_LINE>if (WorkspacePath.isValid(projectViewPath)) {<NEW_LINE>File fileLocation = workspacePathResolver.resolveToFile(new WorkspacePath(projectViewPath));<NEW_LINE>if (fileLocation.exists() && FileUtil.isAncestor(fileBrowserRoot, fileLocation, true)) {<NEW_LINE>startingLocation = fileLocation;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>VirtualFile toSelect = LocalFileSystem.getInstance().refreshAndFindFileByPath(startingLocation.getPath());<NEW_LINE>VirtualFile[] files = chooser.choose(null, toSelect);<NEW_LINE>if (files.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>VirtualFile file = files[0];<NEW_LINE>if (!FileUtil.startsWith(file.getPath(), fileBrowserRoot.getPath())) {<NEW_LINE>Messages.showErrorDialog(String.format("You must choose a project view file under %s. " + "To use an external project view, please use the 'Copy external' option.", fileBrowserRoot.getPath()), "Cannot Use Project View File");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String newWorkspacePath = FileUtil.getRelativePath(fileBrowserRoot, new File<MASK><NEW_LINE>projectViewPathField.setText(newWorkspacePath);<NEW_LINE>} | (file.getPath())); |
657,796 | double leftLabelPadding() {<NEW_LINE>double leftPadding = super.leftLabelPadding();<NEW_LINE>// RT-27167: we must take into account the disclosure node and the<NEW_LINE>// indentation (which is not taken into account by the LabeledSkinBase.<NEW_LINE>final double height = getCellSize();<NEW_LINE>TreeTableCell<S, T> cell = getSkinnable();<NEW_LINE>TreeTableColumn<S, T> tableColumn = cell.getTableColumn();<NEW_LINE>if (tableColumn == null)<NEW_LINE>return leftPadding;<NEW_LINE>// check if this column is the TreeTableView treeColumn (i.e. the<NEW_LINE>// column showing the disclosure node and graphic).<NEW_LINE>TreeTableView<S> treeTable = cell.getTreeTableView();<NEW_LINE>if (treeTable == null)<NEW_LINE>return leftPadding;<NEW_LINE>int columnIndex = treeTable.getVisibleLeafIndex(tableColumn);<NEW_LINE>TreeTableColumn<S, ?> treeColumn = treeTable.getTreeColumn();<NEW_LINE>if ((treeColumn == null && columnIndex != 0) || (treeColumn != null && !tableColumn.equals(treeColumn))) {<NEW_LINE>return leftPadding;<NEW_LINE>}<NEW_LINE>TreeTableRow<S> treeTableRow = cell.getTreeTableRow();<NEW_LINE>if (treeTableRow == null)<NEW_LINE>return leftPadding;<NEW_LINE>TreeItem<S> treeItem = treeTableRow.getTreeItem();<NEW_LINE>if (treeItem == null)<NEW_LINE>return leftPadding;<NEW_LINE>int nodeLevel = treeTable.getTreeItemLevel(treeItem);<NEW_LINE>if (!treeTable.isShowRoot())<NEW_LINE>nodeLevel--;<NEW_LINE>double indentPerLevel = 13.0;<NEW_LINE>// if (treeTableRow.getSkin() instanceof javafx.scene.control.skin.TreeTableRowSkin) {<NEW_LINE>// indentPerLevel = ((javafx.scene.control.skin.TreeTableRowSkin<?>)treeTableRow.getSkin()).getIndentationPerLevel();<NEW_LINE>// }<NEW_LINE>leftPadding += 10 + nodeLevel * indentPerLevel;<NEW_LINE>// add in the width of the disclosure node, if one exists<NEW_LINE>Map<TableColumnBase<?, ?><MASK><NEW_LINE>leftPadding += mdwp.containsKey(treeColumn) ? mdwp.get(treeColumn) : 0;<NEW_LINE>// adding in the width of the graphic on the tree item<NEW_LINE>Node graphic = treeItem.getGraphic();<NEW_LINE>leftPadding += graphic == null ? 0 : graphic.prefWidth(height);<NEW_LINE>return leftPadding;<NEW_LINE>} | , Double> mdwp = TableRowSkinBase.maxDisclosureWidthMap; |
375,551 | private void processSelectControl(ControlFontPair pair, Control ctrl, PDAcroForm acro, int i, Box root) throws IOException {<NEW_LINE>PDComboBox field = new PDComboBox(acro);<NEW_LINE>setPartialNameToField(ctrl, field);<NEW_LINE>List<String> labels = new ArrayList<>();<NEW_LINE>List<String> values = new ArrayList<>();<NEW_LINE>String selectedLabel = populateOptions(ctrl.box.getElement(), labels, values, null);<NEW_LINE><MASK><NEW_LINE>field.setValue(selectedLabel);<NEW_LINE>field.setDefaultValue(selectedLabel);<NEW_LINE>FSColor color = ctrl.box.getStyle().getColor();<NEW_LINE>String colorOperator = getColorOperator(color);<NEW_LINE>String fontInstruction = "/" + pair.fontName + " 0 Tf";<NEW_LINE>field.setDefaultAppearance(fontInstruction + ' ' + colorOperator);<NEW_LINE>if (ctrl.box.getElement().hasAttribute("required")) {<NEW_LINE>field.setRequired(true);<NEW_LINE>}<NEW_LINE>if (ctrl.box.getElement().hasAttribute("readonly")) {<NEW_LINE>field.setReadOnly(true);<NEW_LINE>}<NEW_LINE>if (ctrl.box.getElement().hasAttribute("title")) {<NEW_LINE>field.setAlternateFieldName(ctrl.box.getElement().getAttribute("title"));<NEW_LINE>}<NEW_LINE>if (ctrl.box.getElement().getNodeName().equals("openhtmltopdf-combo")) {<NEW_LINE>field.setEdit(true);<NEW_LINE>field.setCombo(true);<NEW_LINE>}<NEW_LINE>PDAnnotationWidget widget = field.getWidgets().get(0);<NEW_LINE>Rectangle2D rect2D = PdfBoxFastLinkManager.createTargetArea(ctrl.c, ctrl.box, ctrl.pageHeight, ctrl.transform, root, od);<NEW_LINE>PDRectangle rect = new PDRectangle((float) rect2D.getMinX(), (float) rect2D.getMinY(), (float) rect2D.getWidth(), (float) rect2D.getHeight());<NEW_LINE>widget.setRectangle(rect);<NEW_LINE>widget.setPage(ctrl.page);<NEW_LINE>widget.setPrinted(true);<NEW_LINE>ctrl.page.getAnnotations().add(widget);<NEW_LINE>} | field.setOptions(values, labels); |
1,660,626 | public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException {<NEW_LINE>try {<NEW_LINE>final IRODSFileSystemAO fs = session.getClient();<NEW_LINE>final IRODSFile s = fs.getIRODSFileFactory().<MASK><NEW_LINE>if (!s.exists()) {<NEW_LINE>throw new NotfoundException(String.format("%s doesn't exist", file.getAbsolute()));<NEW_LINE>}<NEW_LINE>if (status.isExists()) {<NEW_LINE>delete.delete(Collections.singletonMap(renamed, status), connectionCallback, callback);<NEW_LINE>}<NEW_LINE>final IRODSFile d = fs.getIRODSFileFactory().instanceIRODSFile(renamed.getAbsolute());<NEW_LINE>s.renameTo(d);<NEW_LINE>return renamed;<NEW_LINE>} catch (JargonException e) {<NEW_LINE>throw new IRODSExceptionMappingService().map("Cannot rename {0}", e, file);<NEW_LINE>}<NEW_LINE>} | instanceIRODSFile(file.getAbsolute()); |
978,157 | public SparkSubmitJobDriver unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SparkSubmitJobDriver sparkSubmitJobDriver = new SparkSubmitJobDriver();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("entryPoint", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sparkSubmitJobDriver.setEntryPoint(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("entryPointArguments", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sparkSubmitJobDriver.setEntryPointArguments(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("sparkSubmitParameters", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sparkSubmitJobDriver.setSparkSubmitParameters(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 sparkSubmitJobDriver;<NEW_LINE>} | class).unmarshall(context)); |
892,708 | public ReplicaGlobalSecondaryIndexDescription unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ReplicaGlobalSecondaryIndexDescription replicaGlobalSecondaryIndexDescription = new ReplicaGlobalSecondaryIndexDescription();<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("IndexName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>replicaGlobalSecondaryIndexDescription.setIndexName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ProvisionedThroughputOverride", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>replicaGlobalSecondaryIndexDescription.setProvisionedThroughputOverride(ProvisionedThroughputOverrideJsonUnmarshaller.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 replicaGlobalSecondaryIndexDescription;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
427,818 | public void readSnapshot(HollowBlobInput in, OptionalBlobPartInput optionalParts, TypeFilter filter) throws IOException {<NEW_LINE>validateMemoryMode(in.getMemoryMode());<NEW_LINE>Map<String, HollowBlobInput> optionalPartInputs = null;<NEW_LINE>if (optionalParts != null)<NEW_LINE>optionalPartInputs = optionalParts.getInputsByPartName(in.getMemoryMode());<NEW_LINE>HollowBlobHeader header = readHeader(in, false);<NEW_LINE>List<HollowBlobOptionalPartHeader> partHeaders = readPartHeaders(header, optionalPartInputs, in.getMemoryMode());<NEW_LINE>List<HollowSchema> allSchemas = combineSchemas(header, partHeaders);<NEW_LINE>filter = filter.resolve(allSchemas);<NEW_LINE>notifyBeginUpdate();<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>int numStates = VarInt.readVInt(in);<NEW_LINE>Collection<String> typeNames = new TreeSet<>();<NEW_LINE>for (int i = 0; i < numStates; i++) {<NEW_LINE>String typeName = readTypeStateSnapshot(in, filter);<NEW_LINE>typeNames.add(typeName);<NEW_LINE>}<NEW_LINE>if (optionalPartInputs != null) {<NEW_LINE>for (Map.Entry<String, HollowBlobInput> optionalPartEntry : optionalPartInputs.entrySet()) {<NEW_LINE>numStates = VarInt.readVInt(optionalPartEntry.getValue());<NEW_LINE>for (int i = 0; i < numStates; i++) {<NEW_LINE>String typeName = readTypeStateSnapshot(<MASK><NEW_LINE>typeNames.add(typeName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>stateEngine.wireTypeStatesToSchemas();<NEW_LINE>long endTime = System.currentTimeMillis();<NEW_LINE>log.info("SNAPSHOT COMPLETED IN " + (endTime - startTime) + "ms");<NEW_LINE>log.info("TYPES: " + typeNames);<NEW_LINE>notifyEndUpdate();<NEW_LINE>stateEngine.afterInitialization();<NEW_LINE>} | optionalPartEntry.getValue(), filter); |
505,120 | public static <T> CompletableFuture<List<T>> runWithAvailableThreads(Executor executor, IntSupplier availableThreads, Collection<Supplier<T>> suppliers) throws RejectedExecutionException {<NEW_LINE>int threadsToUse = availableThreads.getAsInt();<NEW_LINE>if (threadsToUse < suppliers.size()) {<NEW_LINE>Iterable<List<Supplier<T>>> partitions = Iterables.partition(suppliers, suppliers.size() / threadsToUse);<NEW_LINE>ArrayList<CompletableFuture<List<T>>> futures = new <MASK><NEW_LINE>for (List<Supplier<T>> partition : partitions) {<NEW_LINE>Supplier<List<T>> executePartition = () -> Lists2.map(partition, Supplier::get);<NEW_LINE>futures.add(CompletableFutures.supplyAsync(executePartition, executor));<NEW_LINE>}<NEW_LINE>return CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).thenApply(aVoid -> {<NEW_LINE>ArrayList<T> finalResult = new ArrayList<>(suppliers.size());<NEW_LINE>for (CompletableFuture<List<T>> future : futures) {<NEW_LINE>finalResult.addAll(future.join());<NEW_LINE>}<NEW_LINE>return finalResult;<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>ArrayList<CompletableFuture<T>> futures = new ArrayList<>(suppliers.size());<NEW_LINE>for (Supplier<T> supplier : suppliers) {<NEW_LINE>futures.add(CompletableFutures.supplyAsync(supplier, executor));<NEW_LINE>}<NEW_LINE>return CompletableFutures.allAsList(futures);<NEW_LINE>}<NEW_LINE>} | ArrayList<>(threadsToUse + 1); |
1,467,899 | protected RelDataType deriveRowType() {<NEW_LINE>final RelDataTypeFactory typeFactory = getCluster().getTypeFactory();<NEW_LINE>List<RelDataTypeFieldImpl> columns = new LinkedList<>();<NEW_LINE>int index = 0;<NEW_LINE>columns.add(new RelDataTypeFieldImpl("TABLE_SCHEMA", index++, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("TABLE_NAME", index++, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("LOCAL_PARTITION_NAME", index++, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("LOCAL_PARTITION_METHOD", index++, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("LOCAL_PARTITION_EXPRESSION", index++, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("LOCAL_PARTITION_DESCRIPTION", index++, typeFactory.<MASK><NEW_LINE>columns.add(new RelDataTypeFieldImpl("LOCAL_PARTITION_COMMENT", index++, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>return typeFactory.createStructType(columns);<NEW_LINE>} | createSqlType(SqlTypeName.VARCHAR))); |
230,069 | private void loadHeaderless(InputStream inStream, String encoding, boolean verbose) throws IOException, UnsupportedEncodingException {<NEW_LINE>int i;<NEW_LINE>DataInputStream in = new <MASK><NEW_LINE>// int fileSize= (int) f.length();<NEW_LINE>// TODO: how robust is this??<NEW_LINE>int fileSize = in.available();<NEW_LINE>int nArcs = in.readInt();<NEW_LINE>// arcs = new int[nArcs];<NEW_LINE>targets = new int[nArcs];<NEW_LINE>labels = new short[nArcs];<NEW_LINE>isLast = new boolean[nArcs];<NEW_LINE>for (i = 0; i < nArcs; i++) {<NEW_LINE>int thisArc = in.readInt();<NEW_LINE>targets[i] = thisArc & 1048575;<NEW_LINE>labels[i] = (short) ((thisArc >> 20) & 2047);<NEW_LINE>isLast[i] = ((byte) (thisArc >> 31)) != 0;<NEW_LINE>}<NEW_LINE>int nPairs = in.readInt();<NEW_LINE>offsets = new short[2 * nPairs];<NEW_LINE>for (i = 0; i < 2 * nPairs; i++) offsets[i] = in.readShort();<NEW_LINE>int nBytes = fileSize - 8 - 4 * (nPairs + nArcs);<NEW_LINE>mapping = new int[nBytes];<NEW_LINE>bytes = new byte[nBytes];<NEW_LINE>in.readFully(bytes);<NEW_LINE>if (verbose) {<NEW_LINE>System.err.println("FST (" + fileSize + " Bytes, " + nArcs + " Arcs, " + nPairs + " Labels)" + " loaded");<NEW_LINE>}<NEW_LINE>in.close();<NEW_LINE>createMapping(mapping, bytes, encoding);<NEW_LINE>} | DataInputStream(new BufferedInputStream(inStream)); |
1,133,226 | public static DescribeSnapshotGroupsResponse unmarshall(DescribeSnapshotGroupsResponse describeSnapshotGroupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSnapshotGroupsResponse.setRequestId(_ctx.stringValue("DescribeSnapshotGroupsResponse.RequestId"));<NEW_LINE>describeSnapshotGroupsResponse.setNextToken(_ctx.stringValue("DescribeSnapshotGroupsResponse.NextToken"));<NEW_LINE>List<SnapshotGroup> snapshotGroups = new ArrayList<SnapshotGroup>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSnapshotGroupsResponse.SnapshotGroups.Length"); i++) {<NEW_LINE>SnapshotGroup snapshotGroup = new SnapshotGroup();<NEW_LINE>snapshotGroup.setStatus(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Status"));<NEW_LINE>snapshotGroup.setCreationTime(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].CreationTime"));<NEW_LINE>snapshotGroup.setDescription(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Description"));<NEW_LINE>snapshotGroup.setProgressStatus(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].ProgressStatus"));<NEW_LINE>snapshotGroup.setSnapshotGroupId(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].SnapshotGroupId"));<NEW_LINE>snapshotGroup.setInstanceId(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].InstanceId"));<NEW_LINE>snapshotGroup.setName(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Name"));<NEW_LINE>snapshotGroup.setResourceGroupId(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].ResourceGroupId"));<NEW_LINE>List<Tag> tags = new ArrayList<Tag>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Tags.Length"); j++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setKey(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Tags[" + j + "].Key"));<NEW_LINE>tag.setValue(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Tags[" + j + "].Value"));<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>snapshotGroup.setTags(tags);<NEW_LINE>List<Snapshot> snapshots = new ArrayList<Snapshot>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots.Length"); j++) {<NEW_LINE>Snapshot snapshot = new Snapshot();<NEW_LINE>snapshot.setSourceDiskId(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].SourceDiskId"));<NEW_LINE>snapshot.setProgress(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].Progress"));<NEW_LINE>snapshot.setInstantAccessRetentionDays(_ctx.integerValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].InstantAccessRetentionDays"));<NEW_LINE>snapshot.setSnapshotId(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i <MASK><NEW_LINE>snapshot.setInstantAccess(_ctx.booleanValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].InstantAccess"));<NEW_LINE>snapshot.setSourceDiskType(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].SourceDiskType"));<NEW_LINE>List<Tag2> tags1 = new ArrayList<Tag2>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].Tags.Length"); k++) {<NEW_LINE>Tag2 tag2 = new Tag2();<NEW_LINE>tag2.setKey(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].Tags[" + k + "].Key"));<NEW_LINE>tag2.setValue(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].Tags[" + k + "].Value"));<NEW_LINE>tags1.add(tag2);<NEW_LINE>}<NEW_LINE>snapshot.setTags1(tags1);<NEW_LINE>snapshots.add(snapshot);<NEW_LINE>}<NEW_LINE>snapshotGroup.setSnapshots(snapshots);<NEW_LINE>snapshotGroups.add(snapshotGroup);<NEW_LINE>}<NEW_LINE>describeSnapshotGroupsResponse.setSnapshotGroups(snapshotGroups);<NEW_LINE>return describeSnapshotGroupsResponse;<NEW_LINE>} | + "].Snapshots[" + j + "].SnapshotId")); |
1,321,232 | public void onChildClicked(GroupBean groupItem, ChildBean childItem) {<NEW_LINE>if (childItem.mIconId == R.drawable.xiaoshipin) {<NEW_LINE>Intent intent <MASK><NEW_LINE>intent.setData(Uri.parse("http://dldir1.qq.com/hudongzhibo/liteav/XiaoShiPin.apk"));<NEW_LINE>startActivity(intent);<NEW_LINE>return;<NEW_LINE>} else if (childItem.mIconId == R.drawable.xiaozhibo) {<NEW_LINE>Intent intent = new Intent(Intent.ACTION_VIEW);<NEW_LINE>intent.setData(Uri.parse("http://dldir1.qq.com/hudongzhibo/liteav/xiaozhibo.apk"));<NEW_LINE>startActivity(intent);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Intent intent = new Intent(MainActivity.this, childItem.getTargetClass());<NEW_LINE>intent.putExtra("TITLE", childItem.mName);<NEW_LINE>intent.putExtra("TYPE", childItem.mType);<NEW_LINE>MainActivity.this.startActivity(intent);<NEW_LINE>} | = new Intent(Intent.ACTION_VIEW); |
489,672 | public TypecheckingResult toResult(CheckTypeVisitor typechecker) {<NEW_LINE>if (myParameters.isEmpty()) {<NEW_LINE>return new TypecheckingResult(getCoreDefCall(), myResultType);<NEW_LINE>}<NEW_LINE>List<SingleDependentLink> parameters = new ArrayList<>();<NEW_LINE>ExprSubstitution substitution = new ExprSubstitution();<NEW_LINE>List<String> names = new ArrayList<>();<NEW_LINE>DependentLink link0 = null;<NEW_LINE>for (DependentLink link : myParameters) {<NEW_LINE>if (link0 == null) {<NEW_LINE>link0 = link;<NEW_LINE>}<NEW_LINE>names.add(link.getName());<NEW_LINE>if (link instanceof TypedDependentLink) {<NEW_LINE>SingleDependentLink parameter = ExpressionFactory.singleParams(link.isExplicit(), names, link.getType().subst(new SubstVisitor(substitution, LevelSubstitution.EMPTY)));<NEW_LINE>parameters.add(parameter);<NEW_LINE>names.clear();<NEW_LINE>for (; parameter.hasNext(); parameter = parameter.getNext(), link0 = link0.getNext()) {<NEW_LINE>substitution.add(link0, new ReferenceExpression(parameter));<NEW_LINE>myArguments.<MASK><NEW_LINE>}<NEW_LINE>link0 = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Expression expression = getCoreDefCall();<NEW_LINE>Expression type = myResultType.subst(substitution, LevelSubstitution.EMPTY);<NEW_LINE>Sort codSort = typechecker.getSortOfType(type, myDefCall);<NEW_LINE>for (int i = parameters.size() - 1; i >= 0; i--) {<NEW_LINE>codSort = PiExpression.generateUpperBound(parameters.get(i).getType().getSortOfType(), codSort, typechecker.getEquations(), myDefCall);<NEW_LINE>expression = new LamExpression(codSort, parameters.get(i), expression);<NEW_LINE>type = new PiExpression(codSort, parameters.get(i), type);<NEW_LINE>}<NEW_LINE>return new TypecheckingResult(expression, type);<NEW_LINE>} | add(new ReferenceExpression(parameter)); |
1,770,080 | public void mousePressed(MouseEvent e) {<NEW_LINE>gui.getImagePanel().grabFocus();<NEW_LINE>double scale = gui.getScale();<NEW_LINE>Point2D_F64 p = new Point2D_F64(e.getX() / scale, e.getY() / scale);<NEW_LINE>System.out.printf("click %5.1f %5.1f\n", <MASK><NEW_LINE>synchronized (detected) {<NEW_LINE>for (int i = 0; i < detected.size; i++) {<NEW_LINE>if (Intersection2D_F64.containsConvex(detected.get(i).bounds, p)) {<NEW_LINE>selectedMarkerMouse(i, false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < failures.size; i++) {<NEW_LINE>if (Intersection2D_F64.containsConvex(failures.get(i).bounds, p)) {<NEW_LINE>selectedMarkerMouse(i, true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | p.x, p.y); |
1,559,973 | public String apply(String input) throws Exception {<NEW_LINE>// SortPom expects a file to sort, so we write the inpout into a temporary file<NEW_LINE>File pom = File.createTempFile("pom", ".xml");<NEW_LINE>pom.deleteOnExit();<NEW_LINE>IOUtils.write(input, new FileOutputStream(pom), cfg.encoding);<NEW_LINE>SortPomImpl sortPom = new SortPomImpl();<NEW_LINE>sortPom.setup(new MySortPomLogger(), PluginParameters.builder().setPomFile(pom).setFileOutput(false, null, null, false).setEncoding(cfg.encoding).setFormatting(cfg.lineSeparator, cfg.expandEmptyElements, cfg.spaceBeforeCloseEmptyElement, cfg.keepBlankLines).setIndent(cfg.nrOfIndentSpace, cfg.indentBlankLines, cfg.indentSchemaLocation).setSortOrder(cfg.sortOrderFile, cfg.predefinedSortOrder).setSortEntities(cfg.sortDependencies, cfg.sortDependencyExclusions, cfg.sortPlugins, cfg.sortProperties, cfg.sortModules, cfg.sortExecutions).setTriggers(false).build());<NEW_LINE>sortPom.sortPom();<NEW_LINE>return IOUtils.toString(new FileInputStream<MASK><NEW_LINE>} | (pom), cfg.encoding); |
1,543,331 | public void takePicture(final TakePictureCallback callback) {<NEW_LINE>if (mCamera == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch(cameraAngle) {<NEW_LINE>case 90:<NEW_LINE>nowAngle = Math.abs(angle + cameraAngle) % 360;<NEW_LINE>break;<NEW_LINE>case 270:<NEW_LINE>nowAngle = Math.abs(cameraAngle - angle);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>TUIChatLog.i(TAG, angle + " = " + cameraAngle + " = " + nowAngle);<NEW_LINE>mCamera.takePicture(null, null, new Camera.PictureCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPictureTaken(byte[] data, Camera camera) {<NEW_LINE>Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);<NEW_LINE>Matrix matrix = new Matrix();<NEW_LINE>if (SELECTED_CAMERA == CAMERA_POST_POSITION) {<NEW_LINE>matrix.setRotate(nowAngle);<NEW_LINE>} else if (SELECTED_CAMERA == CAMERA_FRONT_POSITION) {<NEW_LINE><MASK><NEW_LINE>matrix.postScale(-1, 1);<NEW_LINE>}<NEW_LINE>bitmap = createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);<NEW_LINE>if (callback != null) {<NEW_LINE>if (nowAngle == 90 || nowAngle == 270) {<NEW_LINE>callback.captureResult(bitmap, true);<NEW_LINE>} else {<NEW_LINE>callback.captureResult(bitmap, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | matrix.setRotate(360 - nowAngle); |
340,901 | public static ListFunctionsResponse unmarshall(ListFunctionsResponse listFunctionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listFunctionsResponse.setRequestId(_ctx.stringValue("ListFunctionsResponse.RequestId"));<NEW_LINE>listFunctionsResponse.setHttpStatusCode(_ctx.stringValue("ListFunctionsResponse.HttpStatusCode"));<NEW_LINE>listFunctionsResponse.setSuccess<MASK><NEW_LINE>listFunctionsResponse.setCode(_ctx.stringValue("ListFunctionsResponse.Code"));<NEW_LINE>listFunctionsResponse.setMessage(_ctx.stringValue("ListFunctionsResponse.Message"));<NEW_LINE>listFunctionsResponse.setCode1(_ctx.stringValue("ListFunctionsResponse.Code"));<NEW_LINE>listFunctionsResponse.setMessage2(_ctx.stringValue("ListFunctionsResponse.Message"));<NEW_LINE>listFunctionsResponse.setPageSize(_ctx.integerValue("ListFunctionsResponse.PageSize"));<NEW_LINE>listFunctionsResponse.setPageNumber(_ctx.integerValue("ListFunctionsResponse.PageNumber"));<NEW_LINE>listFunctionsResponse.setTotalCount(_ctx.integerValue("ListFunctionsResponse.TotalCount"));<NEW_LINE>List<Function> functions = new ArrayList<Function>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListFunctionsResponse.Functions.Length"); i++) {<NEW_LINE>Function function = new Function();<NEW_LINE>function.setFunctionId(_ctx.stringValue("ListFunctionsResponse.Functions[" + i + "].FunctionId"));<NEW_LINE>function.setFunctionName(_ctx.stringValue("ListFunctionsResponse.Functions[" + i + "].FunctionName"));<NEW_LINE>function.setFunctionDesc(_ctx.stringValue("ListFunctionsResponse.Functions[" + i + "].FunctionDesc"));<NEW_LINE>function.setCreateTime(_ctx.stringValue("ListFunctionsResponse.Functions[" + i + "].CreateTime"));<NEW_LINE>function.setUpdateTime(_ctx.stringValue("ListFunctionsResponse.Functions[" + i + "].UpdateTime"));<NEW_LINE>FunctionSpec functionSpec = new FunctionSpec();<NEW_LINE>functionSpec.setRuntime(_ctx.stringValue("ListFunctionsResponse.Functions[" + i + "].FunctionSpec.Runtime"));<NEW_LINE>functionSpec.setMemory(_ctx.stringValue("ListFunctionsResponse.Functions[" + i + "].FunctionSpec.Memory"));<NEW_LINE>functionSpec.setTimeout(_ctx.stringValue("ListFunctionsResponse.Functions[" + i + "].FunctionSpec.Timeout"));<NEW_LINE>List<CustomVariable> customVariables = new ArrayList<CustomVariable>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListFunctionsResponse.Functions[" + i + "].FunctionSpec.CustomVariables.Length"); j++) {<NEW_LINE>CustomVariable customVariable = new CustomVariable();<NEW_LINE>customVariable.setName(_ctx.stringValue("ListFunctionsResponse.Functions[" + i + "].FunctionSpec.CustomVariables[" + j + "].Name"));<NEW_LINE>customVariable.setValue(_ctx.stringValue("ListFunctionsResponse.Functions[" + i + "].FunctionSpec.CustomVariables[" + j + "].Value"));<NEW_LINE>customVariables.add(customVariable);<NEW_LINE>}<NEW_LINE>functionSpec.setCustomVariables(customVariables);<NEW_LINE>function.setFunctionSpec(functionSpec);<NEW_LINE>functions.add(function);<NEW_LINE>}<NEW_LINE>listFunctionsResponse.setFunctions(functions);<NEW_LINE>return listFunctionsResponse;<NEW_LINE>} | (_ctx.booleanValue("ListFunctionsResponse.Success")); |
1,171,499 | public static void createLoginCookie(KeycloakSession keycloakSession, RealmModel realm, UserModel user, UserSessionModel session, UriInfo uriInfo, ClientConnection connection) {<NEW_LINE>String cookiePath = getIdentityCookiePath(realm, uriInfo);<NEW_LINE>String issuer = Urls.realmIssuer(uriInfo.getBaseUri(<MASK><NEW_LINE>IdentityCookieToken identityCookieToken = createIdentityToken(keycloakSession, realm, user, session, issuer);<NEW_LINE>String encoded = keycloakSession.tokens().encode(identityCookieToken);<NEW_LINE>boolean secureOnly = realm.getSslRequired().isRequired(connection);<NEW_LINE>int maxAge = NewCookie.DEFAULT_MAX_AGE;<NEW_LINE>if (session != null && session.isRememberMe()) {<NEW_LINE>maxAge = realm.getSsoSessionMaxLifespanRememberMe() > 0 ? realm.getSsoSessionMaxLifespanRememberMe() : realm.getSsoSessionMaxLifespan();<NEW_LINE>}<NEW_LINE>logger.debugv("Create login cookie - name: {0}, path: {1}, max-age: {2}", KEYCLOAK_IDENTITY_COOKIE, cookiePath, maxAge);<NEW_LINE>CookieHelper.addCookie(KEYCLOAK_IDENTITY_COOKIE, encoded, cookiePath, null, null, maxAge, secureOnly, true, SameSiteAttributeValue.NONE);<NEW_LINE>// builder.cookie(new NewCookie(cookieName, encoded, cookiePath, null, null, maxAge, secureOnly));// todo httponly , true);<NEW_LINE>String sessionCookieValue = realm.getName() + "/" + user.getId();<NEW_LINE>if (session != null) {<NEW_LINE>sessionCookieValue += "/" + session.getId();<NEW_LINE>}<NEW_LINE>// THIS SHOULD NOT BE A HTTPONLY COOKIE! It is used for OpenID Connect Iframe Session support!<NEW_LINE>// Max age should be set to the max lifespan of the session as it's used to invalidate old-sessions on re-login<NEW_LINE>int sessionCookieMaxAge = session.isRememberMe() && realm.getSsoSessionMaxLifespanRememberMe() > 0 ? realm.getSsoSessionMaxLifespanRememberMe() : realm.getSsoSessionMaxLifespan();<NEW_LINE>CookieHelper.addCookie(KEYCLOAK_SESSION_COOKIE, sessionCookieValue, cookiePath, null, null, sessionCookieMaxAge, secureOnly, false, SameSiteAttributeValue.NONE);<NEW_LINE>P3PHelper.addP3PHeader();<NEW_LINE>} | ), realm.getName()); |
751,179 | private static void transformElements(JRElement[] elements, double scaleX, int offsetX, double scaleY, int offsetY) {<NEW_LINE>if (elements != null) {<NEW_LINE>for (int i = 0; i < elements.length; i++) {<NEW_LINE>JRFillElement element = (JRFillElement) elements[i];<NEW_LINE>if (scaleX != -1d) {<NEW_LINE>element.setX((int) (element<MASK><NEW_LINE>element.setWidth((int) (element.getWidth() * scaleX));<NEW_LINE>}<NEW_LINE>if (offsetX != 0) {<NEW_LINE>element.setX(element.getX() + offsetX);<NEW_LINE>}<NEW_LINE>if (scaleY != -1d) {<NEW_LINE>element.setY((int) (element.getY() * scaleY));<NEW_LINE>element.setHeight((int) (element.getHeight() * scaleY));<NEW_LINE>}<NEW_LINE>if (offsetY != 0) {<NEW_LINE>element.setY(element.getY() + offsetY);<NEW_LINE>}<NEW_LINE>if (element instanceof JRFrame) {<NEW_LINE>JRElement[] frameElements = ((JRFrame) element).getElements();<NEW_LINE>transformElements(frameElements, scaleX, offsetX, scaleY, offsetY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getX() * scaleX)); |
185,191 | public Request<ListAliasesRequest> marshall(ListAliasesRequest listAliasesRequest) {<NEW_LINE>if (listAliasesRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListAliasesRequest)");<NEW_LINE>}<NEW_LINE>Request<ListAliasesRequest> request = new DefaultRequest<ListAliasesRequest>(listAliasesRequest, "AWSKMS");<NEW_LINE>String target = "TrentService.ListAliases";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (listAliasesRequest.getKeyId() != null) {<NEW_LINE>String keyId = listAliasesRequest.getKeyId();<NEW_LINE>jsonWriter.name("KeyId");<NEW_LINE>jsonWriter.value(keyId);<NEW_LINE>}<NEW_LINE>if (listAliasesRequest.getLimit() != null) {<NEW_LINE>Integer limit = listAliasesRequest.getLimit();<NEW_LINE>jsonWriter.name("Limit");<NEW_LINE>jsonWriter.value(limit);<NEW_LINE>}<NEW_LINE>if (listAliasesRequest.getMarker() != null) {<NEW_LINE>String marker = listAliasesRequest.getMarker();<NEW_LINE>jsonWriter.name("Marker");<NEW_LINE>jsonWriter.value(marker);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE><MASK><NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | String snippet = stringWriter.toString(); |
882,036 | public void prepareNettyResponse(HttpResponse nettyResponse) {<NEW_LINE>nettyResponse.headers().add("Accept-Ranges", "bytes");<NEW_LINE>if (unsatisfiable) {<NEW_LINE>nettyResponse.setStatus(HttpResponseStatus.REQUESTED_RANGE_NOT_SATISFIABLE);<NEW_LINE>nettyResponse.headers().set("Content-Range", "bytes " + 0 + "-" + (fileLength - 1) + "/" + fileLength);<NEW_LINE>nettyResponse.headers(<MASK><NEW_LINE>} else {<NEW_LINE>nettyResponse.setStatus(HttpResponseStatus.PARTIAL_CONTENT);<NEW_LINE>if (byteRanges.length == 1) {<NEW_LINE>ByteRange range = byteRanges[0];<NEW_LINE>nettyResponse.headers().set("Content-Range", "bytes " + range.start + "-" + range.end + "/" + fileLength);<NEW_LINE>} else {<NEW_LINE>nettyResponse.headers().set("Content-type", "multipart/byteranges; boundary=" + DEFAULT_SEPARATOR);<NEW_LINE>}<NEW_LINE>long length = 0;<NEW_LINE>for (ByteRange range : byteRanges) {<NEW_LINE>length += range.computeTotalLength();<NEW_LINE>}<NEW_LINE>nettyResponse.headers().set("Content-length", length);<NEW_LINE>}<NEW_LINE>} | ).set("Content-length", 0); |
1,064,721 | public Collection<NewService> createServices(Server grpcServer, ApplicationContext applicationContext) {<NEW_LINE>final NewService grpcServicePrototype = SINGLE_SERVER_WITH_GLOBAL_CHECK.createServices(grpcServer, applicationContext).iterator().next();<NEW_LINE>List<NewService> newServices = new ArrayList<>();<NEW_LINE>final List<ServerServiceDefinition> services = grpcServer.getServices();<NEW_LINE>for (int i = 0; i < services.size(); ++i) {<NEW_LINE>final ServerServiceDefinition d = services.get(i);<NEW_LINE>if (d.getServiceDescriptor().equals(HealthGrpc.getServiceDescriptor())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final NewService service = clone(grpcServicePrototype, NewService.class);<NEW_LINE>service.setId(String.format("%s-%d", service<MASK><NEW_LINE>service.getTags().add(d.getServiceDescriptor().getName());<NEW_LINE>Optional.ofNullable(service.getCheck()).ifPresent(check -> check.setGrpc(String.format("%s/%s", check.getGrpc(), d.getServiceDescriptor().getName())));<NEW_LINE>newServices.add(service);<NEW_LINE>}<NEW_LINE>return newServices;<NEW_LINE>} | .getId(), i)); |
1,419,097 | private static void overrideCopierMethod(JDefinedClass templateClass, String methodName, Map<String, JVar> fields, boolean resetFields, JClass changeListenerClass) {<NEW_LINE>final JMethod copierMethod = templateClass.method(JMod.PUBLIC, templateClass, methodName);<NEW_LINE><MASK><NEW_LINE>copierMethod._throws(CloneNotSupportedException.class);<NEW_LINE>JVar copyVar = copierMethod.body().decl(templateClass, "__" + methodName, JExpr.cast(templateClass, JExpr._super().invoke(methodName)));<NEW_LINE>if (!fields.isEmpty()) {<NEW_LINE>if (resetFields) {<NEW_LINE>fields.values().forEach(var -> {<NEW_LINE>copierMethod.body().assign(copyVar.ref(var), JExpr._null());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>copierMethod.body().assign(copyVar.ref("__changeListener"), JExpr._new(changeListenerClass).arg(copyVar));<NEW_LINE>copierMethod.body().add(copyVar.invoke("addChangeListener").arg(copyVar.ref("__changeListener")));<NEW_LINE>}<NEW_LINE>copierMethod.body()._return(copyVar);<NEW_LINE>} | copierMethod.annotate(Override.class); |
326,677 | private void printWorkerInfo(List<WorkerInfo> workerInfoList) {<NEW_LINE>mIndentationLevel = 0;<NEW_LINE>if (mCapacityTierInfoMap.size() == 0) {<NEW_LINE>return;<NEW_LINE>} else if (mCapacityTierInfoMap.size() == 1) {<NEW_LINE>// Do not print Total value when only one tier exists<NEW_LINE>printShortWorkerInfo(workerInfoList);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Set<String> tiers = mCapacityTierInfoMap.keySet();<NEW_LINE>String tiersInfo = String.format(Strings.repeat("%-14s", tiers.size()), tiers.toArray());<NEW_LINE>String <MASK><NEW_LINE>print(String.format("%n" + longInfoFormat, "Worker Name", "Last Heartbeat", "Storage", "Total", tiersInfo));<NEW_LINE>for (WorkerInfo info : workerInfoList) {<NEW_LINE>String workerName = info.getAddress().getHost();<NEW_LINE>long usedBytes = info.getUsedBytes();<NEW_LINE>long capacityBytes = info.getCapacityBytes();<NEW_LINE>String usedPercentageInfo = "";<NEW_LINE>if (capacityBytes != 0) {<NEW_LINE>int usedPercentage = (int) (100L * usedBytes / capacityBytes);<NEW_LINE>usedPercentageInfo = String.format(" (%s%%)", usedPercentage);<NEW_LINE>}<NEW_LINE>String capacityTierInfo = getWorkerFormattedTierValues(mCapacityTierInfoMap, workerName);<NEW_LINE>String usedTierInfo = getWorkerFormattedTierValues(mUsedTierInfoMap, workerName);<NEW_LINE>print(String.format(longInfoFormat, workerName, info.getLastContactSec(), "capacity", FormatUtils.getSizeFromBytes(capacityBytes), capacityTierInfo));<NEW_LINE>print(String.format(longInfoFormat, "", "", "used", FormatUtils.getSizeFromBytes(usedBytes) + usedPercentageInfo, usedTierInfo));<NEW_LINE>}<NEW_LINE>} | longInfoFormat = getInfoFormat(workerInfoList, false); |
1,486,023 | protected void validateServerConfig(EndpointType type, ServerConfig config) {<NEW_LINE>String endpointPrefixVariable = "flowable.admin.app.server-config." + type.name().toLowerCase();<NEW_LINE>Assert.hasText(config.getName(), endpointPrefixVariable + ".name must be set");<NEW_LINE>Assert.hasText(config.getDescription(), endpointPrefixVariable + ".description must be set");<NEW_LINE>// TODO needs to be host<NEW_LINE>Assert.hasText(config.<MASK><NEW_LINE>Assert.notNull(config.getPort(), endpointPrefixVariable + ".port must be set");<NEW_LINE>Assert.hasText(config.getContextRoot(), endpointPrefixVariable + ".context-root must be set");<NEW_LINE>Assert.hasText(config.getRestRoot(), endpointPrefixVariable + ".rest-root must be set");<NEW_LINE>Assert.hasText(config.getUserName(), endpointPrefixVariable + ".user-name must be set");<NEW_LINE>Assert.hasText(config.getPassword(), endpointPrefixVariable + ".password must be set");<NEW_LINE>} | getServerAddress(), endpointPrefixVariable + ".server-address must be set"); |
254,700 | private static Map<TypeAlias, jnr.ffi.NativeType> buildTypeMap() {<NEW_LINE>Map<TypeAlias, jnr.ffi.NativeType> m = new EnumMap<TypeAlias, jnr.ffi.NativeType>(TypeAlias.class);<NEW_LINE>m.put(TypeAlias.int8_t, NativeType.SCHAR);<NEW_LINE>m.put(TypeAlias.u_int8_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.int16_t, NativeType.SSHORT);<NEW_LINE>m.put(TypeAlias.u_int16_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.int32_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.u_int32_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.int64_t, NativeType.ADDRESS);<NEW_LINE>m.put(TypeAlias.u_int64_t, NativeType.ADDRESS);<NEW_LINE>m.put(TypeAlias.intptr_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.uintptr_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.caddr_t, NativeType.ADDRESS);<NEW_LINE>m.put(TypeAlias.dev_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.blkcnt_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.blksize_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.gid_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.in_addr_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.in_port_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.ino_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.ino64_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.key_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.mode_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.nlink_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.id_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.pid_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.off_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.swblk_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.uid_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.clock_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.size_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.ssize_t, NativeType.SLONG);<NEW_LINE>m.put(<MASK><NEW_LINE>m.put(TypeAlias.fsblkcnt_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.fsfilcnt_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.sa_family_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.socklen_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.rlim_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.cc_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.speed_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.tcflag_t, NativeType.UINT);<NEW_LINE>return m;<NEW_LINE>} | TypeAlias.time_t, NativeType.SINT); |
763,959 | private void showForm() {<NEW_LINE>Form f = new Form("Hello", <MASK><NEW_LINE>Form prev = CN.getCurrentForm();<NEW_LINE>Toolbar tb = new Toolbar();<NEW_LINE>f.setToolbar(tb);<NEW_LINE>tb.addCommandToLeftBar("Back", null, evt -> {<NEW_LINE>prev.showBack();<NEW_LINE>});<NEW_LINE>SpanLabel profileText = new SpanLabel();<NEW_LINE>profileText.setText("placeholder");<NEW_LINE>f.add(BorderLayout.CENTER, profileText);<NEW_LINE>// Replace the label by a CircleProgress to indicate that it is loading.<NEW_LINE>LoadingTextAnimation.markComponentLoading(profileText);<NEW_LINE>Button next = new Button("Next");<NEW_LINE>next.addActionListener(e -> {<NEW_LINE>showLabelTest();<NEW_LINE>});<NEW_LINE>f.add(BorderLayout.SOUTH, next);<NEW_LINE>AsyncResource<MyData> request = fetchDataAsync();<NEW_LINE>request.ready(data -> {<NEW_LINE>profileText.setText(data.getProfileText());<NEW_LINE>// Replace the progress with the nameLabel now that<NEW_LINE>// it is ready, using a fade transition<NEW_LINE>LoadingTextAnimation.markComponentReady(profileText, CommonTransitions.createFade(300));<NEW_LINE>});<NEW_LINE>f.show();<NEW_LINE>} | new BorderLayout(BorderLayout.CENTER_BEHAVIOR_SCALE)); |
649,728 | public Object calculate(Context ctx) {<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("rgb" + mm.getMessage("function.missingParam"));<NEW_LINE>}<NEW_LINE>int size = param.getSubSize();<NEW_LINE>if (size < 3 || size > 4) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("rgb" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>int r, g, b, a = 255;<NEW_LINE>IParam sub1 = param.getSub(0);<NEW_LINE>IParam sub2 = param.getSub(1);<NEW_LINE>IParam sub3 = param.getSub(2);<NEW_LINE>if (sub1 == null || sub2 == null || sub3 == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("rgb" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object result1 = sub1.getLeafExpression().calculate(ctx);<NEW_LINE>if (result1 instanceof Number) {<NEW_LINE>r = ((Number) result1).intValue();<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("rgb" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>Object result2 = sub2.getLeafExpression().calculate(ctx);<NEW_LINE>if (result2 instanceof Number) {<NEW_LINE>g = ((Number) result2).intValue();<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("rgb" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>Object result3 = sub3.getLeafExpression().calculate(ctx);<NEW_LINE>if (result3 instanceof Number) {<NEW_LINE>b = ((Number) result3).intValue();<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("rgb" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>if (size == 4) {<NEW_LINE>IParam sub4 = param.getSub(3);<NEW_LINE>if (sub4 != null) {<NEW_LINE>Object result4 = sub4.getLeafExpression().calculate(ctx);<NEW_LINE>if (result4 instanceof Number) {<NEW_LINE>a = ((Number) result4).intValue();<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>throw new RQException("rgb" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ((a & 0xFF) << 24) | ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | ((b & 0xFF) << 0);<NEW_LINE>} | MessageManager mm = EngineMessage.get(); |
1,775,696 | public WorkflowProcess defineProcess() {<NEW_LINE>// Configuration process<NEW_LINE>WorkflowProcess process = new WorkflowProcess();<NEW_LINE>process.setName(getProcessName().name());<NEW_LINE>process.setType(getProcessName().getDisplayName());<NEW_LINE>process.setDisplayName(getProcessName().getDisplayName());<NEW_LINE>process.setFormClass(GroupResourceProcessForm.class);<NEW_LINE>process.setVersion(1);<NEW_LINE>process.setHidden(1);<NEW_LINE>// Set up the listener<NEW_LINE>process.addListener(updateGroupListener);<NEW_LINE>process.addListener(updateGroupCompleteListener);<NEW_LINE>process.addListener(updateGroupFailedListener);<NEW_LINE>// Start node<NEW_LINE>StartEvent startEvent = new StartEvent();<NEW_LINE>process.setStartEvent(startEvent);<NEW_LINE>// Stop Source<NEW_LINE>ServiceTask stopSourceTask = new ServiceTask();<NEW_LINE>stopSourceTask.setName("StopSource");<NEW_LINE>stopSourceTask.setDisplayName("Group-StopSource");<NEW_LINE>stopSourceTask.setServiceTaskType(ServiceTaskType.STOP_SOURCE);<NEW_LINE>stopSourceTask.setListenerFactory(groupTaskListenerFactory);<NEW_LINE>process.addTask(stopSourceTask);<NEW_LINE>// Stop Sort<NEW_LINE>ServiceTask stopSortTask = new ServiceTask();<NEW_LINE>stopSortTask.setName("StopSort");<NEW_LINE>stopSortTask.setDisplayName("Group-StopSort");<NEW_LINE><MASK><NEW_LINE>stopSortTask.setListenerFactory(groupTaskListenerFactory);<NEW_LINE>process.addTask(stopSortTask);<NEW_LINE>// End node<NEW_LINE>EndEvent endEvent = new EndEvent();<NEW_LINE>process.setEndEvent(endEvent);<NEW_LINE>startEvent.addNext(stopSourceTask);<NEW_LINE>stopSourceTask.addNext(stopSortTask);<NEW_LINE>stopSortTask.addNext(endEvent);<NEW_LINE>return process;<NEW_LINE>} | stopSortTask.setServiceTaskType(ServiceTaskType.STOP_SORT); |
1,097,711 | public void preparedData() {<NEW_LINE>AlterTableGroupMovePartition alterTableGroupMovePartition = (AlterTableGroupMovePartition) relDdl;<NEW_LINE>String tableGroupName = alterTableGroupMovePartition.getTableGroupName();<NEW_LINE>SqlAlterTableGroup sqlAlterTableGroup = (SqlAlterTableGroup) alterTableGroupMovePartition.getAst();<NEW_LINE>assert sqlAlterTableGroup.getAlters().size() == 1;<NEW_LINE>assert sqlAlterTableGroup.getAlters().get(0) instanceof SqlAlterTableGroupMovePartition;<NEW_LINE>List<GroupDetailInfoExRecord> candidateGroupDetailInfoExRecords = TableGroupLocation.getOrderedGroupList(schemaName);<NEW_LINE>// todo support move multi-groups in one shot<NEW_LINE>String storageInstId = alterTableGroupMovePartition.getTargetPartitions().entrySet().iterator().next().getKey();<NEW_LINE>preparedData = new AlterTableGroupMovePartitionPreparedData();<NEW_LINE>List<GroupDetailInfoExRecord> targetGroupDetailInfoExRecords = candidateGroupDetailInfoExRecords.stream().filter(o -> o.storageInstId.equalsIgnoreCase(storageInstId)).collect(Collectors.toList());<NEW_LINE>if (GeneralUtil.isEmpty(targetGroupDetailInfoExRecords)) {<NEW_LINE>candidateGroupDetailInfoExRecords = <MASK><NEW_LINE>targetGroupDetailInfoExRecords = candidateGroupDetailInfoExRecords.stream().filter(o -> o.storageInstId.equalsIgnoreCase(storageInstId)).collect(Collectors.toList());<NEW_LINE>if (GeneralUtil.isEmpty(targetGroupDetailInfoExRecords)) {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_DN_IS_NOT_READY, String.format("the dn[%s] is not ready, please retry this command later", storageInstId));<NEW_LINE>} else {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_PHYSICAL_TOPOLOGY_CHANGING, String.format("the physical group[%s] is changing, please retry this command later", targetGroupDetailInfoExRecords.get(0)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>preparedData.setTargetGroupDetailInfoExRecords(targetGroupDetailInfoExRecords);<NEW_LINE>preparedData.setSchemaName(schemaName);<NEW_LINE>preparedData.setWithHint(targetTablesHintCache != null);<NEW_LINE>preparedData.setTableGroupName(tableGroupName);<NEW_LINE>preparedData.setTargetPartitionsLocation(alterTableGroupMovePartition.getTargetPartitions());<NEW_LINE>List<String> newPartitionNames = new ArrayList<>();<NEW_LINE>for (Map.Entry<String, Set<String>> entry : alterTableGroupMovePartition.getTargetPartitions().entrySet()) {<NEW_LINE>newPartitionNames.addAll(entry.getValue());<NEW_LINE>}<NEW_LINE>preparedData.setNewPartitionNames(newPartitionNames);<NEW_LINE>preparedData.setOldPartitionNames(newPartitionNames);<NEW_LINE>preparedData.prepareInvisiblePartitionGroup();<NEW_LINE>preparedData.setTaskType(ComplexTaskMetaManager.ComplexTaskType.MOVE_PARTITION);<NEW_LINE>} | TableGroupLocation.getOrderedGroupList(schemaName, true); |
632,341 | final ListHumanLoopsResult executeListHumanLoops(ListHumanLoopsRequest listHumanLoopsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listHumanLoopsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListHumanLoopsRequest> request = null;<NEW_LINE>Response<ListHumanLoopsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListHumanLoopsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listHumanLoopsRequest));<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, "SageMaker A2I Runtime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListHumanLoops");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListHumanLoopsResult>> 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 ListHumanLoopsResultJsonUnmarshaller()); |
1,631,000 | public void marshall(ListEdgePackagingJobsRequest listEdgePackagingJobsRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (listEdgePackagingJobsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(listEdgePackagingJobsRequest.getNextToken(), NEXTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(listEdgePackagingJobsRequest.getMaxResults(), MAXRESULTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(listEdgePackagingJobsRequest.getCreationTimeBefore(), CREATIONTIMEBEFORE_BINDING);<NEW_LINE>protocolMarshaller.marshall(listEdgePackagingJobsRequest.getLastModifiedTimeAfter(), LASTMODIFIEDTIMEAFTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(listEdgePackagingJobsRequest.getLastModifiedTimeBefore(), LASTMODIFIEDTIMEBEFORE_BINDING);<NEW_LINE>protocolMarshaller.marshall(listEdgePackagingJobsRequest.getNameContains(), NAMECONTAINS_BINDING);<NEW_LINE>protocolMarshaller.marshall(listEdgePackagingJobsRequest.getModelNameContains(), MODELNAMECONTAINS_BINDING);<NEW_LINE>protocolMarshaller.marshall(listEdgePackagingJobsRequest.getStatusEquals(), STATUSEQUALS_BINDING);<NEW_LINE>protocolMarshaller.marshall(listEdgePackagingJobsRequest.getSortBy(), SORTBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(listEdgePackagingJobsRequest.getSortOrder(), SORTORDER_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | listEdgePackagingJobsRequest.getCreationTimeAfter(), CREATIONTIMEAFTER_BINDING); |
672,603 | public static QueryToFilterAdapter<?> build(IndexSearcher searcher, String key, Query query) throws IOException {<NEW_LINE>// Wrapping with a ConstantScoreQuery enables a few more rewrite<NEW_LINE>// rules as of Lucene 9.2<NEW_LINE>query = searcher.rewrite(new ConstantScoreQuery(query));<NEW_LINE>if (query instanceof ConstantScoreQuery) {<NEW_LINE>query = ((<MASK><NEW_LINE>}<NEW_LINE>if (query instanceof TermQuery) {<NEW_LINE>return new TermQueryToFilterAdapter(searcher, key, (TermQuery) query);<NEW_LINE>}<NEW_LINE>if (query instanceof DocValuesFieldExistsQuery) {<NEW_LINE>return new DocValuesFieldExistsAdapter(searcher, key, (DocValuesFieldExistsQuery) query);<NEW_LINE>}<NEW_LINE>if (query instanceof MatchAllDocsQuery) {<NEW_LINE>return new MatchAllQueryToFilterAdapter(searcher, key, (MatchAllDocsQuery) query);<NEW_LINE>}<NEW_LINE>if (query instanceof MatchNoDocsQuery) {<NEW_LINE>return new MatchNoneQueryToFilterAdapter(searcher, key, (MatchNoDocsQuery) query);<NEW_LINE>}<NEW_LINE>return new QueryToFilterAdapter<>(searcher, key, query);<NEW_LINE>} | ConstantScoreQuery) query).getQuery(); |
1,276,500 | public boolean process(List<Point2D_I32> contour) {<NEW_LINE>// Reset internal book keeping variables<NEW_LINE>reset();<NEW_LINE>if (loops) {<NEW_LINE>// Reject pathological case<NEW_LINE>if (contour.size() < 3)<NEW_LINE>return false;<NEW_LINE>if (!findInitialTriangle(contour))<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>// Reject pathological case<NEW_LINE>if (contour.size() < 2)<NEW_LINE>return false;<NEW_LINE>// two end points are the seeds. Plus they can't change<NEW_LINE>addCorner(0);<NEW_LINE>addCorner(contour.size() - 1);<NEW_LINE>initializeScore(contour, false);<NEW_LINE>}<NEW_LINE>savePolyline();<NEW_LINE>sequentialSideFit(contour, loops);<NEW_LINE>if (fatalError)<NEW_LINE>return false;<NEW_LINE>int MIN_SIZE = loops ? 3 : 2;<NEW_LINE>double bestScore = Double.MAX_VALUE;<NEW_LINE>int bestSize = -1;<NEW_LINE>for (int i = 0; i < Math.min(maxSides - (MIN_SIZE - 1), polylines.size); i++) {<NEW_LINE>if (polylines.get(i).score < bestScore) {<NEW_LINE>bestPolyline = polylines.get(i);<NEW_LINE>bestScore = bestPolyline.score;<NEW_LINE>bestSize = i + MIN_SIZE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// There was no good match within the min/max size requirement<NEW_LINE>if (bestSize < minSides || bestPolyline == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// make sure all the sides are within error tolerance<NEW_LINE>for (int i = 0, j = bestSize - 1; i < bestSize; j = i, i++) {<NEW_LINE>Point2D_I32 a = contour.get(bestPolyline.splits.get(i));<NEW_LINE>Point2D_I32 b = contour.get(bestPolyline<MASK><NEW_LINE>double length = a.distance(b);<NEW_LINE>double thresholdSideError = this.maxSideError.compute(length);<NEW_LINE>if (bestPolyline.sideErrors.get(i) >= thresholdSideError * thresholdSideError) {<NEW_LINE>bestPolyline = null;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | .splits.get(j)); |
1,601,566 | public static void load(PluginInterface plugin_interface) {<NEW_LINE>plugin_interface.getPluginProperties().setProperty("plugin.version", "1.0");<NEW_LINE>plugin_interface.getPluginProperties().setProperty("plugin.name", PLUGIN_NAME);<NEW_LINE>synchronized (SimpleAPIPlugin.class) {<NEW_LINE>if (loaded) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>loaded = true;<NEW_LINE>}<NEW_LINE>log_channel = plugin_interface.getLogger().getChannel(PLUGIN_NAME);<NEW_LINE>defaults.put(WebPlugin.PR_ENABLE, false);<NEW_LINE>defaults.<MASK><NEW_LINE>defaults.put(WebPlugin.PR_ROOT_DIR, AETemporaryFileHandler.getTempDirectory().getAbsolutePath());<NEW_LINE>defaults.put(WebPlugin.PR_PORT, DEFAULT_PORT);<NEW_LINE>defaults.put(WebPlugin.PR_ACCESS, DEFAULT_ACCESS);<NEW_LINE>defaults.put(WebPlugin.PR_ENABLE_KEEP_ALIVE, true);<NEW_LINE>defaults.put(WebPlugin.PR_HIDE_RESOURCE_CONFIG, true);<NEW_LINE>defaults.put(WebPlugin.PR_ENABLE_PAIRING, false);<NEW_LINE>defaults.put(WebPlugin.PR_ENABLE_UPNP, false);<NEW_LINE>defaults.put(WebPlugin.PR_ENABLE_I2P, false);<NEW_LINE>defaults.put(WebPlugin.PR_ENABLE_TOR, false);<NEW_LINE>defaults.put(WebPlugin.PR_LOG, log_channel);<NEW_LINE>} | put(WebPlugin.PR_DISABLABLE, true); |
550,456 | private Mono<Response<List<ApplicationInsightsComponentExportConfigurationInner>>> listWithResponseAsync(String resourceGroupName, String resourceName, 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 (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 (resourceName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String apiVersion = "2015-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.list(this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), resourceName, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); |
1,307,564 | public void calculateWeights(BoltzmannMachine logic) {<NEW_LINE>for (int sourceTour = 0; sourceTour < NUM_CITIES; sourceTour++) {<NEW_LINE>for (int sourceCity = 0; sourceCity < NUM_CITIES; sourceCity++) {<NEW_LINE>int sourceIndex = sourceTour * NUM_CITIES + sourceCity;<NEW_LINE>for (int targetTour = 0; targetTour < NUM_CITIES; targetTour++) {<NEW_LINE>for (int targetCity = 0; targetCity < NUM_CITIES; targetCity++) {<NEW_LINE>int targetIndex = targetTour * NUM_CITIES + targetCity;<NEW_LINE>double weight = 0;<NEW_LINE>if (sourceIndex != targetIndex) {<NEW_LINE>int predTargetTour = (targetTour == 0 ? NUM_CITIES - 1 : targetTour - 1);<NEW_LINE>int succTargetTour = (targetTour == NUM_CITIES - 1 ? 0 : targetTour + 1);<NEW_LINE>if ((sourceTour == targetTour) || (sourceCity == targetCity)) {<NEW_LINE>weight = -this.gamma;<NEW_LINE>} else if ((sourceTour == predTargetTour) || (sourceTour == succTargetTour)) {<NEW_LINE>weight = -this<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>logic.setWeight(sourceIndex, targetIndex, weight);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logic.getThreshold()[sourceIndex] = -this.gamma / 2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .distance[sourceCity][targetCity]; |
1,682,953 | public void rerun(Set<Testcase> tests) {<NEW_LINE>setEnabled(false);<NEW_LINE>ArrayList<FileObject> tests2run = new ArrayList<>();<NEW_LINE>for (Testcase testcase : tests) {<NEW_LINE>testcase.getTrouble().getStackTrace();<NEW_LINE>TestRunnerReporter.CallStackCallback callStackCallback = new TestRunnerReporter.CallStackCallback(project);<NEW_LINE>for (String callstackFrameInfo : testcase.getTrouble().getStackTrace()) {<NEW_LINE>Pair<File, int[]> pair = callStackCallback.parseLocation(callstackFrameInfo, true);<NEW_LINE>if (pair != null) {<NEW_LINE>FileObject fo = FileUtil.<MASK><NEW_LINE>if (!tests2run.contains(fo)) {<NEW_LINE>tests2run.add(fo);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!tests2run.isEmpty()) {<NEW_LINE>runTests(tests2run.toArray(new FileObject[tests2run.size()]));<NEW_LINE>}<NEW_LINE>setEnabled(true);<NEW_LINE>} | toFileObject(pair.first()); |
60,842 | private Process runLocalSolr4ControlCommand(List<String> solrArguments) throws IOException {<NEW_LINE>// NON-NLS<NEW_LINE>final String MAX_SOLR_MEM_MB_PAR = "-Xmx" + UserPreferences.getMaxSolrVMSize() + "m";<NEW_LINE>// NON-NLS<NEW_LINE>File solr4Folder = InstalledFileLocator.getDefault().locate("solr4", Server.class.getPackage().getName(), false);<NEW_LINE>List<String> commandLine = new ArrayList<>();<NEW_LINE>commandLine.add(javaPath);<NEW_LINE>commandLine.add(MAX_SOLR_MEM_MB_PAR);<NEW_LINE>// NON-NLS<NEW_LINE>commandLine.add("-DSTOP.PORT=" + localSolrStopPort);<NEW_LINE>// NON-NLS<NEW_LINE>commandLine.add("-Djetty.port=" + localSolrServerPort);<NEW_LINE>// NON-NLS<NEW_LINE>commandLine.add("-DSTOP.KEY=" + KEY);<NEW_LINE>// NON-NLS<NEW_LINE>commandLine.add("-jar");<NEW_LINE>// NON-NLS<NEW_LINE>commandLine.add("start.jar");<NEW_LINE>commandLine.addAll(solrArguments);<NEW_LINE>ProcessBuilder solrProcessBuilder = new ProcessBuilder(commandLine);<NEW_LINE>solrProcessBuilder.directory(solr4Folder);<NEW_LINE>// Redirect stdout and stderr to files to prevent blocking.<NEW_LINE>// NON-NLS<NEW_LINE>Path solrStdoutPath = Paths.get(Places.getUserDirectory().getAbsolutePath(), "var", "log", "solr.log.stdout");<NEW_LINE>solrProcessBuilder.redirectOutput(solrStdoutPath.toFile());<NEW_LINE>// NON-NLS<NEW_LINE>Path solrStderrPath = Paths.get(Places.getUserDirectory().getAbsolutePath(), "var", "log", "solr.log.stderr");<NEW_LINE>solrProcessBuilder.<MASK><NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.INFO, "Running Solr 4 command: {0}", solrProcessBuilder.command());<NEW_LINE>Process process = solrProcessBuilder.start();<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.INFO, "Finished running Solr 4 command");<NEW_LINE>return process;<NEW_LINE>} | redirectError(solrStderrPath.toFile()); |
788,232 | private // /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>void addBindings() {<NEW_LINE>amountTextField.textProperty().bindBidirectional(model.amount);<NEW_LINE>volumeTextField.textProperty().bindBidirectional(model.volume);<NEW_LINE>totalToPayTextField.textProperty().bind(model.totalToPay);<NEW_LINE>addressTextField.amountAsCoinProperty().bind(model.dataModel.getMissingCoin());<NEW_LINE>amountTextField.validationResultProperty().bind(model.amountValidationResult);<NEW_LINE>priceCurrencyLabel.textProperty().bind(createStringBinding(() -> CurrencyUtil.getCounterCurrency(model.dataModel.getCurrencyCode())));<NEW_LINE>priceAsPercentageLabel.prefWidthProperty().bind(priceCurrencyLabel.widthProperty());<NEW_LINE>nextButton.disableProperty().bind(model.isNextButtonDisabled);<NEW_LINE>tradeFeeInBtcLabel.textProperty().bind(model.tradeFeeInBtcWithFiat);<NEW_LINE>tradeFeeInBsqLabel.textProperty().bind(model.tradeFeeInBsqWithFiat);<NEW_LINE>tradeFeeDescriptionLabel.textProperty().bind(model.tradeFeeDescription);<NEW_LINE>tradeFeeInBtcLabel.visibleProperty().bind(model.isTradeFeeVisible);<NEW_LINE>tradeFeeInBsqLabel.visibleProperty().bind(model.isTradeFeeVisible);<NEW_LINE>tradeFeeDescriptionLabel.visibleProperty().bind(model.isTradeFeeVisible);<NEW_LINE>tradeFeeDescriptionLabel.managedProperty().bind(tradeFeeDescriptionLabel.visibleProperty());<NEW_LINE>// funding<NEW_LINE>fundingHBox.visibleProperty().bind(model.dataModel.getIsBtcWalletFunded().not().and(model.showPayFundsScreenDisplayed));<NEW_LINE>fundingHBox.managedProperty().bind(model.dataModel.getIsBtcWalletFunded().not().and(model.showPayFundsScreenDisplayed));<NEW_LINE>waitingForFundsLabel.textProperty().bind(model.spinnerInfoText);<NEW_LINE>takeOfferBox.visibleProperty().bind(model.dataModel.getIsBtcWalletFunded().and(model.showPayFundsScreenDisplayed));<NEW_LINE>takeOfferBox.managedProperty().bind(model.dataModel.getIsBtcWalletFunded().and(model.showPayFundsScreenDisplayed));<NEW_LINE>takeOfferButton.disableProperty(<MASK><NEW_LINE>} | ).bind(model.isTakeOfferButtonDisabled); |
109,671 | public void focusLost(FocusEvent e) {<NEW_LINE>if (// set by actionButton<NEW_LINE>e.isTemporary() || m_lookup == null || !m_button.isEnabled())<NEW_LINE>return;<NEW_LINE>// Text Lost focus<NEW_LINE>if (e.getSource() == m_text) {<NEW_LINE>String text = m_text.getText();<NEW_LINE>log.config(m_columnName + " (Text) " + m_columnName + <MASK><NEW_LINE>m_haveFocus = false;<NEW_LINE>// Skip if empty<NEW_LINE>if ((m_value == null && m_text.getText().length() == 0))<NEW_LINE>return;<NEW_LINE>if (m_lastDisplay.equals(text))<NEW_LINE>return;<NEW_LINE>//<NEW_LINE>// re-display<NEW_LINE>actionText();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Combo lost focus<NEW_LINE>if (e.getSource() != m_combo && e.getSource() != m_combo.getEditor().getEditorComponent())<NEW_LINE>return;<NEW_LINE>// Advise listeners of the change.<NEW_LINE>ActionEvent evt = new ActionEvent(this, 0, "vlookup-update");<NEW_LINE>processEvent(evt);<NEW_LINE>if (m_lookup.isValidated() && !m_lookup.hasInactive()) {<NEW_LINE>m_haveFocus = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// prevents actionPerformed<NEW_LINE>m_settingFocus = true;<NEW_LINE>//<NEW_LINE>log.config(m_columnName + " = " + m_combo.getSelectedItem());<NEW_LINE>Object obj = m_combo.getSelectedItem();<NEW_LINE>// Set value<NEW_LINE>if (obj != null) {<NEW_LINE>m_combo.setSelectedItem(obj);<NEW_LINE>// original model may not have item<NEW_LINE>if (!m_combo.getSelectedItem().equals(obj)) {<NEW_LINE>log.fine(m_columnName + " - added to combo - " + obj);<NEW_LINE>m_combo.addItem(obj);<NEW_LINE>m_combo.setSelectedItem(obj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// actionCombo(getValue());<NEW_LINE>m_settingFocus = false;<NEW_LINE>// can gain focus again<NEW_LINE>m_haveFocus = false;<NEW_LINE>} | " = " + m_value + " - " + text); |
1,079,385 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>securePercentage = view.findViewById(R.id.insights_dashboard_percent_secure);<NEW_LINE>progress = view.findViewById(R.id.insights_dashboard_progress);<NEW_LINE>progressContainer = view.findViewById(R.id.insights_dashboard_percent_container);<NEW_LINE>encryptedMessages = view.findViewById(R.id.insights_dashboard_encrypted_messages);<NEW_LINE>tagline = view.findViewById(R.id.insights_dashboard_tagline);<NEW_LINE>title = view.findViewById(R.id.insights_dashboard_make_signal_secure);<NEW_LINE>description = view.findViewById(R.id.insights_dashboard_invite_your_contacts);<NEW_LINE>insecureRecipients = view.findViewById(R.id.insights_dashboard_recycler);<NEW_LINE>locallyGenerated = view.<MASK><NEW_LINE>avatarImageView = view.findViewById(R.id.insights_dashboard_avatar);<NEW_LINE>startAConversation = view.findViewById(R.id.insights_dashboard_start_a_conversation);<NEW_LINE>lottieAnimationView = view.findViewById(R.id.insights_dashboard_lottie_animation);<NEW_LINE>toolbar = view.findViewById(R.id.insights_dashboard_toolbar);<NEW_LINE>setupStartAConversation();<NEW_LINE>setDashboardDetailsAlpha(0f);<NEW_LINE>setNotEnoughDataAlpha(0f);<NEW_LINE>setupToolbar();<NEW_LINE>setupRecycler();<NEW_LINE>initializeViewModel();<NEW_LINE>} | findViewById(R.id.insights_dashboard_this_stat_was_generated_locally); |
356,566 | static void orderMethods(Class<?> c, String orderS) throws Exception {<NEW_LINE>// #7023180<NEW_LINE>if (orderS == null) {<NEW_LINE>orderS = findOrder();<NEW_LINE>}<NEW_LINE>if ("natural".equals(orderS)) {<NEW_LINE>// NOI18N<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Method[] ms = null;<NEW_LINE>try {<NEW_LINE>Field declaredMethodsF = Class.class.getDeclaredField("declaredMethods");<NEW_LINE>declaredMethodsF.setAccessible(true);<NEW_LINE>while (ms == null) {<NEW_LINE>c.getDeclaredMethods();<NEW_LINE>ms = (Method[]) ((Reference) declaredMethodsF.get(c)).get();<NEW_LINE>}<NEW_LINE>} catch (NoSuchFieldException ex) {<NEW_LINE>// try JDK8<NEW_LINE>Field rdF = Class.class.getDeclaredField("reflectionData");<NEW_LINE>rdF.setAccessible(true);<NEW_LINE>c.getDeclaredMethods();<NEW_LINE>Reference<Object> ref = (Reference<Object<MASK><NEW_LINE>Object refData = ref.get();<NEW_LINE>Field dmF = refData.getClass().getDeclaredField("declaredMethods");<NEW_LINE>dmF.setAccessible(true);<NEW_LINE>ms = (Method[]) dmF.get(refData);<NEW_LINE>}<NEW_LINE>// prevent GC<NEW_LINE>allDeclaredMethods.add(ms);<NEW_LINE>if (orderS.equals("a-z")) {<NEW_LINE>abcSort(ms, true);<NEW_LINE>} else if (orderS.equals("z-a")) {<NEW_LINE>abcSort(ms, false);<NEW_LINE>} else if (orderS.equals("shuffle")) {<NEW_LINE>if (shuffleSeed == null) {<NEW_LINE>shuffleSeed = System.currentTimeMillis();<NEW_LINE>}<NEW_LINE>shuffle(ms, shuffleSeed);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>long seed = Long.parseLong(orderS);<NEW_LINE>shuffle(ms, seed);<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>throw new Exception("Specify -DNbTestCase.order=a-z or =z-a or =shuffle or =<number>");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | >) rdF.get(c); |
1,557,102 | public JFreeChart createChart(String type) {<NEW_LINE>if (m_goal.getAD_Chart_ID() > 0) {<NEW_LINE>MChart chart = new MChart(m_goal.getCtx(), m_goal.getAD_Chart_ID(), m_goal.get_TrxName());<NEW_LINE>return chart.createChart();<NEW_LINE>} else {<NEW_LINE>if (X_PA_Goal.CHARTTYPE_BarChart.equals(type)) {<NEW_LINE>return createBarChart();<NEW_LINE>} else if (X_PA_Goal.CHARTTYPE_PieChart.equals(type)) {<NEW_LINE>return createPieChart();<NEW_LINE>} else if (X_PA_Goal.CHARTTYPE_AreaChart.equals(type)) {<NEW_LINE>return createAreaChart();<NEW_LINE>} else if (X_PA_Goal.CHARTTYPE_LineChart.equals(type)) {<NEW_LINE>return createLineChart();<NEW_LINE>} else if (X_PA_Goal.CHARTTYPE_RingChart.equals(type)) {<NEW_LINE>return createRingChart();<NEW_LINE>} else if (X_PA_Goal.CHARTTYPE_WaterfallChart.equals(type)) {<NEW_LINE>return createWaterfallChart();<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | throw new IllegalArgumentException("unknown chart type=" + type); |
1,018,485 | public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {<NEW_LINE>// Get the connected device<NEW_LINE>BluetoothDevice device = gatt.getDevice();<NEW_LINE>String address = device.getAddress();<NEW_LINE>HashMap<Object, Object> connection = connections.get(address);<NEW_LINE>if (connection == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>queueRemove(connection);<NEW_LINE>UUID characteristicUuid = characteristic.getUuid();<NEW_LINE>CallbackContext callbackContext = GetCallback(characteristicUuid, connection, operationRead);<NEW_LINE>RemoveCallback(characteristicUuid, connection, operationRead);<NEW_LINE>// If no callback, just return<NEW_LINE>if (callbackContext == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JSONObject returnObj = new JSONObject();<NEW_LINE>addCharacteristic(returnObj, characteristic);<NEW_LINE>addDevice(returnObj, device);<NEW_LINE>// If successfully read, return value<NEW_LINE>if (status == BluetoothGatt.GATT_SUCCESS) {<NEW_LINE><MASK><NEW_LINE>addPropertyBytes(returnObj, keyValue, characteristic.getValue());<NEW_LINE>callbackContext.success(returnObj);<NEW_LINE>} else {<NEW_LINE>// Else it failed<NEW_LINE>addProperty(returnObj, keyError, errorRead);<NEW_LINE>addProperty(returnObj, keyMessage, logReadFailReturn);<NEW_LINE>callbackContext.error(returnObj);<NEW_LINE>}<NEW_LINE>} | addProperty(returnObj, keyStatus, statusRead); |
1,303,459 | public ListSigningJobsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListSigningJobsResult listSigningJobsResult = new ListSigningJobsResult();<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 listSigningJobsResult;<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("jobs", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listSigningJobsResult.setJobs(new ListUnmarshaller<SigningJob>(SigningJobJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listSigningJobsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listSigningJobsResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,577,086 | public void doAction() {<NEW_LINE>Array<Object[]> payload = getNotification().getBody();<NEW_LINE>for (int i = 0; i < payload.size; i++) {<NEW_LINE>Object[] itemData = payload.get(i);<NEW_LINE>Entity entity <MASK><NEW_LINE>Vector2 newLocation = (Vector2) itemData[1];<NEW_LINE>TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class);<NEW_LINE>Vector2 prevLocation = new Vector2(transformComponent.x, transformComponent.y);<NEW_LINE>if (itemData.length > 2) {<NEW_LINE>prevLocation = (Vector2) itemData[2];<NEW_LINE>}<NEW_LINE>prevLocations.put(EntityUtils.getEntityId(entity), prevLocation);<NEW_LINE>transformComponent.x = newLocation.x;<NEW_LINE>transformComponent.y = newLocation.y;<NEW_LINE>// pining UI to update current item properties tools<NEW_LINE>Overlap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity);<NEW_LINE>}<NEW_LINE>} | = (Entity) itemData[0]; |
526,764 | public Socket createSocket() throws JedisConnectionException {<NEW_LINE>Socket socket = null;<NEW_LINE>try {<NEW_LINE>HostAndPort _hostAndPort = getSocketHostAndPort();<NEW_LINE>socket = connectToFirstSuccessfulHost(_hostAndPort);<NEW_LINE>socket.setSoTimeout(socketTimeout);<NEW_LINE>if (ssl) {<NEW_LINE>SSLSocketFactory _sslSocketFactory = this.sslSocketFactory;<NEW_LINE>if (null == _sslSocketFactory) {<NEW_LINE>_sslSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();<NEW_LINE>}<NEW_LINE>socket = _sslSocketFactory.createSocket(socket, _hostAndPort.getHost(), <MASK><NEW_LINE>if (null != sslParameters) {<NEW_LINE>((SSLSocket) socket).setSSLParameters(sslParameters);<NEW_LINE>}<NEW_LINE>if (null != hostnameVerifier && !hostnameVerifier.verify(_hostAndPort.getHost(), ((SSLSocket) socket).getSession())) {<NEW_LINE>String message = String.format("The connection to '%s' failed ssl/tls hostname verification.", _hostAndPort.getHost());<NEW_LINE>throw new JedisConnectionException(message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return socket;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>IOUtils.closeQuietly(socket);<NEW_LINE>if (ex instanceof JedisConnectionException) {<NEW_LINE>throw (JedisConnectionException) ex;<NEW_LINE>} else {<NEW_LINE>throw new JedisConnectionException("Failed to create socket.", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | _hostAndPort.getPort(), true); |
278,498 | // DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static boolean canGetSourceDebugExtension0(com.sun.jdi.VirtualMachine a) {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.VirtualMachine", "canGetSourceDebugExtension", "JDI CALL: com.sun.jdi.VirtualMachine({0}).canGetSourceDebugExtension()", new Object[] { a });<NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE>boolean ret;<NEW_LINE>ret = a.canGetSourceDebugExtension();<NEW_LINE>retValue = ret;<NEW_LINE>return ret;<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>org.netbeans.modules.debugger.<MASK><NEW_LINE>return false;<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.Mirror) a).virtualMachine();<NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} catch (Error err) {<NEW_LINE>retValue = err;<NEW_LINE>throw err;<NEW_LINE>} catch (RuntimeException rex) {<NEW_LINE>retValue = rex;<NEW_LINE>throw rex;<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.VirtualMachine", "canGetSourceDebugExtension", retValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | jpda.JDIExceptionReporter.report(ex); |
240,505 | public static OnsTrendGroupOutputTpsResponse unmarshall(OnsTrendGroupOutputTpsResponse onsTrendGroupOutputTpsResponse, UnmarshallerContext _ctx) {<NEW_LINE>onsTrendGroupOutputTpsResponse.setRequestId(_ctx.stringValue("OnsTrendGroupOutputTpsResponse.RequestId"));<NEW_LINE>onsTrendGroupOutputTpsResponse.setHelpUrl(_ctx.stringValue("OnsTrendGroupOutputTpsResponse.HelpUrl"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setXUnit(_ctx.stringValue("OnsTrendGroupOutputTpsResponse.Data.XUnit"));<NEW_LINE>data.setYUnit(_ctx.stringValue("OnsTrendGroupOutputTpsResponse.Data.YUnit"));<NEW_LINE>data.setTitle(_ctx.stringValue("OnsTrendGroupOutputTpsResponse.Data.Title"));<NEW_LINE>List<StatsDataDo> records <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("OnsTrendGroupOutputTpsResponse.Data.Records.Length"); i++) {<NEW_LINE>StatsDataDo statsDataDo = new StatsDataDo();<NEW_LINE>statsDataDo.setY(_ctx.floatValue("OnsTrendGroupOutputTpsResponse.Data.Records[" + i + "].Y"));<NEW_LINE>statsDataDo.setX(_ctx.longValue("OnsTrendGroupOutputTpsResponse.Data.Records[" + i + "].X"));<NEW_LINE>records.add(statsDataDo);<NEW_LINE>}<NEW_LINE>data.setRecords(records);<NEW_LINE>onsTrendGroupOutputTpsResponse.setData(data);<NEW_LINE>return onsTrendGroupOutputTpsResponse;<NEW_LINE>} | = new ArrayList<StatsDataDo>(); |
424,942 | public void run() {<NEW_LINE><MASK><NEW_LINE>while (thread == me && !isShowing() || getSize().width == 0) {<NEW_LINE>try {<NEW_LINE>thread.sleep(500);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (thread == me && isShowing()) {<NEW_LINE>Dimension d = getSize();<NEW_LINE>if (d.width != w || d.height != h) {<NEW_LINE>w = d.width;<NEW_LINE>h = d.height;<NEW_LINE>bimg = (BufferedImage) createImage(w, h);<NEW_LINE>big = bimg.createGraphics();<NEW_LINE>big.setFont(font);<NEW_LINE>FontMetrics fm = big.getFontMetrics(font);<NEW_LINE>ascent = (int) fm.getAscent();<NEW_LINE>descent = (int) fm.getDescent();<NEW_LINE>}<NEW_LINE>repaint();<NEW_LINE>try {<NEW_LINE>thread.sleep(sleepAmount);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (MemoryMonitor1.dateStampCB.isSelected()) {<NEW_LINE>System.out.println(new Date().toString() + " " + usedStr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>thread = null;<NEW_LINE>} | Thread me = Thread.currentThread(); |
1,804,069 | private void computePreferredSize() {<NEW_LINE>inputVars = table.getInputVariables();<NEW_LINE>outputVars = table.getOutputVariables();<NEW_LINE>if (inputVars.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>inputVars.add(new Var(S.get("tableNoInputs"), 0));<NEW_LINE>}<NEW_LINE>if (outputVars.isEmpty()) {<NEW_LINE>outputVars = new ArrayList<>();<NEW_LINE>outputVars.add(new Var(S.get("tableNoOutputs"), 0));<NEW_LINE>}<NEW_LINE>cellHeight = defaultCellHeight;<NEW_LINE>inDim.reset(inputVars);<NEW_LINE>outDim.reset(outputVars);<NEW_LINE>final var gfx = getGraphics();<NEW_LINE>final var fm = (gfx != null ? gfx.getFontMetrics(headFont) : canvas.getFontMetrics(headFont));<NEW_LINE>cellHeight = fm.getHeight();<NEW_LINE>inDim.calculate(fm);<NEW_LINE>outDim.calculate(fm);<NEW_LINE>tableWidth = inDim.width + headerHorizSep + outDim.width;<NEW_LINE>computePreferredHeight();<NEW_LINE>} | inputVars = new ArrayList<>(); |
772,562 | public static ReplicaMetadataRequestInfo readFrom(DataInputStream stream, ClusterMap clusterMap, FindTokenHelper findTokenHelper, short requestVersion) throws IOException {<NEW_LINE>String hostName = Utils.readIntString(stream);<NEW_LINE>String replicaPath = Utils.readIntString(stream);<NEW_LINE>ReplicaType replicaType;<NEW_LINE>if (requestVersion == ReplicaMetadataRequest.Replica_Metadata_Request_Version_V2) {<NEW_LINE>replicaType = ReplicaType.values()[stream.readShort()];<NEW_LINE>} else {<NEW_LINE>// before version 2 we only have disk based replicas<NEW_LINE>replicaType = ReplicaType.DISK_BACKED;<NEW_LINE>}<NEW_LINE>PartitionId partitionId = clusterMap.getPartitionIdFromStream(stream);<NEW_LINE>FindTokenFactory <MASK><NEW_LINE>FindToken token = findTokenFactory.getFindToken(stream);<NEW_LINE>return new ReplicaMetadataRequestInfo(partitionId, token, hostName, replicaPath, replicaType, requestVersion);<NEW_LINE>} | findTokenFactory = findTokenHelper.getFindTokenFactoryFromReplicaType(replicaType); |
1,513,040 | public void continueTask() {<NEW_LINE>if (runInBackground) {<NEW_LINE>new Thread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>final Handler handler = new Handler(context.getMainLooper());<NEW_LINE>Runnable nextStep;<NEW_LINE>try {<NEW_LINE>nextStep = user.initiateUserAuthentication(clientMetadata, authenticationDetails, callback, RUN_IN_BACKGROUND);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>nextStep = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>callback.onFailure(e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>handler.post(nextStep);<NEW_LINE>}<NEW_LINE>}).start();<NEW_LINE>} else {<NEW_LINE>Runnable nextStep;<NEW_LINE>try {<NEW_LINE>nextStep = user.initiateUserAuthentication(<MASK><NEW_LINE>} catch (final Exception e) {<NEW_LINE>nextStep = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>callback.onFailure(e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>nextStep.run();<NEW_LINE>}<NEW_LINE>} | clientMetadata, authenticationDetails, callback, RUN_IN_CURRENT); |
1,231,860 | final AssociateNetworkSettingsResult executeAssociateNetworkSettings(AssociateNetworkSettingsRequest associateNetworkSettingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateNetworkSettingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<AssociateNetworkSettingsRequest> request = null;<NEW_LINE>Response<AssociateNetworkSettingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateNetworkSettingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateNetworkSettingsRequest));<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, "WorkSpaces Web");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateNetworkSettings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociateNetworkSettingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociateNetworkSettingsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
973,541 | public Query wildcardQuery(String value, MultiTermQuery.RewriteMethod method, boolean caseInsensitive, QueryShardContext context) {<NEW_LINE>failIfNotIndexed();<NEW_LINE>if (context.allowExpensiveQueries() == false) {<NEW_LINE>throw new OpenSearchException("[wildcard] queries cannot be executed when '" + ALLOW_EXPENSIVE_QUERIES.getKey() + "' is set to false.");<NEW_LINE>}<NEW_LINE>Term term;<NEW_LINE>if (getTextSearchInfo().getSearchAnalyzer() != null) {<NEW_LINE>value = normalizeWildcardPattern(name(), value, getTextSearchInfo().getSearchAnalyzer());<NEW_LINE>term = new Term(name(), value);<NEW_LINE>} else {<NEW_LINE>term = new Term(name(), indexedValueForSearch(value));<NEW_LINE>}<NEW_LINE>if (caseInsensitive) {<NEW_LINE>AutomatonQuery query = AutomatonQueries.caseInsensitiveWildcardQuery(term);<NEW_LINE><MASK><NEW_LINE>return query;<NEW_LINE>}<NEW_LINE>WildcardQuery query = new WildcardQuery(term);<NEW_LINE>QueryParsers.setRewriteMethod(query, method);<NEW_LINE>return query;<NEW_LINE>} | QueryParsers.setRewriteMethod(query, method); |
1,692,371 | private JTree buildTree() {<NEW_LINE>JTree tree = new JTree(treeRoot);<NEW_LINE>tree.setLayout(new BorderLayout());<NEW_LINE>tree.setBorder(BorderFactory.createEmptyBorder());<NEW_LINE>tree.setShowsRootHandles(false);<NEW_LINE>tree.setScrollsOnExpand(false);<NEW_LINE>tree.setSelectionModel(null);<NEW_LINE>tree.setCellRenderer(cellRenderer);<NEW_LINE>tree.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseClicked(MouseEvent event) {<NEW_LINE>if (SwingUtilities.isLeftMouseButton(event)) {<NEW_LINE>Object node = getNodeUnderMouse(tree, event);<NEW_LINE>if (node instanceof MethodTreeNode) {<NEW_LINE>JMethod method = ((<MASK><NEW_LINE>BackgroundExecutor executor = tabbedPane.getMainWindow().getBackgroundExecutor();<NEW_LINE>// TODO: fix bug with incorrect jump on just decompiled code<NEW_LINE>executor.// TODO: fix bug with incorrect jump on just decompiled code<NEW_LINE>execute(// TODO: fix bug with incorrect jump on just decompiled code<NEW_LINE>"Decompiling class", // TODO: fix bug with incorrect jump on just decompiled code<NEW_LINE>() -> tabbedPane.codeJump(method), status -> tabbedPane.codeJump(method));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>tree.addTreeExpansionListener(new TreeExpansionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void treeExpanded(TreeExpansionEvent event) {<NEW_LINE>TreePath path = event.getPath();<NEW_LINE>Object leaf = path.getLastPathComponent();<NEW_LINE>if (leaf instanceof CrimeTreeNode) {<NEW_LINE>CrimeTreeNode node = (CrimeTreeNode) leaf;<NEW_LINE>Enumeration<TreeNode> children = node.children();<NEW_LINE>while (children.hasMoreElements()) {<NEW_LINE>TreeNode child = children.nextElement();<NEW_LINE>tree.expandPath(path.pathByAddingChild(child));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void treeCollapsed(TreeExpansionEvent event) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return tree;<NEW_LINE>} | MethodTreeNode) node).getJMethod(); |
1,628,925 | private // which indicating redirect or exception.<NEW_LINE>boolean findOwnerBrokerForTopic(boolean authoritative, AsyncResponse asyncResponse) {<NEW_LINE>PartitionedTopicMetadata metadata = internalGetPartitionedMetadata(authoritative, false);<NEW_LINE>List<String> redirectAddresses = Collections.synchronizedList<MASK><NEW_LINE>CompletableFuture<Boolean> future = new CompletableFuture<>();<NEW_LINE>List<CompletableFuture<Void>> lookupFutures = new ArrayList<>();<NEW_LINE>if (!topicName.isPartitioned() && metadata.partitions > 1) {<NEW_LINE>// Partitioned topic with multiple partitions, need to do look up for each partition.<NEW_LINE>for (int index = 0; index < metadata.partitions; index++) {<NEW_LINE>lookupFutures.add(lookUpBrokerForTopic(topicName.getPartition(index), authoritative, redirectAddresses));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Non-partitioned topic or specific topic partition.<NEW_LINE>lookupFutures.add(lookUpBrokerForTopic(topicName, authoritative, redirectAddresses));<NEW_LINE>}<NEW_LINE>FutureUtil.waitForAll(lookupFutures).thenRun(() -> {<NEW_LINE>processLookUpResult(redirectAddresses, asyncResponse, future);<NEW_LINE>}).exceptionally(e -> {<NEW_LINE>processLookUpResult(redirectAddresses, asyncResponse, future);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>return future.get();<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Fail to lookup topic for rest produce message request for topic {}.", topicName.toString());<NEW_LINE>}<NEW_LINE>if (!asyncResponse.isDone()) {<NEW_LINE>asyncResponse.resume(new RestException(Status.INTERNAL_SERVER_ERROR, "Internal error: " + e.getMessage()));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} | (new ArrayList<>()); |
1,130,196 | public ListenableFuture<?> execute(DropFunction statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, Session session, List<Expression> parameters, WarningCollector warningCollector) {<NEW_LINE>Map<NodeRef<Parameter>, Expression> parameterLookup = parameterExtractor(statement, parameters);<NEW_LINE>Analyzer analyzer = new Analyzer(session, metadata, sqlParser, accessControl, Optional.empty(), parameters, parameterLookup, warningCollector);<NEW_LINE>analyzer.analyze(statement);<NEW_LINE>Optional<List<TypeSignature>> parameterTypes = statement.getParameterTypes().map(types -> types.stream().map(TypeSignature::parseTypeSignature).collect(toImmutableList()));<NEW_LINE>if (statement.isTemporary()) {<NEW_LINE>removeSessionFunction(session, new SqlFunctionId(QualifiedObjectName.valueOf(SESSION_NAMESPACE, statement.getFunctionName().getSuffix()), parameterTypes.orElse(emptyList())), statement.isExists());<NEW_LINE>} else {<NEW_LINE>metadata.getFunctionAndTypeManager().dropFunction(qualifyObjectName(statement.getFunctionName()), <MASK><NEW_LINE>}<NEW_LINE>return immediateFuture(null);<NEW_LINE>} | parameterTypes, statement.isExists()); |
198,056 | private boolean extractAnnotation(CoreMap sourceAnnotation, CoreMapAggregator aggregator) {<NEW_LINE>Class<TypesafeMap.Key<List<? extends CoreMap>>> tokensAnnotationKey = extractFunc.tokensAnnotationField;<NEW_LINE>if (chunkOffsets != null) {<NEW_LINE>annotation = aggregator.merge((List<? extends CoreMap>) sourceAnnotation.get(tokensAnnotationKey), chunkOffsets.getBegin(), chunkOffsets.getEnd());<NEW_LINE>if (sourceAnnotation.containsKey(CoreAnnotations.TextAnnotation.class)) {<NEW_LINE>ChunkAnnotationUtils.annotateChunkText(annotation, sourceAnnotation);<NEW_LINE>}<NEW_LINE>if (tokenOffsets != null) {<NEW_LINE>if (annotation.get(CoreAnnotations.TokenBeginAnnotation.class) == null) {<NEW_LINE>annotation.set(CoreAnnotations.TokenBeginAnnotation.class, tokenOffsets.getBegin());<NEW_LINE>}<NEW_LINE>if (annotation.get(CoreAnnotations.TokenEndAnnotation.class) == null) {<NEW_LINE>annotation.set(CoreAnnotations.TokenEndAnnotation.class, tokenOffsets.getEnd());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>charOffsets = Interval.toInterval(annotation.get(CoreAnnotations.CharacterOffsetBeginAnnotation.class), annotation.get(CoreAnnotations.CharacterOffsetEndAnnotation.class));<NEW_LINE>tokenOffsets = Interval.toInterval(annotation.get(CoreAnnotations.TokenBeginAnnotation.class), annotation.get(CoreAnnotations.TokenEndAnnotation.class), Interval.INTERVAL_OPEN_END);<NEW_LINE>} else {<NEW_LINE>Integer baseCharOffset = sourceAnnotation.get(CoreAnnotations.CharacterOffsetBeginAnnotation.class);<NEW_LINE>if (baseCharOffset == null) {<NEW_LINE>baseCharOffset = 0;<NEW_LINE>}<NEW_LINE>chunkOffsets = ChunkAnnotationUtils.getChunkOffsetsUsingCharOffsets((List<? extends CoreMap>) sourceAnnotation.get(tokensAnnotationKey), charOffsets.getBegin() + baseCharOffset, charOffsets.getEnd() + baseCharOffset);<NEW_LINE>CoreMap annotation2 = aggregator.merge((List<? extends CoreMap>) sourceAnnotation.get(tokensAnnotationKey), chunkOffsets.getBegin(), chunkOffsets.getEnd());<NEW_LINE>annotation = ChunkAnnotationUtils.getAnnotatedChunkUsingCharOffsets(sourceAnnotation, charOffsets.getBegin(), charOffsets.getEnd());<NEW_LINE>tokenOffsets = Interval.toInterval(annotation.get(CoreAnnotations.TokenBeginAnnotation.class), annotation.get(CoreAnnotations.TokenEndAnnotation.class), Interval.INTERVAL_OPEN_END);<NEW_LINE>annotation.set(tokensAnnotationKey<MASK><NEW_LINE>}<NEW_LINE>text = annotation.get(CoreAnnotations.TextAnnotation.class);<NEW_LINE>extractFunc.annotate(this, (List<? extends CoreMap>) annotation.get(tokensAnnotationKey));<NEW_LINE>return true;<NEW_LINE>} | , annotation2.get(tokensAnnotationKey)); |
1,466,785 | public static SearchFaceResponse unmarshall(SearchFaceResponse searchFaceResponse, UnmarshallerContext _ctx) {<NEW_LINE>searchFaceResponse.setRequestId(_ctx.stringValue("SearchFaceResponse.RequestId"));<NEW_LINE>searchFaceResponse.setCode(_ctx.stringValue("SearchFaceResponse.Code"));<NEW_LINE>searchFaceResponse.setMessage(_ctx.stringValue("SearchFaceResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>List<MatchListItem> matchList = new ArrayList<MatchListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("SearchFaceResponse.Data.MatchList.Length"); i++) {<NEW_LINE>MatchListItem matchListItem = new MatchListItem();<NEW_LINE>matchListItem.setQualitieScore(_ctx.floatValue("SearchFaceResponse.Data.MatchList[" + i + "].QualitieScore"));<NEW_LINE>Location location = new Location();<NEW_LINE>location.setWidth(_ctx.integerValue("SearchFaceResponse.Data.MatchList[" + i + "].Location.Width"));<NEW_LINE>location.setHeight(_ctx.integerValue("SearchFaceResponse.Data.MatchList[" + i + "].Location.Height"));<NEW_LINE>location.setY(_ctx.integerValue("SearchFaceResponse.Data.MatchList[" + i + "].Location.Y"));<NEW_LINE>location.setX(_ctx.integerValue<MASK><NEW_LINE>matchListItem.setLocation(location);<NEW_LINE>List<FaceItemsItem> faceItems = new ArrayList<FaceItemsItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("SearchFaceResponse.Data.MatchList[" + i + "].FaceItems.Length"); j++) {<NEW_LINE>FaceItemsItem faceItemsItem = new FaceItemsItem();<NEW_LINE>faceItemsItem.setEntityId(_ctx.stringValue("SearchFaceResponse.Data.MatchList[" + i + "].FaceItems[" + j + "].EntityId"));<NEW_LINE>faceItemsItem.setFaceId(_ctx.stringValue("SearchFaceResponse.Data.MatchList[" + i + "].FaceItems[" + j + "].FaceId"));<NEW_LINE>faceItemsItem.setScore(_ctx.floatValue("SearchFaceResponse.Data.MatchList[" + i + "].FaceItems[" + j + "].Score"));<NEW_LINE>faceItemsItem.setExtraData(_ctx.stringValue("SearchFaceResponse.Data.MatchList[" + i + "].FaceItems[" + j + "].ExtraData"));<NEW_LINE>faceItemsItem.setDbName(_ctx.stringValue("SearchFaceResponse.Data.MatchList[" + i + "].FaceItems[" + j + "].DbName"));<NEW_LINE>faceItemsItem.setConfidence(_ctx.floatValue("SearchFaceResponse.Data.MatchList[" + i + "].FaceItems[" + j + "].Confidence"));<NEW_LINE>faceItems.add(faceItemsItem);<NEW_LINE>}<NEW_LINE>matchListItem.setFaceItems(faceItems);<NEW_LINE>matchList.add(matchListItem);<NEW_LINE>}<NEW_LINE>data.setMatchList(matchList);<NEW_LINE>searchFaceResponse.setData(data);<NEW_LINE>return searchFaceResponse;<NEW_LINE>} | ("SearchFaceResponse.Data.MatchList[" + i + "].Location.X")); |
959,599 | private Mono<PagedResponse<DriveBitLockerKeyInner>> listSinglePageAsync(String jobName, String resourceGroupName, 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 (jobName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.list(this.client.getEndpoint(), jobName, this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), this.client.getAcceptLanguage(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
1,483,983 | private static StringLookupValue convertToStringLookupValue(@Nullable final Object value, @Nullable final LookupValueByIdSupplier lookupDataSource) {<NEW_LINE>if (value == null) {<NEW_LINE>return null;<NEW_LINE>} else if (value instanceof LookupValue) {<NEW_LINE>final LookupValue lookupValue = (LookupValue) value;<NEW_LINE>return toStringLookupValue(lookupValue);<NEW_LINE>} else if (value instanceof JSONLookupValue) {<NEW_LINE>final JSONLookupValue json = (JSONLookupValue) value;<NEW_LINE>return json.toStringLookupValue();<NEW_LINE>} else if (value instanceof Map) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Map<String, Object> map = (Map<String, Object>) value;<NEW_LINE>final StringLookupValue lookupValue = JSONLookupValue.stringLookupValueFromJsonMap(map);<NEW_LINE>if (Check.isEmpty(lookupValue.getDisplayName(), true) && lookupDataSource != null) {<NEW_LINE>// corner case: the frontend sent a lookup value like '{ "someKey" : "" }'<NEW_LINE>// => we need to resolve the name against the lookup<NEW_LINE>// see https://github.com/metasfresh/metasfresh-webui/issues/230<NEW_LINE>final LookupValue lookupValueResolved = lookupDataSource.findById(lookupValue.getId());<NEW_LINE>return toStringLookupValue(lookupValueResolved);<NEW_LINE>} else {<NEW_LINE>return lookupValue;<NEW_LINE>}<NEW_LINE>} else if (value instanceof String) {<NEW_LINE><MASK><NEW_LINE>return convertToStringLookupValue_fromString(valueStr, lookupDataSource);<NEW_LINE>} else if (value instanceof ReferenceListAwareEnum) {<NEW_LINE>final String valueStr = ((ReferenceListAwareEnum) value).getCode();<NEW_LINE>return convertToStringLookupValue_fromString(valueStr, lookupDataSource);<NEW_LINE>} else if (value instanceof Boolean) {<NEW_LINE>// corner case: happens for Posted field which is generated as Boolean but is defined as List of "_Posted Status".<NEW_LINE>// approach: convert the boolean to Y or N string. We assume our list contains entries for Y and N.<NEW_LINE>final Boolean valueBoolean = (Boolean) value;<NEW_LINE>final String valueStr = StringUtils.ofBoolean(valueBoolean);<NEW_LINE>return convertToStringLookupValue_fromString(valueStr, lookupDataSource);<NEW_LINE>} else {<NEW_LINE>throw new ValueConversionException().setFromValue(value).setTargetType(StringLookupValue.class).setLookupDataSource(lookupDataSource);<NEW_LINE>}<NEW_LINE>} | final String valueStr = (String) value; |
1,345,655 | private State _checkL(char command, boolean expectNumber, State state) throws IOException, DatatypeException {<NEW_LINE>for (; ; ) {<NEW_LINE>switch(state.current) {<NEW_LINE>default:<NEW_LINE>if (expectNumber) {<NEW_LINE>reportUnexpected("coordinate pair for " + "\u201c" + command + "\u201d command", state.current, state.context);<NEW_LINE>state = skipSubPath(state);<NEW_LINE>}<NEW_LINE>return state;<NEW_LINE>case '+':<NEW_LINE>case '-':<NEW_LINE>case '.':<NEW_LINE>case '0':<NEW_LINE>case '1':<NEW_LINE>case '2':<NEW_LINE>case '3':<NEW_LINE>case '4':<NEW_LINE>case '5':<NEW_LINE>case '6':<NEW_LINE>case '7':<NEW_LINE>case '8':<NEW_LINE>case '9':<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>state = <MASK><NEW_LINE>state = skipCommaSpaces(state);<NEW_LINE>state = checkArg(command, "y coordinate", state);<NEW_LINE>state = skipCommaSpaces2(state);<NEW_LINE>expectNumber = state.skipped;<NEW_LINE>}<NEW_LINE>} | checkArg(command, "x coordinate", state); |
514,538 | protected Message doReceiveNoWait(final String queueName) {<NEW_LINE>Message message = execute(channel -> {<NEW_LINE>GetResponse response = channel.basicGet(queueName, !isChannelTransacted());<NEW_LINE>// Response can be null is the case that there is no message on the queue.<NEW_LINE>if (response != null) {<NEW_LINE>long deliveryTag = response.getEnvelope().getDeliveryTag();<NEW_LINE>if (isChannelLocallyTransacted(channel)) {<NEW_LINE><MASK><NEW_LINE>channel.txCommit();<NEW_LINE>} else if (isChannelTransacted()) {<NEW_LINE>// Not locally transacted but it is transacted so it<NEW_LINE>// could be synchronized with an external transaction<NEW_LINE>ConnectionFactoryUtils.registerDeliveryTag(getConnectionFactory(), channel, deliveryTag);<NEW_LINE>}<NEW_LINE>return RabbitTemplate.this.buildMessageFromResponse(response);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}, obtainTargetConnectionFactory(this.receiveConnectionFactorySelectorExpression, queueName));<NEW_LINE>logReceived(message);<NEW_LINE>return message;<NEW_LINE>} | channel.basicAck(deliveryTag, false); |
420,267 | public List<StoragePoolJoinVO> searchByIds(Long... spIds) {<NEW_LINE>// set detail batch query size<NEW_LINE>int DETAILS_BATCH_SIZE = 2000;<NEW_LINE>String batchCfg = _configDao.getValue("detail.batch.query.size");<NEW_LINE>if (batchCfg != null) {<NEW_LINE>DETAILS_BATCH_SIZE = Integer.parseInt(batchCfg);<NEW_LINE>}<NEW_LINE>// query details by batches<NEW_LINE>List<StoragePoolJoinVO> uvList = new ArrayList<StoragePoolJoinVO>();<NEW_LINE>// query details by batches<NEW_LINE>int curr_index = 0;<NEW_LINE>if (spIds.length > DETAILS_BATCH_SIZE) {<NEW_LINE>while ((curr_index + DETAILS_BATCH_SIZE) <= spIds.length) {<NEW_LINE>Long[] ids = new Long[DETAILS_BATCH_SIZE];<NEW_LINE>for (int k = 0, j = curr_index; j < curr_index + DETAILS_BATCH_SIZE; j++, k++) {<NEW_LINE>ids[k] = spIds[j];<NEW_LINE>}<NEW_LINE>SearchCriteria<StoragePoolJoinVO> sc = spSearch.create();<NEW_LINE><MASK><NEW_LINE>List<StoragePoolJoinVO> vms = searchIncludingRemoved(sc, null, null, false);<NEW_LINE>if (vms != null) {<NEW_LINE>uvList.addAll(vms);<NEW_LINE>}<NEW_LINE>curr_index += DETAILS_BATCH_SIZE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (curr_index < spIds.length) {<NEW_LINE>int batch_size = (spIds.length - curr_index);<NEW_LINE>// set the ids value<NEW_LINE>Long[] ids = new Long[batch_size];<NEW_LINE>for (int k = 0, j = curr_index; j < curr_index + batch_size; j++, k++) {<NEW_LINE>ids[k] = spIds[j];<NEW_LINE>}<NEW_LINE>SearchCriteria<StoragePoolJoinVO> sc = spSearch.create();<NEW_LINE>sc.setParameters("idIN", ids);<NEW_LINE>List<StoragePoolJoinVO> vms = searchIncludingRemoved(sc, null, null, false);<NEW_LINE>if (vms != null) {<NEW_LINE>uvList.addAll(vms);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return uvList;<NEW_LINE>} | sc.setParameters("idIN", ids); |
533,245 | private Optional<PredicateFinalStep> buildExpansionPredicate(List<String> theCodes, SearchPredicateFactory thePredicate) {<NEW_LINE>if (CollectionUtils.isEmpty(theCodes)) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (theCodes.size() < BooleanQuery.getMaxClauseCount()) {<NEW_LINE>return Optional.of(thePredicate.simpleQueryString().field("myCode").matching(String.<MASK><NEW_LINE>}<NEW_LINE>// Number of codes is larger than maxClauseCount, so we split the query in several clauses<NEW_LINE>// partition codes in lists of BooleanQuery.getMaxClauseCount() size<NEW_LINE>List<List<String>> listOfLists = ListUtils.partition(theCodes, BooleanQuery.getMaxClauseCount());<NEW_LINE>PredicateFinalStep step = thePredicate.bool(b -> {<NEW_LINE>b.minimumShouldMatchNumber(1);<NEW_LINE>for (List<String> codeList : listOfLists) {<NEW_LINE>b.should(p -> p.simpleQueryString().field("myCode").matching(String.join(" | ", codeList)));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return Optional.of(step);<NEW_LINE>} | join(" | ", theCodes))); |
1,811,251 | public static SearchTracesByPageResponse unmarshall(SearchTracesByPageResponse searchTracesByPageResponse, UnmarshallerContext _ctx) {<NEW_LINE>searchTracesByPageResponse.setRequestId(_ctx.stringValue("SearchTracesByPageResponse.RequestId"));<NEW_LINE>PageBean pageBean = new PageBean();<NEW_LINE>pageBean.setPageNumber(_ctx.integerValue("SearchTracesByPageResponse.PageBean.PageNumber"));<NEW_LINE>pageBean.setPageSize<MASK><NEW_LINE>pageBean.setTotal(_ctx.integerValue("SearchTracesByPageResponse.PageBean.Total"));<NEW_LINE>List<TraceInfo> traceInfos = new ArrayList<TraceInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("SearchTracesByPageResponse.PageBean.TraceInfos.Length"); i++) {<NEW_LINE>TraceInfo traceInfo = new TraceInfo();<NEW_LINE>traceInfo.setOperationName(_ctx.stringValue("SearchTracesByPageResponse.PageBean.TraceInfos[" + i + "].OperationName"));<NEW_LINE>traceInfo.setServiceIp(_ctx.stringValue("SearchTracesByPageResponse.PageBean.TraceInfos[" + i + "].ServiceIp"));<NEW_LINE>traceInfo.setDuration(_ctx.longValue("SearchTracesByPageResponse.PageBean.TraceInfos[" + i + "].Duration"));<NEW_LINE>traceInfo.setTimestamp(_ctx.longValue("SearchTracesByPageResponse.PageBean.TraceInfos[" + i + "].Timestamp"));<NEW_LINE>traceInfo.setServiceName(_ctx.stringValue("SearchTracesByPageResponse.PageBean.TraceInfos[" + i + "].ServiceName"));<NEW_LINE>traceInfo.setTraceID(_ctx.stringValue("SearchTracesByPageResponse.PageBean.TraceInfos[" + i + "].TraceID"));<NEW_LINE>traceInfos.add(traceInfo);<NEW_LINE>}<NEW_LINE>pageBean.setTraceInfos(traceInfos);<NEW_LINE>searchTracesByPageResponse.setPageBean(pageBean);<NEW_LINE>return searchTracesByPageResponse;<NEW_LINE>} | (_ctx.integerValue("SearchTracesByPageResponse.PageBean.PageSize")); |
307,240 | private void validateGELFMessage(JsonNode jsonNode, UUID id, ResolvableInetSocketAddress remoteAddress) {<NEW_LINE>final String prefix = "GELF message <" + id + "> " + (remoteAddress == null ? "" : "(received from <" + remoteAddress + ">) ");<NEW_LINE>final JsonNode hostNode = jsonNode.path("host");<NEW_LINE>if (hostNode.isMissingNode()) {<NEW_LINE>log.warn(prefix + "is missing mandatory \"host\" field.");<NEW_LINE>} else {<NEW_LINE>if (!hostNode.isTextual()) {<NEW_LINE>throw new IllegalArgumentException(prefix + "has invalid \"host\": " + hostNode.asText());<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(hostNode.asText())) {<NEW_LINE>throw new IllegalArgumentException(prefix + "has empty mandatory \"host\" field.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final JsonNode shortMessageNode = jsonNode.path("short_message");<NEW_LINE>final JsonNode messageNode = jsonNode.path("message");<NEW_LINE>if (!shortMessageNode.isMissingNode()) {<NEW_LINE>if (!shortMessageNode.isTextual()) {<NEW_LINE>throw new IllegalArgumentException(prefix + "has invalid \"short_message\": " + shortMessageNode.asText());<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(shortMessageNode.asText()) && StringUtils.isBlank(messageNode.asText())) {<NEW_LINE>throw new IllegalArgumentException(prefix + "has empty mandatory \"short_message\" field.");<NEW_LINE>}<NEW_LINE>} else if (!messageNode.isMissingNode()) {<NEW_LINE>if (!messageNode.isTextual()) {<NEW_LINE>throw new IllegalArgumentException(prefix + "has invalid \"message\": " + messageNode.asText());<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(messageNode.asText())) {<NEW_LINE>throw new IllegalArgumentException(prefix + "has empty mandatory \"message\" field.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(prefix + "is missing mandatory \"short_message\" or \"message\" field.");<NEW_LINE>}<NEW_LINE>final JsonNode timestampNode = jsonNode.path("timestamp");<NEW_LINE>if (timestampNode.isValueNode() && !timestampNode.isNumber()) {<NEW_LINE>log.warn(prefix + "has invalid \"timestamp\": {} (type: {})", timestampNode.asText(), timestampNode.<MASK><NEW_LINE>}<NEW_LINE>} | getNodeType().name()); |
753,509 | private static List<ConsumerVO> convert(List<ConsumerGroupOffsets> consumerGroupOffsets, Collection<TopicVO> topicVos) {<NEW_LINE>final var topicVoMap = topicVos.stream().collect(Collectors.toMap(TopicVO::getName, Function.identity()));<NEW_LINE>final var groupTopicPartitionOffsetMap = new TreeMap<String, Map<String, Map<Integer, Long>>>();<NEW_LINE>for (var consumerGroupOffset : consumerGroupOffsets) {<NEW_LINE>final var groupId = consumerGroupOffset.groupId;<NEW_LINE>for (var topicPartitionOffset : consumerGroupOffset.offsets.entrySet()) {<NEW_LINE>final var topic = topicPartitionOffset<MASK><NEW_LINE>final var partition = topicPartitionOffset.getKey().partition();<NEW_LINE>final var offset = topicPartitionOffset.getValue().offset();<NEW_LINE>groupTopicPartitionOffsetMap.computeIfAbsent(groupId, unused -> new TreeMap<>()).computeIfAbsent(topic, unused -> new TreeMap<>()).put(partition, offset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final var consumerVos = new ArrayList<ConsumerVO>(consumerGroupOffsets.size());<NEW_LINE>for (var groupTopicPartitionOffset : groupTopicPartitionOffsetMap.entrySet()) {<NEW_LINE>final var groupId = groupTopicPartitionOffset.getKey();<NEW_LINE>final var consumerVo = new ConsumerVO(groupId);<NEW_LINE>consumerVos.add(consumerVo);<NEW_LINE>for (var topicPartitionOffset : groupTopicPartitionOffset.getValue().entrySet()) {<NEW_LINE>final var topic = topicPartitionOffset.getKey();<NEW_LINE>final var consumerTopicVo = new ConsumerTopicVO(topic);<NEW_LINE>consumerVo.addTopic(consumerTopicVo);<NEW_LINE>for (var partitionOffset : topicPartitionOffset.getValue().entrySet()) {<NEW_LINE>final var partition = partitionOffset.getKey();<NEW_LINE>final var offset = partitionOffset.getValue();<NEW_LINE>final var offsetVo = new ConsumerPartitionVO(groupId, topic, partition);<NEW_LINE>consumerTopicVo.addOffset(offsetVo);<NEW_LINE>offsetVo.setOffset(offset);<NEW_LINE>final var topicVo = topicVoMap.get(topic);<NEW_LINE>final var topicPartitionVo = topicVo.getPartition(partition);<NEW_LINE>offsetVo.setSize(topicPartitionVo.map(TopicPartitionVO::getSize).orElse(-1L));<NEW_LINE>offsetVo.setFirstOffset(topicPartitionVo.map(TopicPartitionVO::getFirstOffset).orElse(-1L));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return consumerVos;<NEW_LINE>} | .getKey().topic(); |
1,361,013 | static void writeExcel(List<ExcelSheetExport> exports, File path) throws IOException, ExcelExportException {<NEW_LINE>// Create a Workbook<NEW_LINE>// new HSSFWorkbook() for generating `.xls` file<NEW_LINE>Workbook workbook = new XSSFWorkbook();<NEW_LINE>// Create a Font for styling header cells<NEW_LINE>Font headerFont = workbook.createFont();<NEW_LINE>headerFont.setBold(true);<NEW_LINE>// headerFont.setFontHeightInPoints((short) 14);<NEW_LINE>// Create a CellStyle with the font<NEW_LINE>HorizontalAlignment alignment = HorizontalAlignment.LEFT;<NEW_LINE>CellStyle headerCellStyle = workbook.createCellStyle();<NEW_LINE>headerCellStyle.setFont(headerFont);<NEW_LINE>headerCellStyle.setAlignment(alignment);<NEW_LINE>CellStyle defaultCellStyle = workbook.createCellStyle();<NEW_LINE>defaultCellStyle.setAlignment(alignment);<NEW_LINE>WorksheetEnv env = new WorksheetEnv(headerCellStyle, defaultCellStyle, workbook);<NEW_LINE>if (exports != null) {<NEW_LINE>for (int i = 0; i < exports.size(); i++) {<NEW_LINE>ExcelSheetExport export = exports.get(i);<NEW_LINE>if (export == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (sheetName == null) {<NEW_LINE>sheetName = Bundle.ExcelExport_writeExcel_noSheetName(i + 1);<NEW_LINE>}<NEW_LINE>Sheet sheet = workbook.createSheet(sheetName);<NEW_LINE>export.renderSheet(sheet, env);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Write the output to a file<NEW_LINE>FileOutputStream fileOut = new FileOutputStream(path);<NEW_LINE>workbook.write(fileOut);<NEW_LINE>fileOut.close();<NEW_LINE>// Closing the workbook<NEW_LINE>workbook.close();<NEW_LINE>} | String sheetName = export.getSheetName(); |
175,945 | private boolean processShortcut(KeyEvent ev) {<NEW_LINE>// ignore shortcut keys when the IDE is shutting down<NEW_LINE>if (NbLifecycleManager.isExiting()) {<NEW_LINE>ev.consume();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>KeyStroke ks = KeyStroke.getKeyStrokeForEvent(ev);<NEW_LINE>Window w = SwingUtilities.windowForComponent(ev.getComponent());<NEW_LINE>// don't process shortcuts if this is a help frame<NEW_LINE>if (// NOI18N<NEW_LINE>(w instanceof JFrame) && ((JFrame) w).getRootPane().getClientProperty("netbeans.helpframe") != null)<NEW_LINE>return true;<NEW_LINE>// don't let action keystrokes to propagate from both<NEW_LINE>// modal and nonmodal dialogs, but propagate from separate floating windows,<NEW_LINE>// even if they are backed by JDialog<NEW_LINE>if ((w instanceof Dialog) && !WindowManagerImpl.isSeparateWindow(w) && !isTransmodalAction(ks)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Provide a reasonably useful action event that identifies what was focused<NEW_LINE>// when the key was pressed, as well as what keystroke ran the action.<NEW_LINE>ActionEvent aev = new ActionEvent(ev.getSource(), ActionEvent.ACTION_PERFORMED, Utilities.keyToString(ks));<NEW_LINE>Keymap root = Lookup.getDefault(<MASK><NEW_LINE>Action a = root.getAction(ks);<NEW_LINE>if (a != null && a.isEnabled()) {<NEW_LINE>ActionManager am = Lookup.getDefault().lookup(ActionManager.class);<NEW_LINE>am.invokeAction(a, aev);<NEW_LINE>ev.consume();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | ).lookup(Keymap.class); |
1,382,272 | /* public void operate(SimFunctionContext<String> context) {<NEW_LINE>String first = context.getFirstOperand();<NEW_LINE>String second = context.getSecondOperand();<NEW_LINE>double score1 = 0.0;<NEW_LINE>double score2 = 0.0;<NEW_LINE>double score = 0.0;<NEW_LINE>try {<NEW_LINE>if (!(first == null || first.trim().equals(""))) {<NEW_LINE>score1 = 1.0d;<NEW_LINE>}<NEW_LINE>if (!(second == null || second.trim().equals(""))) {<NEW_LINE>score2 = 1.0d;<NEW_LINE>}<NEW_LINE>if (score1 == 1.0d && score2 == 1.0d) {<NEW_LINE>SAffineGap gap = new SAffineGap();<NEW_LINE>SJaroWinkler gap1 = new SJaroWinkler();<NEW_LINE>String f = first<MASK><NEW_LINE>String s = second.split("\\s+")[0];<NEW_LINE>if (!(f == null || f.trim().equals("")) && !(s == null || s.trim().equals(""))) {<NEW_LINE>score = gap.score(f.trim(), s.trim());<NEW_LINE>score1 = gap1.score(f.trim(), s.trim());<NEW_LINE><NEW_LINE>//LOG.debug(gap.explainScore(first, second));<NEW_LINE>gap = null;<NEW_LINE>}<NEW_LINE>LOG.debug("gap bw " + f + " and " + s + " is " +<NEW_LINE>score1 + "," + score2 + ", " + score);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn("Error processing differences for " + first + "," + second);<NEW_LINE>} finally {<NEW_LINE>context.addToResult(score1);<NEW_LINE>//context.addToResult(score2);<NEW_LINE>context.addToResult(score);<NEW_LINE>LOG.debug("Same first word gap bw " + first + " and " + second + " is " +<NEW_LINE>score1 + "," + score2 + ", " + score + ", " + score1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public Double call(String first, String second) {<NEW_LINE>if (first == null || first.trim().length() == 0)<NEW_LINE>return 1d;<NEW_LINE>if (second == null || second.trim().length() == 0)<NEW_LINE>return 1d;<NEW_LINE>String f = first.split("-")[0];<NEW_LINE>String s = second.split("-")[0];<NEW_LINE>double score = super.call(f, s);<NEW_LINE>// LOG.info(" score " + f + " " + s + " " + score);<NEW_LINE>return score;<NEW_LINE>} | .split("\\s+")[0]; |
134,153 | public Texture generateWhiteNoise(GL2 gl2, int width, int height) {<NEW_LINE>float[] noise = new float[width * height];<NEW_LINE>Bitmap bitmap = Bitmap.createBitmap(width / 2, height / 2, Bitmap.Config.ARGB_4444);<NEW_LINE>for (int i = 0; i < width / 2; i++) for (int j = 0; j < height / 2; j++) {<NEW_LINE>int a = (int) (255 * (.5f - currentFeedback / 2f));<NEW_LINE>// int r = random.nextInt(256);<NEW_LINE>int <MASK><NEW_LINE>int b = random.nextInt(256);<NEW_LINE>int color = (a << 24) | (0 << 16) | (g << 8) | b;<NEW_LINE>bitmap.setPixel(i, j, color);<NEW_LINE>}<NEW_LINE>Texture texture = convertBitmapToTexture(bitmap);<NEW_LINE>return texture;<NEW_LINE>} | g = random.nextInt(256); |
712,212 | public static void vertical9(Kernel1D_S32 kernel, GrayU8 src, GrayI16 dst) {<NEW_LINE>final byte[] dataSrc = src.data;<NEW_LINE>final short[] dataDst = dst.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int k5 = kernel.data[4];<NEW_LINE>final int k6 = kernel.data[5];<NEW_LINE>final int k7 = kernel.data[6];<NEW_LINE>final int k8 = kernel.data[7];<NEW_LINE>final int k9 = kernel.data[8];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int imgWidth = dst.getWidth();<NEW_LINE>final int imgHeight = dst.getHeight();<NEW_LINE>final int yEnd = imgHeight - radius;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(radius, yEnd, y -> {<NEW_LINE>for (int y = radius; y < yEnd; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>int i = src.startIndex + (y - radius) * src.stride;<NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>int total = (dataSrc[indexSrc] & 0xFF) * k1;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k2;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k3;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k4;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k5;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k6;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k7;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k8;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k9;<NEW_LINE>dataDst[<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | indexDst++] = (short) total; |
1,511,603 | static KeyStore buildKeyStore(final InputStream certChainFile, final InputStream keyFile, final char[] keyPasswordChars) throws KeyStoreException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeySpecException, InvalidAlgorithmParameterException, CertificateException, KeyException, IOException {<NEW_LINE>ByteBuffer encodedKeyBuf = PemReader.readPrivateKey(keyFile);<NEW_LINE>byte[] encodedKey = encodedKeyBuf.array();<NEW_LINE>PKCS8EncodedKeySpec encodedKeySpec = generateKeySpec(keyPasswordChars, encodedKey);<NEW_LINE>PrivateKey key;<NEW_LINE>try {<NEW_LINE>key = KeyFactory.getInstance("RSA").generatePrivate(encodedKeySpec);<NEW_LINE>} catch (InvalidKeySpecException ignore) {<NEW_LINE>try {<NEW_LINE>key = KeyFactory.getInstance("DSA").generatePrivate(encodedKeySpec);<NEW_LINE>} catch (InvalidKeySpecException ignore2) {<NEW_LINE>try {<NEW_LINE>key = KeyFactory.getInstance("EC").generatePrivate(encodedKeySpec);<NEW_LINE>} catch (InvalidKeySpecException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CertificateFactory cf = CertificateFactory.getInstance("X.509");<NEW_LINE>List<ByteBuffer> certs = PemReader.readCertificates(certChainFile);<NEW_LINE>List<Certificate> certChain = new ArrayList<Certificate>(certs.size());<NEW_LINE>for (ByteBuffer buf : certs) {<NEW_LINE>certChain.add(cf.generateCertificate(new ByteArrayInputStream(buf.array())));<NEW_LINE>}<NEW_LINE>KeyStore ks = KeyStore.getInstance("JKS");<NEW_LINE>ks.load(null, null);<NEW_LINE>ks.setKeyEntry("key", key, keyPasswordChars, certChain.toArray(new Certificate[0]));<NEW_LINE>return ks;<NEW_LINE>} | throw new InvalidKeySpecException("Neither RSA, DSA nor EC worked", e); |
514,214 | private TScanRangeLocations newLocations(TFileScanRangeParams params, BackendPolicy backendPolicy) {<NEW_LINE>// Generate on file scan range<NEW_LINE>TFileScanRange fileScanRange = new TFileScanRange();<NEW_LINE>fileScanRange.setParams(params);<NEW_LINE>// Scan range<NEW_LINE>TExternalScanRange externalScanRange = new TExternalScanRange();<NEW_LINE>externalScanRange.setFileScanRange(fileScanRange);<NEW_LINE>TScanRange scanRange = new TScanRange();<NEW_LINE>scanRange.setExtScanRange(externalScanRange);<NEW_LINE>// Locations<NEW_LINE>TScanRangeLocations locations = new TScanRangeLocations();<NEW_LINE>locations.setScanRange(scanRange);<NEW_LINE>TScanRangeLocation location = new TScanRangeLocation();<NEW_LINE>Backend selectedBackend = backendPolicy.getNextBe();<NEW_LINE>location.<MASK><NEW_LINE>location.setServer(new TNetworkAddress(selectedBackend.getHost(), selectedBackend.getBePort()));<NEW_LINE>locations.addToLocations(location);<NEW_LINE>return locations;<NEW_LINE>} | setBackendId(selectedBackend.getId()); |
1,462,558 | public Xavc4kIntraCbgProfileSettings unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Xavc4kIntraCbgProfileSettings xavc4kIntraCbgProfileSettings = new Xavc4kIntraCbgProfileSettings();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("xavcClass", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>xavc4kIntraCbgProfileSettings.setXavcClass(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return xavc4kIntraCbgProfileSettings;<NEW_LINE>} | class).unmarshall(context)); |
519,645 | private static ProjectLibrary createScalaSdkLibrary(Project scalaProject, Iterable<File> files, boolean useScalaSdk, IdeaModule ideaModule) {<NEW_LINE>ScalaRuntime runtime = scalaProject.getExtensions(<MASK><NEW_LINE>if (runtime != null) {<NEW_LINE>FileCollection scalaClasspath = runtime.inferScalaClasspath(files);<NEW_LINE>File compilerJar = runtime.findScalaJar(scalaClasspath, "compiler");<NEW_LINE>if (compilerJar == null) {<NEW_LINE>compilerJar = runtime.findScalaJar(scalaClasspath, "compiler_3");<NEW_LINE>}<NEW_LINE>String scalaVersion = compilerJar != null ? runtime.getScalaVersion(compilerJar) : DEFAULT_SCALA_PLATFORM_VERSION;<NEW_LINE>return createScalaSdkFromScalaVersion(scalaVersion, scalaClasspath, useScalaSdk);<NEW_LINE>} else {<NEW_LINE>// One of the Scala plugins is applied, but ScalaRuntime extension is missing or the ScalaPlatform is undefined.<NEW_LINE>// we can't create a Scala SDK without either one<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | ).findByType(ScalaRuntime.class); |
497,421 | public void createPartControl(Composite parent) {<NEW_LINE>Server server = ServerManager.getInstance().getServer(serverId);<NEW_LINE>this.setPartName("Connections[" + server.getName() + "][" + date + "]");<NEW_LINE>GridLayout layout = new GridLayout(1, true);<NEW_LINE>layout.marginHeight = 5;<NEW_LINE>layout.marginWidth = 5;<NEW_LINE>parent.setLayout(layout);<NEW_LINE>parent.setBackground(ColorUtil.getInstance().getColor(SWT.COLOR_WHITE));<NEW_LINE>parent.setBackgroundMode(SWT.INHERIT_FORCE);<NEW_LINE>canvas = new FigureCanvas(parent);<NEW_LINE>canvas.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>canvas.setScrollBarVisibility(FigureCanvas.NEVER);<NEW_LINE>canvas.addControlListener(new ControlListener() {<NEW_LINE><NEW_LINE>public void controlMoved(ControlEvent arg0) {<NEW_LINE>}<NEW_LINE><NEW_LINE>public void controlResized(ControlEvent arg0) {<NEW_LINE>Rectangle r = canvas.getClientArea();<NEW_LINE>xyGraph.setSize(r.width, r.height);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>xyGraph = new XYGraph();<NEW_LINE>xyGraph.setShowLegend(true);<NEW_LINE>xyGraph.setShowTitle(false);<NEW_LINE>canvas.setContents(xyGraph);<NEW_LINE>xyGraph.primaryXAxis.setDateEnabled(true);<NEW_LINE>xyGraph.primaryXAxis.setShowMajorGrid(true);<NEW_LINE>xyGraph.primaryYAxis.setAutoScale(true);<NEW_LINE>xyGraph.primaryYAxis.setShowMajorGrid(true);<NEW_LINE>xyGraph.primaryXAxis.setFormatPattern("HH:mm:ss");<NEW_LINE>xyGraph.primaryYAxis.setFormatPattern("#,##0");<NEW_LINE>xyGraph.primaryXAxis.setTitle("");<NEW_LINE>xyGraph.primaryYAxis.setTitle("");<NEW_LINE>final CircularBufferDataProvider totalProvider = new CircularBufferDataProvider(true);<NEW_LINE>totalProvider.setBufferSize(BUFFER_SIZE);<NEW_LINE>totalProvider.setCurrentXDataArray(new double[] {});<NEW_LINE>totalProvider.setCurrentYDataArray(new double[] {});<NEW_LINE>totalTrace = new Trace("Total (SUM)", xyGraph.primaryXAxis, xyGraph.primaryYAxis, totalProvider);<NEW_LINE>totalTrace.setPointStyle(PointStyle.NONE);<NEW_LINE>totalTrace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));<NEW_LINE>totalTrace.setTraceType(TraceType.SOLID_LINE);<NEW_LINE>totalTrace.setTraceColor(ColorUtil.getInstance().getColor(SWT.COLOR_DARK_RED));<NEW_LINE>xyGraph.addTrace(totalTrace);<NEW_LINE>CircularBufferDataProvider activeProvider = new CircularBufferDataProvider(true);<NEW_LINE>activeProvider.setBufferSize(BUFFER_SIZE);<NEW_LINE>activeProvider.setCurrentXDataArray(new double[] {});<NEW_LINE>activeProvider.setCurrentYDataArray(new double[] {});<NEW_LINE>activeTrace = new Trace("Running (SUM)", xyGraph.primaryXAxis, xyGraph.primaryYAxis, activeProvider);<NEW_LINE>activeTrace.setPointStyle(PointStyle.NONE);<NEW_LINE>activeTrace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));<NEW_LINE>activeTrace.setTraceType(TraceType.SOLID_LINE);<NEW_LINE>activeTrace.setTraceColor(ColorUtil.getInstance().getColor(SWT.COLOR_DARK_GREEN));<NEW_LINE>xyGraph.addTrace(activeTrace);<NEW_LINE>ScouterUtil.addHorizontalRangeListener(xyGraph.getPlotArea(), <MASK><NEW_LINE>IToolBarManager man = getViewSite().getActionBars().getToolBarManager();<NEW_LINE>man.add(new OpenDbDailyConnView(serverId, date));<NEW_LINE>man.add(new Action("Zoom out", ImageUtil.getImageDescriptor(Images.zoomout)) {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>long stime = DateUtil.yyyymmdd(date);<NEW_LINE>long etime = stime + DateUtil.MILLIS_PER_DAY - 1;<NEW_LINE>xyGraph.primaryXAxis.setRange(stime, etime);<NEW_LINE>double max = ChartUtil.getMax(totalProvider.iterator());<NEW_LINE>xyGraph.primaryYAxis.setRange(0, max);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>load();<NEW_LINE>} | new OpenDigestTableAction(serverId), true); |
271,696 | public void appendRuntimeTo(Appendable out) throws IOException {<NEW_LINE><MASK><NEW_LINE>if (!runtime.isEmpty()) {<NEW_LINE>mode.appendTraditional(runtime, out, null);<NEW_LINE>}<NEW_LINE>if (transpiler == Transpiler.NULL) {<NEW_LINE>mode.appendTraditional(es6ModuleTranspiler.runtime(), out, null);<NEW_LINE>}<NEW_LINE>mode.appendTraditional("this.CLOSURE_EVAL_PREFILTER = function(s) { return s; };", out, null);<NEW_LINE>mode.appendTraditional("(function(thisValue){", out, null);<NEW_LINE>// Check for Chrome <87 which does not eval properly in workers.<NEW_LINE>mode.appendTraditional("var isChrome87 = false; try {isChrome87 = eval(trustedTypes.emptyScript) !==" + " trustedTypes.emptyScript } catch (e) {} if (typeof trustedTypes !==" + " 'undefined' && trustedTypes.createPolicy &&isChrome87 ) {", out, null);<NEW_LINE>mode.appendTraditional(" var policy = trustedTypes.createPolicy('goog#devserver',{ createScript: function(s){" + " return s; }});", out, null);<NEW_LINE>mode.appendTraditional(" thisValue.CLOSURE_EVAL_PREFILTER = policy.createScript.bind(policy);", out, null);<NEW_LINE>mode.appendTraditional("}", out, null);<NEW_LINE>mode.appendTraditional("})(this);", out, null);<NEW_LINE>} | String runtime = transpiler.runtime(); |
1,463,036 | private PlaybackInfo handlePositionDiscontinuity(MediaPeriodId mediaPeriodId, long positionUs, long requestedContentPositionUs, long discontinuityStartPositionUs, boolean reportDiscontinuity, @DiscontinuityReason int discontinuityReason) {<NEW_LINE>deliverPendingMessageAtStartPositionRequired = deliverPendingMessageAtStartPositionRequired || positionUs != playbackInfo.positionUs || !mediaPeriodId.equals(playbackInfo.periodId);<NEW_LINE>resetPendingPauseAtEndOfPeriod();<NEW_LINE>TrackGroupArray trackGroupArray = playbackInfo.trackGroups;<NEW_LINE>TrackSelectorResult trackSelectorResult = playbackInfo.trackSelectorResult;<NEW_LINE>List<Metadata> staticMetadata = playbackInfo.staticMetadata;<NEW_LINE>if (mediaSourceList.isPrepared()) {<NEW_LINE>@Nullable<NEW_LINE><MASK><NEW_LINE>trackGroupArray = playingPeriodHolder == null ? TrackGroupArray.EMPTY : playingPeriodHolder.getTrackGroups();<NEW_LINE>trackSelectorResult = playingPeriodHolder == null ? emptyTrackSelectorResult : playingPeriodHolder.getTrackSelectorResult();<NEW_LINE>staticMetadata = extractMetadataFromTrackSelectionArray(trackSelectorResult.selections);<NEW_LINE>// Ensure the media period queue requested content position matches the new playback info.<NEW_LINE>if (playingPeriodHolder != null && playingPeriodHolder.info.requestedContentPositionUs != requestedContentPositionUs) {<NEW_LINE>playingPeriodHolder.info = playingPeriodHolder.info.copyWithRequestedContentPositionUs(requestedContentPositionUs);<NEW_LINE>}<NEW_LINE>} else if (!mediaPeriodId.equals(playbackInfo.periodId)) {<NEW_LINE>// Reset previously kept track info if unprepared and the period changes.<NEW_LINE>trackGroupArray = TrackGroupArray.EMPTY;<NEW_LINE>trackSelectorResult = emptyTrackSelectorResult;<NEW_LINE>staticMetadata = ImmutableList.of();<NEW_LINE>}<NEW_LINE>if (reportDiscontinuity) {<NEW_LINE>playbackInfoUpdate.setPositionDiscontinuity(discontinuityReason);<NEW_LINE>}<NEW_LINE>return playbackInfo.copyWithNewPosition(mediaPeriodId, positionUs, requestedContentPositionUs, discontinuityStartPositionUs, getTotalBufferedDurationUs(), trackGroupArray, trackSelectorResult, staticMetadata);<NEW_LINE>} | MediaPeriodHolder playingPeriodHolder = queue.getPlayingPeriod(); |
1,444,166 | private void dbUpdate(ContentType type) throws DotDataException {<NEW_LINE>DotConnect dc = new DotConnect();<NEW_LINE>dc.setSQL(this.contentTypeSql.UPDATE_TYPE);<NEW_LINE>dc.addParam(type.name());<NEW_LINE>dc.addParam(type.description());<NEW_LINE>dc.addParam(type.defaultType());<NEW_LINE>dc.addParam(type.detailPage());<NEW_LINE>dc.addParam(type.baseType().getType());<NEW_LINE>dc.addParam(type.system());<NEW_LINE>dc.addParam(type.fixed());<NEW_LINE>dc.addParam(type.variable());<NEW_LINE>dc.addParam(new CleanURLMap(type.urlMapPattern()).toString());<NEW_LINE>dc.addParam(type.host());<NEW_LINE>dc.addParam(type.folder());<NEW_LINE>dc.addParam(type.expireDateVar());<NEW_LINE>dc.addParam(type.publishDateVar());<NEW_LINE>dc.addParam(type.modDate());<NEW_LINE>dc.<MASK><NEW_LINE>dc.addParam(type.sortOrder());<NEW_LINE>dc.addParam(type.id());<NEW_LINE>dc.loadResult();<NEW_LINE>} | addParam(type.icon()); |
16,001 | private ReadableShoppingCart readableShoppingCart(ShoppingCart cartModel, PersistableShoppingCartItem item, MerchantStore store, Language language) throws Exception {<NEW_LINE>com.salesmanager.core.model.shoppingcart.ShoppingCartItem itemModel = <MASK><NEW_LINE>// need to check if the item is already in the cart<NEW_LINE>boolean duplicateFound = false;<NEW_LINE>// only if item has no attributes<NEW_LINE>if (CollectionUtils.isEmpty(item.getAttributes())) {<NEW_LINE>// increment quantity<NEW_LINE>// get duplicate item from the cart<NEW_LINE>Set<com.salesmanager.core.model.shoppingcart.ShoppingCartItem> cartModelItems = cartModel.getLineItems();<NEW_LINE>for (com.salesmanager.core.model.shoppingcart.ShoppingCartItem cartItem : cartModelItems) {<NEW_LINE>if (cartItem.getProduct().getId().longValue() == item.getProduct().longValue()) {<NEW_LINE>if (CollectionUtils.isEmpty(cartItem.getAttributes())) {<NEW_LINE>if (!duplicateFound) {<NEW_LINE>if (!itemModel.isProductVirtual()) {<NEW_LINE>cartItem.setQuantity(cartItem.getQuantity() + item.getQuantity());<NEW_LINE>}<NEW_LINE>duplicateFound = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!duplicateFound) {<NEW_LINE>cartModel.getLineItems().add(itemModel);<NEW_LINE>}<NEW_LINE>saveShoppingCart(cartModel);<NEW_LINE>// refresh cart<NEW_LINE>cartModel = shoppingCartService.getById(cartModel.getId(), store);<NEW_LINE>shoppingCartCalculationService.calculate(cartModel, store, language);<NEW_LINE>return readableShoppingCartMapper.convert(cartModel, store, language);<NEW_LINE>} | createCartItem(cartModel, item, store); |
828,117 | private StateChange remoteRestart() {<NEW_LINE>boolean debugMode = instance.getJvmMode() == PayaraJvmMode.DEBUG;<NEW_LINE>// Wrong scenario as default.<NEW_LINE>boolean debugPortActive = true;<NEW_LINE>int debugPort = -1;<NEW_LINE>if (debugMode) {<NEW_LINE>debugPort = instance.getDebugPort();<NEW_LINE>debugMode = updateDebugOptions(debugPort);<NEW_LINE>debugPortActive = NetUtils.isPortListeningRemote(instance.getHost(), debugPort, NetUtils.PORT_CHECK_TIMEOUT);<NEW_LINE>}<NEW_LINE>ResultString result = CommandRestartDAS.restartDAS(instance, debugMode);<NEW_LINE>LogViewMgr.removeLog(instance);<NEW_LINE>LogViewMgr logger = LogViewMgr.getInstance(instance.getProperty(PayaraModule.URL_ATTR));<NEW_LINE>logger.stopReaders();<NEW_LINE>switch(result.getState()) {<NEW_LINE>case COMPLETED:<NEW_LINE>if (debugMode && !debugPortActive) {<NEW_LINE>vaitForDebugPort(instance.getHost(), debugPort);<NEW_LINE>waitStartUp(true, false);<NEW_LINE>// This probably won't be needed.<NEW_LINE>// } else {<NEW_LINE>// try {<NEW_LINE>// Thread.sleep(RESTART_DELAY);<NEW_LINE>// } catch (InterruptedException ex) {}<NEW_LINE>}<NEW_LINE>return new StateChange(this, result.getState(), <MASK><NEW_LINE>default:<NEW_LINE>return new StateChange(this, result.getState(), TaskEvent.CMD_COMPLETED, "RestartTask.remoteRestart.failed", new String[] { instanceName, result.getValue() });<NEW_LINE>}<NEW_LINE>} | TaskEvent.CMD_COMPLETED, "RestartTask.remoteRestart.completed", instanceName); |
1,853,688 | public org.python.Object __le__(org.python.Object other) {<NEW_LINE>if (other instanceof org.python.types.Int) {<NEW_LINE>long other_val = ((org.python.types.Int) other).value;<NEW_LINE>return org.python.types.Bool.getBool(this.value <= ((double) other_val));<NEW_LINE>} else if (other instanceof org.python.types.Float) {<NEW_LINE>double other_val = ((org.python.<MASK><NEW_LINE>return org.python.types.Bool.getBool(this.value <= other_val);<NEW_LINE>} else if (other instanceof org.python.types.Bool) {<NEW_LINE>if (((org.python.types.Bool) other).value) {<NEW_LINE>return org.python.types.Bool.getBool(this.value <= 1.0);<NEW_LINE>} else {<NEW_LINE>return org.python.types.Bool.getBool(this.value <= 0.0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return org.python.types.NotImplementedType.NOT_IMPLEMENTED;<NEW_LINE>} | types.Float) other).value; |
32,526 | public static DeploymentBuilder kafkaClients(String namespaceName, boolean tlsListener, String kafkaClientsName, boolean hostnameVerification, String listenerName, String secretPrefix, KafkaUser... kafkaUsers) {<NEW_LINE>Map<String, String> label = new HashMap<>();<NEW_LINE>label.put(<MASK><NEW_LINE>label.put(Constants.DEPLOYMENT_TYPE, DeploymentTypes.KafkaClients.name());<NEW_LINE>DeploymentBuilder kafkaClient = new DeploymentBuilder().withNewMetadata().withName(kafkaClientsName).withLabels(label).withNamespace(namespaceName).endMetadata().withNewSpec().withNewSelector().addToMatchLabels("app", kafkaClientsName).addToMatchLabels(label).endSelector().withReplicas(1).withNewTemplate().withNewMetadata().addToLabels("app", kafkaClientsName).addToLabels(label).endMetadata().withSpec(createClientSpec(namespaceName, tlsListener, kafkaClientsName, hostnameVerification, listenerName, secretPrefix, kafkaUsers)).endTemplate().endSpec();<NEW_LINE>return kafkaClient;<NEW_LINE>} | Constants.KAFKA_CLIENTS_LABEL_KEY, Constants.KAFKA_CLIENTS_LABEL_VALUE); |
1,019,730 | void draw(Canvas canvas, GeometryWayContext context) {<NEW_LINE>if (style instanceof GeometrySolidWayStyle && shouldDrawArrow()) {<NEW_LINE>Context ctx = style.getCtx();<NEW_LINE>GeometrySolidWayStyle<?> arrowsWayStyle = (GeometrySolidWayStyle<?>) style;<NEW_LINE>Bitmap bitmap = style.getPointBitmap();<NEW_LINE>boolean useSpecialArrow = arrowsWayStyle.useSpecialArrow();<NEW_LINE>float newWidth = useSpecialArrow ? AndroidUtils.dpToPx(ctx, 12) : arrowsWayStyle.getWidth(0) == 0 ? 0 : arrowsWayStyle.getWidth(0) / 2f;<NEW_LINE>float paintH2 = bitmap.getHeight() / 2f;<NEW_LINE>float paintW2 = newWidth == 0 ? 0 : newWidth / 2f;<NEW_LINE>Matrix matrix = getMatrix();<NEW_LINE>matrix.reset();<NEW_LINE>float sy = useSpecialArrow ? newWidth / bitmap.getHeight() : 1;<NEW_LINE>matrix.postScale(newWidth / bitmap.getWidth(), sy);<NEW_LINE>matrix.postRotate((float) angle, paintW2, paintH2);<NEW_LINE>matrix.postTranslate(x - paintW2, y - paintH2);<NEW_LINE>if (useSpecialArrow) {<NEW_LINE>drawCircle(canvas, arrowsWayStyle);<NEW_LINE>}<NEW_LINE>Paint paint = context.getPaintIconCustom();<NEW_LINE>int arrowColor = arrowsWayStyle.getPointColor();<NEW_LINE>paint.setColorFilter(new PorterDuffColorFilter(arrowColor<MASK><NEW_LINE>canvas.drawBitmap(bitmap, matrix, paint);<NEW_LINE>}<NEW_LINE>} | , PorterDuff.Mode.SRC_IN)); |
1,053,239 | public void actionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>JButton but = (JButton) evt.getSource();<NEW_LINE>SectionContainer sc = null;<NEW_LINE>for (Container c = but.getParent(); c != null; c = c.getParent()) {<NEW_LINE>if (c instanceof SectionContainer) {<NEW_LINE>sc = (SectionContainer) c;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PersistenceUnitNode pun = (PersistenceUnitNode) sc.getNode();<NEW_LINE>PersistenceUnit punit = pun.getPersistenceUnit();<NEW_LINE>org.openide.DialogDescriptor desc = new ConfirmDialog(NbBundle.getMessage(PersistenceToolBarMVElement.class, "LBL_ConfirmRemove"<MASK><NEW_LINE>java.awt.Dialog dialog = org.openide.DialogDisplayer.getDefault().createDialog(desc);<NEW_LINE>dialog.setVisible(true);<NEW_LINE>if (org.openide.DialogDescriptor.OK_OPTION.equals(desc.getValue())) {<NEW_LINE>sc.removeSection(sc);<NEW_LINE>puDataObject.removePersistenceUnit(punit);<NEW_LINE>}<NEW_LINE>} | , punit.getName())); |
16,314 | static void removeElement(WSDLComponent c, Class cl, boolean underPolicy) {<NEW_LINE>if (c == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>WSDLModel model = c.getModel();<NEW_LINE><MASK><NEW_LINE>if (!isTransaction) {<NEW_LINE>model.startTransaction();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (underPolicy) {<NEW_LINE>List<Policy> policies = c.getExtensibilityElements(Policy.class);<NEW_LINE>if ((policies != null) && (!policies.isEmpty())) {<NEW_LINE>c = policies.get(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<ExtensibilityElement> l = c.getExtensibilityElements(cl);<NEW_LINE>if ((l != null) && (!l.isEmpty())) {<NEW_LINE>ExtensibilityElement tok = l.get(0);<NEW_LINE>tok.getParent().removeExtensibilityElement(tok);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (!isTransaction) {<NEW_LINE>model.endTransaction();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | boolean isTransaction = model.isIntransaction(); |
212,201 | public String changePassword(Model model, @RequestParam("current_password") String currentPassword, @RequestParam("new_password") String newPassword, @RequestParam("confirm_password") String confirmPassword, HttpServletResponse response, HttpServletRequest request) {<NEW_LINE>PasswordConfirmationValidation validation = new PasswordConfirmationValidation(newPassword, confirmPassword);<NEW_LINE>if (!validation.valid()) {<NEW_LINE>model.addAttribute("message_code", validation.getMessageCode());<NEW_LINE>response.setStatus(HttpStatus.UNPROCESSABLE_ENTITY.value());<NEW_LINE>return "change_password";<NEW_LINE>}<NEW_LINE>SecurityContext securityContext = SecurityContextHolder.getContext();<NEW_LINE>Authentication authentication = securityContext.getAuthentication();<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>changePasswordService.changePassword(username, currentPassword, newPassword);<NEW_LINE>request.getSession().invalidate();<NEW_LINE>request.getSession(true);<NEW_LINE>if (authentication instanceof UaaAuthentication) {<NEW_LINE>UaaAuthentication uaaAuthentication = (UaaAuthentication) authentication;<NEW_LINE>uaaAuthentication.setAuthenticatedTime(System.currentTimeMillis());<NEW_LINE>uaaAuthentication.setAuthenticationDetails(new UaaAuthenticationDetails(request));<NEW_LINE>}<NEW_LINE>securityContext.setAuthentication(authentication);<NEW_LINE>return "redirect:profile";<NEW_LINE>} catch (BadCredentialsException e) {<NEW_LINE>model.addAttribute("message_code", "unauthorized");<NEW_LINE>} catch (InvalidPasswordException e) {<NEW_LINE>model.addAttribute("message", e.getMessagesAsOneString());<NEW_LINE>}<NEW_LINE>response.setStatus(HttpStatus.UNPROCESSABLE_ENTITY.value());<NEW_LINE>return "change_password";<NEW_LINE>} | String username = authentication.getName(); |
208,077 | private static String relativizeFile(File basedir, File file) {<NEW_LINE>if (basedir.isFile()) {<NEW_LINE>// NOI18N<NEW_LINE>throw new IllegalArgumentException("Cannot relative w.r.t. a data file " + basedir);<NEW_LINE>}<NEW_LINE>if (basedir.equals(file)) {<NEW_LINE>// NOI18N<NEW_LINE>return ".";<NEW_LINE>}<NEW_LINE>StringBuffer b = new StringBuffer();<NEW_LINE>File base = basedir;<NEW_LINE>String filepath = file.getAbsolutePath();<NEW_LINE>while (!filepath.startsWith(slashify(base.getAbsolutePath()))) {<NEW_LINE>base = base.getParentFile();<NEW_LINE>if (base == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (base.equals(file)) {<NEW_LINE>// #61687: file is a parent of basedir<NEW_LINE>// NOI18N<NEW_LINE>b.append("..");<NEW_LINE>return b.toString();<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>b.append("../");<NEW_LINE>}<NEW_LINE>URI u = base.toURI().relativize(file.toURI());<NEW_LINE>assert !u.isAbsolute() : u + " from " + basedir <MASK><NEW_LINE>b.append(u.getPath());<NEW_LINE>if (b.charAt(b.length() - 1) == '/') {<NEW_LINE>// file is an existing directory and file.toURI ends in /<NEW_LINE>// we do not want the trailing slash<NEW_LINE>b.setLength(b.length() - 1);<NEW_LINE>}<NEW_LINE>return b.toString();<NEW_LINE>} | + " and " + file + " with common root " + base; |
141,507 | public static boolean checkMacros(final Project project, final Set<String> usedMacros) {<NEW_LINE>final Set<String> defined = getDefinedMacros();<NEW_LINE>usedMacros.removeAll(defined);<NEW_LINE>// try to lookup values in System properties<NEW_LINE>@NonNls<NEW_LINE>final String pathMacroSystemPrefix = "path.macro.";<NEW_LINE>for (Iterator it = usedMacros.iterator(); it.hasNext(); ) {<NEW_LINE>final String macro = (String) it.next();<NEW_LINE>final String value = System.getProperty(pathMacroSystemPrefix + macro, null);<NEW_LINE>if (value != null) {<NEW_LINE>ApplicationManager.getApplication().runWriteAction(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>PathMacros.getInstance().setMacro(macro, value);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>it.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (usedMacros.isEmpty()) {<NEW_LINE>// all macros in configuration files are defined<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// there are undefined macros, need to define them before loading components<NEW_LINE>final boolean[<MASK><NEW_LINE>final Runnable r = new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>result[0] = showMacrosConfigurationDialog(project, usedMacros);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>WaitForProgressToShow.runOrInvokeAndWaitAboveProgress(r, ModalityState.NON_MODAL);<NEW_LINE>return result[0];<NEW_LINE>} | ] result = new boolean[1]; |
66,580 | public Object execute(CommandLine commandLine) throws Exception {<NEW_LINE>String projectName = commandLine.getValue(Options.PROJECT_OPTION);<NEW_LINE>String newDir = commandLine.getValue(Options.DIR_OPTION);<NEW_LINE>// moving into an existing directory<NEW_LINE>if (new File(newDir).exists()) {<NEW_LINE>newDir = newDir + '/' + projectName;<NEW_LINE>}<NEW_LINE>IProject project = ProjectUtils.getProject(projectName);<NEW_LINE>if (project.exists()) {<NEW_LINE>IProjectDescription desc = project.getDescription();<NEW_LINE>IWorkspace workspace = ResourcesPlugin.getWorkspace();<NEW_LINE>IPath workspaceLocation = workspace.getRoot().getRawLocation();<NEW_LINE>IPath location = new Path(newDir);<NEW_LINE>// if the new location overlaps the workspace, then set location to null<NEW_LINE>// to force eclipse to move the project to the default location in the<NEW_LINE>// workspace. Also, take the last segment as the new project name.<NEW_LINE>if (location.toOSString().toLowerCase().startsWith(workspaceLocation.toOSString().toLowerCase())) {<NEW_LINE>String name = location.removeFirstSegments(location.matchingFirstSegments(workspaceLocation)).toString();<NEW_LINE>// hack for windows... manually remove drive letter<NEW_LINE>name = <MASK><NEW_LINE>name = name.replaceFirst("/$", "");<NEW_LINE>location = null;<NEW_LINE>desc.setName(name);<NEW_LINE>}<NEW_LINE>desc.setLocation(location);<NEW_LINE>project.move(desc, true, null);<NEW_LINE>// get a new handle on the possibly rename project<NEW_LINE>project = ProjectUtils.getProject(desc.getName());<NEW_LINE>return Services.getMessage("project.moved", projectName, ProjectUtils.getPath(project));<NEW_LINE>}<NEW_LINE>return Services.getMessage("project.not.found", projectName);<NEW_LINE>} | name.replaceFirst("^[A-Z]:", ""); |
738,243 | private void updateDate() {<NEW_LINE>if (!text.getText().isEmpty()) {<NEW_LINE>try {<NEW_LINE>String enteredDate = text.getText();<NEW_LINE>setDate(getDateTimeService().parseDate(enteredDate, getFormatString(), lenient));<NEW_LINE>if (lenient) {<NEW_LINE>// If date value was leniently parsed, normalize text<NEW_LINE>// presentation.<NEW_LINE>// FIXME: Add a description/example here of when this is<NEW_LINE>// needed<NEW_LINE>text.setValue(getDateTimeService().formatDate(getDate(), getFormatString(), timeZone), false);<NEW_LINE>}<NEW_LINE>// remove possibly added invalid value indication<NEW_LINE>removeStyleName(getStylePrimaryName() + PARSE_ERROR_CLASSNAME);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>getLogger().log(Level.INFO, e.getMessage() == null ? "" : <MASK><NEW_LINE>addStyleName(getStylePrimaryName() + PARSE_ERROR_CLASSNAME);<NEW_LINE>setDate(null);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>setDate(null);<NEW_LINE>// remove possibly added invalid value indication<NEW_LINE>removeStyleName(getStylePrimaryName() + PARSE_ERROR_CLASSNAME);<NEW_LINE>}<NEW_LINE>} | e.getMessage(), e); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.