idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,595,268 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see org.eclipse.text.edits.TextEditVisitor#visit(org.eclipse.text.edits.<NEW_LINE>* CopyTargetEdit)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public boolean visit(CopyTargetEdit edit) {<NEW_LINE>try {<NEW_LINE>if (edit.getSourceEdit() != null) {<NEW_LINE>org.eclipse.lsp4j.TextEdit te = new org.eclipse.lsp4j.TextEdit();<NEW_LINE>te.setRange(JDTUtils.toRange(compilationUnit, edit.getOffset(), edit.getLength()));<NEW_LINE>Document doc = new Document(compilationUnit.getSource());<NEW_LINE>edit.apply(doc, TextEdit.UPDATE_REGIONS);<NEW_LINE>String content = doc.get(edit.getSourceEdit().getOffset(), edit.getSourceEdit().getLength());<NEW_LINE>if (edit.getSourceEdit().getSourceModifier() != null) {<NEW_LINE>content = applySourceModifier(content, edit.<MASK><NEW_LINE>}<NEW_LINE>te.setNewText(content);<NEW_LINE>converted.add(te);<NEW_LINE>}<NEW_LINE>// do not visit children<NEW_LINE>return false;<NEW_LINE>} catch (MalformedTreeException | BadLocationException | CoreException e) {<NEW_LINE>JavaLanguageServerPlugin.logException("Error converting TextEdits", e);<NEW_LINE>}<NEW_LINE>return super.visit(edit);<NEW_LINE>} | getSourceEdit().getSourceModifier()); |
1,648,587 | public static void main(String[] args) throws Exception {<NEW_LINE>// Process the command-line options<NEW_LINE>CommandOption.<MASK><NEW_LINE>CommandOption.process(Replacer.class, args);<NEW_LINE>NGramPreprocessor preprocessor = new NGramPreprocessor();<NEW_LINE>if (replacementFiles.value != null) {<NEW_LINE>for (String filename : replacementFiles.value) {<NEW_LINE>System.out.println("including replacements from " + filename);<NEW_LINE>preprocessor.loadReplacements(filename);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (deletionFiles.value != null) {<NEW_LINE>for (String filename : deletionFiles.value) {<NEW_LINE>System.out.println("including deletions from " + filename);<NEW_LINE>preprocessor.loadDeletions(filename);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ArrayList<Pipe> pipes = new ArrayList<Pipe>();<NEW_LINE>PrintWriter out = new PrintWriter(outputFile.value);<NEW_LINE>for (String filename : inputFiles.value) {<NEW_LINE>logger.info("Loading " + filename);<NEW_LINE>CsvIterator reader = new CsvIterator(new FileReader(filename), lineRegex.value, dataGroup.value, labelGroup.value, nameGroup.value);<NEW_LINE>Iterator<Instance> iterator = preprocessor.newIteratorFrom(reader);<NEW_LINE>@Var<NEW_LINE>int count = 0;<NEW_LINE>// We're not saving the instance list, just writing to the out file<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Instance instance = iterator.next();<NEW_LINE>out.println(instance.getName() + "\t" + instance.getTarget() + "\t" + instance.getData());<NEW_LINE>count++;<NEW_LINE>if (count % 10000 == 0) {<NEW_LINE>logger.info("instance " + count);<NEW_LINE>}<NEW_LINE>iterator.next();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.close();<NEW_LINE>} | setSummary(Replacer.class, "Tool for modifying text with n-gram preprocessing"); |
644,623 | public synchronized DeviceInfo[] listDeviceInfos(DeviceInfo keys) throws ConfigurationException {<NEW_LINE>if (!configurationExists())<NEW_LINE>return new DeviceInfo[0];<NEW_LINE>ArrayList<DeviceInfo> results = new ArrayList<DeviceInfo>();<NEW_LINE>NamingEnumeration<SearchResult> ne = null;<NEW_LINE>try {<NEW_LINE>ne = search(devicesDN, toFilter(keys), "dicomDeviceName", "dicomDescription", "dicomManufacturer", "dicomManufacturerModelName", "dicomSoftwareVersion", "dicomStationName", "dicomInstitutionName", <MASK><NEW_LINE>while (ne.hasMore()) {<NEW_LINE>DeviceInfo deviceInfo = new DeviceInfo();<NEW_LINE>loadFrom(deviceInfo, ne.next().getAttributes());<NEW_LINE>results.add(deviceInfo);<NEW_LINE>}<NEW_LINE>} catch (NamingException e) {<NEW_LINE>throw new ConfigurationException(e);<NEW_LINE>} finally {<NEW_LINE>LdapUtils.safeClose(ne);<NEW_LINE>}<NEW_LINE>return results.toArray(new DeviceInfo[results.size()]);<NEW_LINE>} | "dicomInstitutionDepartmentName", "dicomPrimaryDeviceType", "dicomInstalled", "objectClass"); |
897,543 | private final void decodeModifiersForModuleRequires(StringBuffer buffer, int accessFlags) {<NEW_LINE>int[] checkBits = new int[] { <MASK><NEW_LINE>boolean firstModifier = true;<NEW_LINE>for (int i = 0, max = checkBits.length; i < max; i++) {<NEW_LINE>switch(checkBits[i]) {<NEW_LINE>case IModifierConstants.ACC_TRANSITIVE:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>firstModifier = appendModifier(buffer, accessFlags, IModifierConstants.ACC_TRANSITIVE, "transitive", firstModifier);<NEW_LINE>break;<NEW_LINE>case IModifierConstants.ACC_STATIC_PHASE:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>firstModifier = appendModifier(buffer, accessFlags, IModifierConstants.ACC_STATIC_PHASE, "protected", firstModifier);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!firstModifier) {<NEW_LINE>buffer.append(Messages.disassembler_space);<NEW_LINE>}<NEW_LINE>} | IModifierConstants.ACC_TRANSITIVE, IModifierConstants.ACC_STATIC_PHASE }; |
981,499 | private static Fix finishFix(SuggestedFix baseFix, Type exceptionType, List<String> newAsserts, List<StatementTree> throwingStatements, VisitorState state) {<NEW_LINE>if (throwingStatements.isEmpty()) {<NEW_LINE>return baseFix;<NEW_LINE>}<NEW_LINE>SuggestedFix.Builder fix = SuggestedFix.builder().merge(baseFix);<NEW_LINE>fix.addStaticImport("org.junit.Assert.assertThrows");<NEW_LINE>StringBuilder fixPrefix = new StringBuilder();<NEW_LINE>String exceptionTypeName = SuggestedFixes.qualifyType(state, fix, exceptionType);<NEW_LINE>if (!newAsserts.isEmpty()) {<NEW_LINE>fixPrefix.append(String<MASK><NEW_LINE>}<NEW_LINE>fixPrefix.append("assertThrows");<NEW_LINE>fixPrefix.append(String.format("(%s.class, () -> ", exceptionTypeName));<NEW_LINE>boolean useExpressionLambda = throwingStatements.size() == 1 && getOnlyElement(throwingStatements).getKind() == Kind.EXPRESSION_STATEMENT;<NEW_LINE>if (!useExpressionLambda) {<NEW_LINE>fixPrefix.append("{");<NEW_LINE>}<NEW_LINE>fix.prefixWith(throwingStatements.get(0), fixPrefix.toString());<NEW_LINE>if (useExpressionLambda) {<NEW_LINE>fix.postfixWith(((ExpressionStatementTree) throwingStatements.get(0)).getExpression(), ")");<NEW_LINE>fix.postfixWith(getLast(throwingStatements), '\n' + Joiner.on('\n').join(newAsserts));<NEW_LINE>} else {<NEW_LINE>fix.postfixWith(getLast(throwingStatements), "});\n" + Joiner.on('\n').join(newAsserts));<NEW_LINE>}<NEW_LINE>return fix.build();<NEW_LINE>} | .format("%s thrown = ", exceptionTypeName)); |
483,694 | final AssociateMemberToGroupResult executeAssociateMemberToGroup(AssociateMemberToGroupRequest associateMemberToGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateMemberToGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateMemberToGroupRequest> request = null;<NEW_LINE>Response<AssociateMemberToGroupResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new AssociateMemberToGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateMemberToGroupRequest));<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, "WorkMail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateMemberToGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociateMemberToGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociateMemberToGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,076,579 | public void main() {<NEW_LINE>RVec4 color = (RVec4) getGlobal(DefaultShaderVar.G_COLOR);<NEW_LINE>RFloat intensity = new RFloat("intensity");<NEW_LINE>RVec3 normal = (<MASK><NEW_LINE>RFloat power = new RFloat("power");<NEW_LINE>power.assign(0.0f);<NEW_LINE>intensity.assign(0.0f);<NEW_LINE>for (int i = 0; i < mLights.size(); i++) {<NEW_LINE>RFloat attenuation = (RFloat) getGlobal(LightsShaderVar.V_LIGHT_ATTENUATION, i);<NEW_LINE>RFloat lightPower = (RFloat) getGlobal(LightsShaderVar.U_LIGHT_POWER, i);<NEW_LINE>RVec3 lightDir = new RVec3("lightDir" + i);<NEW_LINE>RFloat nDotL = mgNdotL[i];<NEW_LINE>nDotL.assign(max(dot(normal, lightDir), 0.1f));<NEW_LINE>//<NEW_LINE>// -- power = uLightPower * NdotL * vAttenuation;<NEW_LINE>//<NEW_LINE>power.assign(lightPower.multiply(nDotL).multiply(attenuation));<NEW_LINE>intensity.assignAdd(power);<NEW_LINE>}<NEW_LINE>startif(new Condition(intensity, Operator.GREATER_THAN, .95f));<NEW_LINE>{<NEW_LINE>color.assign(muToonColor0);<NEW_LINE>}<NEW_LINE>ifelseif(new Condition(intensity, Operator.GREATER_THAN, .5f));<NEW_LINE>{<NEW_LINE>color.assign(muToonColor1);<NEW_LINE>}<NEW_LINE>ifelseif(new Condition(intensity, Operator.GREATER_THAN, .25f));<NEW_LINE>{<NEW_LINE>color.assign(muToonColor2);<NEW_LINE>}<NEW_LINE>ifelse();<NEW_LINE>{<NEW_LINE>color.assign(muToonColor3);<NEW_LINE>}<NEW_LINE>endif();<NEW_LINE>} | RVec3) getGlobal(DefaultShaderVar.G_NORMAL); |
1,265,269 | public static List<Record> fromReader(DatagramReader reader, ConnectionIdGenerator cidGenerator, long receiveNanos) {<NEW_LINE>if (reader == null) {<NEW_LINE>throw new NullPointerException("Reader must not be null");<NEW_LINE>}<NEW_LINE>int datagramLength = reader.bitsLeft() / Byte.SIZE;<NEW_LINE>List<Record> records = new ArrayList<Record>();<NEW_LINE>while (reader.bytesAvailable()) {<NEW_LINE>if (reader.bitsLeft() < RECORD_HEADER_BITS) {<NEW_LINE>LOGGER.debug("Received truncated DTLS record(s). Discarding ...");<NEW_LINE>return records;<NEW_LINE>}<NEW_LINE>int type = reader.read(CONTENT_TYPE_BITS);<NEW_LINE>int major = reader.read(VERSION_BITS);<NEW_LINE>int minor = reader.read(VERSION_BITS);<NEW_LINE>ProtocolVersion version = ProtocolVersion.valueOf(major, minor);<NEW_LINE>int epoch = reader.read(EPOCH_BITS);<NEW_LINE>long sequenceNumber = reader.readLong(SEQUENCE_NUMBER_BITS);<NEW_LINE>ConnectionId connectionId = null;<NEW_LINE>if (type == ContentType.TLS12_CID.getCode()) {<NEW_LINE>if (cidGenerator == null) {<NEW_LINE>LOGGER.debug("Received TLS_CID record, but cid is not supported. Discarding ...");<NEW_LINE>return records;<NEW_LINE>} else if (cidGenerator.useConnectionId()) {<NEW_LINE>try {<NEW_LINE>connectionId = cidGenerator.read(reader);<NEW_LINE>if (connectionId == null) {<NEW_LINE>LOGGER.debug("Received TLS_CID record, but cid is not matching. Discarding ...");<NEW_LINE>return records;<NEW_LINE>}<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>LOGGER.debug("Received TLS_CID record, failed to read cid. Discarding ...", ex);<NEW_LINE>return records;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("Received TLS_CID record, but cid is not used. Discarding ...");<NEW_LINE>return records;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>int left = reader.bitsLeft() / Byte.SIZE;<NEW_LINE>if (left < length) {<NEW_LINE>LOGGER.debug("Received truncated DTLS record(s) ({} bytes, but only {} available). {} records, {} bytes. Discarding ...", length, left, records.size(), datagramLength);<NEW_LINE>return records;<NEW_LINE>}<NEW_LINE>// delay decryption/interpretation of fragment<NEW_LINE>byte[] fragmentBytes = reader.readBytes(length);<NEW_LINE>ContentType contentType = ContentType.getTypeByValue(type);<NEW_LINE>if (contentType == null) {<NEW_LINE>LOGGER.debug("Received DTLS record of unsupported type [{}]. Discarding ...", type);<NEW_LINE>} else {<NEW_LINE>records.add(new Record(contentType, version, epoch, sequenceNumber, connectionId, fragmentBytes, receiveNanos, !records.isEmpty()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return records;<NEW_LINE>} | length = reader.read(LENGTH_BITS); |
982,398 | private Set<TransferFile> prepareUpload(FileObject sources, FileObject[] filesToUpload, FileObject[] preselectedFiles, RemoteClient remoteClient) {<NEW_LINE>Set<TransferFile<MASK><NEW_LINE>ProgressHandle progressHandle = ProgressHandle.createHandle(NbBundle.getMessage(UploadCommand.class, "MSG_UploadingFiles", getProject().getName()), remoteClient);<NEW_LINE>try {<NEW_LINE>progressHandle.start();<NEW_LINE>forUpload = remoteClient.prepareUpload(sources, filesToUpload);<NEW_LINE>RemoteUtils.fetchAllFiles(false, forUpload, sources, filesToUpload);<NEW_LINE>// manage preselected files - it is just enough to touch the file<NEW_LINE>if (preselectedFiles != null && preselectedFiles.length > 0) {<NEW_LINE>File baseLocalDir = FileUtil.toFile(sources);<NEW_LINE>String baseLocalAbsolutePath = baseLocalDir.getAbsolutePath();<NEW_LINE>for (FileObject fo : preselectedFiles) {<NEW_LINE>// we need to touch the _original_ transfer file because of its parent!<NEW_LINE>TransferFile transferFile = TransferFile.fromFileObject(remoteClient.createRemoteClientImplementation(baseLocalAbsolutePath), null, fo);<NEW_LINE>for (TransferFile file : forUpload) {<NEW_LINE>if (transferFile.equals(file)) {<NEW_LINE>file.touch();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean showDialog = true;<NEW_LINE>if (forUpload.size() == 1 && forUpload.iterator().next().isFile()) {<NEW_LINE>// do not show transfer dialog for exactly one file (not folder!)<NEW_LINE>showDialog = false;<NEW_LINE>}<NEW_LINE>if (showDialog) {<NEW_LINE>forUpload = TransferFilesChooser.forUpload(forUpload, RemoteUtils.getLastTimestamp(true, getProject())).showDialog();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>progressHandle.finish();<NEW_LINE>}<NEW_LINE>return forUpload;<NEW_LINE>} | > forUpload = Collections.emptySet(); |
685,859 | private void initMainPane() {<NEW_LINE>// Displays Quick Start pane initially and KeyStore tabbed pane when at<NEW_LINE>// least one KeyStore is open<NEW_LINE>jQuickStart = new JQuickStartPane(this);<NEW_LINE>jkstpKeyStores = new JKeyStoreTabbedPane(this);<NEW_LINE>int tabLayout = applicationSettings.getTabLayout();<NEW_LINE>jkstpKeyStores.setTabLayoutPolicy(tabLayout);<NEW_LINE>jkstpKeyStores.setBorder(new EmptyBorder(3<MASK><NEW_LINE>jkstpKeyStores.addChangeListener(evt -> {<NEW_LINE>// Update controls as selected KeyStore is changed<NEW_LINE>updateControls(false);<NEW_LINE>});<NEW_LINE>jkstpKeyStores.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mousePressed(MouseEvent evt) {<NEW_LINE>maybeShowKeyStoreTabPopup(evt);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseReleased(MouseEvent evt) {<NEW_LINE>maybeShowKeyStoreTabPopup(evt);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseClicked(MouseEvent evt) {<NEW_LINE>// Close tab if it is middle-clicked<NEW_LINE>if (evt.getButton() == MouseEvent.BUTTON2) {<NEW_LINE>closeAction.closeActiveKeyStore();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Rectangle sizeAndPosition = applicationSettings.getSizeAndPosition();<NEW_LINE>int width = sizeAndPosition.width;<NEW_LINE>int height = sizeAndPosition.height;<NEW_LINE>if (width <= 0 || height <= 0) {<NEW_LINE>jQuickStart.setPreferredSize(new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGHT));<NEW_LINE>} else {<NEW_LINE>jQuickStart.setPreferredSize(new Dimension(width, height));<NEW_LINE>}<NEW_LINE>frame.getContentPane().add(jQuickStart, BorderLayout.CENTER);<NEW_LINE>} | , 3, 3, 3)); |
582,089 | private ContextMenu buildContextMenu() {<NEW_LINE>ArrayList<MenuItem> menuItems = new ArrayList<>();<NEW_LINE>menuItems.add(CategorizeAction.getCategoriesMenu(controller));<NEW_LINE>try {<NEW_LINE>menuItems.add(AddTagAction.getTagMenu(controller));<NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>logger.log(<MASK><NEW_LINE>}<NEW_LINE>Lookup.getDefault().lookupAll(ContextMenuActionsProvider.class).stream().map(ContextMenuActionsProvider::getActions).flatMap(Collection::stream).filter(Presenter.Popup.class::isInstance).map(Presenter.Popup.class::cast).map(Presenter.Popup::getPopupPresenter).map(SwingMenuItemAdapter::create).forEachOrdered(menuItems::add);<NEW_LINE>final MenuItem extractMenuItem = new MenuItem(Bundle.GroupPane_gridViewContextMenuItem_extractFiles());<NEW_LINE>extractMenuItem.setOnAction(actionEvent -> {<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>TopComponent etc = ImageGalleryTopComponent.getTopComponent();<NEW_LINE>ExtractAction.getInstance().actionPerformed(new java.awt.event.ActionEvent(etc, 0, null));<NEW_LINE>});<NEW_LINE>});<NEW_LINE>menuItems.add(extractMenuItem);<NEW_LINE>ContextMenu contextMenu = new ContextMenu(menuItems.toArray(new MenuItem[] {}));<NEW_LINE>contextMenu.setAutoHide(true);<NEW_LINE>return contextMenu;<NEW_LINE>} | Level.SEVERE, "Error building tagging context menu.", ex); |
1,430,164 | private void handle(Message msg) {<NEW_LINE>setThreadLoggingContext(msg);<NEW_LINE>if (logger.isTraceEnabled() && wire.logMessage(msg)) {<NEW_LINE>logger.trace(String.format("[msg received]: %s", wire.dumpMessage(msg)));<NEW_LINE>}<NEW_LINE>if (msg instanceof MessageReply) {<NEW_LINE>beforeDeliverMessage(msg);<NEW_LINE>MessageReply r = (MessageReply) msg;<NEW_LINE>String correlationId = <MASK><NEW_LINE>Envelope e = envelopes.get(correlationId);<NEW_LINE>if (e == null) {<NEW_LINE>logger.warn(String.format("received a message reply but no envelope found," + "maybe the message request has been timeout or sender doesn't care about reply." + "drop it. reply dump:\n%s", wire.dumpMessage(r)));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>e.ack(r);<NEW_LINE>} else {<NEW_LINE>dealWithUnknownMessage(msg);<NEW_LINE>}<NEW_LINE>} | r.getHeaderEntry(CloudBus.HEADER_CORRELATION_ID); |
752,194 | private static void initializeClasses() {<NEW_LINE>try {<NEW_LINE>Class.forName(CoroutineExitException.class.getName());<NEW_LINE>Class.forName(WispThreadWrapper.class.getName());<NEW_LINE>Class.forName(TaskDispatcher.class.getName());<NEW_LINE>Class.forName(StartShutdown.class.getName());<NEW_LINE>Class.forName(Coroutine.StealResult.class.getName());<NEW_LINE>Class.forName(WispCounterMXBeanImpl.class.getName());<NEW_LINE>Class.forName(ThreadAsWisp.class.getName());<NEW_LINE>Class.forName(WispEventPump.class.getName());<NEW_LINE>Class.forName(ShutdownEngine.class.getName());<NEW_LINE>Class.forName(AbstractShutdownTask.class.getName());<NEW_LINE>Class.forName(<MASK><NEW_LINE>if (WispConfiguration.WISP_PROFILE) {<NEW_LINE>Class.forName(WispPerfCounterMonitor.class.getName());<NEW_LINE>}<NEW_LINE>if (WispConfiguration.WISP_HIGH_PRECISION_TIMER) {<NEW_LINE>timer.submit(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>new ConcurrentLinkedQueue<>().iterator();<NEW_LINE>new ConcurrentSkipListMap<>().keySet().iterator();<NEW_LINE>WispCarrier carrier = WispCarrier.current();<NEW_LINE>carrier.addTimer(System.nanoTime() + Integer.MAX_VALUE, TimeOut.Action.JDK_UNPARK);<NEW_LINE>WispCarrier.current().current.timeOut.doAction();<NEW_LINE>carrier.cancelTimer();<NEW_LINE>carrier.createResumeEntry(new WispTask(carrier, null, false, false));<NEW_LINE>// preload classes used by by constraintInResourceContainer method.<NEW_LINE>WispTask.wrapRunOutsideWisp(null);<NEW_LINE>registerPerfCounter(carrier);<NEW_LINE>deRegisterPerfCounter(carrier);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ExceptionInInitializerError(e);<NEW_LINE>}<NEW_LINE>} | ShutdownControlGroup.class.getName()); |
1,362,505 | private static void emitBackEnd(StructuredGraph graph, Object stub, ResolvedJavaMethod installedCodeOwner, SPIRVBackend backend, SPIRVCompilationResult compilationResult, CompilationResultBuilderFactory factory, RegisterConfig registerConfig, TornadoLIRSuites lirSuites, boolean isKernel, boolean isParallel) {<NEW_LINE>try (DebugContext.Scope s = getDebugContext().scope("SPIRVBackend", graph.getLastSchedule());<NEW_LINE>DebugCloseable a = BackEnd.start(getDebugContext())) {<NEW_LINE>LIRGenerationResult lirGen = null;<NEW_LINE>lirGen = emitLIR(backend, graph, stub, registerConfig, lirSuites, compilationResult, isKernel);<NEW_LINE>try (DebugContext.Scope s2 = getDebugContext().scope("SPIRVCodeGen", lirGen, lirGen.getLIR())) {<NEW_LINE>int bytecodeSize = graph.method() == null <MASK><NEW_LINE>compilationResult.setHasUnsafeAccess(graph.hasUnsafeAccess());<NEW_LINE>emitCode(backend, graph.getAssumptions(), graph.method(), graph.getMethods(), bytecodeSize, lirGen, compilationResult, installedCodeOwner, factory, isKernel, isParallel);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw getDebugContext().handle(e);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw getDebugContext().handle(e);<NEW_LINE>}<NEW_LINE>} | ? 0 : graph.getBytecodeSize(); |
1,657,136 | final DescribeAlarmsForMetricResult executeDescribeAlarmsForMetric(DescribeAlarmsForMetricRequest describeAlarmsForMetricRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAlarmsForMetricRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAlarmsForMetricRequest> request = null;<NEW_LINE>Response<DescribeAlarmsForMetricResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAlarmsForMetricRequestMarshaller().marshall(super.beforeMarshalling(describeAlarmsForMetricRequest));<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, "CloudWatch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAlarmsForMetric");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeAlarmsForMetricResult> responseHandler = new StaxResponseHandler<DescribeAlarmsForMetricResult>(new DescribeAlarmsForMetricResultStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
348,070 | private boolean checkClass(TypeElement element) {<NEW_LINE>if (element.getKind() != ElementKind.CLASS) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Set<Modifier> modifiers = element.getModifiers();<NEW_LINE>Element enclosing = element.getEnclosingElement();<NEW_LINE>if (!(enclosing instanceof PackageElement)) {<NEW_LINE>if (!modifiers.contains(Modifier.STATIC)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Elements elements = getHelper().getCompilationController().getElements();<NEW_LINE>Types types = getHelper().getCompilationController().getTypes();<NEW_LINE>List<? extends AnnotationMirror> allAnnotations = elements.getAllAnnotationMirrors(element);<NEW_LINE>if (modifiers.contains(Modifier.ABSTRACT) && !getHelper().hasAnnotation(allAnnotations, DECORATOR)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>TypeElement extensionElement = elements.getTypeElement(EXTENSION);<NEW_LINE>if (extensionElement != null) {<NEW_LINE>TypeMirror extensionType = extensionElement.asType();<NEW_LINE>if (types.isAssignable(element.asType(), extensionType)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<ExecutableElement> constructors = ElementFilter.constructorsIn(element.getEnclosedElements());<NEW_LINE>boolean foundCtor <MASK><NEW_LINE>for (ExecutableElement ctor : constructors) {<NEW_LINE>if (ctor.getParameters().size() == 0) {<NEW_LINE>foundCtor = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (getHelper().hasAnnotation(allAnnotations, FieldInjectionPointLogic.INJECT_ANNOTATION)) {<NEW_LINE>foundCtor = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return foundCtor;<NEW_LINE>} | = constructors.size() == 0; |
536,582 | private SecurityContext oauth2SecurityContext(Oauth2 oauth2) {<NEW_LINE>List<AuthorizationScope> scopes = new ArrayList<>();<NEW_LINE>List<AuthorizationScope<MASK><NEW_LINE>for (AuthorizationScope oauth2Scope : oauth2Scopes) {<NEW_LINE>scopes.add(new AuthorizationScope(oauth2Scope.getScope(), oauth2Scope.getDescription()));<NEW_LINE>}<NEW_LINE>SecurityReference securityReference = new SecurityReference(oauth2.getName(), scopes.toArray(new AuthorizationScope[0]));<NEW_LINE>final List<String> pathPatterns = new ArrayList<>(oauth2.getPathPatterns());<NEW_LINE>if (pathPatterns.isEmpty()) {<NEW_LINE>pathPatterns.add("/**");<NEW_LINE>}<NEW_LINE>final AntPathMatcher matcher = new AntPathMatcher();<NEW_LINE>return SecurityContext.builder().securityReferences(Collections.singletonList(securityReference)).operationSelector((context) -> {<NEW_LINE>String mappingPattern = context.requestMappingPattern();<NEW_LINE>return pathPatterns.stream().anyMatch(patterns -> matcher.match(patterns, mappingPattern));<NEW_LINE>}).build();<NEW_LINE>} | > oauth2Scopes = oauth2.getScopes(); |
28,682 | public void memcpy(DataBuffer dstBuffer, DataBuffer srcBuffer) {<NEW_LINE>val context = AtomicAllocator.getInstance().getDeviceContext();<NEW_LINE>if (dstBuffer instanceof CompressedDataBuffer && !(srcBuffer instanceof CompressedDataBuffer)) {<NEW_LINE>// destination is compressed, source isn't<NEW_LINE>AllocationPoint srcPoint = AtomicAllocator.getInstance().getAllocationPoint(srcBuffer);<NEW_LINE>allocateHostPointers(dstBuffer, srcBuffer);<NEW_LINE>long size = srcBuffer.getElementSize() * srcBuffer.length();<NEW_LINE>if (!srcPoint.isActualOnHostSide()) {<NEW_LINE>// copying device -> host<NEW_LINE>AtomicAllocator.getInstance().synchronizeHostData(srcBuffer);<NEW_LINE>// Pointer src = AtomicAllocator.getInstance().getPointer(srcBuffer, context);<NEW_LINE>// NativeOpsHolder.getInstance().getDeviceNativeOps().memcpyAsync(dstBuffer.addressPointer(), src, size, 2, context.getSpecialStream());<NEW_LINE>// context.syncSpecialStream();<NEW_LINE>}<NEW_LINE>// else {<NEW_LINE>// copying host -> host<NEW_LINE>val src = AtomicAllocator.getInstance().getHostPointer(srcBuffer);<NEW_LINE>Pointer.memcpy(dstBuffer.addressPointer(), src, size);<NEW_LINE>// }<NEW_LINE>} else if (!(dstBuffer instanceof CompressedDataBuffer) && srcBuffer instanceof CompressedDataBuffer) {<NEW_LINE>allocateHostPointers(dstBuffer, srcBuffer);<NEW_LINE>// destination is NOT compressed, source is compressed<NEW_LINE>AllocationPoint dstPoint = AtomicAllocator.getInstance().getAllocationPoint(dstBuffer);<NEW_LINE>long size = srcBuffer.getElementSize() * srcBuffer.length();<NEW_LINE>Pointer.memcpy(dstBuffer.addressPointer(), srcBuffer.addressPointer(), size);<NEW_LINE>dstPoint.tickHostWrite();<NEW_LINE>} else if (dstBuffer instanceof CompressedDataBuffer && srcBuffer instanceof CompressedDataBuffer) {<NEW_LINE>// both buffers are compressed, just fire memcpy<NEW_LINE>allocateHostPointers(dstBuffer, srcBuffer);<NEW_LINE>Pointer.memcpy(dstBuffer.addressPointer(), srcBuffer.addressPointer(), srcBuffer.length() * srcBuffer.getElementSize());<NEW_LINE>} else {<NEW_LINE>// both buffers are NOT compressed<NEW_LINE>AtomicAllocator.getInstance(<MASK><NEW_LINE>}<NEW_LINE>} | ).memcpy(dstBuffer, srcBuffer); |
424,832 | default <T2, R1, R2, R3, R> MonadicValue<R> forEach4(final Function<? super T, ? extends MonadicValue<R1>> value1, final BiFunction<? super T, ? super R1, ? extends MonadicValue<R2>> value2, final Function3<? super T, ? super R1, ? super R2, ? extends MonadicValue<R3>> value3, final Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction) {<NEW_LINE>return this.flatMap(in -> {<NEW_LINE>MonadicValue<R1> a = value1.apply(in);<NEW_LINE>return a.flatMap(ina -> {<NEW_LINE>MonadicValue<R2> b = value2.apply(in, ina);<NEW_LINE>return b.flatMap(inb -> {<NEW_LINE>MonadicValue<R3> c = value3.<MASK><NEW_LINE>return c.map(in2 -> yieldingFunction.apply(in, ina, inb, in2));<NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>} | apply(in, ina, inb); |
546,314 | private void generateVBO(ChunkMesh.RenderType type) {<NEW_LINE>VertexElements elements = vertexElements[type.ordinal()];<NEW_LINE>int id = type.getIndex();<NEW_LINE>if (!disposed && elements.buffer.elements() > 0) {<NEW_LINE>vertexBuffers[id] = GL30.glGenBuffers();<NEW_LINE>idxBuffers[id] = GL30.glGenBuffers();<NEW_LINE>vaoCount[id] = GL30.glGenVertexArrays();<NEW_LINE>GL30.glBindVertexArray(vaoCount[id]);<NEW_LINE>GL30.glBindBuffer(GL30.GL_ARRAY_BUFFER, vertexBuffers[id]);<NEW_LINE>elements.buffer.writeBuffer(buffer -> GL30.glBufferData(GL30.GL_ARRAY_BUFFER<MASK><NEW_LINE>for (VertexResource.VertexDefinition definition : elements.buffer.definitions()) {<NEW_LINE>GL30.glEnableVertexAttribArray(definition.location);<NEW_LINE>if (definition.location == VertexElements.FLAGS_INDEX) {<NEW_LINE>GL30.glVertexAttribIPointer(definition.location, definition.attribute.count, definition.attribute.mapping.glType, elements.buffer.inStride(), definition.offset);<NEW_LINE>} else {<NEW_LINE>GL30.glVertexAttribPointer(definition.location, definition.attribute.count, definition.attribute.mapping.glType, false, elements.buffer.inStride(), definition.offset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>GL30.glBindBuffer(GL30.GL_ELEMENT_ARRAY_BUFFER, idxBuffers[id]);<NEW_LINE>elements.indices.writeBuffer((buffer) -> GL30.glBufferData(GL30.GL_ELEMENT_ARRAY_BUFFER, buffer, GL30.GL_STATIC_DRAW));<NEW_LINE>vertexCount[id] = elements.indices.indices();<NEW_LINE>GL30.glBindVertexArray(0);<NEW_LINE>} else {<NEW_LINE>vertexBuffers[id] = 0;<NEW_LINE>idxBuffers[id] = 0;<NEW_LINE>vertexCount[id] = 0;<NEW_LINE>}<NEW_LINE>} | , buffer, GL30.GL_STATIC_DRAW)); |
1,053,826 | private void applyBrand() {<NEW_LINE>if (switchView != null) {<NEW_LINE>final int finalMainColor = getSecondaryForegroundColorDependingOnTheme(getContext(), mainColor);<NEW_LINE>// int trackColor = Color.argb(77, Color.red(finalMainColor), Color.green(finalMainColor), Color.blue(finalMainColor));<NEW_LINE>DrawableCompat.setTintList(switchView.getThumbDrawable(), new ColorStateList(new int[][] { new int[] { android.R.attr.state_checked }, new int[] {} }, new int[] { finalMainColor, getContext().getResources().getColor(R.color.fg_default_low) }));<NEW_LINE>DrawableCompat.setTintList(switchView.getTrackDrawable(), new ColorStateList(new int[][] { new int[] { android.R.attr.state_checked }, new int[] {} }, new int[] { finalMainColor, getContext().getResources().getColor(R<MASK><NEW_LINE>}<NEW_LINE>} | .color.fg_default_low) })); |
1,406,571 | private Mono<PagedResponse<ContainerAppInner>> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == 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>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
273,461 | protected Optional<PlanNode> pushDownProjectOff(Context context, ValuesNode valuesNode, Set<Symbol> referencedOutputs) {<NEW_LINE>// no symbols to prune<NEW_LINE>if (valuesNode.getOutputSymbols().isEmpty()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>List<Symbol> newOutputs = filteredCopy(valuesNode.getOutputSymbols(), referencedOutputs::contains);<NEW_LINE>// no output symbols left<NEW_LINE>if (newOutputs.isEmpty()) {<NEW_LINE>return Optional.of(new ValuesNode(valuesNode.getId(), valuesNode.getRowCount()));<NEW_LINE>}<NEW_LINE>checkState(valuesNode.getRows().isPresent(), "rows is empty");<NEW_LINE>// if any of ValuesNode's rows is specified by expression other than Row, the redundant piece cannot be extracted and pruned<NEW_LINE>if (!valuesNode.getRows().get().stream().allMatch(Row.class::isInstance)) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>// for each output of project, the corresponding column in the values node<NEW_LINE>int[] mapping = new int[newOutputs.size()];<NEW_LINE>for (int i = 0; i < mapping.length; i++) {<NEW_LINE>mapping[i] = valuesNode.getOutputSymbols().indexOf(newOutputs.get(i));<NEW_LINE>}<NEW_LINE>ImmutableList.Builder<Expression<MASK><NEW_LINE>for (Expression row : valuesNode.getRows().get()) {<NEW_LINE>rowsBuilder.add(new Row(Arrays.stream(mapping).mapToObj(i -> ((Row) row).getItems().get(i)).collect(Collectors.toList())));<NEW_LINE>}<NEW_LINE>return Optional.of(new ValuesNode(valuesNode.getId(), newOutputs, rowsBuilder.build()));<NEW_LINE>} | > rowsBuilder = ImmutableList.builder(); |
187,356 | public void addEntries(@Nonnull ItemStack itemstack, @Nonnull List<String> list, @Nullable String withGrindingMultiplier) {<NEW_LINE>IGrindingMultiplier ball = SagMillRecipeManager.getInstance().getGrindballFromStack(itemstack);<NEW_LINE>list.add(Lang.GRINDING_BALL_1.get(TextFormatting.BLUE));<NEW_LINE>if (withGrindingMultiplier == null) {<NEW_LINE>list.add(Lang.GRINDING_BALL_2.get(TextFormatting.GRAY, LangPower.toPercent(ball.getGrindingMultiplier())));<NEW_LINE>} else {<NEW_LINE>list.add(Lang.GRINDING_BALL_2.get(TextFormatting.GRAY, withGrindingMultiplier));<NEW_LINE>}<NEW_LINE>list.add(Lang.GRINDING_BALL_3.get(TextFormatting.GRAY, LangPower.toPercent(ball.getChanceMultiplier())));<NEW_LINE>list.add(Lang.GRINDING_BALL_4.get(TextFormatting.GRAY, LangPower.toPercent(<MASK><NEW_LINE>} | ball.getPowerMultiplier()))); |
502,304 | private final void _restoreStatePersistentlyLocked(AbstractItemLink link, LinkOwner stream, long lockID) throws SevereMessageStoreException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "_restoreStatePersistentlyLocked", new Object[] { link, stream, Long.valueOf(lockID) });<NEW_LINE>synchronized (this) {<NEW_LINE>if (ItemLinkState.STATE_NOT_STORED == _itemLinkState) {<NEW_LINE>// going 'not stored' to a 'stored' state requires<NEW_LINE>// an increment in total count<NEW_LINE>ListStatistics stats = getParentStatistics();<NEW_LINE>// Defect 510343.1<NEW_LINE>stats.incrementLocked(_inMemoryItemSize);<NEW_LINE>_lockID = lockID;<NEW_LINE>_itemLinkState = ItemLinkState.STATE_PERSISTENTLY_LOCKED;<NEW_LINE>} else {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())<NEW_LINE>SibTr.event(this, tc, "State has already been set: " + _itemLinkState);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.<MASK><NEW_LINE>throw new StateException(_itemLinkState.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(this, tc, "_restoreStatePersistentlyLocked");<NEW_LINE>} | exit(this, tc, "_restoreStatePersistentlyLocked"); |
33,708 | public void showToolbar(boolean showToolbar) {<NEW_LINE>toolbarVisible_ = showToolbar;<NEW_LINE>outerPanel_.clear();<NEW_LINE>if (showToolbar) {<NEW_LINE>if (!hostedMode_) {<NEW_LINE>logoAnchor_.getElement().removeAllChildren();<NEW_LINE>logoAnchor_.getElement().appendChild(logoLarge_.getElement());<NEW_LINE>outerPanel_.add(new BannerWidget(logoAnchor_));<NEW_LINE>}<NEW_LINE>HeaderPanel headerPanel = new HeaderPanel(headerBarPanel_, toolbar_);<NEW_LINE>Roles.getNavigationRole().set(headerPanel.getElement());<NEW_LINE>Roles.getNavigationRole().setAriaLabelProperty(headerPanel.getElement(), "Main menu and toolbar");<NEW_LINE>outerPanel_.add(headerPanel);<NEW_LINE>preferredHeight_ = 65;<NEW_LINE>showProjectMenu(false);<NEW_LINE>} else {<NEW_LINE>if (!hostedMode_) {<NEW_LINE>logoAnchor_.getElement().removeAllChildren();<NEW_LINE>logoAnchor_.getElement().appendChild(logoSmall_.getElement());<NEW_LINE>outerPanel_.add(new BannerWidget(logoAnchor_));<NEW_LINE>}<NEW_LINE>MenubarPanel menubarPanel = new MenubarPanel(headerBarPanel_);<NEW_LINE>Roles.getNavigationRole().set(menubarPanel.getElement());<NEW_LINE>Roles.getNavigationRole().setAriaLabelProperty(menubarPanel.getElement(), "Main menu");<NEW_LINE>outerPanel_.add(menubarPanel);<NEW_LINE>preferredHeight_ = 45;<NEW_LINE>showProjectMenu(true);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | overlay_.setGlobalToolbarVisible(this, showToolbar); |
864,808 | public void execute() throws BuildException {<NEW_LINE>try {<NEW_LINE>run();<NEW_LINE>log("OUTPUT: " + supersFile, Project.MSG_INFO);<NEW_LINE>log("OUTPUT: " + suspendablesFile, Project.MSG_INFO);<NEW_LINE>// output results<NEW_LINE>final ArrayList<String> suspendables = suspendablesFile != null ? new ArrayList<String>() : null;<NEW_LINE>final ArrayList<String> suspendableSupers = supersFile != null ? new <MASK><NEW_LINE>putSuspendablesAndSupers(suspendables, suspendableSupers);<NEW_LINE>if (suspendablesFile != null) {<NEW_LINE>Collections.sort(suspendables);<NEW_LINE>outputResults(suspendablesFile, append, suspendables);<NEW_LINE>}<NEW_LINE>if (supersFile != null) {<NEW_LINE>Collections.sort(suspendableSupers);<NEW_LINE>outputResults(supersFile, append, suspendableSupers);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log(e, Project.MSG_ERR);<NEW_LINE>throw new BuildException(e);<NEW_LINE>}<NEW_LINE>} | ArrayList<String>() : null; |
1,408,835 | public static List<ErrorDescription> systemArrayCopy(HintContext ctx) {<NEW_LINE>List<ErrorDescription> result = new LinkedList<ErrorDescription>();<NEW_LINE>for (String objName : Arrays.asList("$src", "$dest")) {<NEW_LINE>TreePath obj = ctx.getVariables().get(objName);<NEW_LINE>TypeMirror type = ctx.getInfo().getTrees().getTypeMirror(obj);<NEW_LINE>if (Utilities.isValidType(type) && type.getKind() != TypeKind.ARRAY) {<NEW_LINE>String treeDisplayName = Utilities.shortDisplayName(ctx.getInfo(), (ExpressionTree) obj.getLeaf());<NEW_LINE>String displayName = NbBundle.getMessage(Tiny.class, "ERR_system_arraycopy_notarray", treeDisplayName);<NEW_LINE>result.add(ErrorDescriptionFactory.forTree(ctx, obj, displayName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String countName : Arrays.asList("$srcPos", "$destPos", "$length")) {<NEW_LINE>TreePath count = ctx.<MASK><NEW_LINE>Number value = ArithmeticUtilities.compute(ctx.getInfo(), count, true);<NEW_LINE>if (value != null && value.intValue() < 0) {<NEW_LINE>String treeDisplayName = Utilities.shortDisplayName(ctx.getInfo(), (ExpressionTree) count.getLeaf());<NEW_LINE>String displayName = NbBundle.getMessage(Tiny.class, "ERR_system_arraycopy_negative", treeDisplayName);<NEW_LINE>result.add(ErrorDescriptionFactory.forTree(ctx, count, displayName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | getVariables().get(countName); |
1,694,119 | private static void formatInlineCodeTag(StringBuilder builder, DetailNode inlineTag) throws CheckstyleException {<NEW_LINE>boolean wrapWithCodeTag = false;<NEW_LINE>for (DetailNode node : inlineTag.getChildren()) {<NEW_LINE>switch(node.getType()) {<NEW_LINE>case JavadocTokenTypes.CODE_LITERAL:<NEW_LINE>wrapWithCodeTag = true;<NEW_LINE>break;<NEW_LINE>// The text to append.<NEW_LINE>case JavadocTokenTypes.TEXT:<NEW_LINE>if (wrapWithCodeTag) {<NEW_LINE>builder.append("<code>").append(node.getText()).append("</code>");<NEW_LINE>} else {<NEW_LINE>builder.<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>// Empty content tags.<NEW_LINE>case JavadocTokenTypes.LITERAL_LITERAL:<NEW_LINE>case JavadocTokenTypes.JAVADOC_INLINE_TAG_START:<NEW_LINE>case JavadocTokenTypes.JAVADOC_INLINE_TAG_END:<NEW_LINE>case JavadocTokenTypes.WS:<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new CheckstyleException("Unsupported inline tag " + JavadocUtil.getTokenName(node.getType()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | append(node.getText()); |
556,143 | public Builder mergeFrom(io.kubernetes.client.proto.V1alpha1Rbac.RoleBinding other) {<NEW_LINE>if (other == io.kubernetes.client.proto.V1alpha1Rbac.RoleBinding.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (other.hasMetadata()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (subjectsBuilder_ == null) {<NEW_LINE>if (!other.subjects_.isEmpty()) {<NEW_LINE>if (subjects_.isEmpty()) {<NEW_LINE>subjects_ = other.subjects_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>} else {<NEW_LINE>ensureSubjectsIsMutable();<NEW_LINE>subjects_.addAll(other.subjects_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.subjects_.isEmpty()) {<NEW_LINE>if (subjectsBuilder_.isEmpty()) {<NEW_LINE>subjectsBuilder_.dispose();<NEW_LINE>subjectsBuilder_ = null;<NEW_LINE>subjects_ = other.subjects_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>subjectsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getSubjectsFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE>subjectsBuilder_.addAllMessages(other.subjects_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (other.hasRoleRef()) {<NEW_LINE>mergeRoleRef(other.getRoleRef());<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>} | mergeMetadata(other.getMetadata()); |
185,721 | private void processAddByHostname(final List<String> requestedHostnames, List<JSONObject> foundHosts, boolean allowOneTimeHosts) {<NEW_LINE>List<String> oneTimeHostnames = findOneTimeHosts(requestedHostnames, foundHosts);<NEW_LINE>if (!allowOneTimeHosts && !oneTimeHostnames.isEmpty()) {<NEW_LINE>NotifyManager.getInstance().showError("Hosts not found: " + Utils<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// deselect existing non-metahost hosts<NEW_LINE>// iterate over copy to allow modification<NEW_LINE>for (JSONObject host : new ArrayList<JSONObject>(selectedHostData.getItems())) {<NEW_LINE>if (isOneTimeHost(host)) {<NEW_LINE>selectedHostData.removeItem(host);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>availableSelection.deselectAll();<NEW_LINE>// add one-time hosts<NEW_LINE>for (String hostname : oneTimeHostnames) {<NEW_LINE>JSONObject oneTimeObject = new JSONObject();<NEW_LINE>JSONArray profiles = new JSONArray();<NEW_LINE>profiles.set(0, new JSONString("N/A"));<NEW_LINE>oneTimeObject.put("hostname", new JSONString(hostname));<NEW_LINE>oneTimeObject.put("platform", new JSONString(ONE_TIME));<NEW_LINE>oneTimeObject.put("profiles", profiles);<NEW_LINE>oneTimeObject.put("other_labels", new JSONString(""));<NEW_LINE>oneTimeObject.put("status", new JSONString(""));<NEW_LINE>oneTimeObject.put("locked_text", new JSONString(""));<NEW_LINE>oneTimeObject.put("id", new JSONNumber(--META_INDEX));<NEW_LINE>selectRow(oneTimeObject);<NEW_LINE>}<NEW_LINE>// add existing hosts<NEW_LINE>// this refreshes the selection<NEW_LINE>availableSelection.selectObjects(foundHosts);<NEW_LINE>} | .joinStrings(", ", oneTimeHostnames)); |
1,724,575 | public void read(org.apache.thrift.protocol.TProtocol prot, getTabletStats_result struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(2);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TList _list363 = iprot.readListBegin(org.apache.<MASK><NEW_LINE>struct.success = new java.util.ArrayList<TabletStats>(_list363.size);<NEW_LINE>@org.apache.thrift.annotation.Nullable<NEW_LINE>TabletStats _elem364;<NEW_LINE>for (int _i365 = 0; _i365 < _list363.size; ++_i365) {<NEW_LINE>_elem364 = new TabletStats();<NEW_LINE>_elem364.read(iprot);<NEW_LINE>struct.success.add(_elem364);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>struct.setSuccessIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException();<NEW_LINE>struct.sec.read(iprot);<NEW_LINE>struct.setSecIsSet(true);<NEW_LINE>}<NEW_LINE>} | thrift.protocol.TType.STRUCT); |
167,496 | protected void execute(Terminal terminal, OptionSet options, Environment env) throws Exception {<NEW_LINE>terminal.println(Verbosity.VERBOSE, "Running with configuration path: " + env.configFile());<NEW_LINE>setupOptions(terminal, options, env);<NEW_LINE>checkElasticKeystorePasswordValid(terminal, env);<NEW_LINE>checkClusterHealth(terminal);<NEW_LINE>if (shouldPrompt) {<NEW_LINE>terminal.println("******************************************************************************");<NEW_LINE>terminal.println("Note: The 'elasticsearch-setup-passwords' tool has been deprecated. This " + " command will be removed in a future release.");<NEW_LINE>terminal.println("******************************************************************************");<NEW_LINE>terminal.println("");<NEW_LINE>terminal.println("Initiating the setup of passwords for reserved users " + String.join(",", USERS) + ".");<NEW_LINE>terminal.println("You will be prompted to enter passwords as the process progresses.");<NEW_LINE>boolean shouldContinue = terminal.promptYesNo("Please confirm that you would like to continue", false);<NEW_LINE>terminal.println("\n");<NEW_LINE>if (shouldContinue == false) {<NEW_LINE>throw new UserException(ExitCodes.OK, "User cancelled operation");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>changePasswords(user -> promptForPassword(terminal, user), (user, password) -> changedPasswordCallback(terminal<MASK><NEW_LINE>} | , user, password), terminal); |
1,576,465 | private boolean isNewBinary() {<NEW_LINE>String versionCode = "";<NEW_LINE>String versionName = "";<NEW_LINE>SharedPreferences prefs = getContext().getSharedPreferences(com.getcapacitor.plugin.WebView.WEBVIEW_PREFS_NAME, Activity.MODE_PRIVATE);<NEW_LINE>String lastVersionCode = prefs.getString(LAST_BINARY_VERSION_CODE, null);<NEW_LINE>String lastVersionName = prefs.getString(LAST_BINARY_VERSION_NAME, null);<NEW_LINE>try {<NEW_LINE>PackageInfo pInfo = getContext().getPackageManager().getPackageInfo(getContext().getPackageName(), 0);<NEW_LINE>versionCode = Integer.toString(pInfo.versionCode);<NEW_LINE>versionName = pInfo.versionName;<NEW_LINE>} catch (Exception ex) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (!versionCode.equals(lastVersionCode) || !versionName.equals(lastVersionName)) {<NEW_LINE>SharedPreferences.Editor editor = prefs.edit();<NEW_LINE>editor.putString(LAST_BINARY_VERSION_CODE, versionCode);<NEW_LINE>editor.putString(LAST_BINARY_VERSION_NAME, versionName);<NEW_LINE>editor.putString(com.getcapacitor.plugin.WebView.CAP_SERVER_PATH, "");<NEW_LINE>editor.apply();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | Logger.error("Unable to get package info", ex); |
603,842 | public void marshall(CopyPackageVersionsRequest copyPackageVersionsRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (copyPackageVersionsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getDomain(), DOMAIN_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getDomainOwner(), DOMAINOWNER_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getSourceRepository(), SOURCEREPOSITORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getDestinationRepository(), DESTINATIONREPOSITORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getFormat(), FORMAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getNamespace(), NAMESPACE_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getPackage(), PACKAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getVersions(), VERSIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getVersionRevisions(), VERSIONREVISIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getAllowOverwrite(), ALLOWOVERWRITE_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getIncludeFromUpstream(), INCLUDEFROMUPSTREAM_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>} | e.getMessage(), e); |
1,104,201 | private String browseQueueDetails(Queue queue, SampleResult res) {<NEW_LINE>String queueName = null;<NEW_LINE>try {<NEW_LINE>queueName = queue.getQueueName();<NEW_LINE>StringBuilder messageBodies = new StringBuilder(150);<NEW_LINE>messageBodies.append("==== Browsing Messages ===\n");<NEW_LINE>// get some queue details<NEW_LINE>QueueBrowser qBrowser = session.createBrowser(queue);<NEW_LINE>// browse the messages<NEW_LINE>Enumeration<?> e = qBrowser.getEnumeration();<NEW_LINE>int numMsgs = 0;<NEW_LINE>// count number of messages<NEW_LINE>String corrID;<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE>TextMessage message = <MASK><NEW_LINE>corrID = message.getJMSCorrelationID();<NEW_LINE>if (corrID == null) {<NEW_LINE>corrID = message.getJMSMessageID();<NEW_LINE>messageBodies.append(numMsgs).append(" - MessageID: ").append(corrID).append(": ").append(message.getText()).append("\n");<NEW_LINE>} else {<NEW_LINE>messageBodies.append(numMsgs).append(" - CorrelationID: ").append(corrID).append(": ").append(message.getText()).append("\n");<NEW_LINE>}<NEW_LINE>numMsgs++;<NEW_LINE>}<NEW_LINE>res.setResponseMessage(numMsgs + " messages available on the queue");<NEW_LINE>res.setResponseHeaders(qBrowser.toString());<NEW_LINE>return messageBodies + queue.getQueueName() + " has " + numMsgs + " messages";<NEW_LINE>} catch (Exception e) {<NEW_LINE>res.setResponseMessage("Error counting message on the queue");<NEW_LINE>LOGGER.error("Error browsing messages on the queue {}", queueName, e);<NEW_LINE>return "Error browsing messages on the queue, message " + e.getMessage();<NEW_LINE>}<NEW_LINE>} | (TextMessage) e.nextElement(); |
1,715,582 | private void generateUnionMemberAccessors(JDefinedClass unionClass, UnionTemplateSpec.Member member, JClass memberClass, JClass dataClass, JVar schemaField, JVar memberVar) {<NEW_LINE>final DataSchema memberType = member.getSchema();<NEW_LINE>final String memberKey = member.getUnionMemberKey();<NEW_LINE>final String capitalizedName = CodeUtil.getUnionMemberName(member);<NEW_LINE>final JExpression mapRef = JExpr._super().ref("_map");<NEW_LINE>final String memberFieldName = "MEMBER_" + capitalizedName;<NEW_LINE>final JFieldVar memberField = unionClass.field(JMod.PRIVATE | JMod.STATIC | JMod.FINAL, DataSchema.class, memberFieldName);<NEW_LINE>memberField.init(schemaField.invoke("getTypeByMemberKey").arg(memberKey));<NEW_LINE>final String memberFieldKeyName = "MEMBERKEY_" + capitalizedName;<NEW_LINE>unionClass.field(JMod.PUBLIC | JMod.STATIC | JMod.FINAL, String.class, memberFieldKeyName, JExpr.lit(memberKey));<NEW_LINE>final String setterName = "set" + capitalizedName;<NEW_LINE>// Generate builder.<NEW_LINE>final String builderMethodName = (member.getAlias() != null) ? "createWith" + capitalizedName : "create";<NEW_LINE>final JMethod createMethod = unionClass.method(JMod.PUBLIC | JMod.STATIC, unionClass, builderMethodName);<NEW_LINE>JVar param = createMethod.param(memberClass, "value");<NEW_LINE>final JVar newUnionVar = createMethod.body().decl(unionClass, "newUnion", JExpr._new(unionClass));<NEW_LINE>createMethod.body().invoke(newUnionVar, setterName).arg(param);<NEW_LINE>createMethod.body()._return(newUnionVar);<NEW_LINE>// Is method.<NEW_LINE>final JMethod is = unionClass.method(JMod.PUBLIC, getCodeModel().BOOLEAN, "is" + capitalizedName);<NEW_LINE>final JBlock isBody = is.body();<NEW_LINE>JExpression res = JExpr.invoke("memberIs").arg(JExpr.lit(memberKey));<NEW_LINE>isBody._return(res);<NEW_LINE>// Getter method.<NEW_LINE>final String getterName = "get" + capitalizedName;<NEW_LINE>final JMethod getter = unionClass.method(<MASK><NEW_LINE>final JBlock getterBody = getter.body();<NEW_LINE>getterBody.invoke("checkNotNull");<NEW_LINE>JBlock memberVarNonNullBlock = getterBody._if(memberVar.ne(JExpr._null()))._then();<NEW_LINE>memberVarNonNullBlock._return(memberVar);<NEW_LINE>JVar rawValueVar = getterBody.decl(_objectClass, "__rawValue", mapRef.invoke("get").arg(JExpr.lit(memberKey)));<NEW_LINE>getterBody.assign(memberVar, getCoerceOutputExpression(rawValueVar, memberType, memberClass, member.getCustomInfo()));<NEW_LINE>getterBody._return(memberVar);<NEW_LINE>// Setter method.<NEW_LINE>final JMethod setter = unionClass.method(JMod.PUBLIC, Void.TYPE, setterName);<NEW_LINE>param = setter.param(memberClass, "value");<NEW_LINE>final JBlock setterBody = setter.body();<NEW_LINE>setterBody.invoke("checkNotNull");<NEW_LINE>setterBody.add(mapRef.invoke("clear"));<NEW_LINE>setterBody.assign(memberVar, param);<NEW_LINE>setterBody.add(_checkedUtilClass.staticInvoke("putWithoutChecking").arg(mapRef).arg(JExpr.lit(memberKey)).arg(getCoerceInputExpression(param, memberType, member.getCustomInfo())));<NEW_LINE>} | JMod.PUBLIC, memberClass, getterName); |
127,068 | public void testDSOverride008() throws Throwable {<NEW_LINE>final long id = atomicID.incrementAndGet();<NEW_LINE>System.out.println("Start executing DSOverrideTestServlet.testDSOverride008");<NEW_LINE>try {<NEW_LINE>// Create a new Entity using the persistence unit's default datasource<NEW_LINE>DSOverrideEntity newEntity = populateRow(emfAudit, null, id, "data");<NEW_LINE>// Verify that the entity exists in the database<NEW_LINE>DSOverrideEntity findNormal = validateRowExistanceByFind(emfAudit, null, id, "data", null, null, true);<NEW_LINE>// Search for the new Entity using an alternate datasource addressing a different database<NEW_LINE>// -- should result in a null find result (ie, can't find an entity by that identity)<NEW_LINE>Map<String, Object> map = new HashMap<String, Object>();<NEW_LINE>map.put(getJTADatasourcePropertyKeyName(), altJTADataSource);<NEW_LINE>validateRowNonExistanceByFind(emfAudit, map, id, true);<NEW_LINE>// Test again with an EM without the override properties, to ensure that the EMF has not been unexpectedly altered.<NEW_LINE>DSOverrideEntity findEntityNormAgain = validateRowExistanceByFind(emf, null, id, "data", Arrays.asList(findNormal), null, true);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | System.out.println("End executing DSOverrideTestServlet.testDSOverride008"); |
1,542,744 | static boolean isExternalViewConverged(String tableNameWithType, Map<String, Map<String, String>> externalViewSegmentStates, Map<String, Map<String, String>> idealStateSegmentStates, boolean bestEfforts) {<NEW_LINE>for (Map.Entry<String, Map<String, String>> entry : idealStateSegmentStates.entrySet()) {<NEW_LINE>String segmentName = entry.getKey();<NEW_LINE>Map<String, String> externalViewInstanceStateMap = externalViewSegmentStates.get(segmentName);<NEW_LINE>Map<String, String> idealStateInstanceStateMap = entry.getValue();<NEW_LINE>for (Map.Entry<String, String> instanceStateEntry : idealStateInstanceStateMap.entrySet()) {<NEW_LINE>// Ignore OFFLINE state in IdealState<NEW_LINE>String idealStateInstanceState = instanceStateEntry.getValue();<NEW_LINE>if (idealStateInstanceState.equals(SegmentStateModel.OFFLINE)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// ExternalView should contain the segment<NEW_LINE>if (externalViewInstanceStateMap == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Check whether the instance state in ExternalView matches the IdealState<NEW_LINE>String instanceName = instanceStateEntry.getKey();<NEW_LINE>String <MASK><NEW_LINE>if (!idealStateInstanceState.equals(externalViewInstanceState)) {<NEW_LINE>if (SegmentStateModel.ERROR.equals(externalViewInstanceState)) {<NEW_LINE>if (bestEfforts) {<NEW_LINE>LOGGER.warn("Found ERROR instance: {} for segment: {}, table: {}, counting it as good state (best-efforts)", instanceName, segmentName, tableNameWithType);<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("Found ERROR instance: {} for segment: {}, table: {}", instanceName, segmentName, tableNameWithType);<NEW_LINE>throw new IllegalStateException("Found segments in ERROR state");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | externalViewInstanceState = externalViewInstanceStateMap.get(instanceName); |
457,991 | private void fixSyncForDifferingDataTypes() {<NEW_LINE>boolean fixedSync = false;<NEW_LINE>List<DataType> dataTypes = dataTypeManager.getDataTypes(sourceArchive);<NEW_LINE>for (DataType dataType : dataTypes) {<NEW_LINE>DataTypeSyncInfo dataTypeSyncInfo = new DataTypeSyncInfo(dataType, sourceDTM);<NEW_LINE>DataType sourceDataType = dataTypeSyncInfo.getSourceDataType();<NEW_LINE>DataTypeSyncState syncState = dataTypeSyncInfo.getSyncState();<NEW_LINE>if (syncState == DataTypeSyncState.IN_SYNC && dataTypeSyncInfo.hasChange()) {<NEW_LINE>Msg.info(getClass(), "Program data type '" + dataType.getPathName() + "' differs from its source data type '" + <MASK><NEW_LINE>// Set timestamp so user must re-sync.<NEW_LINE>dataType.setLastChangeTimeInSourceArchive(0);<NEW_LINE>fixedSync = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fixedSync) {<NEW_LINE>// Set dirty flag so user must re-sync.<NEW_LINE>sourceArchive.setDirtyFlag(true);<NEW_LINE>// Set timestamp so user must re-sync.<NEW_LINE>sourceArchive.setLastSyncTime(0);<NEW_LINE>}<NEW_LINE>} | sourceDataType.getPathName() + "' and is being changed to not be in-sync!"); |
702,570 | public void passive(final Supplier<Context> context, final PassiveHandler<Config> handler, final Config config) {<NEW_LINE>if (config instanceof EtcdPassiveConfig) {<NEW_LINE>EtcdPassiveConfig etcdPassiveConfig = (EtcdPassiveConfig) config;<NEW_LINE>String value = etcdPassiveConfig.getValue();<NEW_LINE>if (StringUtils.isBlank(value)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PropertyLoader propertyLoader = LOADERS.get(etcdPassiveConfig.getFileExtension());<NEW_LINE>if (propertyLoader == null) {<NEW_LINE>throw new ConfigException("etcd.fileExtension setting error, The loader was not found");<NEW_LINE>}<NEW_LINE>InputStream inputStream = new ByteArrayInputStream(value.getBytes());<NEW_LINE>Optional.of(inputStream).map(e -> propertyLoader.load(etcdPassiveConfig.fileName(), e)).ifPresent(e -> e.forEach(x -> x.getKeys().forEach(t -> ConfigEnv.getInstance().stream().filter(c -> t.startsWith(c.prefix())).forEach(c -> {<NEW_LINE>Object o = c.getSource().get(t);<NEW_LINE>EventData data = null;<NEW_LINE>if (Objects.isNull(o)) {<NEW_LINE>data = new AddData(t<MASK><NEW_LINE>} else if (!Objects.equals(o, x.getValue(t))) {<NEW_LINE>data = new ModifyData(t, x.getValue(t));<NEW_LINE>}<NEW_LINE>push(context, data);<NEW_LINE>}))));<NEW_LINE>}<NEW_LINE>} | , x.getValue(t)); |
1,328,615 | public static Saml20Token createSamlTokenFromAssertion(Assertion assertion) throws Exception {<NEW_LINE>Saml20Token token = null;<NEW_LINE>SsoService saml20Service = getCommonSsoService(SsoService.TYPE_SAML20);<NEW_LINE>if (saml20Service != null) {<NEW_LINE>Map<String, Object> requestContext = new HashMap<String, Object>();<NEW_LINE>requestContext.put(SsoService.WSSEC_SAML_ASSERTION, assertion);<NEW_LINE>Map<String, Object> result = saml20Service.handleRequest(SsoService.WSSEC_SAML_ASSERTION, requestContext);<NEW_LINE>if (!result.isEmpty()) {<NEW_LINE>token = (Saml20Token) result.get(SsoService.SAML_SSO_TOKEN);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return token;<NEW_LINE>} | tc, "Can not find SAML20 SsoService=" + SsoService.TYPE_SAML20); |
1,795,819 | public void init(DataBlock<LabeledData> dataSet) throws IOException {<NEW_LINE>numRow = dataSet.size();<NEW_LINE>numCol = param.numFeature;<NEW_LINE>numNonzero = param.numNonzero;<NEW_LINE>instances = new IntFloatVector[numRow];<NEW_LINE>labels = new float[numRow];<NEW_LINE>preds = new float[numRow];<NEW_LINE>weights = new float[numRow];<NEW_LINE>baseWeights = new float[numRow];<NEW_LINE>// max and min of each feature<NEW_LINE>double[] minFeatures = new double[numCol];<NEW_LINE>double[] maxFeatures = new double[numCol];<NEW_LINE>Arrays.<MASK><NEW_LINE>Arrays.setAll(maxFeatures, i -> Float.MAX_VALUE);<NEW_LINE>dataSet.resetReadIndex();<NEW_LINE>LabeledData data;<NEW_LINE>IntFloatVector x = null;<NEW_LINE>double y;<NEW_LINE>for (int idx = 0; idx < dataSet.size(); idx++) {<NEW_LINE>data = dataSet.read();<NEW_LINE>if (data.getX() instanceof IntFloatVector) {<NEW_LINE>x = (IntFloatVector) data.getX();<NEW_LINE>} else if (data.getX() instanceof IntDoubleVector) {<NEW_LINE>x = VFactory.sparseFloatVector((int) data.getX().dim(), ((IntDoubleVector) data.getX()).getStorage().getIndices(), Maths.double2Float(((IntDoubleVector) data.getX()).getStorage().getValues()));<NEW_LINE>}<NEW_LINE>y = data.getY();<NEW_LINE>if (y != 1) {<NEW_LINE>y = 0;<NEW_LINE>}<NEW_LINE>int[] indices = x.getStorage().getIndices();<NEW_LINE>float[] values = x.getStorage().getValues();<NEW_LINE>for (int i = 0; i < indices.length; i++) {<NEW_LINE>int fid = indices[i];<NEW_LINE>double fvalue = values[i];<NEW_LINE>if (fvalue > maxFeatures[fid]) {<NEW_LINE>maxFeatures[fid] = fvalue;<NEW_LINE>}<NEW_LINE>if (fvalue < minFeatures[fid]) {<NEW_LINE>minFeatures[fid] = fvalue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>instances[idx] = x;<NEW_LINE>labels[idx] = (float) y;<NEW_LINE>preds[idx] = 0.0f;<NEW_LINE>weights[idx] = 1.0f;<NEW_LINE>baseWeights[idx] = 1.0f;<NEW_LINE>}<NEW_LINE>featureMeta = new FeatureMeta(numCol, Maths.double2Float(minFeatures), Maths.double2Float(maxFeatures));<NEW_LINE>} | setAll(minFeatures, i -> 0.0f); |
557,300 | public static GetVideoListResponse unmarshall(GetVideoListResponse getVideoListResponse, UnmarshallerContext _ctx) {<NEW_LINE>getVideoListResponse.setRequestId(_ctx.stringValue("GetVideoListResponse.RequestId"));<NEW_LINE>getVideoListResponse.setTotal(_ctx.integerValue("GetVideoListResponse.Total"));<NEW_LINE>List<Video> videoList = new ArrayList<Video>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetVideoListResponse.VideoList.Length"); i++) {<NEW_LINE>Video video = new Video();<NEW_LINE>video.setVideoId(_ctx.stringValue("GetVideoListResponse.VideoList[" + i + "].VideoId"));<NEW_LINE>video.setTitle(_ctx.stringValue("GetVideoListResponse.VideoList[" + i + "].Title"));<NEW_LINE>video.setTags(_ctx.stringValue("GetVideoListResponse.VideoList[" + i + "].Tags"));<NEW_LINE>video.setStatus(_ctx.stringValue("GetVideoListResponse.VideoList[" + i + "].Status"));<NEW_LINE>video.setSize(_ctx.longValue("GetVideoListResponse.VideoList[" + i + "].Size"));<NEW_LINE>video.setDuration(_ctx.floatValue("GetVideoListResponse.VideoList[" + i + "].Duration"));<NEW_LINE>video.setDescription(_ctx.stringValue("GetVideoListResponse.VideoList[" + i + "].Description"));<NEW_LINE>video.setCreateTime(_ctx.stringValue("GetVideoListResponse.VideoList[" + i + "].CreateTime"));<NEW_LINE>video.setModifyTime(_ctx.stringValue("GetVideoListResponse.VideoList[" + i + "].ModifyTime"));<NEW_LINE>video.setModificationTime(_ctx.stringValue("GetVideoListResponse.VideoList[" + i + "].ModificationTime"));<NEW_LINE>video.setCreationTime(_ctx.stringValue<MASK><NEW_LINE>video.setCoverURL(_ctx.stringValue("GetVideoListResponse.VideoList[" + i + "].CoverURL"));<NEW_LINE>video.setCateId(_ctx.longValue("GetVideoListResponse.VideoList[" + i + "].CateId"));<NEW_LINE>video.setCateName(_ctx.stringValue("GetVideoListResponse.VideoList[" + i + "].CateName"));<NEW_LINE>video.setStorageLocation(_ctx.stringValue("GetVideoListResponse.VideoList[" + i + "].StorageLocation"));<NEW_LINE>video.setAppId(_ctx.stringValue("GetVideoListResponse.VideoList[" + i + "].AppId"));<NEW_LINE>List<String> snapshots = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("GetVideoListResponse.VideoList[" + i + "].Snapshots.Length"); j++) {<NEW_LINE>snapshots.add(_ctx.stringValue("GetVideoListResponse.VideoList[" + i + "].Snapshots[" + j + "]"));<NEW_LINE>}<NEW_LINE>video.setSnapshots(snapshots);<NEW_LINE>videoList.add(video);<NEW_LINE>}<NEW_LINE>getVideoListResponse.setVideoList(videoList);<NEW_LINE>return getVideoListResponse;<NEW_LINE>} | ("GetVideoListResponse.VideoList[" + i + "].CreationTime")); |
479,490 | private static int findAttributePage(int fileId, @Nonnull FileAttribute attr, boolean toWrite) throws IOException {<NEW_LINE>checkFileIsValid(fileId);<NEW_LINE>int recordId = getAttributeRecordId(fileId);<NEW_LINE>int encodedAttrId = DbConnection.getAttributeId(attr.getId());<NEW_LINE>boolean directoryRecord = false;<NEW_LINE>Storage storage = getAttributesStorage();<NEW_LINE>if (recordId == 0) {<NEW_LINE>if (!toWrite)<NEW_LINE>return 0;<NEW_LINE>recordId = storage.createNewRecord();<NEW_LINE>setAttributeRecordId(fileId, recordId);<NEW_LINE>directoryRecord = true;<NEW_LINE>} else {<NEW_LINE>try (DataInputStream attrRefs = storage.readStream(recordId)) {<NEW_LINE>if (bulkAttrReadSupport)<NEW_LINE>skipRecordHeader(attrRefs, DbConnection.RESERVED_ATTR_ID, fileId);<NEW_LINE>while (attrRefs.available() > 0) {<NEW_LINE>final int attIdOnPage = DataInputOutputUtil.readINT(attrRefs);<NEW_LINE>final int <MASK><NEW_LINE>if (attIdOnPage == encodedAttrId) {<NEW_LINE>if (inlineAttributes) {<NEW_LINE>return attrAddressOrSize < MAX_SMALL_ATTR_SIZE ? -recordId : attrAddressOrSize - MAX_SMALL_ATTR_SIZE;<NEW_LINE>} else {<NEW_LINE>return attrAddressOrSize;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (inlineAttributes && attrAddressOrSize < MAX_SMALL_ATTR_SIZE) {<NEW_LINE>attrRefs.skipBytes(attrAddressOrSize);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (toWrite) {<NEW_LINE>try (AbstractStorage.AppenderStream appender = storage.appendStream(recordId)) {<NEW_LINE>if (bulkAttrReadSupport) {<NEW_LINE>if (directoryRecord) {<NEW_LINE>DataInputOutputUtil.writeINT(appender, DbConnection.RESERVED_ATTR_ID);<NEW_LINE>DataInputOutputUtil.writeINT(appender, fileId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DataInputOutputUtil.writeINT(appender, encodedAttrId);<NEW_LINE>int attrAddress = storage.createNewRecord();<NEW_LINE>DataInputOutputUtil.writeINT(appender, inlineAttributes ? attrAddress + MAX_SMALL_ATTR_SIZE : attrAddress);<NEW_LINE>DbConnection.REASONABLY_SMALL.myAttrPageRequested = true;<NEW_LINE>return attrAddress;<NEW_LINE>} finally {<NEW_LINE>DbConnection.REASONABLY_SMALL.myAttrPageRequested = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | attrAddressOrSize = DataInputOutputUtil.readINT(attrRefs); |
686,282 | private void normalizeCollectionParameters(Map<String, String[]> queryParameters) {<NEW_LINE>class OrderValue {<NEW_LINE><NEW_LINE>int index;<NEW_LINE><NEW_LINE>String value;<NEW_LINE><NEW_LINE>public OrderValue(int index, String value) {<NEW_LINE>this.index = index;<NEW_LINE>this.value = value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, List<OrderValue>> lstParameters = new HashMap<>();<NEW_LINE>Iterator<Map.Entry<String, String[]>> it = queryParameters.entrySet().iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Map.Entry<String, String[]> ie = it.next();<NEW_LINE>String k = ie.getKey();<NEW_LINE>String[<MASK><NEW_LINE>if (!k.contains(".")) {<NEW_LINE>// not a list parameter<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String[] pairs = k.split("\\.");<NEW_LINE>String fname = pairs[0];<NEW_LINE>String key = pairs[1];<NEW_LINE>try {<NEW_LINE>int index = Integer.parseInt(key);<NEW_LINE>List<OrderValue> values = lstParameters.computeIfAbsent(fname, x -> new ArrayList<>());<NEW_LINE>values.add(new OrderValue(index, vals[0]));<NEW_LINE>it.remove();<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>// not a number<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lstParameters.forEach((k, v) -> {<NEW_LINE>String[] vals = new String[v.size()];<NEW_LINE>v.sort(Comparator.comparingInt(o -> o.index));<NEW_LINE>for (int i = 0; i < v.size(); i++) {<NEW_LINE>vals[i] = v.get(i).value;<NEW_LINE>}<NEW_LINE>queryParameters.put(k, vals);<NEW_LINE>});<NEW_LINE>} | ] vals = ie.getValue(); |
818,047 | private static RelationshipGroupRecord readRelationshipGroupRecord(long id, ReadableChannel channel) throws IOException {<NEW_LINE>byte flags = channel.get();<NEW_LINE>boolean inUse = bitFlag(flags, Record.IN_USE.byteValue());<NEW_LINE>boolean requireSecondaryUnit = <MASK><NEW_LINE>boolean hasSecondaryUnit = bitFlag(flags, Record.HAS_SECONDARY_UNIT);<NEW_LINE>boolean usesFixedReferenceFormat = bitFlag(flags, Record.USES_FIXED_REFERENCE_FORMAT);<NEW_LINE>boolean hasExternalDegreesOut = bitFlag(flags, Record.ADDITIONAL_FLAG_1);<NEW_LINE>boolean hasExternalDegreesIn = bitFlag(flags, Record.ADDITIONAL_FLAG_2);<NEW_LINE>boolean hasExternalDegreesLoop = bitFlag(flags, Record.ADDITIONAL_FLAG_3);<NEW_LINE>int type = unsignedShortToInt(channel.getShort());<NEW_LINE>long next = channel.getLong();<NEW_LINE>long firstOut = channel.getLong();<NEW_LINE>long firstIn = channel.getLong();<NEW_LINE>long firstLoop = channel.getLong();<NEW_LINE>long owningNode = channel.getLong();<NEW_LINE>RelationshipGroupRecord record = new RelationshipGroupRecord(id).initialize(inUse, type, firstOut, firstIn, firstLoop, owningNode, next);<NEW_LINE>record.setHasExternalDegreesOut(hasExternalDegreesOut);<NEW_LINE>record.setHasExternalDegreesIn(hasExternalDegreesIn);<NEW_LINE>record.setHasExternalDegreesLoop(hasExternalDegreesLoop);<NEW_LINE>record.setRequiresSecondaryUnit(requireSecondaryUnit);<NEW_LINE>if (hasSecondaryUnit) {<NEW_LINE>record.setSecondaryUnitIdOnLoad(channel.getLong());<NEW_LINE>}<NEW_LINE>record.setUseFixedReferences(usesFixedReferenceFormat);<NEW_LINE>return record;<NEW_LINE>} | bitFlag(flags, Record.REQUIRE_SECONDARY_UNIT); |
842,535 | public void close(HippyMap param) {<NEW_LINE>if (param == null) {<NEW_LINE>LogUtils.d(TAG, "close: ERROR: request is null");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!param.containsKey(PARAM_KEY_SOCKET_ID)) {<NEW_LINE>LogUtils.d(TAG, "close: ERROR: no socket id specified");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int socketId = param.getInt(PARAM_KEY_SOCKET_ID);<NEW_LINE>WebSocketClient socketClient = mWebSocketConnections.get(socketId, null);<NEW_LINE>if (socketClient == null || !socketClient.isConnected()) {<NEW_LINE>LogUtils.d(TAG, "send: ERROR: specified socket not found, or not connected yet");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int code = 0;<NEW_LINE>String reason = "";<NEW_LINE>if (param.containsKey(PARAM_KEY_CODE)) {<NEW_LINE>code = param.getInt(PARAM_KEY_CODE);<NEW_LINE>}<NEW_LINE>if (param.containsKey(PARAM_KEY_REASON)) {<NEW_LINE>reason = param.getString(PARAM_KEY_REASON);<NEW_LINE>}<NEW_LINE>socketClient.requestClose(code, <MASK><NEW_LINE>} | reason == null ? "" : reason); |
994,857 | final PutInsightRuleResult executePutInsightRule(PutInsightRuleRequest putInsightRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putInsightRuleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutInsightRuleRequest> request = null;<NEW_LINE>Response<PutInsightRuleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutInsightRuleRequestMarshaller().marshall(super.beforeMarshalling(putInsightRuleRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudWatch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutInsightRule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<PutInsightRuleResult> responseHandler = new StaxResponseHandler<PutInsightRuleResult>(new PutInsightRuleResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,395,281 | public void deserialize(InLongMsgMixedSerializedRecord inLongMsgRecord, Collector<Record> collector) throws Exception {<NEW_LINE>preDeserializer.flatMap(inLongMsgRecord.getData(), new CallbackCollector<>(mixedRow -> {<NEW_LINE>final String tid = InLongMsgUtils.getTidFromMixedRow(mixedRow);<NEW_LINE>final Set<Long> dataFlowIds = interface2DataFlowsMap.get(tid);<NEW_LINE>if (dataFlowIds.isEmpty()) {<NEW_LINE>throw new Exception("No data flow found for tid:" + tid);<NEW_LINE>}<NEW_LINE>final InLongMsgMixedFormatConverter <MASK><NEW_LINE>if (deserializer == null) {<NEW_LINE>throw new Exception("No data flow found for tid:" + tid);<NEW_LINE>}<NEW_LINE>deserializer.flatMap(mixedRow, new CallbackCollector<>((row -> {<NEW_LINE>// each tid might be associated with multiple data flows<NEW_LINE>for (long dataFlowId : dataFlowIds) {<NEW_LINE>collector.collect(new Record(dataFlowId, System.currentTimeMillis(), row));<NEW_LINE>}<NEW_LINE>})));<NEW_LINE>}));<NEW_LINE>} | deserializer = deserializers.get(tid); |
665,253 | public void log(LogRecord record) {<NEW_LINE>Level level = record.getLevel();<NEW_LINE>if (level.intValue() >= Level.SEVERE.intValue()) {<NEW_LINE>if (slf4jLogger.isErrorEnabled()) {<NEW_LINE>slf4jLogger.error(getMessage(record<MASK><NEW_LINE>}<NEW_LINE>} else if (level.intValue() >= Level.WARNING.intValue()) {<NEW_LINE>if (slf4jLogger.isWarnEnabled()) {<NEW_LINE>slf4jLogger.warn(getMessage(record), record.getThrown());<NEW_LINE>}<NEW_LINE>} else if (level.intValue() >= Level.CONFIG.intValue()) {<NEW_LINE>if (slf4jLogger.isInfoEnabled()) {<NEW_LINE>slf4jLogger.info(getMessage(record), record.getThrown());<NEW_LINE>}<NEW_LINE>} else if (level.intValue() >= Level.FINE.intValue()) {<NEW_LINE>if (slf4jLogger.isDebugEnabled()) {<NEW_LINE>slf4jLogger.debug(getMessage(record), record.getThrown());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (slf4jLogger.isTraceEnabled()) {<NEW_LINE>slf4jLogger.trace(getMessage(record), record.getThrown());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), record.getThrown()); |
427,711 | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>ModelAndView model = new ModelAndView();<NEW_LINE>PageDTO page = (PageDTO) request.getAttribute(PageHandlerMapping.PAGE_ATTRIBUTE_NAME);<NEW_LINE>assert page != null;<NEW_LINE>model.addObject(MODEL_ATTRIBUTE_NAME, page);<NEW_LINE>// For convenience<NEW_LINE>model.addObject("pageFields", page.getPageFields());<NEW_LINE><MASK><NEW_LINE>String plainTextStr = (String) page.getPageFields().get("plainText");<NEW_LINE>if (!StringUtils.isEmpty(plainTextStr)) {<NEW_LINE>if (Boolean.valueOf(plainTextStr)) {<NEW_LINE>response.setCharacterEncoding("UTF-8");<NEW_LINE>response.setContentType("text/plain");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String templatePath = page.getTemplatePath();<NEW_LINE>// Allow extension managers to override the path.<NEW_LINE>ExtensionResultHolder<String> erh = new ExtensionResultHolder<String>();<NEW_LINE>Boolean internalValidateFindPreviouslySet = false;<NEW_LINE>ExtensionResultStatusType extResult;<NEW_LINE>try {<NEW_LINE>if (!BroadleafRequestContext.getBroadleafRequestContext().getInternalValidateFind()) {<NEW_LINE>BroadleafRequestContext.getBroadleafRequestContext().setInternalValidateFind(true);<NEW_LINE>internalValidateFindPreviouslySet = true;<NEW_LINE>}<NEW_LINE>extResult = templateOverrideManager.getProxy().getOverrideTemplate(erh, page);<NEW_LINE>} finally {<NEW_LINE>if (internalValidateFindPreviouslySet) {<NEW_LINE>BroadleafRequestContext.getBroadleafRequestContext().setInternalValidateFind(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (extResult != ExtensionResultStatusType.NOT_HANDLED) {<NEW_LINE>templatePath = erh.getResult();<NEW_LINE>}<NEW_LINE>model.setViewName(templatePath);<NEW_LINE>addDeepLink(model, deepLinkService, page);<NEW_LINE>return model;<NEW_LINE>} | model.addObject("BLC_PAGE_TYPE", "page"); |
775,719 | public IRubyObject call(ThreadContext context, IRubyObject[] largs, Block blk) {<NEW_LINE>IRubyObject value;<NEW_LINE>if (largs.length == 0) {<NEW_LINE>value = context.nil;<NEW_LINE>} else if (largs.length == 1) {<NEW_LINE>value = largs[0];<NEW_LINE>} else {<NEW_LINE>value = RubyArray.newArrayNoCopy(context.runtime, largs);<NEW_LINE>}<NEW_LINE>IRubyObject count = result.fastARef(value);<NEW_LINE>if (count == null) {<NEW_LINE>result.fastASet(value, RubyFixnum.one(context.runtime));<NEW_LINE>} else if (count instanceof RubyFixnum) {<NEW_LINE>result.fastASetSmall(value, ((RubyInteger) count).succ(context));<NEW_LINE>} else {<NEW_LINE>TypeConverter.checkType(context, count, <MASK><NEW_LINE>result.fastASetSmall(value, ((RubyBignum) count).op_plus(context, 1L));<NEW_LINE>}<NEW_LINE>return context.nil;<NEW_LINE>} | context.runtime.getBignum()); |
1,631,259 | final CreateAgentResult executeCreateAgent(CreateAgentRequest createAgentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createAgentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<CreateAgentRequest> request = null;<NEW_LINE>Response<CreateAgentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateAgentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createAgentRequest));<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, "DataSync");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateAgent");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateAgentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateAgentResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,489,969 | protected void encodeDropDown(FacesContext context, AutoComplete ac) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String dropdownClass = AutoComplete.DROPDOWN_CLASS;<NEW_LINE>boolean disabled = ac.isDisabled() || ac.isReadonly();<NEW_LINE>if (disabled) {<NEW_LINE>dropdownClass += " ui-state-disabled";<NEW_LINE>}<NEW_LINE>writer.startElement("button", ac);<NEW_LINE>writer.writeAttribute("class", dropdownClass, null);<NEW_LINE>writer.writeAttribute("type", "button", null);<NEW_LINE>if (LangUtils.isNotBlank(ac.getDropdownAriaLabel())) {<NEW_LINE>writer.writeAttribute(HTML.ARIA_LABEL, <MASK><NEW_LINE>}<NEW_LINE>if (disabled) {<NEW_LINE>writer.writeAttribute("disabled", "disabled", null);<NEW_LINE>}<NEW_LINE>if (ac.getDropdownTabindex() != null) {<NEW_LINE>writer.writeAttribute("tabindex", ac.getDropdownTabindex(), null);<NEW_LINE>} else if (ac.getTabindex() != null) {<NEW_LINE>writer.writeAttribute("tabindex", ac.getTabindex(), null);<NEW_LINE>}<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.writeAttribute("class", "ui-button-icon-primary ui-icon ui-icon-triangle-1-s", null);<NEW_LINE>writer.endElement("span");<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.writeAttribute("class", "ui-button-text", null);<NEW_LINE>writer.write(" ");<NEW_LINE>writer.endElement("span");<NEW_LINE>writer.endElement("button");<NEW_LINE>} | ac.getDropdownAriaLabel(), null); |
1,448,738 | public void updateFilters() {<NEW_LINE>updateList(R.id.domainlist, SettingValues.domainFilters, SettingValues.domainFilters::remove);<NEW_LINE>updateList(R.id.subredditlist, SettingValues.subredditFilters, SettingValues.subredditFilters::remove);<NEW_LINE>updateList(R.id.userlist, SettingValues.userFilters, SettingValues.userFilters::remove);<NEW_LINE>updateList(R.id.selftextlist, SettingValues.textFilters, SettingValues.textFilters::remove);<NEW_LINE>updateList(R.id.titlelist, SettingValues.titleFilters, SettingValues.titleFilters::remove);<NEW_LINE>((LinearLayout) findViewById(R.id.flairlist)).removeAllViews();<NEW_LINE>for (String s : SettingValues.flairFilters) {<NEW_LINE>final View t = getLayoutInflater().inflate(R.layout.account_textview, (LinearLayout) findViewById(R.id.domainlist), false);<NEW_LINE>SpannableStringBuilder b = new SpannableStringBuilder();<NEW_LINE>String subname = s.split(":")[0];<NEW_LINE>SpannableStringBuilder subreddit = new SpannableStringBuilder(" /r/" + subname + " ");<NEW_LINE>if ((SettingValues.colorSubName && Palette.getColor(subname) != Palette.getDefaultColor())) {<NEW_LINE>subreddit.setSpan(new ForegroundColorSpan(Palette.getColor(subname)), 0, subreddit.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);<NEW_LINE>subreddit.setSpan(new StyleSpan(Typeface.BOLD), 0, subreddit.<MASK><NEW_LINE>}<NEW_LINE>b.append(subreddit).append(s.split(":")[1]);<NEW_LINE>((TextView) t.findViewById(R.id.name)).setText(b);<NEW_LINE>t.findViewById(R.id.remove).setOnClickListener(v -> {<NEW_LINE>SettingValues.flairFilters.remove(s);<NEW_LINE>updateFilters();<NEW_LINE>});<NEW_LINE>((LinearLayout) findViewById(R.id.flairlist)).addView(t);<NEW_LINE>}<NEW_LINE>} | length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
460,240 | public static ArrayList<IntegerGeoPoint> integerGeoPoints(String locationName, int limit) throws LocationNotFoundException, ClientProtocolException, IOException, URISyntaxException {<NEW_LINE>ArrayList<IntegerGeoPoint> ret = new ArrayList<>();<NEW_LINE>String rawJson = NominatimService.getRawJsonResponse(NominatimService.getUri(locationName));<NEW_LINE>assertThat(rawJson, notNullValue());<NEW_LINE>// Maybe we should implement returning a list, so the user has the option to choose?<NEW_LINE><MASK><NEW_LINE>if (places.length() == 0) {<NEW_LINE>throw new NominatimService.LocationNotFoundException(locationName);<NEW_LINE>} else {<NEW_LINE>JSONObject place = places.getJSONObject(0);<NEW_LINE>for (int i = 0; i < places.length(); i++) {<NEW_LINE>ret.add(new IntegerGeoPoint(place.getDouble("lat"), place.getDouble("lon")));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | JSONArray places = new JSONArray(rawJson); |
1,428,329 | public ValueInstantiator constructValueInstantiator(DeserializationContext ctxt) throws JsonMappingException {<NEW_LINE>final DeserializationConfig config = ctxt.getConfig();<NEW_LINE>final JavaType delegateType = _computeDelegateType(ctxt, _creators[C_DELEGATE], _delegateArgs);<NEW_LINE>final JavaType arrayDelegateType = _computeDelegateType(ctxt<MASK><NEW_LINE>final JavaType type = _beanDesc.getType();<NEW_LINE>StdValueInstantiator inst = new StdValueInstantiator(config, type);<NEW_LINE>inst.configureFromObjectSettings(_creators[C_DEFAULT], _creators[C_DELEGATE], delegateType, _delegateArgs, _creators[C_PROPS], _propertyBasedArgs);<NEW_LINE>inst.configureFromArraySettings(_creators[C_ARRAY_DELEGATE], arrayDelegateType, _arrayDelegateArgs);<NEW_LINE>inst.configureFromStringCreator(_creators[C_STRING]);<NEW_LINE>inst.configureFromIntCreator(_creators[C_INT]);<NEW_LINE>inst.configureFromLongCreator(_creators[C_LONG]);<NEW_LINE>inst.configureFromBigIntegerCreator(_creators[C_BIG_INTEGER]);<NEW_LINE>inst.configureFromDoubleCreator(_creators[C_DOUBLE]);<NEW_LINE>inst.configureFromBigDecimalCreator(_creators[C_BIG_DECIMAL]);<NEW_LINE>inst.configureFromBooleanCreator(_creators[C_BOOLEAN]);<NEW_LINE>return inst;<NEW_LINE>} | , _creators[C_ARRAY_DELEGATE], _arrayDelegateArgs); |
1,595,369 | protected void loadLookup(TokenList component, Element element) {<NEW_LINE>Element lookupElement = element.element("lookup");<NEW_LINE>if (lookupElement == null) {<NEW_LINE>throw new GuiDevelopmentException("'tokenList' must contain 'lookup' element", context, "TokenList ID", element.attributeValue("id"));<NEW_LINE>}<NEW_LINE>loadOptionsContainer(component, lookupElement);<NEW_LINE>if (component.getOptions() == null) {<NEW_LINE>String optionsDatasource = lookupElement.attributeValue("optionsDatasource");<NEW_LINE>if (!StringUtils.isEmpty(optionsDatasource)) {<NEW_LINE>CollectionDatasource ds = (CollectionDatasource) getComponentContext().getDsContext().get(optionsDatasource);<NEW_LINE>component.setOptionsDatasource(ds);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String optionsCaptionProperty = lookupElement.attributeValue("captionProperty");<NEW_LINE>if (!StringUtils.isEmpty(optionsCaptionProperty)) {<NEW_LINE>component.setOptionsCaptionMode(CaptionMode.PROPERTY);<NEW_LINE>component.setOptionsCaptionProperty(optionsCaptionProperty);<NEW_LINE>}<NEW_LINE>String lookup = lookupElement.attributeValue("lookup");<NEW_LINE>if (StringUtils.isNotEmpty(lookup)) {<NEW_LINE>component.setLookup(Boolean.parseBoolean(lookup));<NEW_LINE>if (component.isLookup()) {<NEW_LINE>String <MASK><NEW_LINE>if (StringUtils.isNotEmpty(lookupScreen)) {<NEW_LINE>component.setLookupScreen(lookupScreen);<NEW_LINE>}<NEW_LINE>String openType = lookupElement.attributeValue("openType");<NEW_LINE>if (StringUtils.isNotEmpty(openType)) {<NEW_LINE>component.setLookupOpenMode(OpenType.valueOf(openType));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String multiSelect = lookupElement.attributeValue("multiselect");<NEW_LINE>if (StringUtils.isNotEmpty(multiSelect)) {<NEW_LINE>component.setMultiSelect(Boolean.parseBoolean(multiSelect));<NEW_LINE>}<NEW_LINE>String inputPrompt = lookupElement.attributeValue("inputPrompt");<NEW_LINE>if (StringUtils.isNotEmpty(inputPrompt)) {<NEW_LINE>component.setLookupInputPrompt(loadResourceString(inputPrompt));<NEW_LINE>}<NEW_LINE>loadFilterMode(component, lookupElement);<NEW_LINE>} | lookupScreen = lookupElement.attributeValue("lookupScreen"); |
317,357 | public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {<NEW_LINE>readCommonProcessorOptions();<NEW_LINE>readOptionCrashWhenMethodIsNotPackageProtected();<NEW_LINE><MASK><NEW_LINE>mapTypeElementToMethodInjectorTargetList = new LinkedHashMap<>();<NEW_LINE>mapTypeElementToSuperTypeElementThatNeedsInjection = new LinkedHashMap<>();<NEW_LINE>findAndParseTargets(roundEnv);<NEW_LINE>// Generate member scopes<NEW_LINE>Set<TypeElement> elementWithInjectionSet = new HashSet<>();<NEW_LINE>elementWithInjectionSet.addAll(mapTypeElementToFieldInjectorTargetList.keySet());<NEW_LINE>elementWithInjectionSet.addAll(mapTypeElementToMethodInjectorTargetList.keySet());<NEW_LINE>for (TypeElement typeElement : elementWithInjectionSet) {<NEW_LINE>List<FieldInjectionTarget> fieldInjectionTargetList = mapTypeElementToFieldInjectorTargetList.get(typeElement);<NEW_LINE>List<MethodInjectionTarget> methodInjectionTargetList = mapTypeElementToMethodInjectorTargetList.get(typeElement);<NEW_LINE>TypeElement superClassThatNeedsInjection = mapTypeElementToSuperTypeElementThatNeedsInjection.get(typeElement);<NEW_LINE>MemberInjectorGenerator memberInjectorGenerator = new //<NEW_LINE>MemberInjectorGenerator(//<NEW_LINE>typeElement, //<NEW_LINE>superClassThatNeedsInjection, //<NEW_LINE>fieldInjectionTargetList, methodInjectionTargetList, typeUtils);<NEW_LINE>String fileDescription = String.format("MemberInjector for type %s", typeElement);<NEW_LINE>writeToFile(memberInjectorGenerator, fileDescription, typeElement);<NEW_LINE>allRoundsGeneratedToTypeElement.put(memberInjectorGenerator.getFqcn(), typeElement);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | mapTypeElementToFieldInjectorTargetList = new LinkedHashMap<>(); |
1,019,873 | private WebResponse makeWebResponseForFileUrl(final WebRequest webRequest) throws IOException {<NEW_LINE>URL cleanUrl = webRequest.getUrl();<NEW_LINE>if (cleanUrl.getQuery() != null) {<NEW_LINE>// Get rid of the query portion before trying to load the file.<NEW_LINE>cleanUrl = UrlUtils.getUrlWithNewQuery(cleanUrl, null);<NEW_LINE>}<NEW_LINE>if (cleanUrl.getRef() != null) {<NEW_LINE>// Get rid of the ref portion before trying to load the file.<NEW_LINE>cleanUrl = UrlUtils.getUrlWithNewRef(cleanUrl, null);<NEW_LINE>}<NEW_LINE>final WebResponse fromCache = getCache().getCachedResponse(webRequest);<NEW_LINE>if (fromCache != null) {<NEW_LINE>return new WebResponseFromCache(fromCache, webRequest);<NEW_LINE>}<NEW_LINE>String fileUrl = cleanUrl.toExternalForm();<NEW_LINE>fileUrl = URLDecoder.decode(fileUrl, UTF_8.name());<NEW_LINE>final File file = new File(fileUrl.substring(5));<NEW_LINE>if (!file.exists()) {<NEW_LINE>// construct 404<NEW_LINE>final List<NameValuePair> compiledHeaders = new ArrayList<>();<NEW_LINE>compiledHeaders.add(new NameValuePair(HttpHeader.CONTENT_TYPE, MimeType.TEXT_HTML));<NEW_LINE>final WebResponseData responseData = new WebResponseData(TextUtils.stringToByteArray("File: " + file.getAbsolutePath(), UTF_8), 404, "Not Found", compiledHeaders);<NEW_LINE>return new WebResponse(responseData, webRequest, 0);<NEW_LINE>}<NEW_LINE>final String contentType = guessContentType(file);<NEW_LINE>final DownloadedContent content = new DownloadedContent.OnFile(file, false);<NEW_LINE>final List<NameValuePair> compiledHeaders = new ArrayList<>();<NEW_LINE>compiledHeaders.add(new NameValuePair<MASK><NEW_LINE>compiledHeaders.add(new NameValuePair(HttpHeader.LAST_MODIFIED, DateUtils.formatDate(new Date(file.lastModified()))));<NEW_LINE>final WebResponseData responseData = new WebResponseData(content, 200, "OK", compiledHeaders);<NEW_LINE>final WebResponse webResponse = new WebResponse(responseData, webRequest, 0);<NEW_LINE>getCache().cacheIfPossible(webRequest, webResponse, null);<NEW_LINE>return webResponse;<NEW_LINE>} | (HttpHeader.CONTENT_TYPE, contentType)); |
1,169,010 | public static void logCurrentDeploymentStatus(Deployment deployment, String namespaceName) {<NEW_LINE>if (deployment != null) {<NEW_LINE>String kind = deployment.getKind();<NEW_LINE>String name = deployment<MASK><NEW_LINE>List<String> log = new ArrayList<>(asList("\n", kind, " status:\n", "\nConditions:\n"));<NEW_LINE>for (DeploymentCondition deploymentCondition : deployment.getStatus().getConditions()) {<NEW_LINE>log.add("\tType: " + deploymentCondition.getType() + "\n");<NEW_LINE>log.add("\tMessage: " + deploymentCondition.getMessage() + "\n");<NEW_LINE>}<NEW_LINE>if (kubeClient(namespaceName).listPodsByPrefixInName(name).size() != 0) {<NEW_LINE>log.add("\nPods with conditions and messages:\n\n");<NEW_LINE>for (Pod pod : kubeClient(namespaceName).listPodsByPrefixInName(name)) {<NEW_LINE>log.add(pod.getMetadata().getName() + ":");<NEW_LINE>for (PodCondition podCondition : pod.getStatus().getConditions()) {<NEW_LINE>if (podCondition.getMessage() != null) {<NEW_LINE>log.add("\n\tType: " + podCondition.getType() + "\n");<NEW_LINE>log.add("\tMessage: " + podCondition.getMessage() + "\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.add("\n\n");<NEW_LINE>}<NEW_LINE>LOGGER.info("{}", String.join("", log));<NEW_LINE>}<NEW_LINE>LOGGER.info("{}", String.join("", log));<NEW_LINE>}<NEW_LINE>} | .getMetadata().getName(); |
765,468 | private RowExpression toRowExpression(Subfield subfield, List<Type> types) {<NEW_LINE>List<Subfield.PathElement> path = subfield.getPath();<NEW_LINE>if (path.isEmpty()) {<NEW_LINE>return new VariableReferenceExpression(Optional.empty(), subfield.getRootName(), types.get(0));<NEW_LINE>}<NEW_LINE>RowExpression base = toRowExpression(new Subfield(subfield.getRootName(), path.subList(0, path.size() - 1)), types.subList(0, types.size() - 1));<NEW_LINE>Type baseType = types.get(types.size() - 2);<NEW_LINE>Subfield.PathElement pathElement = path.get(path.size() - 1);<NEW_LINE>if (pathElement instanceof Subfield.LongSubscript) {<NEW_LINE>Type indexType = baseType instanceof MapType ? ((MapType) baseType).getKeyType() : BIGINT;<NEW_LINE>FunctionHandle functionHandle = functionResolution.subscriptFunction(baseType, indexType);<NEW_LINE>ConstantExpression index = new ConstantExpression(base.getSourceLocation(), ((Subfield.LongSubscript) pathElement).getIndex(), indexType);<NEW_LINE>return new CallExpression(base.getSourceLocation(), SUBSCRIPT.name(), functionHandle, types.get(types.size() - 1), ImmutableList.of(base, index));<NEW_LINE>}<NEW_LINE>if (pathElement instanceof Subfield.StringSubscript) {<NEW_LINE>Type indexType = ((MapType) baseType).getKeyType();<NEW_LINE>FunctionHandle functionHandle = functionResolution.subscriptFunction(baseType, indexType);<NEW_LINE>ConstantExpression index = new ConstantExpression(base.getSourceLocation(), Slices.utf8Slice(((Subfield.StringSubscript) pathElement).getIndex()), indexType);<NEW_LINE>return new CallExpression(base.getSourceLocation(), SUBSCRIPT.name(), functionHandle, types.get(types.size() - 1), ImmutableList.of(base, index));<NEW_LINE>}<NEW_LINE>if (pathElement instanceof Subfield.NestedField) {<NEW_LINE>Subfield.NestedField nestedField = (Subfield.NestedField) pathElement;<NEW_LINE>return new SpecialFormExpression(base.getSourceLocation(), DEREFERENCE, types.get(types.size() - 1), base, new ConstantExpression(base.getSourceLocation(), getFieldIndex((RowType) baseType, nestedField.getName()), INTEGER));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>} | verify(false, "Unexpected path element: " + pathElement); |
1,736,257 | private static void trySelectWhereJoined4CoercionBack(RegressionEnvironment env, AtomicInteger milestone, String stmtText) {<NEW_LINE>env.compileDeployAddListenerMile(stmtText, "s0", milestone.getAndIncrement());<NEW_LINE>// intPrimitive, intBoxed, longBoxed, doubleBoxed<NEW_LINE>sendBean(env, "A", 1, 10, 200, 3000);<NEW_LINE>sendBean(env, "B", 1, 10, 200, 3000);<NEW_LINE>sendBean(env, "C", 1, 10, 200, 3000);<NEW_LINE>env.assertEqualsNew("s0", "ids0", null);<NEW_LINE>// intPrimitive, intBoxed, longBoxed, doubleBoxed<NEW_LINE>sendBean(env, "S", -1, 11, 201, 0);<NEW_LINE>sendBean(env, "A", 2, 201, 0, 0);<NEW_LINE>sendBean(env, "B", <MASK><NEW_LINE>sendBean(env, "C", 2, 0, 11, 0);<NEW_LINE>env.assertEqualsNew("s0", "ids0", -1);<NEW_LINE>// intPrimitive, intBoxed, longBoxed, doubleBoxed<NEW_LINE>sendBean(env, "S", -2, 12, 202, 0);<NEW_LINE>sendBean(env, "A", 3, 202, 0, 0);<NEW_LINE>sendBean(env, "B", 3, 0, 0, 202);<NEW_LINE>sendBean(env, "C", 3, 0, -1, 0);<NEW_LINE>env.assertEqualsNew("s0", "ids0", null);<NEW_LINE>// intPrimitive, intBoxed, longBoxed, doubleBoxed<NEW_LINE>sendBean(env, "S", -3, 13, 203, 0);<NEW_LINE>sendBean(env, "A", 4, 203, 0, 0);<NEW_LINE>sendBean(env, "B", 4, 0, 0, 203.0001);<NEW_LINE>sendBean(env, "C", 4, 0, 13, 0);<NEW_LINE>env.assertEqualsNew("s0", "ids0", null);<NEW_LINE>// intPrimitive, intBoxed, longBoxed, doubleBoxed<NEW_LINE>sendBean(env, "S", -4, 14, 204, 0);<NEW_LINE>sendBean(env, "A", 5, 205, 0, 0);<NEW_LINE>sendBean(env, "B", 5, 0, 0, 204);<NEW_LINE>sendBean(env, "C", 5, 0, 14, 0);<NEW_LINE>env.assertEqualsNew("s0", "ids0", null);<NEW_LINE>env.undeployAll();<NEW_LINE>} | 2, 0, 0, 201); |
95,669 | private Object decodeV2(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception {<NEW_LINE>buffer.resetReaderIndex();<NEW_LINE>if (buffer.readableBytes() < 21) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>buffer.skipBytes(2);<NEW_LINE>boolean isRequest = isV2Request(buffer.readByte());<NEW_LINE>buffer.skipBytes(2);<NEW_LINE>long requestId = buffer.readLong();<NEW_LINE>int size = 13;<NEW_LINE><MASK><NEW_LINE>size += 4;<NEW_LINE>if (metasize > 0) {<NEW_LINE>size += metasize;<NEW_LINE>if (buffer.readableBytes() < metasize) {<NEW_LINE>buffer.resetReaderIndex();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>buffer.skipBytes(metasize);<NEW_LINE>}<NEW_LINE>if (buffer.readableBytes() < 4) {<NEW_LINE>buffer.resetReaderIndex();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int bodysize = buffer.readInt();<NEW_LINE>checkMaxContext(bodysize, ctx, channel, isRequest, requestId, RpcProtocolVersion.VERSION_2);<NEW_LINE>size += 4;<NEW_LINE>if (bodysize > 0) {<NEW_LINE>size += bodysize;<NEW_LINE>if (buffer.readableBytes() < bodysize) {<NEW_LINE>buffer.resetReaderIndex();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>byte[] data = new byte[size];<NEW_LINE>buffer.resetReaderIndex();<NEW_LINE>buffer.readBytes(data);<NEW_LINE>return decode(data, channel, isRequest, requestId, RpcProtocolVersion.VERSION_2);<NEW_LINE>} | int metasize = buffer.readInt(); |
834,541 | public ListenableCompletableFuture<PaymentProtocol.Ack> sendPayment(List<Transaction> txns, @Nullable Address refundAddr, @Nullable String memo) {<NEW_LINE>Protos.Payment payment = null;<NEW_LINE>try {<NEW_LINE>payment = getPayment(txns, refundAddr, memo);<NEW_LINE>} catch (IOException | PaymentProtocolException.InvalidNetwork e) {<NEW_LINE>return ListenableCompletableFuture.failedFuture(e);<NEW_LINE>}<NEW_LINE>if (payment == null)<NEW_LINE>return ListenableCompletableFuture.failedFuture(new PaymentProtocolException.InvalidPaymentRequestURL("Missing Payment URL"));<NEW_LINE>if (isExpired())<NEW_LINE>return ListenableCompletableFuture.failedFuture(new PaymentProtocolException.Expired("PaymentRequest is expired"));<NEW_LINE>URL url;<NEW_LINE>try {<NEW_LINE>url = new URL(paymentDetails.getPaymentUrl());<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>return ListenableCompletableFuture.failedFuture(new PaymentProtocolException.InvalidPaymentURL(e));<NEW_LINE>}<NEW_LINE>return ListenableCompletableFuture.of<MASK><NEW_LINE>} | (sendPayment(url, payment)); |
213,344 | public void showError(String title, String message, Throwable ex) {<NEW_LINE>final Alert alert = new Alert(Alert.AlertType.ERROR);<NEW_LINE>final Scene scene = alert.getDialogPane().getScene();<NEW_LINE>BrandUtil.applyBrand(injector, stage, scene);<NEW_LINE>alert.setHeaderText(title);<NEW_LINE>alert.setContentText(message);<NEW_LINE>alert.setGraphic(FontAwesome.EXCLAMATION_TRIANGLE.view());<NEW_LINE>alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);<NEW_LINE>if (ex == null) {<NEW_LINE>alert.setTitle("Error");<NEW_LINE>} else {<NEW_LINE>alert.setTitle(ex.getClass().getSimpleName());<NEW_LINE>final StringWriter sw = new StringWriter();<NEW_LINE>final PrintWriter pw = new PrintWriter(sw);<NEW_LINE>ex.printStackTrace(pw);<NEW_LINE>final Label label = new Label("The exception stacktrace was:");<NEW_LINE>final String exceptionText = sw.toString();<NEW_LINE>final TextArea textArea = new TextArea(exceptionText);<NEW_LINE>textArea.setEditable(false);<NEW_LINE>textArea.setWrapText(true);<NEW_LINE>textArea.setMaxWidth(Double.MAX_VALUE);<NEW_LINE>textArea.setMaxHeight(Double.MAX_VALUE);<NEW_LINE>GridPane.setVgrow(textArea, Priority.ALWAYS);<NEW_LINE>GridPane.setHgrow(textArea, Priority.ALWAYS);<NEW_LINE><MASK><NEW_LINE>expContent.setMaxWidth(Double.MAX_VALUE);<NEW_LINE>expContent.add(label, 0, 0);<NEW_LINE>expContent.add(textArea, 0, 1);<NEW_LINE>alert.getDialogPane().setExpandableContent(expContent);<NEW_LINE>}<NEW_LINE>alert.showAndWait();<NEW_LINE>} | final GridPane expContent = new GridPane(); |
12,703 | private static <T extends FunctionSignature> String formatAvailableSignatures(final T function) {<NEW_LINE>final boolean variadicFunction = function.isVariadic();<NEW_LINE>final List<ParameterInfo> parameters = function.parameterInfo();<NEW_LINE>final StringBuilder result = new StringBuilder();<NEW_LINE>result.append(function.name().toString(FormatOptions.noEscape(<MASK><NEW_LINE>for (int i = 0; i < parameters.size(); i++) {<NEW_LINE>final ParameterInfo param = parameters.get(i);<NEW_LINE>final boolean variadicParam = variadicFunction && i == (parameters.size() - 1);<NEW_LINE>final String type = variadicParam ? ((ArrayType) param.type()).element().toString() + "..." : param.type().toString();<NEW_LINE>if (i != 0) {<NEW_LINE>result.append(", ");<NEW_LINE>}<NEW_LINE>result.append(type);<NEW_LINE>if (!param.name().isEmpty()) {<NEW_LINE>result.append(" ").append(param.name());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result.append(")").toString();<NEW_LINE>} | ))).append("("); |
513,965 | private void newLine(MRequisitionLine requisitionLine) throws Exception {<NEW_LINE>if (purcaseOrderLine != null) {<NEW_LINE>purcaseOrderLine.saveEx();<NEW_LINE>}<NEW_LINE>purcaseOrderLine = null;<NEW_LINE>MProduct product = MProduct.get(getCtx(), requisitionLine.getM_Product_ID());<NEW_LINE>// Get Business Partner<NEW_LINE>int partnerId = requisitionLine.getC_BPartner_ID();<NEW_LINE>if (partnerId != 0) {<NEW_LINE>;<NEW_LINE>} else if (requisitionLine.getC_Charge_ID() != 0) {<NEW_LINE>MCharge charge = MCharge.get(getCtx(), requisitionLine.getC_Charge_ID());<NEW_LINE>partnerId = charge.getC_BPartner_ID();<NEW_LINE>if (partnerId == 0) {<NEW_LINE>throw new AdempiereUserError("No Vendor for Charge " + charge.getName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Find Strategic Vendor for Product<NEW_LINE>// TODO: refactor<NEW_LINE>MProductPO[] pproductPurchaseInfo = MProductPO.getOfProduct(getCtx(), product.getM_Product_ID(), null);<NEW_LINE>for (int i = 0; i < pproductPurchaseInfo.length; i++) {<NEW_LINE>if (pproductPurchaseInfo[i].isCurrentVendor() && pproductPurchaseInfo[i].getC_BPartner_ID() != 0) {<NEW_LINE>partnerId = pproductPurchaseInfo[i].getC_BPartner_ID();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (partnerId == 0 && pproductPurchaseInfo.length > 0) {<NEW_LINE>partnerId = pproductPurchaseInfo[0].getC_BPartner_ID();<NEW_LINE>}<NEW_LINE>if (partnerId == 0) {<NEW_LINE>throw new NoVendorForProductException(product.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isGenerateForVendor(partnerId)) {<NEW_LINE>log.info("Skip for partner " + partnerId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// New Order - Different Vendor<NEW_LINE>if (purchaseOrder == null || purchaseOrder.getC_BPartner_ID() != partnerId) {<NEW_LINE>newOrder(requisitionLine, partnerId);<NEW_LINE>}<NEW_LINE>// No Order Line<NEW_LINE>purcaseOrderLine = new MOrderLine(purchaseOrder);<NEW_LINE>purcaseOrderLine.<MASK><NEW_LINE>if (product != null) {<NEW_LINE>purcaseOrderLine.setProduct(product);<NEW_LINE>purcaseOrderLine.setM_AttributeSetInstance_ID(requisitionLine.getM_AttributeSetInstance_ID());<NEW_LINE>} else {<NEW_LINE>purcaseOrderLine.setC_Charge_ID(requisitionLine.getC_Charge_ID());<NEW_LINE>purcaseOrderLine.setPriceActual(requisitionLine.getPriceActual());<NEW_LINE>}<NEW_LINE>purcaseOrderLine.setAD_Org_ID(requisitionLine.getAD_Org_ID());<NEW_LINE>// Prepare Save<NEW_LINE>productId = requisitionLine.getM_Product_ID();<NEW_LINE>attributeSetInstanceId = requisitionLine.getM_AttributeSetInstance_ID();<NEW_LINE>purcaseOrderLine.saveEx();<NEW_LINE>} | setDatePromised(requisitionLine.getDateRequired()); |
1,329,708 | public static final String encode(String message) {<NEW_LINE>boolean encoded = false;<NEW_LINE>StringBuffer buf = new StringBuffer(message.length() + 32);<NEW_LINE>for (int i = 0; i < message.length(); i++) {<NEW_LINE>char c = message.charAt(i);<NEW_LINE>switch(c) {<NEW_LINE>case '\\':<NEW_LINE>case '\'':<NEW_LINE>buf.append('\\');<NEW_LINE>buf.append(c);<NEW_LINE>encoded = true;<NEW_LINE>break;<NEW_LINE>case '\r':<NEW_LINE>buf.append('\\');<NEW_LINE>buf.append('r');<NEW_LINE>encoded = true;<NEW_LINE>break;<NEW_LINE>case '\n':<NEW_LINE>buf.append('\\');<NEW_LINE>buf.append('n');<NEW_LINE>encoded = true;<NEW_LINE>break;<NEW_LINE>case '\t':<NEW_LINE>buf.append('\\');<NEW_LINE>buf.append('t');<NEW_LINE>encoded = true;<NEW_LINE>break;<NEW_LINE>case '\f':<NEW_LINE>buf.append('\\');<NEW_LINE>buf.append('f');<NEW_LINE>encoded = true;<NEW_LINE>break;<NEW_LINE>case '\b':<NEW_LINE>buf.append('\\');<NEW_LINE>buf.append('b');<NEW_LINE>encoded = true;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>if (c <= '\u000f') {<NEW_LINE>buf.append('\\');<NEW_LINE>buf.append('x');<NEW_LINE>buf.append('0');<NEW_LINE>buf.append(Integer.toHexString(c));<NEW_LINE>encoded = true;<NEW_LINE>} else if (c >= ' ' && c < '\u007f') {<NEW_LINE>buf.append(c);<NEW_LINE>} else if (c <= '\u00ff') {<NEW_LINE>buf.append('\\');<NEW_LINE>buf.append('x');<NEW_LINE>buf.append(Integer.toHexString(c));<NEW_LINE>encoded = true;<NEW_LINE>} else {<NEW_LINE>buf.append('\\');<NEW_LINE>buf.append('u');<NEW_LINE>if (c <= '\u0fff') {<NEW_LINE>buf.append('0');<NEW_LINE>}<NEW_LINE>buf.append<MASK><NEW_LINE>encoded = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (encoded) {<NEW_LINE>return buf.toString();<NEW_LINE>}<NEW_LINE>return message;<NEW_LINE>} | (Integer.toHexString(c)); |
107,253 | public String buildJson(String type, List<String> descriptions, Response.Status status, GrobidExceptionStatus grobidExceptionStatus, String requestUri) {<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>ObjectNode root = mapper.createObjectNode();<NEW_LINE>root.put("type", type);<NEW_LINE>root.put("description", Joiner.on("\n").join(descriptions));<NEW_LINE>root.put("code", status.getStatusCode());<NEW_LINE>root.put("requestUri", requestUri);<NEW_LINE>String correlationId = MDC.get("correlationId");<NEW_LINE>if (correlationId != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (grobidExceptionStatus != null) {<NEW_LINE>root.put("grobidExceptionStatus", grobidExceptionStatus.name());<NEW_LINE>}<NEW_LINE>String json;<NEW_LINE>try {<NEW_LINE>json = mapper.writeValueAsString(root);<NEW_LINE>} catch (IOException e) {<NEW_LINE>// LOGGER.warn("Error in ServiceExceptionMapper: ", e);<NEW_LINE>json = "{\"description\": \"Internal error: " + e.getMessage() + "\"}";<NEW_LINE>}<NEW_LINE>return json;<NEW_LINE>} | root.put("correlationId", correlationId); |
1,776,531 | public static boolean saveProfilerConfig(final Project project, final String profileTarget, final String profileSingleTarget) {<NEW_LINE>// not yet modified for profiler => create profiler-build-impl & modify build.xml and project.xml<NEW_LINE>final // NOI18N<NEW_LINE>Element // NOI18N<NEW_LINE>profilerFragment = // NOI18N<NEW_LINE>XMLUtil.createDocument("ignore", null, null, null).// NOI18N<NEW_LINE>createElementNS(// NOI18N<NEW_LINE>ProjectUtilities.PROFILER_NAME_SPACE, "data");<NEW_LINE>profilerFragment.setAttribute(PROFILE_VERSION_ATTRIBUTE, VERSION_NUMBER);<NEW_LINE>// TODO: shouldn't the user select the profiler target here? See revision 208377.<NEW_LINE>if (profileTarget != null) {<NEW_LINE>profilerFragment.setAttribute(PROFILE_TARGET_ATTRIBUTE, profileTarget);<NEW_LINE>}<NEW_LINE>if (profileSingleTarget != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>ProjectUtils.getAuxiliaryConfiguration(project).putConfigurationFragment(profilerFragment, false);<NEW_LINE>try {<NEW_LINE>ProjectManager.getDefault().saveProject(project);<NEW_LINE>} catch (IOException e1) {<NEW_LINE>Profiler.getDefault().notifyException(Profiler.EXCEPTION, e1);<NEW_LINE>ProfilerLogger.log(e1);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | profilerFragment.setAttribute(PROFILE_SINGLE_TARGET_ATTRIBUTE, profileSingleTarget); |
1,576,555 | private CommitableFieldPanel createOutputPathPanel(String title, ContentFolderTypeProvider provider, Disposable parentUIDisposable, Consumer<String> commitPathRunnable) {<NEW_LINE>FileChooserTextBoxBuilder builder = FileChooserTextBoxBuilder.create(myProject);<NEW_LINE>builder.dialogTitle(title);<NEW_LINE>builder.<MASK><NEW_LINE>builder.uiDisposable(parentUIDisposable);<NEW_LINE>FileChooserTextBoxBuilder.Controller controller = builder.build();<NEW_LINE>Label label = Label.create(LocalizeValue.localizeTODO(provider.getName() + " Output: "));<NEW_LINE>CommitableFieldPanel commitableFieldPanel = new CommitableFieldPanel(controller, label);<NEW_LINE>commitableFieldPanel.myCommitRunnable = () -> {<NEW_LINE>if (!getModel().isWritable()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String url = commitableFieldPanel.getUrl();<NEW_LINE>commitPathRunnable.accept(url);<NEW_LINE>};<NEW_LINE>return commitableFieldPanel;<NEW_LINE>} | fileChooserDescriptor(FileChooserDescriptorFactory.createSingleFolderDescriptor()); |
916,184 | private static EventLine parseEventLine(String line, CalDavEvent event, String defaultItemOnBegin) {<NEW_LINE>final Matcher <MASK><NEW_LINE>if (matcher.matches()) {<NEW_LINE>final String scope = matcher.group(1);<NEW_LINE>final String itemName = matcher.group(3);<NEW_LINE>final String stateString = matcher.group(4);<NEW_LINE>if (itemName.trim().length() > 0 && stateString.trim().length() > 0) {<NEW_LINE>if (SCOPE_BEGIN.equals(scope)) {<NEW_LINE>return new EventLine(itemName, stateString, scope, event.getStart());<NEW_LINE>}<NEW_LINE>if (SCOPE_END.equals(scope)) {<NEW_LINE>return new EventLine(itemName, stateString, scope, event.getEnd());<NEW_LINE>}<NEW_LINE>if (SCOPE_BETWEEN.equals(scope)) {<NEW_LINE>final String timeString = matcher.group(2);<NEW_LINE>final DateTime time = DateTimeFormat.forPattern(EventUtils.DATE_FORMAT).parseDateTime(timeString);<NEW_LINE>return new EventLine(itemName, stateString, scope, time);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (defaultItemOnBegin != null && !COMMAND_PATTERN.matcher(line).matches()) {<NEW_LINE>// if defaultItemOnBegin is set, use entire line as command value<NEW_LINE>return new EventLine(defaultItemOnBegin, line, SCOPE_BEGIN, event.getStart());<NEW_LINE>}<NEW_LINE>log.error("invalid format for line: {}", line);<NEW_LINE>// nothing meaningful found in line<NEW_LINE>return null;<NEW_LINE>} | matcher = LINE_PATTERN.matcher(line); |
564,435 | public static void init() {<NEW_LINE>// register farmland texture<NEW_LINE>ClocheRecipe.registerSoilTexture(Ingredient.of(new ItemStack(Items.DIRT), new ItemStack(Items.COARSE_DIRT), new ItemStack(Items.GRASS_BLOCK), new ItemStack(Items.GRASS_PATH)), new ResourceLocation("block/farmland_moist"));<NEW_LINE>// register defaults<NEW_LINE>ClocheRenderFunction.RENDER_FUNCTION_FACTORIES.put("crop", RenderFunctionCrop::new);<NEW_LINE>ClocheRenderFunction.RENDER_FUNCTION_FACTORIES.put("stacking", RenderFunctionStacking::new);<NEW_LINE>ClocheRenderFunction.RENDER_FUNCTION_FACTORIES.put("stem", RenderFunctionStem::new);<NEW_LINE>ClocheRenderFunction.RENDER_FUNCTION_FACTORIES.<MASK><NEW_LINE>ClocheRenderFunction.RENDER_FUNCTION_FACTORIES.put("hemp", block -> new RenderFunctionHemp());<NEW_LINE>ClocheRenderFunction.RENDER_FUNCTION_FACTORIES.put("chorus", block -> new RenderFunctionChorus());<NEW_LINE>} | put("generic", RenderFunctionGeneric::new); |
1,755,804 | public void configure(Context context) {<NEW_LINE>this.context = context;<NEW_LINE>port = context.getInteger(ConfigConstants.CONFIG_PORT);<NEW_LINE>host = context.<MASK><NEW_LINE>Configurables.ensureRequiredNonNull(context, ConfigConstants.CONFIG_PORT);<NEW_LINE>Preconditions.checkArgument(ConfStringUtils.isValidIp(host), "ip config not valid");<NEW_LINE>Preconditions.checkArgument(ConfStringUtils.isValidPort(port), "port config not valid");<NEW_LINE>maxMsgLength = context.getInteger(ConfigConstants.MAX_MSG_LENGTH, 1024 * 64);<NEW_LINE>Preconditions.checkArgument((maxMsgLength >= 4 && maxMsgLength <= ConfigConstants.MSG_MAX_LENGTH_BYTES), "maxMsgLength must be >= 4 and <= 65536");<NEW_LINE>topic = context.getString(ConfigConstants.TOPIC);<NEW_LINE>attr = context.getString(ConfigConstants.ATTR);<NEW_LINE>Configurables.ensureRequiredNonNull(context, ConfigConstants.TOPIC, ConfigConstants.ATTR);<NEW_LINE>topic = topic.trim();<NEW_LINE>Preconditions.checkArgument(!topic.isEmpty(), "topic is empty");<NEW_LINE>attr = attr.trim();<NEW_LINE>Preconditions.checkArgument(!attr.isEmpty(), "attr is empty");<NEW_LINE>messageHandlerName = context.getString(ConfigConstants.MESSAGE_HANDLER_NAME, "org.apache.inlong.dataproxy.source.ServerMessageHandler");<NEW_LINE>messageHandlerName = messageHandlerName.trim();<NEW_LINE>Preconditions.checkArgument(!messageHandlerName.isEmpty(), "messageHandlerName is empty");<NEW_LINE>filterEmptyMsg = context.getBoolean(ConfigConstants.FILTER_EMPTY_MSG, false);<NEW_LINE>statIntervalSec = context.getInteger(ConfigConstants.STAT_INTERVAL_SEC, 60);<NEW_LINE>Preconditions.checkArgument((statIntervalSec >= 0), "statIntervalSec must be >= 0");<NEW_LINE>customProcessor = context.getBoolean(ConfigConstants.CUSTOM_CHANNEL_PROCESSOR, false);<NEW_LINE>try {<NEW_LINE>maxConnections = context.getInteger(CONNECTIONS, 5000);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>logger.warn("BaseSource\'s \"connections\" property must specify an integer value. {}", context.getString(CONNECTIONS));<NEW_LINE>}<NEW_LINE>} | getString(ConfigConstants.CONFIG_HOST, "0.0.0.0"); |
474,208 | final DescribePageResult executeDescribePage(DescribePageRequest describePageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describePageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribePageRequest> request = null;<NEW_LINE>Response<DescribePageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribePageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describePageRequest));<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, "SSM Contacts");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribePage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribePageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribePageResultJsonUnmarshaller());<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); |
867,284 | public void init() {<NEW_LINE>// Cache color palette<NEW_LINE>try (InputStream stream = client.getResourceManager().getResource(paletteIdentifier).getInputStream()) {<NEW_LINE><MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>paletteAsBufferedImage = null;<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>TextRenderer tr = client.textRenderer;<NEW_LINE>paletteX = width / 2 - 100;<NEW_LINE>paletteY = 32;<NEW_LINE>fieldsX = width / 2 - 100;<NEW_LINE>fieldsY = 129 + 5;<NEW_LINE>hexValueField = new TextFieldWidget(tr, fieldsX, fieldsY, 92, 20, new LiteralText(""));<NEW_LINE>hexValueField.setText(ColorUtils.toHex(color).substring(1));<NEW_LINE>hexValueField.setMaxLength(6);<NEW_LINE>hexValueField.setChangedListener(s -> updateColor(true));<NEW_LINE>// RGB fields<NEW_LINE>redValueField = new TextFieldWidget(tr, fieldsX, fieldsY + 35, 50, 20, new LiteralText(""));<NEW_LINE>redValueField.setText("" + color.getRed());<NEW_LINE>redValueField.setMaxLength(3);<NEW_LINE>redValueField.setChangedListener(s -> updateColor(false));<NEW_LINE>greenValueField = new TextFieldWidget(tr, fieldsX + 75, fieldsY + 35, 50, 20, new LiteralText(""));<NEW_LINE>greenValueField.setText("" + color.getGreen());<NEW_LINE>greenValueField.setMaxLength(3);<NEW_LINE>greenValueField.setChangedListener(s -> updateColor(false));<NEW_LINE>blueValueField = new TextFieldWidget(tr, fieldsX + 150, fieldsY + 35, 50, 20, new LiteralText(""));<NEW_LINE>blueValueField.setText("" + color.getBlue());<NEW_LINE>blueValueField.setMaxLength(3);<NEW_LINE>blueValueField.setChangedListener(s -> updateColor(false));<NEW_LINE>addSelectableChild(hexValueField);<NEW_LINE>addSelectableChild(redValueField);<NEW_LINE>addSelectableChild(greenValueField);<NEW_LINE>addSelectableChild(blueValueField);<NEW_LINE>setInitialFocus(hexValueField);<NEW_LINE>hexValueField.setTextFieldFocused(true);<NEW_LINE>hexValueField.setSelectionStart(0);<NEW_LINE>hexValueField.setSelectionEnd(6);<NEW_LINE>doneButton = new ButtonWidget(fieldsX, height - 30, 200, 20, new LiteralText("Done"), b -> done());<NEW_LINE>addDrawableChild(doneButton);<NEW_LINE>} | paletteAsBufferedImage = ImageIO.read(stream); |
27,049 | final EnableOrganizationAdminAccountResult executeEnableOrganizationAdminAccount(EnableOrganizationAdminAccountRequest enableOrganizationAdminAccountRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(enableOrganizationAdminAccountRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<EnableOrganizationAdminAccountRequest> request = null;<NEW_LINE>Response<EnableOrganizationAdminAccountResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new EnableOrganizationAdminAccountRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(enableOrganizationAdminAccountRequest));<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, "Detective");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "EnableOrganizationAdminAccount");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<EnableOrganizationAdminAccountResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new EnableOrganizationAdminAccountResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
221,762 | private void findFieldsAndMethodsFromFavorites(char[] token, Scope scope, InvocationSite invocationSite, Scope invocationScope, ObjectVector localsFound, ObjectVector fieldsFound, ObjectVector methodsFound) {<NEW_LINE>ObjectVector methodsFoundFromFavorites = new ObjectVector();<NEW_LINE>ImportBinding[] favoriteBindings = getFavoriteReferenceBindings(invocationScope);<NEW_LINE>if (favoriteBindings != null && favoriteBindings.length > 0) {<NEW_LINE>for (int i = 0; i < favoriteBindings.length; i++) {<NEW_LINE>ImportBinding favoriteBinding = favoriteBindings[i];<NEW_LINE>switch(favoriteBinding.resolvedImport.kind()) {<NEW_LINE>case Binding.FIELD:<NEW_LINE>FieldBinding fieldBinding = (FieldBinding) favoriteBinding.resolvedImport;<NEW_LINE>findFieldsFromFavorites(token, new FieldBinding[] { fieldBinding }, scope, fieldsFound, localsFound, fieldBinding.declaringClass, invocationSite, invocationScope);<NEW_LINE>break;<NEW_LINE>case Binding.METHOD:<NEW_LINE>MethodBinding <MASK><NEW_LINE>MethodBinding[] methods = methodBinding.declaringClass.availableMethods();<NEW_LINE>long range;<NEW_LINE>if ((range = ReferenceBinding.binarySearch(methodBinding.selector, methods)) >= 0) {<NEW_LINE>int start = (int) range, end = (int) (range >> 32);<NEW_LINE>int length = end - start + 1;<NEW_LINE>System.arraycopy(methods, start, methods = new MethodBinding[length], 0, length);<NEW_LINE>} else {<NEW_LINE>methods = Binding.NO_METHODS;<NEW_LINE>}<NEW_LINE>findLocalMethodsFromFavorites(token, methods, scope, methodsFound, methodsFoundFromFavorites, methodBinding.declaringClass, invocationSite, invocationScope);<NEW_LINE>break;<NEW_LINE>case Binding.TYPE:<NEW_LINE>ReferenceBinding referenceBinding = (ReferenceBinding) favoriteBinding.resolvedImport;<NEW_LINE>if (favoriteBinding.onDemand) {<NEW_LINE>findFieldsFromFavorites(token, referenceBinding.availableFields(), scope, fieldsFound, localsFound, referenceBinding, invocationSite, invocationScope);<NEW_LINE>findLocalMethodsFromFavorites(token, referenceBinding.availableMethods(), scope, methodsFound, methodsFoundFromFavorites, referenceBinding, invocationSite, invocationScope);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>methodsFound.addAll(methodsFoundFromFavorites);<NEW_LINE>} | methodBinding = (MethodBinding) favoriteBinding.resolvedImport; |
587,959 | private void downloadRecordingImageToLocal(LocalDockerManager dockMng) {<NEW_LINE>log.info("Recording module required: Downloading openvidu/openvidu-recording:" + openviduConfig.getOpenViduRecordingVersion() + " Docker image (350MB aprox)");<NEW_LINE>if (dockMng.dockerImageExistsLocally(openviduConfig.getOpenviduRecordingImageRepo() + ":" + openviduConfig.getOpenViduRecordingVersion())) {<NEW_LINE>log.info("Docker image already exists locally");<NEW_LINE>} else {<NEW_LINE>Thread t = new Thread(() -> {<NEW_LINE>boolean keep = true;<NEW_LINE>log.info("Downloading ");<NEW_LINE>while (keep) {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>Thread.sleep(1000);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>keep = false;<NEW_LINE>log.info("\nDownload complete");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>t.start();<NEW_LINE>try {<NEW_LINE>dockMng.downloadDockerImage(openviduConfig.getOpenviduRecordingImageRepo() + ":" + openviduConfig.getOpenViduRecordingVersion(), 600);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error downloading docker image {}:{}", openviduConfig.getOpenviduRecordingImageRepo(), openviduConfig.getOpenViduRecordingVersion());<NEW_LINE>}<NEW_LINE>t.interrupt();<NEW_LINE>try {<NEW_LINE>t.join();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>log.info("Docker image available");<NEW_LINE>}<NEW_LINE>} | System.out.print("."); |
1,443,378 | private void processFields(CtClass clazz) throws CannotCompileException, NotFoundException {<NEW_LINE>CtField[<MASK><NEW_LINE>for (int i = 0; i < fs.length; ++i) {<NEW_LINE>CtField f = fs[i];<NEW_LINE>int mod = f.getModifiers();<NEW_LINE>if ((mod & Modifier.PUBLIC) != 0 && (mod & Modifier.FINAL) == 0) {<NEW_LINE>mod |= Modifier.STATIC;<NEW_LINE>String name = f.getName();<NEW_LINE>CtClass ftype = f.getType();<NEW_LINE>CtMethod wmethod = CtNewMethod.wrapped(ftype, readPrefix + name, readParam, null, trapRead, ConstParameter.string(name), clazz);<NEW_LINE>wmethod.setModifiers(mod);<NEW_LINE>clazz.addMethod(wmethod);<NEW_LINE>CtClass[] writeParam = new CtClass[2];<NEW_LINE>writeParam[0] = classPool.get("java.lang.Object");<NEW_LINE>writeParam[1] = ftype;<NEW_LINE>wmethod = CtNewMethod.wrapped(CtClass.voidType, writePrefix + name, writeParam, null, trapWrite, ConstParameter.string(name), clazz);<NEW_LINE>wmethod.setModifiers(mod);<NEW_LINE>clazz.addMethod(wmethod);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ] fs = clazz.getDeclaredFields(); |
1,452,336 | private ServerPlugin load(File pluginFile) {<NEW_LINE>LogManager.LOGGER.info("Loading plugin file " + pluginFile.getName());<NEW_LINE>ZipFile zipFile = null;<NEW_LINE>try {<NEW_LINE>// Get the plugin config file from the archive<NEW_LINE>zipFile = new ZipFile(pluginFile);<NEW_LINE>ZipEntry configEntry = zipFile.getEntry("plugin.properties");<NEW_LINE>if (configEntry != null) {<NEW_LINE>InputStream stream = zipFile.getInputStream(configEntry);<NEW_LINE>Properties pluginConfig = new Properties();<NEW_LINE>pluginConfig.load(stream);<NEW_LINE>ClassLoader loader = URLClassLoader.newInstance(new URL[] { pluginFile.toURI().toURL() });<NEW_LINE>Class<?> aClass = Class.forName(pluginConfig.getProperty("classpath"), true, loader);<NEW_LINE>Class<? extends ServerPlugin> pluginClass = aClass.asSubclass(ServerPlugin.class);<NEW_LINE>Constructor<? extends ServerPlugin> constructor = pluginClass.getConstructor();<NEW_LINE>ServerPlugin plugin = constructor.newInstance();<NEW_LINE>plugin.setName(pluginConfig.getProperty("name"));<NEW_LINE>plugin.setVersion<MASK><NEW_LINE>String dependStr = pluginConfig.getProperty("depend");<NEW_LINE>if (dependStr != null) {<NEW_LINE>for (String dep : dependStr.split(",")) {<NEW_LINE>plugin.dependencies.add(dep.trim());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return plugin;<NEW_LINE>} else {<NEW_LINE>LogManager.LOGGER.severe("Couldn't find plugin.properties in " + pluginFile.getName());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (zipFile != null) {<NEW_LINE>zipFile.close();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | (pluginConfig.getProperty("version")); |
1,671,184 | public Object[] prepareArgs(RootCallTarget callTarget, ParserContext parserContext, DeclarationContext declarationContext, MaterializedFrame parentFrame, Object self, LexicalScope lexicalScope, Object[] arguments) {<NEW_LINE>final RubyRootNode rootNode = RubyRootNode.of(callTarget);<NEW_LINE>final InternalMethod parentMethod = parentFrame == null ? null : RubyArguments.getMethod(parentFrame);<NEW_LINE>final RubyModule declaringModule;<NEW_LINE>if ((parserContext == ParserContext.EVAL || parserContext == ParserContext.INSTANCE_EVAL) && parentFrame != null) {<NEW_LINE>declaringModule = parentMethod.getDeclaringModule();<NEW_LINE>} else if (parserContext == ParserContext.MODULE) {<NEW_LINE>declaringModule = (RubyModule) self;<NEW_LINE>} else {<NEW_LINE>declaringModule = context.getCoreLibrary().objectClass;<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>final InternalMethod method = new InternalMethod(context, sharedMethodInfo, lexicalScope, declarationContext, sharedMethodInfo.getMethodNameForNotBlock(), declaringModule, Visibility.PUBLIC, callTarget);<NEW_LINE>return RubyArguments.pack(parentFrame, null, method, null, self, Nil.INSTANCE, EmptyArgumentsDescriptor.INSTANCE, arguments);<NEW_LINE>} | SharedMethodInfo sharedMethodInfo = rootNode.getSharedMethodInfo(); |
1,329,913 | final GetDomainResult executeGetDomain(GetDomainRequest getDomainRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDomainRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDomainRequest> request = null;<NEW_LINE>Response<GetDomainResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetDomainRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDomainRequest));<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, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDomain");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDomainResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDomainResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
13,427 | private String processTargetTypeCreation(final CreateUpdateTargetTypeDetailsRequest targetTypeRequest, final String userId) throws PacManException {<NEW_LINE>String targetName = targetTypeRequest.getName().toLowerCase().trim().replaceAll(" ", "-");<NEW_LINE>targetTypeRequest.setName(targetName);<NEW_LINE>boolean isTargetTypeExits = targetTypesRepository.existsById(targetName);<NEW_LINE>if (!isTargetTypeExits) {<NEW_LINE>Date currentDate = new Date();<NEW_LINE>TargetTypes newTargetType = new TargetTypes();<NEW_LINE>newTargetType.setTargetName(targetName);<NEW_LINE>newTargetType.<MASK><NEW_LINE>newTargetType.setCategory(targetTypeRequest.getCategory());<NEW_LINE>newTargetType.setDataSourceName(targetTypeRequest.getDataSource());<NEW_LINE>newTargetType.setTargetConfig(targetTypeRequest.getConfig());<NEW_LINE>newTargetType.setStatus("");<NEW_LINE>newTargetType.setUserId(userId);<NEW_LINE>String endpoint = config.getElasticSearch().getDevIngestHost() + ":" + config.getElasticSearch().getDevIngestPort() + "/" + targetTypeRequest.getDataSource() + "_" + targetName + "/" + targetName;<NEW_LINE>newTargetType.setEndpoint(endpoint);<NEW_LINE>newTargetType.setCreatedDate(currentDate);<NEW_LINE>newTargetType.setModifiedDate(currentDate);<NEW_LINE>newTargetType.setDomain(targetTypeRequest.getDomain());<NEW_LINE>targetTypesRepository.save(newTargetType);<NEW_LINE>return AdminConstants.TARGET_TYPE_CREATION_SUCCESS;<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>invokeAPI("DELETE", "aws_" + targetName, null);<NEW_LINE>} catch (Exception exception) {<NEW_LINE>log.error(UNEXPECTED_ERROR_OCCURRED, exception);<NEW_LINE>}<NEW_LINE>throw new PacManException(AdminConstants.TARGET_TYPE_NAME_EXITS);<NEW_LINE>}<NEW_LINE>} | setTargetDesc(targetTypeRequest.getDesc()); |
146,481 | private Observable<Observable<MantisServerSentEvent>> sinksToObservable(final Observable<SinkClient<MantisServerSentEvent>> sinkClients) {<NEW_LINE>final ConditionalRetry retryObject = new ConditionalRetry(null, "SinkClient_" + builder.name);<NEW_LINE>return sinkClients.switchMap((SinkClient<MantisServerSentEvent> serverSentEventSinkClient) -> {<NEW_LINE>if (serverSentEventSinkClient.hasError())<NEW_LINE>return Observable.just(Observable.just(new MantisServerSentEvent(serverSentEventSinkClient.getError())));<NEW_LINE>return serverSentEventSinkClient.getPartitionedResults(forPartition, totalPartitions);<NEW_LINE>}).doOnError((Throwable throwable) -> {<NEW_LINE>logger.warn(<MASK><NEW_LINE>if (!(throwable instanceof NoSuchJobException))<NEW_LINE>// don't retry if not NoSuchJobException<NEW_LINE>retryObject.setErrorRef(throwable);<NEW_LINE>}).retryWhen(retryObject.getRetryLogic());<NEW_LINE>} | "Error getting sink Observable: " + throwable.getMessage()); |
886,050 | public void execute(String[] args) throws Exception {<NEW_LINE>LinkedList<String> aa = new LinkedList<String>(Arrays.asList(args));<NEW_LINE>final List<MP4Edit> commands = new LinkedList<MP4Edit>();<NEW_LINE>while (aa.size() > 0) {<NEW_LINE>int i;<NEW_LINE>for (i = 0; i < factories.length; i++) {<NEW_LINE>if (aa.get(0).equals(factories[i].getName())) {<NEW_LINE>aa.remove(0);<NEW_LINE>try {<NEW_LINE>commands.add(factories[i].parseArgs(aa));<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("ERROR: " + e.getMessage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (i == factories.length)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (aa.isEmpty()) {<NEW_LINE>System.err.println("ERROR: A movie file should be specified");<NEW_LINE>help();<NEW_LINE>}<NEW_LINE>if (commands.isEmpty()) {<NEW_LINE>System.err.println("ERROR: At least one command should be specified");<NEW_LINE>help();<NEW_LINE>}<NEW_LINE>File input = new File(aa.remove(0));<NEW_LINE>if (!input.exists()) {<NEW_LINE>System.err.println("ERROR: Input file '" + input.getAbsolutePath() + "' doesn't exist");<NEW_LINE>help();<NEW_LINE>}<NEW_LINE>new ReplaceMP4Editor().replace(<MASK><NEW_LINE>} | input, new CompoundMP4Edit(commands)); |
735,750 | private Mono<PagedResponse<JitNetworkAccessPolicyInner>> listByResourceGroupSinglePageAsync(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 (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String apiVersion = "2020-01-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null));<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
304,546 | public Collection<Identifier> findResources(ResourceType type, String namespace, String path, int depth, Predicate<String> predicate) {<NEW_LINE>if (!namespaces.getOrDefault(type, Collections.emptySet()).contains(namespace)) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>List<Identifier> ids = new ArrayList<>();<NEW_LINE>for (Path basePath : basePaths) {<NEW_LINE>String separator = basePath.getFileSystem().getSeparator();<NEW_LINE>Path nsPath = basePath.resolve(type.getDirectory()).resolve(namespace);<NEW_LINE>Path searchPath = nsPath.resolve(path.replace("/"<MASK><NEW_LINE>if (!Files.exists(searchPath))<NEW_LINE>continue;<NEW_LINE>try {<NEW_LINE>Files.walkFileTree(searchPath, new SimpleFileVisitor<Path>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {<NEW_LINE>String fileName = file.getFileName().toString();<NEW_LINE>if (!fileName.endsWith(".mcmeta") && predicate.test(fileName)) {<NEW_LINE>try {<NEW_LINE>ids.add(new Identifier(namespace, nsPath.relativize(file).toString().replace(separator, "/")));<NEW_LINE>} catch (InvalidIdentifierException e) {<NEW_LINE>LOGGER.error(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.warn("findResources at " + path + " in namespace " + namespace + ", mod " + modInfo.getId() + " failed!", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ids;<NEW_LINE>} | , separator)).normalize(); |
66,203 | private void addProgressListener(ProgressMode mode, int direction, ProgressListener listener) {<NEW_LINE>checkProgressListenerArguments(mode, listener);<NEW_LINE>boolean isStreaming = (mode == ProgressMode.INDEFINITELY);<NEW_LINE>long listenerId = progressListenerId.incrementAndGet();<NEW_LINE>// A listener might be triggered immediately as part of `nativeAddProgressListener`, so<NEW_LINE>// we need to make sure it can be found by SyncManager.notifyProgressListener()<NEW_LINE>listenerIdToProgressListenerMap.put(listenerId, new Pair<ProgressListener, Progress>(listener, null));<NEW_LINE>long listenerToken = nativeAddProgressListener(appNativePointer, configuration.getPath(<MASK><NEW_LINE>if (listenerToken == 0) {<NEW_LINE>// ObjectStore did not register the listener. This can happen if a<NEW_LINE>// listener is registered with ProgressMode.CURRENT_CHANGES and no changes actually<NEW_LINE>// exists. In that case the listener was triggered immediately and we just need<NEW_LINE>// to clean it up, since it will never be called again.<NEW_LINE>listenerIdToProgressListenerMap.remove(listenerId);<NEW_LINE>} else {<NEW_LINE>// Listener was properly registered.<NEW_LINE>progressListenerToOsTokenMap.put(listener, listenerToken);<NEW_LINE>}<NEW_LINE>} | ), listenerId, direction, isStreaming); |
160,949 | public Request<ListMetricsRequest> marshall(ListMetricsRequest listMetricsRequest) {<NEW_LINE>if (listMetricsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListMetricsRequest)");<NEW_LINE>}<NEW_LINE>Request<ListMetricsRequest> request = new DefaultRequest<ListMetricsRequest>(listMetricsRequest, "AmazonCloudWatch");<NEW_LINE>request.addParameter("Action", "ListMetrics");<NEW_LINE>request.addParameter("Version", "2010-08-01");<NEW_LINE>String prefix;<NEW_LINE>if (listMetricsRequest.getNamespace() != null) {<NEW_LINE>prefix = "Namespace";<NEW_LINE>String namespace = listMetricsRequest.getNamespace();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(namespace));<NEW_LINE>}<NEW_LINE>if (listMetricsRequest.getMetricName() != null) {<NEW_LINE>prefix = "MetricName";<NEW_LINE>String metricName = listMetricsRequest.getMetricName();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(metricName));<NEW_LINE>}<NEW_LINE>if (listMetricsRequest.getDimensions() != null) {<NEW_LINE>prefix = "Dimensions";<NEW_LINE>java.util.List<DimensionFilter<MASK><NEW_LINE>int dimensionsIndex = 1;<NEW_LINE>String dimensionsPrefix = prefix;<NEW_LINE>for (DimensionFilter dimensionsItem : dimensions) {<NEW_LINE>prefix = dimensionsPrefix + ".member." + dimensionsIndex;<NEW_LINE>if (dimensionsItem != null) {<NEW_LINE>DimensionFilterStaxMarshaller.getInstance().marshall(dimensionsItem, request, prefix + ".");<NEW_LINE>}<NEW_LINE>dimensionsIndex++;<NEW_LINE>}<NEW_LINE>prefix = dimensionsPrefix;<NEW_LINE>}<NEW_LINE>if (listMetricsRequest.getNextToken() != null) {<NEW_LINE>prefix = "NextToken";<NEW_LINE>String nextToken = listMetricsRequest.getNextToken();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(nextToken));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | > dimensions = listMetricsRequest.getDimensions(); |
1,150,297 | public void onInstanceConfigChange(List<InstanceConfig> instanceConfigs, NotificationContext context) {<NEW_LINE>logger.info("Instance config change notification received with instanceConfigs: {}", instanceConfigs);<NEW_LINE>Set<CloudDataNode> newVcrNodes = new HashSet<>();<NEW_LINE>ConcurrentHashMap<String, CloudDataNode> <MASK><NEW_LINE>// create a new list of available vcr nodes.<NEW_LINE>for (InstanceConfig instanceConfig : instanceConfigs) {<NEW_LINE>if (instanceConfig.getRecord().getBooleanField(VCR_HELIX_CONFIG_READY, false)) {<NEW_LINE>// only when VCR_HELIX_CONFIG_READY, we take action on it.<NEW_LINE>String instanceName = instanceConfig.getInstanceName();<NEW_LINE>Port sslPort = getSslPortStr(instanceConfig) == null ? null : new Port(getSslPortStr(instanceConfig), PortType.SSL);<NEW_LINE>Port http2Port = getHttp2PortStr(instanceConfig) == null ? null : new Port(getHttp2PortStr(instanceConfig), PortType.HTTP2);<NEW_LINE>CloudDataNode cloudDataNode = new CloudDataNode(instanceConfig.getHostName(), new Port(Integer.parseInt(instanceConfig.getPort()), PortType.PLAINTEXT), sslPort, http2Port, clusterMapConfig.clustermapVcrDatacenterName, clusterMapConfig);<NEW_LINE>newInstanceNameToCloudDataNode.put(instanceName, cloudDataNode);<NEW_LINE>newVcrNodes.add(cloudDataNode);<NEW_LINE>logger.info("Instance config change. VCR Node {} added. SslPort: {}, Http2Port: {}", cloudDataNode, sslPort, http2Port);<NEW_LINE>} else {<NEW_LINE>logger.info("Instance config change received, but VCR_HELIX_CONFIG_READY is false. Instance: {}:{}", instanceConfig.getHostName(), instanceConfig.getPort());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>synchronized (notificationLock) {<NEW_LINE>instanceNameToCloudDataNode.set(newInstanceNameToCloudDataNode);<NEW_LINE>handleChangeInVcrNodes(newVcrNodes);<NEW_LINE>}<NEW_LINE>} | newInstanceNameToCloudDataNode = new ConcurrentHashMap<>(); |
394,111 | final TestFunctionResult executeTestFunction(TestFunctionRequest testFunctionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(testFunctionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TestFunctionRequest> request = null;<NEW_LINE>Response<TestFunctionResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new TestFunctionRequestMarshaller().marshall(super.beforeMarshalling(testFunctionRequest));<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, "CloudFront");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TestFunction");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<TestFunctionResult> responseHandler = new StaxResponseHandler<TestFunctionResult>(new TestFunctionResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,339,528 | protected void addHighlights(@Nonnull Map<TextRange, TextAttributes> ranges, @Nonnull Editor editor, @Nonnull Collection<RangeHighlighter> highlighters, @Nonnull HighlightManager highlightManager) {<NEW_LINE>final TextAttributes attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(EditorColors.SEARCH_RESULT_ATTRIBUTES);<NEW_LINE>final V variable = getVariable();<NEW_LINE>if (variable != null) {<NEW_LINE>final String name = variable.getName();<NEW_LINE>LOG.assertTrue(name != null, variable);<NEW_LINE>final int variableNameLength = name.length();<NEW_LINE>if (isReplaceAllOccurrences()) {<NEW_LINE>for (RangeMarker marker : getOccurrenceMarkers()) {<NEW_LINE>final int startOffset = marker.getStartOffset();<NEW_LINE>highlightManager.addOccurrenceHighlight(editor, startOffset, startOffset + variableNameLength, attributes, 0, highlighters, null);<NEW_LINE>}<NEW_LINE>} else if (getExpr() != null) {<NEW_LINE>final int startOffset <MASK><NEW_LINE>highlightManager.addOccurrenceHighlight(editor, startOffset, startOffset + variableNameLength, attributes, 0, highlighters, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (RangeHighlighter highlighter : highlighters) {<NEW_LINE>highlighter.setGreedyToLeft(true);<NEW_LINE>highlighter.setGreedyToRight(true);<NEW_LINE>}<NEW_LINE>} | = getExprMarker().getStartOffset(); |
435,180 | public static Map<String, List<SSLCertificateVH>> fetchACMCertficateInfo(BasicSessionCredentials temporaryCredentials, String skipRegions, String account, String accountName) {<NEW_LINE>log.info("ACM cert method Entry");<NEW_LINE>Map<String, List<SSLCertificateVH>> sslVH = new LinkedHashMap<>();<NEW_LINE>List<CertificateSummary> listCertificateSummary = new ArrayList<>();<NEW_LINE>List<SSLCertificateVH> sslCertList = new ArrayList<>();<NEW_LINE>DescribeCertificateResult describeCertificateResult = new DescribeCertificateResult();<NEW_LINE>Date expiryDate = null;<NEW_LINE>String certificateARN = null;<NEW_LINE>String domainName = null;<NEW_LINE>List<String> issuerDetails = null;<NEW_LINE>String expPrefix = InventoryConstants.ERROR_PREFIX_CODE + account + "\",\"Message\": \"Exception in fetching info for resource in specific region\" ,\"type\": \"ACM Certificate \" , \"region\":\"";<NEW_LINE>for (Region region : RegionUtils.getRegions()) {<NEW_LINE>try {<NEW_LINE>if (!skipRegions.contains(region.getName())) {<NEW_LINE>AWSCertificateManager awsCertifcateManagerClient = AWSCertificateManagerClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(temporaryCredentials)).withRegion(region.getName()).build();<NEW_LINE>listCertificateSummary = awsCertifcateManagerClient.listCertificates(new ListCertificatesRequest()).getCertificateSummaryList();<NEW_LINE>if (!CollectionUtils.isEmpty(listCertificateSummary)) {<NEW_LINE>for (CertificateSummary certSummary : listCertificateSummary) {<NEW_LINE>String certArn = certSummary.getCertificateArn();<NEW_LINE>DescribeCertificateRequest describeCertificateRequest = new DescribeCertificateRequest().withCertificateArn(certArn);<NEW_LINE><MASK><NEW_LINE>CertificateDetail certificateDetail = describeCertificateResult.getCertificate();<NEW_LINE>domainName = certificateDetail.getDomainName();<NEW_LINE>certificateARN = certificateDetail.getCertificateArn();<NEW_LINE>expiryDate = certificateDetail.getNotAfter();<NEW_LINE>SSLCertificateVH sslCertificate = new SSLCertificateVH();<NEW_LINE>sslCertificate.setDomainName(domainName);<NEW_LINE>sslCertificate.setCertificateARN(certificateARN);<NEW_LINE>sslCertificate.setExpiryDate(expiryDate);<NEW_LINE>sslCertificate.setIssuerDetails(issuerDetails);<NEW_LINE>sslCertList.add(sslCertificate);<NEW_LINE>}<NEW_LINE>sslVH.put(account + delimiter + accountName + delimiter + region.getName(), sslCertList);<NEW_LINE>} else {<NEW_LINE>log.info("List is empty");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn(expPrefix + region.getName() + InventoryConstants.ERROR_CAUSE + e.getMessage() + "\"}");<NEW_LINE>ErrorManageUtil.uploadError(account, region.getName(), "acmcertificate", e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sslVH;<NEW_LINE>} | describeCertificateResult = awsCertifcateManagerClient.describeCertificate(describeCertificateRequest); |
402,170 | public void gbmv(char order, char TransA, int KL, int KU, double alpha, INDArray A, INDArray X, double beta, INDArray Y) {<NEW_LINE>if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL)<NEW_LINE>OpProfiler.getInstance().processBlasCall(<MASK><NEW_LINE>if (A.data().dataType() == DataType.DOUBLE) {<NEW_LINE>DefaultOpExecutioner.validateDataType(DataType.DOUBLE, A, X, Y);<NEW_LINE>if (A.rows() > Integer.MAX_VALUE || A.columns() > Integer.MAX_VALUE || A.size(0) > Integer.MAX_VALUE)<NEW_LINE>throw new ND4JArraySizeException();<NEW_LINE>dgbmv(order, TransA, (int) A.rows(), (int) A.columns(), KL, KU, alpha, A, (int) A.size(0), X, X.stride(-1), beta, Y, Y.stride(-1));<NEW_LINE>} else {<NEW_LINE>DefaultOpExecutioner.validateDataType(DataType.FLOAT, A, X, Y);<NEW_LINE>sgbmv(order, TransA, (int) A.rows(), (int) A.columns(), KL, KU, (float) alpha, A, (int) A.size(0), X, X.stride(-1), (float) beta, Y, Y.stride(-1));<NEW_LINE>}<NEW_LINE>OpExecutionerUtil.checkForAny(Y);<NEW_LINE>} | false, A, X, Y); |
345,467 | private static Map<TaggedWord, List<String>> loadMapping(InputStream inputStream, Set<String> outTags) throws IOException {<NEW_LINE>Map<String, String> internedStrings = new HashMap<>();<NEW_LINE>Map<TaggedWord, List<String>> mapping = new HashMap<>();<NEW_LINE>Map<String, String> interned = new HashMap<>();<NEW_LINE>try (Scanner scanner = new Scanner(inputStream, "utf8")) {<NEW_LINE>String separator = DEFAULT_SEPARATOR;<NEW_LINE>while (scanner.hasNextLine()) {<NEW_LINE>String line = scanner.nextLine();<NEW_LINE>line = line.trim();<NEW_LINE>if (line.startsWith("#separatorRegExp=")) {<NEW_LINE>separator = line.replace("#separatorRegExp=", "");<NEW_LINE>}<NEW_LINE>if (StringTools.isEmpty(line) || line.charAt(0) == '#') {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>line = StringUtils.substringBefore(line, "#").trim();<NEW_LINE>String[] <MASK><NEW_LINE>if (parts.length != 3) {<NEW_LINE>throw new IOException("Unknown line format when loading manual synthesizer dictionary, " + "expected 3 parts separated by '" + separator + "', found " + parts.length + ": '" + line + "'");<NEW_LINE>}<NEW_LINE>String form = parts[0];<NEW_LINE>String lemma = parts[1];<NEW_LINE>if (form.equals(lemma)) {<NEW_LINE>form = lemma;<NEW_LINE>}<NEW_LINE>lemma = interned.computeIfAbsent(lemma, Function.identity());<NEW_LINE>String posTag = internedStrings.computeIfAbsent(parts[2], Function.identity());<NEW_LINE>mapping.computeIfAbsent(new TaggedWord(lemma, posTag), __ -> new ArrayList<>()).add(form);<NEW_LINE>outTags.add(posTag);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return mapping;<NEW_LINE>} | parts = line.split(separator); |
555,653 | public static ListApplicationsResponse unmarshall(ListApplicationsResponse listApplicationsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listApplicationsResponse.setRequestId(_ctx.stringValue("ListApplicationsResponse.RequestId"));<NEW_LINE>listApplicationsResponse.setMessage(_ctx.stringValue("ListApplicationsResponse.Message"));<NEW_LINE>listApplicationsResponse.setErrorCode(_ctx.stringValue("ListApplicationsResponse.ErrorCode"));<NEW_LINE>listApplicationsResponse.setCode(_ctx.stringValue("ListApplicationsResponse.Code"));<NEW_LINE>listApplicationsResponse.setSuccess(_ctx.booleanValue("ListApplicationsResponse.Success"));<NEW_LINE>listApplicationsResponse.setCurrentPage(_ctx.integerValue("ListApplicationsResponse.CurrentPage"));<NEW_LINE>listApplicationsResponse.setTotalSize<MASK><NEW_LINE>listApplicationsResponse.setPageSize(_ctx.integerValue("ListApplicationsResponse.PageSize"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setCurrentPage(_ctx.integerValue("ListApplicationsResponse.Data.CurrentPage"));<NEW_LINE>data.setTotalSize(_ctx.integerValue("ListApplicationsResponse.Data.TotalSize"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListApplicationsResponse.Data.PageSize"));<NEW_LINE>List<Application> applications = new ArrayList<Application>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListApplicationsResponse.Data.Applications.Length"); i++) {<NEW_LINE>Application application = new Application();<NEW_LINE>application.setAppName(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].AppName"));<NEW_LINE>application.setNamespaceId(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].NamespaceId"));<NEW_LINE>application.setAppDeletingStatus(_ctx.booleanValue("ListApplicationsResponse.Data.Applications[" + i + "].AppDeletingStatus"));<NEW_LINE>application.setAppId(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].AppId"));<NEW_LINE>application.setScaleRuleEnabled(_ctx.booleanValue("ListApplicationsResponse.Data.Applications[" + i + "].ScaleRuleEnabled"));<NEW_LINE>application.setScaleRuleType(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].ScaleRuleType"));<NEW_LINE>application.setRunningInstances(_ctx.integerValue("ListApplicationsResponse.Data.Applications[" + i + "].RunningInstances"));<NEW_LINE>application.setInstances(_ctx.integerValue("ListApplicationsResponse.Data.Applications[" + i + "].Instances"));<NEW_LINE>application.setRegionId(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].RegionId"));<NEW_LINE>application.setAppDescription(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].AppDescription"));<NEW_LINE>List<TagsItem> tags = new ArrayList<TagsItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListApplicationsResponse.Data.Applications[" + i + "].Tags.Length"); j++) {<NEW_LINE>TagsItem tagsItem = new TagsItem();<NEW_LINE>tagsItem.setKey(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].Tags[" + j + "].Key"));<NEW_LINE>tagsItem.setValue(_ctx.stringValue("ListApplicationsResponse.Data.Applications[" + i + "].Tags[" + j + "].Value"));<NEW_LINE>tags.add(tagsItem);<NEW_LINE>}<NEW_LINE>application.setTags(tags);<NEW_LINE>applications.add(application);<NEW_LINE>}<NEW_LINE>data.setApplications(applications);<NEW_LINE>listApplicationsResponse.setData(data);<NEW_LINE>return listApplicationsResponse;<NEW_LINE>} | (_ctx.integerValue("ListApplicationsResponse.TotalSize")); |
195,348 | public boolean reactivateTask(SingularityTaskId taskId, ExtendedTaskState taskState, SingularityTaskStatusHolder newUpdate, Optional<String> statusMessage, Optional<String> statusReason) {<NEW_LINE>if (!leaderCache.active()) {<NEW_LINE>LOG.error("reactivateTask can only be called on the leading Singularity instance");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<SingularityTaskHistoryUpdate> updates = getTaskHistoryUpdates(taskId);<NEW_LINE>if (updates.size() < 2) {<NEW_LINE><MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>SingularityTaskHistoryUpdate last = updates.get(updates.size() - 1);<NEW_LINE>updates.remove(last);<NEW_LINE>LOG.info("Removing obsolete status update {}", last);<NEW_LINE>// remove the terminal task status update to return to previous state<NEW_LINE>deleteTaskHistoryUpdate(taskId, last.getTaskState(), Optional.empty());<NEW_LINE>// Fill back into the leader cache and active task state<NEW_LINE>saveTaskHistoryUpdate(new SingularityTaskHistoryUpdate(taskId, newUpdate.getServerTimestamp(), taskState, statusMessage, statusReason), true);<NEW_LINE>saveLastActiveTaskStatus(newUpdate);<NEW_LINE>LOG.info("New status for recovered task is {}", newUpdate);<NEW_LINE>// Mark as active again<NEW_LINE>leaderCache.putActiveTask(taskId);<NEW_LINE>return true;<NEW_LINE>} | LOG.error("No valid previous task state to return to for task {}", taskId); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.