idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,547,728 | final void executeDeprecateActivityType(DeprecateActivityTypeRequest deprecateActivityTypeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deprecateActivityTypeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeprecateActivityTypeRequest> request = null;<NEW_LINE>Response<Void> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeprecateActivityTypeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deprecateActivityTypeRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeprecateActivityType");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<Void>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), null);<NEW_LINE>invoke(request, responseHandler, executionContext);<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "SWF"); |
1,798,397 | protected static List<Method> collectValidatorMethods(Class annotationClass, Class... argTypes) {<NEW_LINE>if (argTypes == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>List<Method> methods = new ArrayList<>();<NEW_LINE>Set<Method> ms = Platform.getReflections().getMethodsAnnotatedWith(annotationClass);<NEW_LINE>for (Method m : ms) {<NEW_LINE>if (!Modifier.isStatic(m.getModifiers())) {<NEW_LINE>throw new CloudRuntimeException(String.format("@%s %s.%s must be defined as static method", annotationClass, m.getDeclaringClass(), m.getName()));<NEW_LINE>}<NEW_LINE>if (m.getParameterCount() != argTypes.length) {<NEW_LINE>throw new CloudRuntimeException(String.format("wrong argument list of the @%s %s.%s, %s arguments required" + " but the method has %s arguments", annotationClass, m.getDeclaringClass(), m.getName(), argTypes.length, m.getParameterCount()));<NEW_LINE>}<NEW_LINE>for (int i = 0; i < argTypes.length; i++) {<NEW_LINE>Class expectedType = argTypes[i];<NEW_LINE>Class actualType = m.getParameterTypes()[i];<NEW_LINE>if (expectedType != actualType) {<NEW_LINE>throw new CloudRuntimeException(String.format("wrong argument list of the @%s %s.%s. The argument[%s] is expected of type %s" + " but got type %s", annotationClass, m.getDeclaringClass(), m.getName(), i, expectedType, actualType));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>m.setAccessible(true);<NEW_LINE>methods.add(m);<NEW_LINE>}<NEW_LINE>return methods;<NEW_LINE>} | argTypes = new Class[] {}; |
711,515 | private void showInputDialog(ActionEvent event) {<NEW_LINE>EscapeDialog messageDialog = new // $NON-NLS-1$<NEW_LINE>EscapeDialog(// $NON-NLS-1$<NEW_LINE>getParentFrame(event), JMeterUtils.getResString("curl_import"), false);<NEW_LINE>Container contentPane = messageDialog.getContentPane();<NEW_LINE>contentPane.setLayout(new BorderLayout());<NEW_LINE>statusText = new JLabel("", JLabel.CENTER);<NEW_LINE>statusText.setForeground(UIManager.getColor(JMeterUIDefaults.LABEL_ERROR_FOREGROUND));<NEW_LINE>contentPane.add(statusText, BorderLayout.NORTH);<NEW_LINE>cURLCommandTA = JSyntaxTextArea.getInstance(20, 80, false);<NEW_LINE>cURLCommandTA.setCaretPosition(0);<NEW_LINE>contentPane.add(JTextScrollPane.getInstance(cURLCommandTA), BorderLayout.CENTER);<NEW_LINE>JPanel optionPanel = new JPanel(new BorderLayout(3, 1));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>filePanel = new FilePanel(JMeterUtils.getResString("curl_import_from_file"));<NEW_LINE>optionPanel.<MASK><NEW_LINE>uploadCookiesCheckBox = new JCheckBox(JMeterUtils.getResString("curl_add_cookie_header_to_cookiemanager"), false);<NEW_LINE>optionPanel.add(uploadCookiesCheckBox, BorderLayout.NORTH);<NEW_LINE>JButton button = new JButton(JMeterUtils.getResString("curl_create_request"));<NEW_LINE>button.setActionCommand(CREATE_REQUEST);<NEW_LINE>button.addActionListener(this);<NEW_LINE>button.setPreferredSize(new Dimension(50, 50));<NEW_LINE>optionPanel.add(button, BorderLayout.SOUTH);<NEW_LINE>contentPane.add(optionPanel, BorderLayout.SOUTH);<NEW_LINE>messageDialog.pack();<NEW_LINE>ComponentUtil.centerComponentInComponent(GuiPackage.getInstance().getMainFrame(), messageDialog);<NEW_LINE>SwingUtilities.invokeLater(() -> messageDialog.setVisible(true));<NEW_LINE>} | add(filePanel, BorderLayout.CENTER); |
340,978 | public StopSentimentDetectionJobResult stopSentimentDetectionJob(StopSentimentDetectionJobRequest stopSentimentDetectionJobRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopSentimentDetectionJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopSentimentDetectionJobRequest> request = null;<NEW_LINE>Response<StopSentimentDetectionJobResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new StopSentimentDetectionJobRequestMarshaller().marshall(stopSentimentDetectionJobRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<StopSentimentDetectionJobResult, JsonUnmarshallerContext> unmarshaller = new StopSentimentDetectionJobResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<StopSentimentDetectionJobResult> responseHandler = new JsonResponseHandler<StopSentimentDetectionJobResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,216,574 | final CreateFargateProfileResult executeCreateFargateProfile(CreateFargateProfileRequest createFargateProfileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createFargateProfileRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateFargateProfileRequest> request = null;<NEW_LINE>Response<CreateFargateProfileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateFargateProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createFargateProfileRequest));<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, "EKS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateFargateProfile");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateFargateProfileResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateFargateProfileResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
1,772,240 | public static DataSource<VehicleRentalPlace> create(VehicleRentalDataSourceParameters source) {<NEW_LINE>switch(source.getSourceType()) {<NEW_LINE>// There used to be a lot more updaters and corresponding config variables here, but since<NEW_LINE>// the industry has largely moved towards GBFS, they were removed.<NEW_LINE>// See: https://groups.google.com/g/opentripplanner-users/c/0P8UGBJG-zE/m/xaOZnL3OAgAJ<NEW_LINE>// If you want to add your provider-specific updater, you can move them into a sandbox module<NEW_LINE>// and become the point of contact for the community.<NEW_LINE>case GBFS:<NEW_LINE>return new GbfsVehicleRentalDataSource((GbfsVehicleRentalDataSourceParameters) source);<NEW_LINE>case SMOOVE:<NEW_LINE>return new SmooveBikeRentalDataSource((SmooveBikeRentalDataSourceParameters) source);<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>} | "Unknown vehicle rental source type: " + source.getSourceType()); |
1,323,822 | AggregatedCostAmount createCostDetails(final AcctSchema as) {<NEW_LINE>final I_M_InOutLine receiptLine = getReceiptLine();<NEW_LINE>Check.assumeNotNull(receiptLine, "Parameter receiptLine is not null");<NEW_LINE>final I_C_OrderLine orderLine = getOrderLine();<NEW_LINE>final CurrencyConversionTypeId currencyConversionTypeId = CurrencyConversionTypeId.ofRepoIdOrNull(orderLine.getC_Order().getC_ConversionType_ID());<NEW_LINE>final Timestamp receiptDateAcct = receiptLine<MASK><NEW_LINE>final Quantity qty = isReturnTrx() ? getQty().negate() : getQty();<NEW_LINE>final ProductPrice costPrice = getOrderLineCostPrice();<NEW_LINE>final CostAmount amt = CostAmount.multiply(costPrice, qty);<NEW_LINE>final AcctSchemaId acctSchemaId = as.getId();<NEW_LINE>return services.createCostDetail(CostDetailCreateRequest.builder().acctSchemaId(acctSchemaId).clientId(ClientId.ofRepoId(orderLine.getAD_Client_ID())).orgId(OrgId.ofRepoId(orderLine.getAD_Org_ID())).productId(getProductId()).attributeSetInstanceId(getAttributeSetInstanceId()).documentRef(CostingDocumentRef.ofMatchPOId(getM_MatchPO_ID())).qty(qty).amt(amt).currencyConversionTypeId(currencyConversionTypeId).date(TimeUtil.asLocalDate(receiptDateAcct)).description(orderLine.getDescription()).build());<NEW_LINE>} | .getM_InOut().getDateAcct(); |
98,083 | public final void cook(Parser[] parsers) throws CompileException, IOException {<NEW_LINE>int count = parsers.length;<NEW_LINE>this.setScriptCount(count);<NEW_LINE>final Parser parser = count == 1 ? parsers[0] : null;<NEW_LINE>// Create compilation unit.<NEW_LINE>Java.AbstractCompilationUnit.ImportDeclaration[] <MASK><NEW_LINE>Java.BlockStatement[][] statementss = new Java.BlockStatement[count][];<NEW_LINE>Java.MethodDeclarator[][] localMethodss = new Java.MethodDeclarator[count][];<NEW_LINE>// Create methods with one block each.<NEW_LINE>for (int i = 0; i < count; ++i) {<NEW_LINE>// Create the statements of the method.<NEW_LINE>List<Java.BlockStatement> statements = new ArrayList<>();<NEW_LINE>List<Java.MethodDeclarator> localMethods = new ArrayList<>();<NEW_LINE>this.makeStatements(i, parsers[i], statements, localMethods);<NEW_LINE>statementss[i] = (BlockStatement[]) statements.toArray(new Java.BlockStatement[statements.size()]);<NEW_LINE>// SUPPRESS CHECKSTYLE LineLength<NEW_LINE>localMethodss[i] = (MethodDeclarator[]) localMethods.toArray(new Java.MethodDeclarator[localMethods.size()]);<NEW_LINE>}<NEW_LINE>// fileName<NEW_LINE>this.// fileName<NEW_LINE>cook(parsers.length >= 1 ? parsers[0].getScanner().getFileName() : null, importDeclarations, statementss, localMethodss);<NEW_LINE>} | importDeclarations = this.parseImports(parser); |
1,102,145 | protected void processProgramVars() {<NEW_LINE>if (program.getLanguage().getProcessor() == Processor.findOrPossiblyCreateProcessor("PowerPC")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SymbolTable symbolTable = program.getSymbolTable();<NEW_LINE>int defaultPointerSize = program.getDefaultPointerSize();<NEW_LINE>DataType intDataType = (defaultPointerSize == 8) ? new QWordDataType() : new DWordDataType();<NEW_LINE>// int *<NEW_LINE>DataType intPointerDataType = PointerDataType.getPointer(intDataType, defaultPointerSize);<NEW_LINE>// void *<NEW_LINE>DataType // void *<NEW_LINE>voidPointerDatatype = PointerDataType.getPointer(new VoidDataType(), defaultPointerSize);<NEW_LINE>// char *<NEW_LINE>DataType // char *<NEW_LINE>charPointerX1DataType = PointerDataType.getPointer(new CharDataType(), defaultPointerSize);<NEW_LINE>// char **<NEW_LINE>DataType // char **<NEW_LINE>charPointerX2DataType = PointerDataType.getPointer(charPointerX1DataType, defaultPointerSize);<NEW_LINE>// char ***<NEW_LINE>DataType // char ***<NEW_LINE>charPointerX3DataType = PointerDataType.getPointer(charPointerX2DataType, defaultPointerSize);<NEW_LINE>Structure structure = new StructureDataType(SectionNames.PROGRAM_VARS, 0);<NEW_LINE>structure.add(voidPointerDatatype, "mh", "pointer to __mh_execute_header");<NEW_LINE>structure.add(intPointerDataType, "NXArgcPtr", "pointer to argc");<NEW_LINE>structure.add(charPointerX3DataType, "NXArgvPtr", "pointer to argv");<NEW_LINE>structure.add(charPointerX3DataType, "environPtr", "pointer to environment");<NEW_LINE>structure.add(charPointerX2DataType, "__prognamePtr", "pointer to program name");<NEW_LINE>Namespace namespace = createNamespace(SectionNames.PROGRAM_VARS);<NEW_LINE>List<Section> sections = machoHeader.getAllSections();<NEW_LINE>for (Section section : sections) {<NEW_LINE>if (section.getSectionName().equals(SectionNames.PROGRAM_VARS)) {<NEW_LINE>MemoryBlock memoryBlock = getMemoryBlock(section);<NEW_LINE>try {<NEW_LINE>listing.createData(memoryBlock.getStart(), structure);<NEW_LINE>Data data = listing.getDataAt(memoryBlock.getStart());<NEW_LINE>Data mhData = data.getComponent(0);<NEW_LINE>if (symbolTable.getSymbol("__mh_execute_header", mhData.getAddress(0), namespace) == null) {<NEW_LINE>symbolTable.createLabel(mhData.getAddress(0), "__mh_execute_header", namespace, SourceType.IMPORTED);<NEW_LINE>}<NEW_LINE>Data argcData = data.getComponent(1);<NEW_LINE>symbolTable.createLabel(argcData.getAddress(0), <MASK><NEW_LINE>listing.createData(argcData.getAddress(0), intDataType);<NEW_LINE>Data argvData = data.getComponent(2);<NEW_LINE>symbolTable.createLabel(argvData.getAddress(0), "NXArgv", namespace, SourceType.IMPORTED);<NEW_LINE>listing.createData(argvData.getAddress(0), charPointerX2DataType);<NEW_LINE>Data environData = data.getComponent(3);<NEW_LINE>symbolTable.createLabel(environData.getAddress(0), "environ", namespace, SourceType.IMPORTED);<NEW_LINE>listing.createData(environData.getAddress(0), charPointerX2DataType);<NEW_LINE>Data prognameData = data.getComponent(4);<NEW_LINE>symbolTable.createLabel(prognameData.getAddress(0), "__progname", namespace, SourceType.IMPORTED);<NEW_LINE>listing.createData(prognameData.getAddress(0), charPointerX1DataType);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.appendException(e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "NXArgc", namespace, SourceType.IMPORTED); |
537,133 | public void renderCalendar(boolean updateDate) {<NEW_LINE>super.setStylePrimaryName(parent.getStylePrimaryName() + "-calendarpanel");<NEW_LINE>if (focusedDate == null) {<NEW_LINE>Date now = new Date();<NEW_LINE>// focusedDate must have zero hours, mins, secs, millisecs<NEW_LINE>focusedDate = new FocusedDate(now.getYear(), now.getMonth(), now.getDate());<NEW_LINE>displayedMonth = new FocusedDate(now.getYear(), now.getMonth(), 1);<NEW_LINE>}<NEW_LINE>if (updateDate && getResolution().getCalendarField() <= Resolution.MONTH.getCalendarField() && focusChangeListener != null) {<NEW_LINE>focusChangeListener.focusChanged(new Date(focusedDate.getTime()));<NEW_LINE>}<NEW_LINE>final boolean needsMonth = getResolution().getCalendarField() > Resolution.YEAR.getCalendarField();<NEW_LINE>boolean needsBody = getResolution().getCalendarField() >= Resolution.DAY.getCalendarField();<NEW_LINE>buildCalendarHeader(needsMonth);<NEW_LINE>clearCalendarBody(!needsBody);<NEW_LINE>if (needsBody) {<NEW_LINE>buildCalendarBody();<NEW_LINE>}<NEW_LINE>if (isTimeSelectorNeeded()) {<NEW_LINE>time = new VTime();<NEW_LINE>setWidget(2, 0, time);<NEW_LINE>getFlexCellFormatter().<MASK><NEW_LINE>getFlexCellFormatter().setStyleName(2, 0, parent.getStylePrimaryName() + "-calendarpanel-time");<NEW_LINE>} else if (time != null) {<NEW_LINE>remove(time);<NEW_LINE>}<NEW_LINE>initialRenderDone = true;<NEW_LINE>} | setColSpan(2, 0, 5); |
157,296 | private boolean completeSatisfiedVersionDependentTasks() {<NEW_LINE>int publishedVersion = systemStateBroadcaster.lastClusterStateVersionInSync();<NEW_LINE>long queueSizeBefore = taskCompletionQueue.size();<NEW_LINE>// Note: although version monotonicity of tasks in queue always should hold,<NEW_LINE>// deadline monotonicity is not guaranteed to do so due to reconfigs of task<NEW_LINE>// timeout durations. Means that tasks enqueued with shorter deadline duration<NEW_LINE>// might be observed as having at least the same timeout as tasks enqueued during<NEW_LINE>// a previous configuration. Current clock implementation is also susceptible to<NEW_LINE>// skewing.<NEW_LINE>final <MASK><NEW_LINE>while (!taskCompletionQueue.isEmpty()) {<NEW_LINE>VersionDependentTaskCompletion taskCompletion = taskCompletionQueue.peek();<NEW_LINE>// TODO expose and use monotonic clock instead of system clock<NEW_LINE>if (publishedVersion >= taskCompletion.getMinimumVersion()) {<NEW_LINE>context.log(logger, Level.FINE, () -> String.format("Deferred task of type '%s' has minimum version %d, published is %d; completing", taskCompletion.getTask().getClass().getName(), taskCompletion.getMinimumVersion(), publishedVersion));<NEW_LINE>taskCompletion.getTask().notifyCompleted();<NEW_LINE>taskCompletionQueue.remove();<NEW_LINE>} else if (taskCompletion.getDeadlineTimePointMs() <= now) {<NEW_LINE>var details = buildNodesNotYetConvergedMessage(taskCompletion.getMinimumVersion());<NEW_LINE>context.log(logger, Level.WARNING, () -> String.format("Deferred task of type '%s' has exceeded wait deadline; completing with failure (details: %s)", taskCompletion.getTask().getClass().getName(), details));<NEW_LINE>taskCompletion.getTask().handleFailure(RemoteClusterControllerTask.Failure.of(RemoteClusterControllerTask.FailureCondition.DEADLINE_EXCEEDED, details));<NEW_LINE>taskCompletion.getTask().notifyCompleted();<NEW_LINE>taskCompletionQueue.remove();<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (taskCompletionQueue.size() != queueSizeBefore);<NEW_LINE>} | long now = timer.getCurrentTimeInMillis(); |
1,674,878 | public void replaceAllChildren(List<C> values, SelectionModel<? super C> selectionModel, boolean stealFocus) {<NEW_LINE>// Render the children.<NEW_LINE>SafeHtmlBuilder sb = new SafeHtmlBuilder();<NEW_LINE>render(sb, values, 0, selectionModel);<NEW_LINE>// Hide the child container so we can animate it.<NEW_LINE>if (nodeView.tree.isAnimationEnabled()) {<NEW_LINE>nodeView.ensureAnimationFrame().getStyle(<MASK><NEW_LINE>}<NEW_LINE>// Replace the child nodes.<NEW_LINE>nodeView.tree.isRefreshing = true;<NEW_LINE>Map<Object, CellTreeNodeView<?>> savedViews = saveChildState(values, 0);<NEW_LINE>AbstractHasData.replaceAllChildren(nodeView.tree, childContainer, sb.toSafeHtml());<NEW_LINE>nodeView.tree.isRefreshing = false;<NEW_LINE>// Trim the list of children.<NEW_LINE>int size = values.size();<NEW_LINE>int childCount = nodeView.children.size();<NEW_LINE>while (childCount > size) {<NEW_LINE>childCount--;<NEW_LINE>CellTreeNodeView<?> deleted = nodeView.children.remove(childCount);<NEW_LINE>deleted.cleanup(true);<NEW_LINE>}<NEW_LINE>// Reattach the open nodes.<NEW_LINE>loadChildState(values, 0, savedViews);<NEW_LINE>// If this is the root node, move keyboard focus to the first child.<NEW_LINE>if (nodeView.isRootNode() && nodeView.tree.getKeyboardSelectedNode() == nodeView && values.size() > 0) {<NEW_LINE>nodeView.tree.keyboardSelect(nodeView.children.get(0), false);<NEW_LINE>}<NEW_LINE>// Animate the child container open.<NEW_LINE>if (nodeView.tree.isAnimationEnabled()) {<NEW_LINE>nodeView.tree.maybeAnimateTreeNode(nodeView);<NEW_LINE>}<NEW_LINE>} | ).setDisplay(Display.NONE); |
88,439 | private boolean readSamples() throws IOException {<NEW_LINE>if (readSamples) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>readSamples = true;<NEW_LINE>byte[] header = new byte[15];<NEW_LINE>boolean ret = false;<NEW_LINE>inputStream.mark(15);<NEW_LINE>while (-1 != inputStream.read(header)) {<NEW_LINE>ret = true;<NEW_LINE>ByteBuffer bb = ByteBuffer.wrap(header);<NEW_LINE>inputStream.reset();<NEW_LINE>BitReaderBuffer brb = new BitReaderBuffer(bb);<NEW_LINE>int syncword = brb.readBits(12);<NEW_LINE>if (syncword != 0xfff) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>brb.readBits(3);<NEW_LINE>int protectionAbsent = brb.readBits(1);<NEW_LINE>brb.readBits(14);<NEW_LINE>int frameSize = brb.readBits(13);<NEW_LINE>int bufferFullness = brb.readBits(11);<NEW_LINE>int noBlocks = brb.readBits(2);<NEW_LINE>int used = (int) Math.ceil(<MASK><NEW_LINE>if (protectionAbsent == 0) {<NEW_LINE>used += 2;<NEW_LINE>}<NEW_LINE>inputStream.skip(used);<NEW_LINE>frameSize -= used;<NEW_LINE>// System.out.println("Size: " + frameSize + " fullness: " + bufferFullness + " no blocks: " + noBlocks);<NEW_LINE>byte[] data = new byte[frameSize];<NEW_LINE>inputStream.read(data);<NEW_LINE>samples.add(ByteBuffer.wrap(data));<NEW_LINE>stts.add(new TimeToSampleBox.Entry(1, 1024));<NEW_LINE>inputStream.mark(15);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | brb.getPosition() / 8.0); |
1,826,292 | private static final byte[] doExpansion(Mac hmac, byte[] label, byte[] seed, int length) {<NEW_LINE>int offset = 0;<NEW_LINE>final int macLength = hmac.getMacLength();<NEW_LINE>final byte[] aAndSeed = new byte[macLength + label.length + seed.length];<NEW_LINE>final byte[] expansion = new byte[length];<NEW_LINE>try {<NEW_LINE>// copy appended seed to buffer end<NEW_LINE>System.arraycopy(label, 0, aAndSeed, macLength, label.length);<NEW_LINE>System.arraycopy(seed, 0, aAndSeed, macLength + label.length, seed.length);<NEW_LINE>// calculate A(n) from A(0)<NEW_LINE>hmac.update(label);<NEW_LINE>hmac.update(seed);<NEW_LINE>while (true) {<NEW_LINE>// write result to "A(n) + seed"<NEW_LINE>hmac.doFinal(aAndSeed, 0);<NEW_LINE>// calculate HMAC_hash from "A(n) + seed"<NEW_LINE>hmac.update(aAndSeed);<NEW_LINE>final int nextOffset = offset + macLength;<NEW_LINE>if (nextOffset > length) {<NEW_LINE>// too large for expansion!<NEW_LINE>// write HMAC_hash result temporary to "A(n) + seed"<NEW_LINE>hmac.doFinal(aAndSeed, 0);<NEW_LINE>// write head of result from temporary "A(n) + seed" to<NEW_LINE>// expansion<NEW_LINE>System.arraycopy(aAndSeed, 0, <MASK><NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>// write HMAC_hash result to expansion<NEW_LINE>hmac.doFinal(expansion, offset);<NEW_LINE>if (nextOffset == length) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>offset = nextOffset;<NEW_LINE>// calculate A(n+1) from "A(n) + seed" head ("A(n)")<NEW_LINE>hmac.update(aAndSeed, 0, macLength);<NEW_LINE>}<NEW_LINE>} catch (ShortBufferException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>Bytes.clear(aAndSeed);<NEW_LINE>return expansion;<NEW_LINE>} | expansion, offset, length - offset); |
141,044 | public static DescribeParametersResponse unmarshall(DescribeParametersResponse describeParametersResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeParametersResponse.setRequestId(_ctx.stringValue("DescribeParametersResponse.RequestId"));<NEW_LINE>describeParametersResponse.setEngine(_ctx.stringValue("DescribeParametersResponse.Engine"));<NEW_LINE>describeParametersResponse.setEngineVersion(_ctx.stringValue("DescribeParametersResponse.EngineVersion"));<NEW_LINE>List<DBInstanceParameter> configParameters = new ArrayList<DBInstanceParameter>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeParametersResponse.ConfigParameters.Length"); i++) {<NEW_LINE>DBInstanceParameter dBInstanceParameter = new DBInstanceParameter();<NEW_LINE>dBInstanceParameter.setParameterName(_ctx.stringValue("DescribeParametersResponse.ConfigParameters[" + i + "].ParameterName"));<NEW_LINE>dBInstanceParameter.setParameterValue(_ctx.stringValue("DescribeParametersResponse.ConfigParameters[" + i + "].ParameterValue"));<NEW_LINE>dBInstanceParameter.setParameterDescription(_ctx.stringValue("DescribeParametersResponse.ConfigParameters[" + i + "].ParameterDescription"));<NEW_LINE>configParameters.add(dBInstanceParameter);<NEW_LINE>}<NEW_LINE>describeParametersResponse.setConfigParameters(configParameters);<NEW_LINE>List<DBInstanceParameter> runningParameters <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeParametersResponse.RunningParameters.Length"); i++) {<NEW_LINE>DBInstanceParameter dBInstanceParameter_ = new DBInstanceParameter();<NEW_LINE>dBInstanceParameter_.setParameterName(_ctx.stringValue("DescribeParametersResponse.RunningParameters[" + i + "].ParameterName"));<NEW_LINE>dBInstanceParameter_.setParameterValue(_ctx.stringValue("DescribeParametersResponse.RunningParameters[" + i + "].ParameterValue"));<NEW_LINE>dBInstanceParameter_.setParameterDescription(_ctx.stringValue("DescribeParametersResponse.RunningParameters[" + i + "].ParameterDescription"));<NEW_LINE>runningParameters.add(dBInstanceParameter_);<NEW_LINE>}<NEW_LINE>describeParametersResponse.setRunningParameters(runningParameters);<NEW_LINE>return describeParametersResponse;<NEW_LINE>} | = new ArrayList<DBInstanceParameter>(); |
388,858 | public JsNode transformProgram(JProgram program) {<NEW_LINE>// Handle the visiting here as we need to slightly change the order.<NEW_LINE>// 1.1 (preamble) Immortal code gentypes.<NEW_LINE>// 1.2 (preamble) Classes in the preamble, i.e. all the classes that are needed<NEW_LINE>// to support creation of class literals (reachable through Class.createFor* ).<NEW_LINE>// 1.3 (preamble) Class literals for classes in the preamble.<NEW_LINE>// 2. (body) Normal classes, each with its corresponding class literal (if live).<NEW_LINE>// 3. (epilogue) Code to start the execution of the program (gwtOnLoad, etc).<NEW_LINE>Set<JDeclaredType> preambleTypes = generatePreamble(program);<NEW_LINE>if (incremental) {<NEW_LINE>// Record the names of preamble types so that it's possible to invalidate caches when the<NEW_LINE>// preamble types are known to have become stale.<NEW_LINE>if (!minimalRebuildCache.hasPreambleTypeNames()) {<NEW_LINE>Set<String> preambleTypeNames = Sets.newHashSet();<NEW_LINE>for (JDeclaredType preambleType : preambleTypes) {<NEW_LINE>preambleTypeNames.add(preambleType.getName());<NEW_LINE>}<NEW_LINE>minimalRebuildCache.setPreambleTypeNames(logger, preambleTypeNames);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Sort normal types according to superclass relationship.<NEW_LINE>Set<JDeclaredType> topologicallySortedBodyTypes = Sets.newLinkedHashSet();<NEW_LINE>for (JDeclaredType type : program.getModuleDeclaredTypes()) {<NEW_LINE>insertInTopologicalOrder(type, topologicallySortedBodyTypes);<NEW_LINE>}<NEW_LINE>// Remove all preamble types that might have been inserted here.<NEW_LINE>topologicallySortedBodyTypes.removeAll(preambleTypes);<NEW_LINE>// Iterate over each type in the right order.<NEW_LINE>markPosition("Program", Type.PROGRAM_START);<NEW_LINE>for (JDeclaredType type : topologicallySortedBodyTypes) {<NEW_LINE>markPosition(type.getName(), Type.CLASS_START);<NEW_LINE>transform(type);<NEW_LINE>maybeGenerateClassLiteral(type);<NEW_LINE>installClassLiterals<MASK><NEW_LINE>markPosition(type.getName(), Type.CLASS_END);<NEW_LINE>}<NEW_LINE>markPosition("Program", Type.PROGRAM_END);<NEW_LINE>generateEpilogue();<NEW_LINE>// All done, do not visit children.<NEW_LINE>return null;<NEW_LINE>} | (Arrays.asList(type)); |
15,664 | public Recording startRecording(String sessionId, RecordingProperties properties) throws OpenViduJavaClientException, OpenViduHttpException {<NEW_LINE>HttpPost request = new HttpPost(this.hostname + API_RECORDINGS_START);<NEW_LINE>JsonObject json = properties.toJson();<NEW_LINE><MASK><NEW_LINE>StringEntity params = new StringEntity(json.toString(), "UTF-8");<NEW_LINE>request.setHeader(HttpHeaders.CONTENT_TYPE, "application/json");<NEW_LINE>request.setEntity(params);<NEW_LINE>HttpResponse response = null;<NEW_LINE>try {<NEW_LINE>response = this.httpClient.execute(request);<NEW_LINE>int statusCode = response.getStatusLine().getStatusCode();<NEW_LINE>if ((statusCode == org.apache.http.HttpStatus.SC_OK)) {<NEW_LINE>Recording r = new Recording(httpResponseToJson(response));<NEW_LINE>Session activeSession = this.activeSessions.get(r.getSessionId());<NEW_LINE>if (activeSession != null) {<NEW_LINE>activeSession.setIsBeingRecorded(true);<NEW_LINE>} else {<NEW_LINE>log.warn("No active session found for sessionId '{}'. This instance of OpenVidu Java Client didn't create this session", r.getSessionId());<NEW_LINE>}<NEW_LINE>return r;<NEW_LINE>} else {<NEW_LINE>throw new OpenViduHttpException(statusCode);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new OpenViduJavaClientException(e.getMessage(), e.getCause());<NEW_LINE>} finally {<NEW_LINE>if (response != null) {<NEW_LINE>EntityUtils.consumeQuietly(response.getEntity());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | json.addProperty("session", sessionId); |
60,604 | public void onResp(BaseResp baseResp) {<NEW_LINE><MASK><NEW_LINE>map.putInt("errCode", baseResp.errCode);<NEW_LINE>map.putString("errStr", baseResp.errStr);<NEW_LINE>map.putString("openId", baseResp.openId);<NEW_LINE>map.putString("transaction", baseResp.transaction);<NEW_LINE>if (baseResp instanceof SendAuth.Resp) {<NEW_LINE>SendAuth.Resp resp = (SendAuth.Resp) (baseResp);<NEW_LINE>map.putString("type", "SendAuth.Resp");<NEW_LINE>map.putString("code", resp.code);<NEW_LINE>map.putString("state", resp.state);<NEW_LINE>map.putString("url", resp.url);<NEW_LINE>map.putString("lang", resp.lang);<NEW_LINE>map.putString("country", resp.country);<NEW_LINE>} else if (baseResp instanceof SendMessageToWX.Resp) {<NEW_LINE>SendMessageToWX.Resp resp = (SendMessageToWX.Resp) (baseResp);<NEW_LINE>map.putString("type", "SendMessageToWX.Resp");<NEW_LINE>} else if (baseResp instanceof PayResp) {<NEW_LINE>PayResp resp = (PayResp) (baseResp);<NEW_LINE>map.putString("type", "PayReq.Resp");<NEW_LINE>map.putString("returnKey", resp.returnKey);<NEW_LINE>}<NEW_LINE>this.getReactApplicationContext().getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("WeChat_Resp", map);<NEW_LINE>} | WritableMap map = Arguments.createMap(); |
1,560,742 | public static void run(JavaPlatform javaPlatform, FileObject js, boolean debug) throws IOException, UnsupportedOperationException {<NEW_LINE>LifecycleManager.getDefault().saveAll();<NEW_LINE>Map<String, Object> properties = new HashMap<>();<NEW_LINE>properties.put(JavaRunner.PROP_PLATFORM, javaPlatform);<NEW_LINE>final ClassPath path = getClassPath(js);<NEW_LINE>final Preferences p = Settings.getPreferences();<NEW_LINE>boolean preferNashorn = NashornPlatform.isNashornSupported(javaPlatform);<NEW_LINE>if (p.get(Settings.PREF_NASHORN, null) != null) {<NEW_LINE>preferNashorn = p.<MASK><NEW_LINE>} else {<NEW_LINE>if (NashornPlatform.isGraalJsSupported(javaPlatform)) {<NEW_LINE>if (NashornPlatform.isGraalJSPreferred(javaPlatform)) {<NEW_LINE>preferNashorn = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (preferNashorn) {<NEW_LINE>try {<NEW_LINE>javaPlatform.getBootstrapLibraries().getClassLoader(true).loadClass(NASHORN_SHELL);<NEW_LINE>properties.put(JavaRunner.PROP_CLASSNAME, NASHORN_SHELL);<NEW_LINE>} catch (ClassNotFoundException ex) {<NEW_LINE>properties.put(JavaRunner.PROP_CLASSNAME, JS_SHELL);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>properties.put(JavaRunner.PROP_CLASSNAME, JS_SHELL);<NEW_LINE>}<NEW_LINE>properties.put(JavaRunner.PROP_EXECUTE_CLASSPATH, path);<NEW_LINE>properties.put(JavaRunner.PROP_WORK_DIR, js.getParent());<NEW_LINE>// Collections.singletonList(js.getNameExt()));<NEW_LINE>properties.put(JavaRunner.PROP_APPLICATION_ARGS, getApplicationArgs(js));<NEW_LINE>if (debug) {<NEW_LINE>JavaRunner.execute(JavaRunner.QUICK_DEBUG, properties);<NEW_LINE>} else {<NEW_LINE>JavaRunner.execute(JavaRunner.QUICK_RUN, properties);<NEW_LINE>}<NEW_LINE>} | getBoolean(Settings.PREF_NASHORN, false); |
1,412,442 | /* Build call for apisApiIdGet */<NEW_LINE>private com.squareup.okhttp.Call apisApiIdGetCall(String apiId, String accept, String ifNoneMatch, String ifModifiedSince, String xWSO2Tenant, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/{apiId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "apiId" + "\\}", apiClient.escapeString(apiId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (accept != null)<NEW_LINE>localVarHeaderParams.put("Accept", apiClient.parameterToString(accept));<NEW_LINE>if (ifNoneMatch != null)<NEW_LINE>localVarHeaderParams.put("If-None-Match", apiClient.parameterToString(ifNoneMatch));<NEW_LINE>if (ifModifiedSince != null)<NEW_LINE>localVarHeaderParams.put("If-Modified-Since", apiClient.parameterToString(ifModifiedSince));<NEW_LINE>if (xWSO2Tenant != null)<NEW_LINE>localVarHeaderParams.put("X-WSO2-Tenant", apiClient.parameterToString(xWSO2Tenant));<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final <MASK><NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>} | String[] localVarAccepts = { "application/json" }; |
841,686 | private void rewriteRulesExport(String rulesTableName) {<NEW_LINE>String inFile = StringUtils.format(<MASK><NEW_LINE>String outFile = StringUtils.format("%s/%s.csv", outputPath, rulesTableName);<NEW_LINE>try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(inFile), StandardCharsets.UTF_8));<NEW_LINE>OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(outFile), StandardCharsets.UTF_8)) {<NEW_LINE>String line;<NEW_LINE>while ((line = reader.readLine()) != null) {<NEW_LINE>String[] parsed = PARSER.parseLine(line);<NEW_LINE>// id<NEW_LINE>String // id<NEW_LINE>newLine = // dataSource<NEW_LINE>parsed[0] + "," + parsed[1] + "," + // version<NEW_LINE>parsed[2] + // payload<NEW_LINE>"," + rewriteHexPayloadAsEscapedJson(parsed[3]) + "\n";<NEW_LINE>writer.write(newLine);<NEW_LINE>}<NEW_LINE>} catch (IOException ioex) {<NEW_LINE>throw new RuntimeException(ioex);<NEW_LINE>}<NEW_LINE>} | ("%s/%s_raw.csv"), outputPath, rulesTableName); |
1,053,533 | public void onEnterStage(MySQLResponseService service) {<NEW_LINE>TxState state = service.getXaStatus();<NEW_LINE>RouteResultsetNode rrn = (RouteResultsetNode) service.getAttachment();<NEW_LINE>// if conn is closed or has been rollback, release conn<NEW_LINE>if (state == TxState.TX_INITIALIZE_STATE || state == TxState.TX_CONN_QUIT || state == TxState.TX_ROLLBACKED_STATE || (lastStageIsXAEnd && service.getConnection().isClosed())) {<NEW_LINE>// first release, then faked, to avoid retrying in faked, resulting in release delay<NEW_LINE>session.releaseConnection(rrn, false);<NEW_LINE>xaHandler.fakedResponse(rrn);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// need fresh conn to rollback again<NEW_LINE>if (state == TxState.TX_PREPARE_UNCONNECT_STATE || state == TxState.TX_ROLLBACK_FAILED_STATE || (!lastStageIsXAEnd && service.getConnection().isClosed())) {<NEW_LINE>MySQLResponseService newService = session.freshConn(service.getConnection(), xaHandler);<NEW_LINE>xaOldThreadIds.putIfAbsent(service.getAttachment(), service.getConnection().getThreadId());<NEW_LINE>if (newService.equals(service)) {<NEW_LINE>xaHandler.fakedResponse(service, "fail to fresh connection to rollback failed xa transaction");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>service = newService;<NEW_LINE>}<NEW_LINE>String xaTxId = service.getConnXID(session.getSessionXaID(), rrn);<NEW_LINE>XaDelayProvider.delayBeforeXaRollback(<MASK><NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("XA ROLLBACK " + xaTxId + " to " + service);<NEW_LINE>}<NEW_LINE>service.execCmd("XA ROLLBACK " + xaTxId + ";");<NEW_LINE>} | rrn.getName(), xaTxId); |
216,847 | private static void processXML(PrintData pd, Document document, Element root) {<NEW_LINE>for (int r = 0; r < pd.getRowCount(); r++) {<NEW_LINE>pd.setRowIndex(r);<NEW_LINE>Element row = document.createElement(PrintData.XML_ROW_TAG);<NEW_LINE>row.setAttribute(XML_ATTRIBUTE_NO, String.valueOf(r));<NEW_LINE>if (pd.isFunctionRow())<NEW_LINE>row.setAttribute(XML_ATTRIBUTE_FUNCTION_ROW, "yes");<NEW_LINE>root.appendChild(row);<NEW_LINE>//<NEW_LINE>for (int i = 0; i < pd.getNodeCount(); i++) {<NEW_LINE>Object o = pd.getNode(i);<NEW_LINE>if (o instanceof PrintData) {<NEW_LINE>PrintData pd_x = (PrintData) o;<NEW_LINE>Element element = document.createElement(PrintData.XML_TAG);<NEW_LINE>element.setAttribute(XML_ATTRIBUTE_NAME, pd_x.getName());<NEW_LINE>element.setAttribute(XML_ATTRIBUTE_COUNT, String.valueOf(pd_x.getRowCount()));<NEW_LINE>row.appendChild(element);<NEW_LINE>// recursive call<NEW_LINE>processXML(pd_x, document, element);<NEW_LINE>} else if (o instanceof PrintDataElement) {<NEW_LINE>PrintDataElement pde = (PrintDataElement) o;<NEW_LINE>if (!pde.isNull()) {<NEW_LINE>Element element = <MASK><NEW_LINE>element.setAttribute(PrintDataElement.XML_ATTRIBUTE_NAME, pde.getColumnName());<NEW_LINE>if (pde.hasKey())<NEW_LINE>element.setAttribute(PrintDataElement.XML_ATTRIBUTE_KEY, pde.getValueKey());<NEW_LINE>// not formatted<NEW_LINE>element.appendChild(document.createTextNode(pde.getValueDisplay(null)));<NEW_LINE>row.appendChild(element);<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>log.error("Element not PrintData(Element) " + o.getClass().getName());<NEW_LINE>}<NEW_LINE>// columns<NEW_LINE>}<NEW_LINE>// rows<NEW_LINE>} | document.createElement(PrintDataElement.XML_TAG); |
1,066,949 | public void introspectFramework(String timestamp, Set<JavaDumpAction> javaDumpActions) {<NEW_LINE>Tr.audit(tc, "info.introspect.request.received");<NEW_LINE>File dumpDir = config.getOutputFile(BootstrapConstants.SERVER_DUMP_FOLDER_PREFIX + timestamp + "/");<NEW_LINE>if (!dumpDir.exists()) {<NEW_LINE>throw new IllegalStateException("dump directory does not exist.");<NEW_LINE>}<NEW_LINE>// generate java dumps if needed, and move them to the dump directory.<NEW_LINE>if (javaDumpActions != null) {<NEW_LINE>File javaDumpLocations = new File(dumpDir, BootstrapConstants.SERVER_DUMPED_FILE_LOCATIONS);<NEW_LINE>dumpJava(javaDumpActions, javaDumpLocations);<NEW_LINE>}<NEW_LINE>IntrospectionContext introspectionCtx = new IntrospectionContext(systemBundleCtx, dumpDir);<NEW_LINE>introspectionCtx.introspectAll();<NEW_LINE>// create dumped flag file<NEW_LINE>File dumpedFlag = new <MASK><NEW_LINE>try {<NEW_LINE>dumpedFlag.createNewFile();<NEW_LINE>} catch (IOException e) {<NEW_LINE>Tr.warning(tc, "warn.unableWriteFile", dumpedFlag, e.getMessage());<NEW_LINE>}<NEW_LINE>} | File(dumpDir, BootstrapConstants.SERVER_DUMPED_FLAG_FILE_NAME); |
321,961 | /*<NEW_LINE>* The basic idea here is to create a few different versions of the<NEW_LINE>* LinearConvolve hardware effect peers, based on the kernel size.<NEW_LINE>* The LinearConvolveRenderState state class contains the algorithm that<NEW_LINE>* determines how many peers should be generated and at which optimized<NEW_LINE>* sizes.<NEW_LINE>*/<NEW_LINE>private static void compileLinearConvolve(JSLCInfo jslcinfo, String name) throws Exception {<NEW_LINE>int outTypes = jslcinfo.outTypes;<NEW_LINE>jslcinfo.shaderName = "Effect";<NEW_LINE>File baseFile = jslcinfo.getJSLFile(name);<NEW_LINE>String base = CompileJSL.readFile(baseFile);<NEW_LINE>long basetime = baseFile.lastModified();<NEW_LINE>// output one hardware shader for each unrolled size (as determined<NEW_LINE>// by the LinearConvolveRenderState quantization algorithm)<NEW_LINE>jslcinfo.outTypes = (outTypes & JSLC.OUT_HW_SHADERS);<NEW_LINE>int lastpeersize = -1;<NEW_LINE>for (int i = 1; i < LinearConvolveRenderState.MAX_COMPILED_KERNEL_SIZE; i += 4) {<NEW_LINE>int peersize = LinearConvolveRenderState.getPeerSize(i);<NEW_LINE>if (peersize != lastpeersize) {<NEW_LINE>String source = String.format(base, peersize / 4, peersize / 4);<NEW_LINE>jslcinfo<MASK><NEW_LINE>JSLC.compile(jslcinfo, source, basetime);<NEW_LINE>lastpeersize = peersize;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// output a single hardware peer class (can be instantiated for<NEW_LINE>// each of the shaders generated above)<NEW_LINE>jslcinfo.outTypes = (outTypes & JSLC.OUT_HW_PEERS);<NEW_LINE>jslcinfo.peerName = name;<NEW_LINE>jslcinfo.genericsName = "LinearConvolveRenderState";<NEW_LINE>// "LinearConvolvePeer";<NEW_LINE>jslcinfo.interfaceName = null;<NEW_LINE>int peersize = LinearConvolveRenderState.MAX_COMPILED_KERNEL_SIZE / 4;<NEW_LINE>String genericbase = String.format(base, peersize, 0);<NEW_LINE>JSLC.compile(jslcinfo, genericbase, basetime);<NEW_LINE>// output a single version of the software peer (there's<NEW_LINE>// no loop unrolling in this case)<NEW_LINE>jslcinfo.outTypes = (outTypes & JSLC.OUT_SW_PEERS);<NEW_LINE>JSLC.compile(jslcinfo, genericbase, basetime);<NEW_LINE>} | .peerName = name + "_" + peersize; |
1,535,885 | public void activate(final BundleContext bundleContext, final Map<String, Object> config) {<NEW_LINE>String offsetString = (String) config.get("offset");<NEW_LINE>if (StringUtils.isNotBlank(offsetString)) {<NEW_LINE>try {<NEW_LINE>offset = Integer.valueOf(offsetString);<NEW_LINE>} catch (IllegalArgumentException iae) {<NEW_LINE>logger.warn("couldn't parse '{}' to an integer");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String urlString = (String) config.get("calendar_name");<NEW_LINE>if (!StringUtils.isBlank(urlString)) {<NEW_LINE>calendar_name = urlString;<NEW_LINE>} else {<NEW_LINE>logger.warn("gcal-persistence:calendar_name must be configured in openhab.cfg. Calendar name or word \"primary\" MUST be specified");<NEW_LINE>}<NEW_LINE>String executeScriptString = (<MASK><NEW_LINE>if (StringUtils.isNotBlank(executeScriptString)) {<NEW_LINE>executeScript = executeScriptString;<NEW_LINE>}<NEW_LINE>initialized = true;<NEW_LINE>scheduleUploadJob();<NEW_LINE>} | String) config.get("executescript"); |
1,033,981 | File[] guessPath(String input) {<NEW_LINE>List<File> results = new ArrayList<>();<NEW_LINE>String apkPathRoot = "/data/app/";<NEW_LINE>for (String potential : splitPathList(input)) {<NEW_LINE>if (!potential.startsWith(apkPathRoot)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int end = potential.lastIndexOf(".apk");<NEW_LINE>if (end != potential.length() - 4) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int endSlash = potential.lastIndexOf("/", end);<NEW_LINE>if (endSlash == apkPathRoot.length() - 1) {<NEW_LINE>// Apks cannot be directly under /data/app<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int startSlash = potential.lastIndexOf("/", endSlash - 1);<NEW_LINE>if (startSlash == -1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Look for the first dash after the package name<NEW_LINE>int dash = <MASK><NEW_LINE>if (dash == -1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>end = dash;<NEW_LINE>String packageName = potential.substring(startSlash + 1, end);<NEW_LINE>File dataDir = getWriteableDirectory("/data/data/" + packageName);<NEW_LINE>if (dataDir == null) {<NEW_LINE>// If we can't access "/data/data", try to guess user specific data directory.<NEW_LINE>dataDir = guessUserDataDirectory(packageName);<NEW_LINE>}<NEW_LINE>if (dataDir != null) {<NEW_LINE>File cacheDir = new File(dataDir, "cache");<NEW_LINE>// The cache directory might not exist -- create if necessary<NEW_LINE>if (fileOrDirExists(cacheDir) || cacheDir.mkdir()) {<NEW_LINE>if (isWriteableDirectory(cacheDir)) {<NEW_LINE>results.add(cacheDir);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return results.toArray(new File[results.size()]);<NEW_LINE>} | potential.indexOf("-", startSlash); |
519,414 | private ConfigParameters mergeWithDefaultConfig(ConfigParameters config) {<NEW_LINE>Properties p = new Properties();<NEW_LINE>p.put(BOX_ATTRIBUTES_KEY + '/' + Factory.CLASS_NAME_KEY, ShapeAttributes.class.getName());<NEW_LINE>p.put(BOX_ATTRIBUTES_KEY + <MASK><NEW_LINE>p.put(BOX_ATTRIBUTES_KEY + '/' + ShapeAttributes.LINE_COLOR_KEY, "0");<NEW_LINE>p.put(TITLE_ATTRIBUTES_KEY + '/' + Factory.CLASS_NAME_KEY, BasicGraphicAttributes.class.getName());<NEW_LINE>p.put(TITLE_ATTRIBUTES_KEY + '/' + BasicGraphicAttributes.HORIZONTAL_ANCHOR_KEY, "center");<NEW_LINE>p.put(TITLE_ATTRIBUTES_KEY + '/' + BasicGraphicAttributes.VERTICAL_ANCHOR_KEY, "top");<NEW_LINE>p.put(CURVE_TITLE_ATTRIBUTES_KEY + '/' + Factory.CLASS_NAME_KEY, BasicGraphicAttributes.class.getName());<NEW_LINE>ConfigData cd = new PropertiesBasedConfigData(p);<NEW_LINE>cd = new ConfigParametersBasedConfigData(config, new ConfigParameters(cd));<NEW_LINE>return new ConfigParameters(cd);<NEW_LINE>} | '/' + ShapeAttributes.FILL_COLOR_KEY, "0xffffff"); |
1,406,857 | protected Object execute(final OETLExtractedItem source) {<NEW_LINE>int retry = 0;<NEW_LINE>do {<NEW_LINE>try (ODatabaseDocument db = acquire()) {<NEW_LINE>try {<NEW_LINE>Object current = source.payload;<NEW_LINE>context.setVariable("extractedNum", source.num);<NEW_LINE>context.setVariable("extractedPayload", source.payload);<NEW_LINE>for (OETLTransformer t : transformers) {<NEW_LINE>current = t.transform(db, current);<NEW_LINE>if (current == null) {<NEW_LINE>processor.getContext().getMessageHandler().warn(this, "Transformer [%s] returned null, skip rest of pipeline execution", t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (current != null) {<NEW_LINE>// LOAD<NEW_LINE>loader.load(db, current, context);<NEW_LINE>}<NEW_LINE>db.commit();<NEW_LINE>return current;<NEW_LINE>} catch (ONeedRetryException e) {<NEW_LINE>loader.rollback(db);<NEW_LINE>retry++;<NEW_LINE>processor.getContext().getMessageHandler().info(this, "Error in pipeline execution, retry = %d/%d (exception=)", retry, maxRetries, e);<NEW_LINE>} catch (OETLProcessHaltedException e) {<NEW_LINE>processor.getContext().getMessageHandler().error(this, "Pipeline execution halted");<NEW_LINE>processor.getStats().incrementErrors();<NEW_LINE>loader.rollback(db);<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>processor.getContext().getMessageHandler().error(this, "Error in Pipeline execution:", e);<NEW_LINE>processor<MASK><NEW_LINE>if (!haltOnError) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>loader.rollback(db);<NEW_LINE>throw OException.wrapException(new OETLProcessHaltedException("Halt"), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} while (retry < maxRetries);<NEW_LINE>return this;<NEW_LINE>} | .getStats().incrementErrors(); |
369,675 | public WebElement findElement(RemoteWebDriver driver, SearchContext context, BiFunction<String, Object, CommandPayload> createPayload, By locator) {<NEW_LINE>Require.nonNull("WebDriver", driver);<NEW_LINE>Require.nonNull("Context for finding elements", context);<NEW_LINE><MASK><NEW_LINE>Require.nonNull("Locator", locator);<NEW_LINE>ElementFinder mechanism = finders.get(locator.getClass());<NEW_LINE>if (mechanism != null) {<NEW_LINE>return mechanism.findElement(driver, context, createPayload, locator);<NEW_LINE>}<NEW_LINE>// We prefer to use the remote version if possible<NEW_LINE>if (locator instanceof By.Remotable) {<NEW_LINE>try {<NEW_LINE>WebElement element = ElementFinder.REMOTE.findElement(driver, context, createPayload, locator);<NEW_LINE>finders.put(locator.getClass(), ElementFinder.REMOTE);<NEW_LINE>return element;<NEW_LINE>} catch (NoSuchElementException e) {<NEW_LINE>finders.put(locator.getClass(), ElementFinder.REMOTE);<NEW_LINE>throw e;<NEW_LINE>} catch (InvalidArgumentException e) {<NEW_LINE>// Fall through<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// But if that's not an option, then default to using the locator<NEW_LINE>// itself for finding things.<NEW_LINE>try {<NEW_LINE>WebElement element = ElementFinder.CONTEXT.findElement(driver, context, createPayload, locator);<NEW_LINE>finders.put(locator.getClass(), ElementFinder.CONTEXT);<NEW_LINE>return element;<NEW_LINE>} catch (NoSuchElementException e) {<NEW_LINE>finders.put(locator.getClass(), ElementFinder.CONTEXT);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | Require.nonNull("Method for creating remote requests", createPayload); |
105,031 | public List<FixedAsset> createFixedAssets(Invoice invoice) throws AxelorException {<NEW_LINE>List<FixedAsset> fixedAssetList = new ArrayList<>();<NEW_LINE>if (invoice == null || CollectionUtils.isEmpty(invoice.getInvoiceLineList())) {<NEW_LINE>return fixedAssetList;<NEW_LINE>}<NEW_LINE>AccountConfig accountConfig = accountConfigService.getAccountConfig(invoice.getCompany());<NEW_LINE>for (InvoiceLine invoiceLine : invoice.getInvoiceLineList()) {<NEW_LINE>if (accountConfig.getFixedAssetCatReqOnInvoice() && invoiceLine.getFixedAssets() && invoiceLine.getFixedAssetCategory() == null) {<NEW_LINE>throw new AxelorException(invoiceLine, TraceBackRepository.CATEGORY_MISSING_FIELD, I18n.get(IExceptionMessage.INVOICE_LINE_ERROR_FIXED_ASSET_CATEGORY), invoiceLine.getProductName());<NEW_LINE>}<NEW_LINE>if (!invoiceLine.getFixedAssets() || invoiceLine.getFixedAssetCategory() == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>FixedAsset fixedAsset = new FixedAsset();<NEW_LINE>fixedAsset.setFixedAssetCategory(invoiceLine.getFixedAssetCategory());<NEW_LINE>if (fixedAsset.getFixedAssetCategory().getIsValidateFixedAsset()) {<NEW_LINE>fixedAsset.setStatusSelect(FixedAssetRepository.STATUS_VALIDATED);<NEW_LINE>} else {<NEW_LINE>fixedAsset.setStatusSelect(FixedAssetRepository.STATUS_DRAFT);<NEW_LINE>}<NEW_LINE>fixedAsset.setAcquisitionDate(invoice.getInvoiceDate());<NEW_LINE>fixedAsset.setFirstDepreciationDate(invoice.getInvoiceDate());<NEW_LINE>fixedAsset.setReference(invoice.getInvoiceId());<NEW_LINE>fixedAsset.setName(invoiceLine.getProductName() + " (" + invoiceLine.getQty() + ")");<NEW_LINE>fixedAsset.setCompany(fixedAsset.getFixedAssetCategory().getCompany());<NEW_LINE>fixedAsset.setJournal(fixedAsset.getFixedAssetCategory().getJournal());<NEW_LINE>fixedAsset.setComputationMethodSelect(fixedAsset.getFixedAssetCategory().getComputationMethodSelect());<NEW_LINE>fixedAsset.setDegressiveCoef(fixedAsset.getFixedAssetCategory().getDegressiveCoef());<NEW_LINE>fixedAsset.setNumberOfDepreciation(fixedAsset.getFixedAssetCategory().getNumberOfDepreciation());<NEW_LINE>fixedAsset.setPeriodicityInMonth(fixedAsset.getFixedAssetCategory().getPeriodicityInMonth());<NEW_LINE>fixedAsset.setDurationInMonth(fixedAsset.getFixedAssetCategory().getDurationInMonth());<NEW_LINE>fixedAsset.setGrossValue(invoiceLine.getCompanyExTaxTotal());<NEW_LINE>fixedAsset.<MASK><NEW_LINE>fixedAsset.setPurchaseAccount(invoiceLine.getAccount());<NEW_LINE>fixedAsset.setInvoiceLine(invoiceLine);<NEW_LINE>this.generateAndComputeLines(fixedAsset);<NEW_LINE>fixedAssetList.add(fixedAssetRepo.save(fixedAsset));<NEW_LINE>}<NEW_LINE>return fixedAssetList;<NEW_LINE>} | setPartner(invoice.getPartner()); |
368,341 | void addOrderItem(List<SqlNode> orderByList, RelFieldCollation field) {<NEW_LINE>boolean added = false;<NEW_LINE>if (field.nullDirection != RelFieldCollation.NullDirection.UNSPECIFIED) {<NEW_LINE>final boolean first = field.nullDirection == RelFieldCollation.NullDirection.FIRST;<NEW_LINE>SqlNode nullDirectionNode = dialect.emulateNullDirection(field(field.getFieldIndex()), first, <MASK><NEW_LINE>if (nullDirectionNode != null) {<NEW_LINE>orderByList.add(nullDirectionNode);<NEW_LINE>field = new RelFieldCollation(field.getFieldIndex(), field.getDirection(), RelFieldCollation.NullDirection.UNSPECIFIED);<NEW_LINE>added = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Each(targetName=c0, sql=SELECT * FROM db1_0.travelrecord_0 WHERE (`id` = ?) ORDER BY (`id` IS NULL), `id`)<NEW_LINE>// if (!added) {<NEW_LINE>orderByList.add(toSql(field));<NEW_LINE>// }<NEW_LINE>} | field.direction.isDescending()); |
994,652 | public boolean appendEntry(final LogEntry entry) {<NEW_LINE>if (entry.getType() == EntryType.ENTRY_TYPE_CONFIGURATION) {<NEW_LINE>return executeBatch(batch -> addConfBatch(entry, batch));<NEW_LINE>} else {<NEW_LINE>this.readLock.lock();<NEW_LINE>try {<NEW_LINE>if (this.db == null) {<NEW_LINE>LOG.warn("DB not initialized or destroyed in data path: {}.", this.path);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final WriteContext writeCtx = newWriteContext();<NEW_LINE>final long logIndex = entry.getId().getIndex();<NEW_LINE>final byte[] valueBytes = this.logEntryEncoder.encode(entry);<NEW_LINE>final byte[] newValueBytes = onDataAppend(logIndex, valueBytes, writeCtx);<NEW_LINE>writeCtx.startJob();<NEW_LINE>this.db.put(this.defaultHandle, this.writeOptions, getKeyBytes(logIndex), newValueBytes);<NEW_LINE>writeCtx.joinAll();<NEW_LINE>if (newValueBytes != valueBytes) {<NEW_LINE>doSync();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (final RocksDBException | IOException e) {<NEW_LINE>LOG.error("Fail to append entry.", e);<NEW_LINE>return false;<NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE>Thread<MASK><NEW_LINE>return false;<NEW_LINE>} finally {<NEW_LINE>this.readLock.unlock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .currentThread().interrupt(); |
817,698 | private Bootstrap createClientBootstrap(EventLoopGroup eventLoopGroup) {<NEW_LINE>final Bootstrap bootstrap = new Bootstrap();<NEW_LINE>bootstrap.group(eventLoopGroup);<NEW_LINE>bootstrap.channel(NettyBootstrap.clientChannel());<NEW_LINE>bootstrap.option(ChannelOption.TCP_NODELAY, TransportSettings.TCP_NO_DELAY.get(settings));<NEW_LINE>bootstrap.option(ChannelOption.SO_KEEPALIVE, TransportSettings.TCP_KEEP_ALIVE.get(settings));<NEW_LINE>final ByteSizeValue tcpSendBufferSize = TransportSettings.TCP_SEND_BUFFER_SIZE.get(settings);<NEW_LINE>if (tcpSendBufferSize.getBytes() > 0) {<NEW_LINE>bootstrap.option(ChannelOption.SO_SNDBUF, Math.toIntExact(tcpSendBufferSize.getBytes()));<NEW_LINE>}<NEW_LINE>final ByteSizeValue tcpReceiveBufferSize = TransportSettings.TCP_RECEIVE_BUFFER_SIZE.get(settings);<NEW_LINE>if (tcpReceiveBufferSize.getBytes() > 0) {<NEW_LINE>bootstrap.option(ChannelOption.SO_RCVBUF, Math.toIntExact<MASK><NEW_LINE>}<NEW_LINE>bootstrap.option(ChannelOption.RCVBUF_ALLOCATOR, recvByteBufAllocator);<NEW_LINE>final boolean reuseAddress = TransportSettings.TCP_REUSE_ADDRESS.get(settings);<NEW_LINE>bootstrap.option(ChannelOption.SO_REUSEADDR, reuseAddress);<NEW_LINE>return bootstrap;<NEW_LINE>} | (tcpReceiveBufferSize.getBytes())); |
195,985 | default LongColumn timeWindow(ChronoUnit unit, int n, LocalDateTime start) {<NEW_LINE>String newColumnName = "" + n + " " + unit.toString() <MASK><NEW_LINE>long packedStartDate = pack(start);<NEW_LINE>LongColumn numberColumn = LongColumn.create(newColumnName, size());<NEW_LINE>for (int i = 0; i < size(); i++) {<NEW_LINE>long packedDate = getLongInternal(i);<NEW_LINE>long result;<NEW_LINE>switch(unit) {<NEW_LINE>case MINUTES:<NEW_LINE>result = minutesUntil(packedDate, packedStartDate) / n;<NEW_LINE>numberColumn.set(i, result);<NEW_LINE>break;<NEW_LINE>case HOURS:<NEW_LINE>result = hoursUntil(packedDate, packedStartDate) / n;<NEW_LINE>numberColumn.set(i, result);<NEW_LINE>break;<NEW_LINE>case DAYS:<NEW_LINE>result = daysUntil(packedDate, packedStartDate) / n;<NEW_LINE>numberColumn.set(i, result);<NEW_LINE>break;<NEW_LINE>case WEEKS:<NEW_LINE>result = weeksUntil(packedDate, packedStartDate) / n;<NEW_LINE>numberColumn.set(i, result);<NEW_LINE>break;<NEW_LINE>case MONTHS:<NEW_LINE>result = monthsUntil(packedDate, packedStartDate) / n;<NEW_LINE>numberColumn.set(i, result);<NEW_LINE>break;<NEW_LINE>case YEARS:<NEW_LINE>result = yearsUntil(packedDate, packedStartDate) / n;<NEW_LINE>numberColumn.set(i, result);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnsupportedTemporalTypeException("The ChronoUnit " + unit + " is not supported for timeWindows on dates");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>numberColumn.setPrintFormatter(NumberColumnFormatter.ints());<NEW_LINE>return numberColumn;<NEW_LINE>} | + " window [" + name() + "]"; |
184,170 | final GetUserAttributeVerificationCodeResult executeGetUserAttributeVerificationCode(GetUserAttributeVerificationCodeRequest getUserAttributeVerificationCodeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getUserAttributeVerificationCodeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetUserAttributeVerificationCodeRequest> request = null;<NEW_LINE>Response<GetUserAttributeVerificationCodeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetUserAttributeVerificationCodeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getUserAttributeVerificationCodeRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetUserAttributeVerificationCode");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetUserAttributeVerificationCodeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetUserAttributeVerificationCodeResultJsonUnmarshaller());<NEW_LINE>response = anonymousInvoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
1,790,534 | protected Node createUndecoratedEditor() {<NEW_LINE><MASK><NEW_LINE>final Node wrappedCb = ItemUtil.lockDecorator(cbNull, document, ItemUtil.DATABASE_RELATION_TOOLTIP);<NEW_LINE>final Label label = new Label(IMPLEMENTATION_TITLE);<NEW_LINE>final ChoiceBox<ImplementAs> cbImpl = new ChoiceBox<>(observableArrayList(ImplementAs.values()));<NEW_LINE>cbImpl.setTooltip(new Tooltip(IMPLEMENTATION_TOOLTIP));<NEW_LINE>final HBox right = new HBox(label, cbImpl);<NEW_LINE>final HBox left = new HBox(wrappedCb, right);<NEW_LINE>left.setSpacing(16);<NEW_LINE>right.setSpacing(8);<NEW_LINE>right.setAlignment(Pos.CENTER);<NEW_LINE>cbNull.selectedProperty().bindBidirectional(nullable);<NEW_LINE>cbImpl.valueProperty().bindBidirectional(implementation);<NEW_LINE>right.visibleProperty().bind(nullable);<NEW_LINE>right.disableProperty().bind(nullable.not());<NEW_LINE>return left;<NEW_LINE>} | final CheckBox cbNull = new CheckBox(); |
1,517,219 | void notifyContextClosed() {<NEW_LINE>assert Thread.holdsLock(context);<NEW_LINE>assert !context.isActive() || context.state == PolyglotContextImpl.State.CLOSED_CANCELLED || context.state <MASK><NEW_LINE>if (intervalTimer != null) {<NEW_LINE>intervalTimer.cancel();<NEW_LINE>}<NEW_LINE>if (!activeEvents.isEmpty()) {<NEW_LINE>ArrayList<AbstractTLHandshake> activeEventsList = new ArrayList<>(activeEvents.keySet());<NEW_LINE>boolean pendingThreadLocalAction = false;<NEW_LINE>for (AbstractTLHandshake handshake : activeEventsList) {<NEW_LINE>Future<?> future = handshake.future;<NEW_LINE>if (!future.isDone()) {<NEW_LINE>if (context.state == PolyglotContextImpl.State.CLOSED_CANCELLED) {<NEW_LINE>// we allow cancellation for invalid or cancelled contexts<NEW_LINE>future.cancel(true);<NEW_LINE>pendingThreadLocalAction = true;<NEW_LINE>} else {<NEW_LINE>throw new AssertionError("Pending thread local actions found. Did the actions not process on last leave? Pending action: " + handshake.action);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!pendingThreadLocalAction) {<NEW_LINE>activeEvents.clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (statistics != null) {<NEW_LINE>logStatistics();<NEW_LINE>}<NEW_LINE>} | == PolyglotContextImpl.State.CLOSED_EXITED : "context is still active, cannot flush safepoints"; |
1,799,751 | private void writeBinaryFile(OutputStreamWriter writer, OutputStream output, File file) throws IOException {<NEW_LINE>writer.append("--" + multipartBoundary).append(NEWLINE);<NEW_LINE>writer.append("Content-Disposition: form-data; name=\"warFile\"; filename=\"" + file.getAbsolutePath() + "\"").append(NEWLINE);<NEW_LINE>writer.append("Content-Type: application/octet-stream").append(NEWLINE);<NEW_LINE>writer.append("Content-Transfer-Encoding: binary").append(NEWLINE);<NEW_LINE>writer.append(NEWLINE).flush();<NEW_LINE>InputStream input = null;<NEW_LINE>try {<NEW_LINE>input = new FileInputStream(file);<NEW_LINE>byte[] buffer <MASK><NEW_LINE>for (int length = 0; (length = input.read(buffer)) > 0; ) {<NEW_LINE>output.write(buffer, 0, length);<NEW_LINE>}<NEW_LINE>// Important! Output cannot be closed. Close of writer will close output as well.<NEW_LINE>output.flush();<NEW_LINE>} finally {<NEW_LINE>if (input != null) {<NEW_LINE>try {<NEW_LINE>input.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.append(NEWLINE).flush();<NEW_LINE>} | = new byte[1024 * 1024]; |
105,568 | static List<ChunkDescriptor> buildChunkDescriptors(Torrent torrent, long transferBlockSize, long totalSize, long chunkSize, int chunksTotal, List<List<TorrentFile>> pieceNumToFile, Map<StorageUnit, TorrentFile> storageUnitsToFilesMap, List<StorageUnit> nonEmptyStorageUnits) {<NEW_LINE>Iterator<byte[]> chunkHashes = torrent<MASK><NEW_LINE>List<ChunkDescriptor> chunks = new ArrayList<>(chunksTotal);<NEW_LINE>if (nonEmptyStorageUnits.size() > 0) {<NEW_LINE>DataRange data = buildReadWriteDataRange(nonEmptyStorageUnits);<NEW_LINE>for (long remaining = totalSize; remaining > 0; remaining -= chunkSize) {<NEW_LINE>long off = chunks.size() * chunkSize;<NEW_LINE>long lim = Math.min(chunkSize, remaining);<NEW_LINE>DataRange subrange = data.getSubrange(off, lim);<NEW_LINE>if (!chunkHashes.hasNext()) {<NEW_LINE>throw new BtException("Wrong number of chunk hashes in the torrent: too few");<NEW_LINE>}<NEW_LINE>ArrayList<TorrentFile> chunkFiles = new ArrayList<>();<NEW_LINE>subrange.visitUnits((unit, off1, lim1) -> chunkFiles.add(storageUnitsToFilesMap.get(unit)));<NEW_LINE>chunkFiles.trimToSize();<NEW_LINE>pieceNumToFile.add(chunkFiles);<NEW_LINE>chunks.add(buildChunkDescriptor(subrange, transferBlockSize, chunkHashes.next()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (chunkHashes.hasNext()) {<NEW_LINE>throw new BtException("Wrong number of chunk hashes in the torrent: too many");<NEW_LINE>}<NEW_LINE>return chunks;<NEW_LINE>} | .getChunkHashes().iterator(); |
673,032 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_draft_box);<NEW_LINE>mDraftBox = PLDraftBox.getInstance(this);<NEW_LINE>mDrafts = mDraftBox.getAllDrafts();<NEW_LINE>mAdapter = new DraftAdapter(this);<NEW_LINE>mNullView = <MASK><NEW_LINE>mListView = findViewById(R.id.draft_list);<NEW_LINE>mListView.setAdapter(mAdapter);<NEW_LINE>mListView.setOnItemClickListener((adapterView, view, i, l) -> {<NEW_LINE>Intent intent = new Intent(DraftBoxActivity.this, VideoRecordActivity.class);<NEW_LINE>PLDraft draft = mDrafts.get(i);<NEW_LINE>intent.putExtra(VideoRecordActivity.DRAFT, draft.getTag());<NEW_LINE>startActivity(intent);<NEW_LINE>});<NEW_LINE>mListView.setOnItemLongClickListener((adapterView, view, pos, l) -> {<NEW_LINE>final AlertDialog.Builder alertDialog = new AlertDialog.Builder(DraftBoxActivity.this).setTitle(R.string.dlg_delete_draft).setPositiveButton(getString(R.string.dlg_yes), new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialogInterface, int i) {<NEW_LINE>PLDraft draft = mDrafts.get(pos);<NEW_LINE>PLDraftBox.getInstance(DraftBoxActivity.this).removeDraftByTag(draft.getTag(), true);<NEW_LINE>updateView();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>alertDialog.show();<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>} | findViewById(R.id.tv_null_view); |
458,971 | static void checkMatchParent(ConstraintWidgetContainer container, LinearSystem system, ConstraintWidget widget) {<NEW_LINE>widget.mHorizontalResolution = UNKNOWN;<NEW_LINE>widget.mVerticalResolution = UNKNOWN;<NEW_LINE>if (container.mListDimensionBehaviors[DIMENSION_HORIZONTAL] != ConstraintWidget.DimensionBehaviour.WRAP_CONTENT && widget.mListDimensionBehaviors[DIMENSION_HORIZONTAL] == ConstraintWidget.DimensionBehaviour.MATCH_PARENT) {<NEW_LINE>int left = widget.mLeft.mMargin;<NEW_LINE>int right = container.getWidth() - widget.mRight.mMargin;<NEW_LINE>widget.mLeft.mSolverVariable = system.createObjectVariable(widget.mLeft);<NEW_LINE>widget.mRight.mSolverVariable = system.createObjectVariable(widget.mRight);<NEW_LINE>system.addEquality(widget.mLeft.mSolverVariable, left);<NEW_LINE>system.addEquality(widget.mRight.mSolverVariable, right);<NEW_LINE>widget.mHorizontalResolution = ConstraintWidget.DIRECT;<NEW_LINE>widget.setHorizontalDimension(left, right);<NEW_LINE>}<NEW_LINE>if (container.mListDimensionBehaviors[DIMENSION_VERTICAL] != ConstraintWidget.DimensionBehaviour.WRAP_CONTENT && widget.mListDimensionBehaviors[DIMENSION_VERTICAL] == ConstraintWidget.DimensionBehaviour.MATCH_PARENT) {<NEW_LINE>int top = widget.mTop.mMargin;<NEW_LINE>int bottom = container.getHeight<MASK><NEW_LINE>widget.mTop.mSolverVariable = system.createObjectVariable(widget.mTop);<NEW_LINE>widget.mBottom.mSolverVariable = system.createObjectVariable(widget.mBottom);<NEW_LINE>system.addEquality(widget.mTop.mSolverVariable, top);<NEW_LINE>system.addEquality(widget.mBottom.mSolverVariable, bottom);<NEW_LINE>if (widget.mBaselineDistance > 0 || widget.getVisibility() == ConstraintWidget.GONE) {<NEW_LINE>widget.mBaseline.mSolverVariable = system.createObjectVariable(widget.mBaseline);<NEW_LINE>system.addEquality(widget.mBaseline.mSolverVariable, top + widget.mBaselineDistance);<NEW_LINE>}<NEW_LINE>widget.mVerticalResolution = ConstraintWidget.DIRECT;<NEW_LINE>widget.setVerticalDimension(top, bottom);<NEW_LINE>}<NEW_LINE>} | () - widget.mBottom.mMargin; |
871,593 | private String parseMessageListener(Element element, ParserContext parserContext, BeanDefinition adapterBeanDefinition) {<NEW_LINE>BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(ChannelPublishingJmsMessageListener.class);<NEW_LINE>builder.addPropertyValue("expectReply", this.expectReply);<NEW_LINE>if (this.expectReply) {<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "request-channel");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "request-timeout");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "reply-timeout");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "extract-request-payload");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "extract-reply-payload");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "correlation-key");<NEW_LINE>int defaults = 0;<NEW_LINE>if (StringUtils.hasText(element.getAttribute(DEFAULT_REPLY_DESTINATION_ATTRIB))) {<NEW_LINE>defaults++;<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(element.getAttribute(DEFAULT_REPLY_QUEUE_NAME_ATTRIB))) {<NEW_LINE>defaults++;<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(element.getAttribute(DEFAULT_REPLY_TOPIC_NAME_ATTRIB))) {<NEW_LINE>defaults++;<NEW_LINE>}<NEW_LINE>if (defaults > 1) {<NEW_LINE>parserContext.getReaderContext().error("At most one of '" + DEFAULT_REPLY_DESTINATION_ATTRIB + "', '" + DEFAULT_REPLY_QUEUE_NAME_ATTRIB + <MASK><NEW_LINE>}<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, DEFAULT_REPLY_DESTINATION_ATTRIB);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, DEFAULT_REPLY_QUEUE_NAME_ATTRIB);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, DEFAULT_REPLY_TOPIC_NAME_ATTRIB);<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "destination-resolver");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, REPLY_TIME_TO_LIVE);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, REPLY_PRIORITY);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, REPLY_DELIVERY_PERSISTENT);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, EXPLICIT_QOS_ENABLED_FOR_REPLIES);<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "reply-channel");<NEW_LINE>} else {<NEW_LINE>String channelName = element.getAttribute("channel");<NEW_LINE>if (!StringUtils.hasText(channelName)) {<NEW_LINE>channelName = IntegrationNamespaceUtils.createDirectChannel(element, parserContext);<NEW_LINE>}<NEW_LINE>builder.addPropertyReference("requestChannel", channelName);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "send-timeout", "requestTimeout");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "extract-payload", "extractRequestPayload");<NEW_LINE>}<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "error-channel");<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "message-converter");<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "header-mapper");<NEW_LINE>String alias = adapterBeanNameRoot(element, parserContext, adapterBeanDefinition) + ".listener";<NEW_LINE>BeanDefinition beanDefinition = builder.getBeanDefinition();<NEW_LINE>String beanName = BeanDefinitionReaderUtils.generateBeanName(beanDefinition, parserContext.getRegistry());<NEW_LINE>BeanComponentDefinition component = new BeanComponentDefinition(beanDefinition, beanName, new String[] { alias });<NEW_LINE>parserContext.registerBeanComponent(component);<NEW_LINE>return beanName;<NEW_LINE>} | "', or '" + DEFAULT_REPLY_TOPIC_NAME_ATTRIB + "' may be provided.", element); |
947,934 | final GetExportSnapshotRecordsResult executeGetExportSnapshotRecords(GetExportSnapshotRecordsRequest getExportSnapshotRecordsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getExportSnapshotRecordsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetExportSnapshotRecordsRequest> request = null;<NEW_LINE>Response<GetExportSnapshotRecordsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetExportSnapshotRecordsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getExportSnapshotRecordsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetExportSnapshotRecords");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetExportSnapshotRecordsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetExportSnapshotRecordsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,420,994 | private void addCSSClasses(SVGPlot svgp) {<NEW_LINE>final StyleLibrary style = context.getStyleLibrary();<NEW_LINE>if (!svgp.getCSSClassManager().contains(SELECTAXISVISIBILITY)) {<NEW_LINE>CSSClass cls = new CSSClass(this, SELECTAXISVISIBILITY);<NEW_LINE>cls.setStatement(SVGConstants.CSS_OPACITY_PROPERTY, 0.1);<NEW_LINE>cls.setStatement(SVGConstants.CSS_FILL_PROPERTY, SVGConstants.CSS_BLUE_VALUE);<NEW_LINE>svgp.addCSSClassOrLogError(cls);<NEW_LINE>}<NEW_LINE>if (!svgp.getCSSClassManager().contains(SAV_BORDER)) {<NEW_LINE>CSSClass cls = new CSSClass(this, SAV_BORDER);<NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_PROPERTY, SVGConstants.CSS_GREY_VALUE);<NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_WIDTH_PROPERTY, style.getLineWidth(StyleLibrary.PLOT) * .5);<NEW_LINE>cls.setStatement(SVGConstants.CSS_FILL_PROPERTY, SVGConstants.CSS_NONE_VALUE);<NEW_LINE>svgp.addCSSClassOrLogError(cls);<NEW_LINE>}<NEW_LINE>if (!svgp.getCSSClassManager().contains(SAV_BUTTON)) {<NEW_LINE>CSSClass cls = new CSSClass(this, SAV_BUTTON);<NEW_LINE>cls.setStatement(SVGConstants.CSS_OPACITY_PROPERTY, 0.01);<NEW_LINE>cls.setStatement(SVGConstants.CSS_FILL_PROPERTY, SVGConstants.CSS_GREY_VALUE);<NEW_LINE>cls.setStatement(SVGConstants.CSS_CURSOR_PROPERTY, SVGConstants.CSS_POINTER_VALUE);<NEW_LINE>svgp.addCSSClassOrLogError(cls);<NEW_LINE>}<NEW_LINE>if (!svgp.getCSSClassManager().contains(SAV_CROSS)) {<NEW_LINE>CSSClass cls = new CSSClass(this, SAV_CROSS);<NEW_LINE>cls.setStatement(<MASK><NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_WIDTH_PROPERTY, style.getLineWidth(StyleLibrary.PLOT) * .75);<NEW_LINE>cls.setStatement(SVGConstants.CSS_FILL_PROPERTY, SVGConstants.CSS_NONE_VALUE);<NEW_LINE>svgp.addCSSClassOrLogError(cls);<NEW_LINE>}<NEW_LINE>} | SVGConstants.CSS_STROKE_PROPERTY, SVGConstants.CSS_BLACK_VALUE); |
1,577,309 | private RefactoringStatus addWarnings(final Set<Warning> warnings) {<NEW_LINE>RefactoringStatus status = new RefactoringStatus();<NEW_LINE>// Remove deleted ripple methods from user selection and add warnings<NEW_LINE>for (Iterator<Warning> iter = warnings.iterator(); iter.hasNext(); ) {<NEW_LINE>final Warning warning = iter.next();<NEW_LINE>final IMethod[] elements = warning.getRipple();<NEW_LINE>if (warning.isSelectionWarning()) {<NEW_LINE>String message = Messages.format(RefactoringCoreMessages.RenameTypeProcessor_deselected_method_is_overridden, new String[] { JavaElementLabels.getElementLabel(elements[0], JavaElementLabels.ALL_DEFAULT), JavaElementLabels.getElementLabel(elements[0].getDeclaringType(<MASK><NEW_LINE>status.addWarning(message);<NEW_LINE>}<NEW_LINE>if (warning.isNameWarning()) {<NEW_LINE>String message = Messages.format(RefactoringCoreMessages.RenameTypeProcessor_renamed_method_is_overridden, new String[] { JavaElementLabels.getElementLabel(elements[0], JavaElementLabels.ALL_DEFAULT), JavaElementLabels.getElementLabel(elements[0].getDeclaringType(), JavaElementLabels.ALL_DEFAULT) });<NEW_LINE>status.addWarning(message);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < elements.length; i++) {<NEW_LINE>fPreloadedElementToSelection.put(elements[i], Boolean.FALSE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return status;<NEW_LINE>} | ), JavaElementLabels.ALL_DEFAULT) }); |
1,258,048 | public WriteFilesResult<DestinationT> expand(PCollection<UserT> input) {<NEW_LINE>Write.Builder<DestinationT, UserT> resolvedSpec = new AutoValue_FileIO_Write.Builder<>();<NEW_LINE>resolvedSpec.setDynamic(getDynamic());<NEW_LINE>checkArgument(getSinkFn() != null, ".via() is required");<NEW_LINE>resolvedSpec.setSinkFn(getSinkFn());<NEW_LINE>checkArgument(getOutputFn() != null, "outputFn should have been set by .via()");<NEW_LINE>resolvedSpec.setOutputFn(getOutputFn());<NEW_LINE>// Resolve destinationFn<NEW_LINE>if (getDynamic()) {<NEW_LINE>checkArgument(getDestinationFn() != null, "when using writeDynamic(), .by() is required");<NEW_LINE>resolvedSpec.setDestinationFn(getDestinationFn());<NEW_LINE>resolvedSpec.setDestinationCoder(resolveDestinationCoder(input));<NEW_LINE>} else {<NEW_LINE>checkArgument(getDestinationFn() == null, ".by() requires writeDynamic()");<NEW_LINE>checkArgument(getDestinationCoder() == null, ".withDestinationCoder() requires writeDynamic()");<NEW_LINE>resolvedSpec.setDestinationFn(fn(SerializableFunctions.constant(null)));<NEW_LINE>resolvedSpec.setDestinationCoder((Coder) VoidCoder.of());<NEW_LINE>}<NEW_LINE>resolvedSpec.setFileNamingFn(resolveFileNamingFn());<NEW_LINE>resolvedSpec.setEmptyWindowDestination(getEmptyWindowDestination());<NEW_LINE>if (getTempDirectory() == null) {<NEW_LINE>checkArgument(getOutputDirectory() != null, "must specify either .withTempDirectory() or .to()");<NEW_LINE>resolvedSpec.setTempDirectory(getOutputDirectory());<NEW_LINE>} else {<NEW_LINE>resolvedSpec.setTempDirectory(getTempDirectory());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>resolvedSpec.setNumShards(getNumShards());<NEW_LINE>resolvedSpec.setSharding(getSharding());<NEW_LINE>resolvedSpec.setIgnoreWindowing(getIgnoreWindowing());<NEW_LINE>resolvedSpec.setNoSpilling(getNoSpilling());<NEW_LINE>Write<DestinationT, UserT> resolved = resolvedSpec.build();<NEW_LINE>WriteFiles<UserT, DestinationT, ?> writeFiles = WriteFiles.to(new ViaFileBasedSink<>(resolved)).withSideInputs(Lists.newArrayList(resolved.getAllSideInputs()));<NEW_LINE>if (getNumShards() != null) {<NEW_LINE>writeFiles = writeFiles.withNumShards(getNumShards());<NEW_LINE>} else if (getSharding() != null) {<NEW_LINE>writeFiles = writeFiles.withSharding(getSharding());<NEW_LINE>} else {<NEW_LINE>writeFiles = writeFiles.withRunnerDeterminedSharding();<NEW_LINE>}<NEW_LINE>if (!getIgnoreWindowing()) {<NEW_LINE>writeFiles = writeFiles.withWindowedWrites();<NEW_LINE>}<NEW_LINE>if (getNoSpilling()) {<NEW_LINE>writeFiles = writeFiles.withNoSpilling();<NEW_LINE>}<NEW_LINE>return input.apply(writeFiles);<NEW_LINE>} | resolvedSpec.setCompression(getCompression()); |
1,470,712 | public static void main(String[] args) throws Exception {<NEW_LINE>String inputfilepath = System.getProperty("user.dir") + "/one.docx";<NEW_LINE>WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new java.io.File(inputfilepath));<NEW_LINE>StyleDefinitionsPart stylesPart = wordMLPackage.getMainDocumentPart().getStyleDefinitionsPart();<NEW_LINE>System.out.println("BEFORE");<NEW_LINE>report(stylesPart.getContents().getStyle());<NEW_LINE>System.out.println("styles which are in use:");<NEW_LINE>Set<String> stylesInUse = wordMLPackage.getMainDocumentPart().getStylesInUse();<NEW_LINE>for (String s : stylesInUse) {<NEW_LINE>System.out.println(s);<NEW_LINE>}<NEW_LINE>// Our style trees usually only cover styles which are in use<NEW_LINE>// To trim unused styles, we're interested in the ones which are NOT is use<NEW_LINE>// Setup<NEW_LINE>Styles styles = wordMLPackage.getMainDocumentPart().getStyleDefinitionsPart(false).getJaxbElement();<NEW_LINE>Set<String> stylesNotInUse = new HashSet<String>();<NEW_LINE>for (org.docx4j.wml.Style s : styles.getStyle()) {<NEW_LINE>if (stylesInUse.contains(s.getStyleId())) {<NEW_LINE>// System.out.println("ignoring " + s.getStyleId() );<NEW_LINE>} else {<NEW_LINE>stylesNotInUse.add(s.getStyleId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, Style> allStyles = new HashMap<String, Style>();<NEW_LINE>for (org.docx4j.wml.Style s : styles.getStyle()) {<NEW_LINE>allStyles.put(s.getStyleId(), s);<NEW_LINE>}<NEW_LINE>// For docx4j before 8.1.3|11.1.3<NEW_LINE>// StyleTree st = new StyleTree(stylesNotInUse, allStyles,<NEW_LINE>// styles.getDocDefaults(), allStyles.get("Normal"));<NEW_LINE>// Need docx4j 8.1.3|11.1.3 for this<NEW_LINE>StyleTree st = new StyleTree(stylesNotInUse, allStyles, styles.getDocDefaults(), allStyles.get("Normal"), stylesPart.getDefaultCharacterStyle(), stylesPart.getDefaultTableStyle());<NEW_LINE>System.out.println("PARAGRAPH STYLES");<NEW_LINE>walk(st.getParagraphStylesTree().getRootElement(), "");<NEW_LINE>// You can't use this code to delete character styles unless you have docx4j 8.1.3|11.1.3<NEW_LINE>System.out.println("\nCHARACTER STYLES");<NEW_LINE>walk(st.getCharacterStylesTree().getRootElement(), "");<NEW_LINE>// now delete the deletableStyles<NEW_LINE>Styles stylesClone = XmlUtils.deepCopy(styles);<NEW_LINE>styles.getStyle().clear();<NEW_LINE>for (org.docx4j.wml.Style s : stylesClone.getStyle()) {<NEW_LINE>if (deletableStyles.contains(s.getStyleId())) {<NEW_LINE>// we can drop this one<NEW_LINE>} else {<NEW_LINE>styles.getStyle().add(s);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("AFTER");<NEW_LINE><MASK><NEW_LINE>// Save the document now if you want<NEW_LINE>} | report(styles.getStyle()); |
1,593,077 | public CategoricalDistribution likelihoodWeighting(RandomVariable[] X, AssignmentProposition[] e, BayesianNetwork bn, int N) {<NEW_LINE>// local variables: W, a vector of weighted counts for each value of X,<NEW_LINE>// initially zero<NEW_LINE>double[] W = new double[ProbUtil.expectedSizeOfCategoricalDistribution(X)];<NEW_LINE>// for j = 1 to N do<NEW_LINE>for (int j = 0; j < N; j++) {<NEW_LINE>// <b>x</b>,w <- WEIGHTED-SAMPLE(bn,e)<NEW_LINE>Pair<Map<RandomVariable, Object>, Double> <MASK><NEW_LINE>// W[x] <- W[x] + w where x is the value of X in <b>x</b><NEW_LINE>W[ProbUtil.indexOf(X, x_w.getFirst())] += x_w.getSecond();<NEW_LINE>}<NEW_LINE>// return NORMALIZE(W)<NEW_LINE>return new ProbabilityTable(W, X).normalize();<NEW_LINE>} | x_w = weightedSample(bn, e); |
1,306,523 | static void displayErrorMessage(DiscoveryDialog dialog) {<NEW_LINE>// check if modules run and assemble message<NEW_LINE>try {<NEW_LINE>SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase();<NEW_LINE>Map<Long, DataSourceModulesWrapper> dataSourceIngestModules = new HashMap<>();<NEW_LINE>for (DataSource dataSource : skCase.getDataSources()) {<NEW_LINE>dataSourceIngestModules.put(dataSource.getId(), new DataSourceModulesWrapper(dataSource.getName()));<NEW_LINE>}<NEW_LINE>for (IngestJobInfo jobInfo : skCase.getIngestJobs()) {<NEW_LINE>dataSourceIngestModules.get(jobInfo.getObjectId<MASK><NEW_LINE>}<NEW_LINE>String message = "";<NEW_LINE>for (DataSourceModulesWrapper dsmodulesWrapper : dataSourceIngestModules.values()) {<NEW_LINE>message += dsmodulesWrapper.getMessage();<NEW_LINE>}<NEW_LINE>if (!message.isEmpty()) {<NEW_LINE>JScrollPane messageScrollPane = new JScrollPane();<NEW_LINE>JTextPane messageTextPane = new JTextPane();<NEW_LINE>messageTextPane.setText(message);<NEW_LINE>messageTextPane.setVisible(true);<NEW_LINE>messageTextPane.setEditable(false);<NEW_LINE>messageTextPane.setCaretPosition(0);<NEW_LINE>messageScrollPane.setMaximumSize(new Dimension(600, 100));<NEW_LINE>messageScrollPane.setPreferredSize(new Dimension(600, 100));<NEW_LINE>messageScrollPane.setViewportView(messageTextPane);<NEW_LINE>JOptionPane.showMessageDialog(dialog, messageScrollPane, Bundle.DiscoveryUiUtils_resultsIncomplete_text(), JOptionPane.PLAIN_MESSAGE);<NEW_LINE>}<NEW_LINE>} catch (NoCurrentCaseException | TskCoreException ex) {<NEW_LINE>logger.log(Level.WARNING, "Exception while determining which modules have been run for Discovery", ex);<NEW_LINE>}<NEW_LINE>dialog.validateDialog();<NEW_LINE>} | ()).updateModulesRun(jobInfo); |
1,653,677 | public void run() {<NEW_LINE>switch(opCode) {<NEW_LINE>case FIND_LINE_NUMBER:<NEW_LINE>{<NEW_LINE>Element paragraphsParent = findLineRootElement(doc);<NEW_LINE>// argInt is offset<NEW_LINE>retInt = paragraphsParent.getElementIndex(argInt);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case FIND_LINE_COLUMN:<NEW_LINE>{<NEW_LINE>Element paragraphsParent = findLineRootElement(doc);<NEW_LINE>// argInt is offset<NEW_LINE>int indx = paragraphsParent.getElementIndex(argInt);<NEW_LINE>retInt = argInt - paragraphsParent.getElement(indx).getStartOffset();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case FIND_LINE_OFFSET:<NEW_LINE>{<NEW_LINE>Element paragraphsParent = findLineRootElement(doc);<NEW_LINE>// argInt is lineNumber<NEW_LINE>Element line = paragraphsParent.getElement(argInt);<NEW_LINE>if (line == null) {<NEW_LINE>// NOI18N<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>retInt = line.getStartOffset();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>} | IndexOutOfBoundsException("Index=" + argInt + " is out of bounds."); |
331,900 | void store() {<NEW_LINE>UserPreferences.setLogFileCount(Integer.parseInt(logFileCount.getText()));<NEW_LINE>storeTempDir();<NEW_LINE>if (!agencyLogoPathField.getText().isEmpty()) {<NEW_LINE>File file = new <MASK><NEW_LINE>if (file.exists()) {<NEW_LINE>reportBranding.setAgencyLogoPath(agencyLogoPathField.getText());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>reportBranding.setAgencyLogoPath("");<NEW_LINE>}<NEW_LINE>UserPreferences.setMaxSolrVMSize((int) solrMaxHeapSpinner.getValue());<NEW_LINE>if (isJVMHeapSettingsCapable()) {<NEW_LINE>// if the field could of been changed we need to try and save it<NEW_LINE>try {<NEW_LINE>writeEtcConfFile();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>logger.log(Level.WARNING, "Unable to save config file to " + PlatformUtil.getUserDirectory() + "\\" + ETC_FOLDER_NAME, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | File(agencyLogoPathField.getText()); |
1,151,781 | /* (non-Javadoc)<NEW_LINE>* @see com.webank.weid.service.impl.engine.AuthorityIssuerController<NEW_LINE>* #removeAuthorityIssuer(com.webank.weid.protocol.request.RemoveAuthorityIssuerArgs)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public ResponseData<Boolean> removeAuthorityIssuer(RemoveAuthorityIssuerArgs args) {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>AuthorityIssuerController authorityIssuerController = reloadContract(fiscoConfig.getIssuerAddress(), args.getWeIdPrivateKey().getPrivateKey(), AuthorityIssuerController.class);<NEW_LINE>TransactionReceipt receipt = authorityIssuerController.removeAuthorityIssuer(WeIdUtils.convertWeIdToAddress(weId)).send();<NEW_LINE>List<AuthorityIssuerRetLogEventResponse> eventList = authorityIssuerController.getAuthorityIssuerRetLogEvents(receipt);<NEW_LINE>TransactionInfo info = new TransactionInfo(receipt);<NEW_LINE>AuthorityIssuerRetLogEventResponse event = eventList.get(0);<NEW_LINE>if (event != null) {<NEW_LINE>ErrorCode errorCode = verifyAuthorityIssuerRelatedEvent(event, WeIdConstant.REMOVE_AUTHORITY_ISSUER_OPCODE);<NEW_LINE>if (ErrorCode.SUCCESS.getCode() != errorCode.getCode()) {<NEW_LINE>return new ResponseData<>(false, errorCode, info);<NEW_LINE>} else {<NEW_LINE>return new ResponseData<>(true, errorCode, info);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.error("remove authority issuer failed, transcation event decoding failure.");<NEW_LINE>return new ResponseData<>(false, ErrorCode.AUTHORITY_ISSUER_ERROR, info);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("remove authority issuer failed.", e);<NEW_LINE>return new ResponseData<>(false, ErrorCode.AUTHORITY_ISSUER_ERROR);<NEW_LINE>}<NEW_LINE>} | String weId = args.getWeId(); |
571,601 | public void run() {<NEW_LINE>// We need to synchronize access to (and overwriting of) the latch to avoid race conditions<NEW_LINE>synchronized (WPAndroidGlueCode.this) {<NEW_LINE>mGetContentCountDownLatch = new CountDownLatch(1);<NEW_LINE>mRnReactNativeGutenbergBridgePackage.getRNReactNativeGutenbergBridgeModule().getHtmlFromJS();<NEW_LINE>try {<NEW_LINE>boolean success = mGetContentCountDownLatch.await(5, TimeUnit.SECONDS);<NEW_LINE>if (!success) {<NEW_LINE>AppLog.<MASK><NEW_LINE>}<NEW_LINE>if (mContentInfo == null) {<NEW_LINE>onContentInfoReceivedListener.onContentInfoFailed();<NEW_LINE>} else {<NEW_LINE>onContentInfoReceivedListener.onContentInfoReceived(mContentInfo.toHashMap());<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>onContentInfoReceivedListener.onContentInfoFailed();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | e(T.EDITOR, "Timeout reached before response from requestGetHtml."); |
745,917 | protected void removeNode(final NodeType node) {<NEW_LINE>if (node.getNode().getGraph() == null) {<NEW_LINE>m_graph.reInsertNode(node.getNode());<NEW_LINE>}<NEW_LINE>final HierarchyManager manager = m_graph.getHierarchyManager();<NEW_LINE>final Node n = node.getNode();<NEW_LINE>if (manager.isNormalNode(n)) {<NEW_LINE>m_graph.<MASK><NEW_LINE>} else if (getGraph().getHierarchyManager().isFolderNode(node.getNode())) {<NEW_LINE>GroupHelpers.extractFolder(m_graph, node.getNode());<NEW_LINE>m_graph.removeNode(node.getNode());<NEW_LINE>} else if (getGraph().getHierarchyManager().isGroupNode(node.getNode())) {<NEW_LINE>GroupHelpers.extractGroup(m_graph, node.getNode());<NEW_LINE>m_graph.removeNode(node.getNode());<NEW_LINE>}<NEW_LINE>m_mappings.removeNode(node);<NEW_LINE>} | removeNode(node.getNode()); |
1,784,932 | public synchronized void updateView(OView view, ODatabaseDocumentInternal db) {<NEW_LINE>lastUpdateTimestampForView.put(view.getName(<MASK><NEW_LINE>int cluster = db.addCluster(getNextClusterNameFor(view, db));<NEW_LINE>String viewName = view.getName();<NEW_LINE>String query = view.getQuery();<NEW_LINE>String originRidField = view.getOriginRidField();<NEW_LINE>String clusterName = db.getClusterNameById(cluster);<NEW_LINE>List<OIndex> indexes = createNewIndexesForView(view, cluster, db);<NEW_LINE>OScenarioThreadLocal.executeAsDistributed(new Callable<Object>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object call() {<NEW_LINE>OResultSet rs = db.query(query);<NEW_LINE>while (rs.hasNext()) {<NEW_LINE>OResult item = rs.next();<NEW_LINE>addItemToView(item, db, originRidField, viewName, clusterName, indexes);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>view = db.getMetadata().getSchema().getView(view.getName());<NEW_LINE>if (view == null) {<NEW_LINE>// the view was dropped in the meantime<NEW_LINE>db.dropCluster(clusterName);<NEW_LINE>indexes.forEach(x -> x.delete());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>lockView(view);<NEW_LINE>view.addClusterId(cluster);<NEW_LINE>for (int i : view.getClusterIds()) {<NEW_LINE>if (i != cluster) {<NEW_LINE>clustersToDrop.add(i);<NEW_LINE>viewCluserVisitors.put(i, new AtomicInteger(0));<NEW_LINE>oldClustersPerViews.put(i, view.getName());<NEW_LINE>view.removeClusterId(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final OViewImpl viewImpl = ((OViewImpl) view);<NEW_LINE>viewImpl.getInactiveIndexes().forEach(idx -> {<NEW_LINE>indexesToDrop.add(idx);<NEW_LINE>viewIndexVisitors.put(idx, new AtomicInteger(0));<NEW_LINE>oldIndexesPerViews.put(idx, viewName);<NEW_LINE>});<NEW_LINE>viewImpl.inactivateIndexes();<NEW_LINE>viewImpl.addActiveIndexes(indexes.stream().map(x -> x.getName()).collect(Collectors.toList()));<NEW_LINE>unlockView(view);<NEW_LINE>cleanUnusedViewIndexes(db);<NEW_LINE>cleanUnusedViewClusters(db);<NEW_LINE>} | ), System.currentTimeMillis()); |
851,865 | private LambdaParameters parseLambdaParameters() throws CompileException, IOException {<NEW_LINE>// Identifier<NEW_LINE>String identifier = this.peekRead(TokenType.IDENTIFIER);<NEW_LINE>if (identifier != null)<NEW_LINE>return new IdentifierLambdaParameters(identifier);<NEW_LINE>this.read("(");<NEW_LINE>// '(' ')'<NEW_LINE>if (this.peekRead(")"))<NEW_LINE>return new FormalLambdaParameters(new FormalParameters(this.location()));<NEW_LINE>// '(' Identifier { ',' Identifier } ')'<NEW_LINE>if (this.peek(TokenType.IDENTIFIER) && (this.peekNextButOne(",") || this.peekNextButOne(")"))) {<NEW_LINE>List<String> names = new ArrayList<>();<NEW_LINE>names.add(this<MASK><NEW_LINE>while (this.peekRead(",")) names.add(this.read(TokenType.IDENTIFIER));<NEW_LINE>this.read(")");<NEW_LINE>return new InferredLambdaParameters((String[]) names.toArray(new String[names.size()]));<NEW_LINE>}<NEW_LINE>// '(' FormalParameterList ')'<NEW_LINE>FormalParameters fpl = this.parseFormalParameterList();<NEW_LINE>this.read(")");<NEW_LINE>return new FormalLambdaParameters(fpl);<NEW_LINE>} | .read(TokenType.IDENTIFIER)); |
308,886 | public Map<String, Object> perform() {<NEW_LINE>// Keeps a list of users<NEW_LINE>ArrayList<Map<String, String>> list = null;<NEW_LINE>// Keeps the objects in container needed by the Ajax proxy (client-side)<NEW_LINE>Map<String, Object> results = new HashMap<String, Object>(2);<NEW_LINE>// Keeps the grand total of items<NEW_LINE>int totalItemCount = 0;<NEW_LINE>// (No. of users)<NEW_LINE>List<User> users = null;<NEW_LINE>int realUserCount = 0;<NEW_LINE>// Step 1. Retrieve users, beginning from "start" parameter, up to a number of "limit" items, filtered by "filter" parameter.<NEW_LINE>try {<NEW_LINE>totalItemCount = getUserCount();<NEW_LINE>if (start < totalItemCount) {<NEW_LINE>users = getUsers();<NEW_LINE>realUserCount = users.size();<NEW_LINE>}<NEW_LINE>// Step 2. Assemble all of this information into an appropriate container to the view<NEW_LINE>if (users != null) {<NEW_LINE>int pageSize = realUserCount;<NEW_LINE>list = new ArrayList<Map<String, String>>(pageSize);<NEW_LINE>for (User aUser : users) {<NEW_LINE>Map<String, String> aRecord = new HashMap<String, String>();<NEW_LINE>String fullName = aUser.getFullName();<NEW_LINE>fullName = (UtilMethods.isSet(fullName) ? fullName : " ");<NEW_LINE>String emailAddress = aUser.getEmailAddress();<NEW_LINE>emailAddress = (UtilMethods.isSet(emailAddress) ? emailAddress : " ");<NEW_LINE>aRecord.put("id", aUser.getUserId());<NEW_LINE>aRecord.put("type", USER_TYPE_VALUE);<NEW_LINE>aRecord.put("name", fullName);<NEW_LINE>aRecord.put("emailaddress", emailAddress);<NEW_LINE>list.add(aRecord);<NEW_LINE>}<NEW_LINE>} else // No users retrieved. So create an empty list.<NEW_LINE>{<NEW_LINE>list = new ArrayList<Map<<MASK><NEW_LINE>}<NEW_LINE>// end if<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Logger.warn(UserAjax.class, "::processUsersList -> Could not process list of users.");<NEW_LINE>list = new ArrayList<Map<String, String>>(0);<NEW_LINE>}<NEW_LINE>results.put("data", list);<NEW_LINE>results.put("total", totalItemCount);<NEW_LINE>return results;<NEW_LINE>} | String, String>>(0); |
1,724,066 | public void deserializeWorld(EntityData.GlobalStore world) {<NEW_LINE>entityManager.<MASK><NEW_LINE>Map<Class<? extends Component>, Integer> componentIdTable = Maps.newHashMap();<NEW_LINE>for (int index = 0; index < world.getComponentClassCount(); ++index) {<NEW_LINE>ComponentMetadata<?> componentMetadata = componentLibrary.resolve(world.getComponentClass(index));<NEW_LINE>if (componentMetadata != null) {<NEW_LINE>componentIdTable.put(componentMetadata.getType(), index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>entitySerializer.setComponentIdMapping(componentIdTable);<NEW_LINE>prefabSerializer.setComponentIdMapping(componentIdTable);<NEW_LINE>// Prefabs that still need to be created, by their required parent<NEW_LINE>ListMultimap<String, EntityData.Prefab> pendingPrefabs = ArrayListMultimap.create();<NEW_LINE>world.getPrefabList().stream().filter(prefabData -> !prefabManager.exists(prefabData.getName())).forEach(prefabData -> {<NEW_LINE>if (!prefabData.hasParentName()) {<NEW_LINE>createPrefab(prefabData);<NEW_LINE>} else {<NEW_LINE>pendingPrefabs.put(prefabData.getParentName(), prefabData);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>while (!pendingPrefabs.isEmpty()) {<NEW_LINE>Iterator<Map.Entry<String, Collection<EntityData.Prefab>>> i = pendingPrefabs.asMap().entrySet().iterator();<NEW_LINE>while (i.hasNext()) {<NEW_LINE>Map.Entry<String, Collection<EntityData.Prefab>> entry = i.next();<NEW_LINE>if (prefabManager.exists(entry.getKey())) {<NEW_LINE>entry.getValue().forEach(this::createPrefab);<NEW_LINE>i.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (EntityData.Entity entityData : world.getEntityList()) {<NEW_LINE>entitySerializer.deserialize(entityData);<NEW_LINE>}<NEW_LINE>entitySerializer.removeComponentIdMapping();<NEW_LINE>prefabSerializer.removeComponentIdMapping();<NEW_LINE>} | setNextId(world.getNextEntityId()); |
521,778 | protected int writeValueAndFinal(int i, boolean isFinal) {<NEW_LINE>if (0 <= i && i <= BytesTrie.kMaxOneByteValue) {<NEW_LINE>return write(((BytesTrie.kMinOneByteValueLead + i) << 1) | (isFinal ? 1 : 0));<NEW_LINE>}<NEW_LINE>int length = 1;<NEW_LINE>if (i < 0 || i > 0xffffff) {<NEW_LINE>intBytes[0] = (byte) BytesTrie.kFiveByteValueLead;<NEW_LINE>intBytes[1] = (byte) (i >> 24);<NEW_LINE>intBytes[2] = (byte) (i >> 16);<NEW_LINE>intBytes[3] = (byte) (i >> 8);<NEW_LINE>intBytes[4] = (byte) i;<NEW_LINE>length = 5;<NEW_LINE>// } else if(i<=BytesTrie.kMaxOneByteValue) {<NEW_LINE>// intBytes[0]=(byte)(BytesTrie.kMinOneByteValueLead+i);<NEW_LINE>} else {<NEW_LINE>if (i <= BytesTrie.kMaxTwoByteValue) {<NEW_LINE>intBytes[0] = (byte) (BytesTrie.kMinTwoByteValueLead + (i >> 8));<NEW_LINE>} else {<NEW_LINE>if (i <= BytesTrie.kMaxThreeByteValue) {<NEW_LINE>intBytes[0] = (byte) (BytesTrie.kMinThreeByteValueLead + (i >> 16));<NEW_LINE>} else {<NEW_LINE>intBytes[0] = (byte) BytesTrie.kFourByteValueLead;<NEW_LINE>intBytes[1] = (byte) (i >> 16);<NEW_LINE>length = 2;<NEW_LINE>}<NEW_LINE>intBytes[length++] = (byte) (i >> 8);<NEW_LINE>}<NEW_LINE>intBytes[length++] = (byte) i;<NEW_LINE>}<NEW_LINE>intBytes[0] = (byte) ((intBytes[0] << 1) | <MASK><NEW_LINE>return write(intBytes, length);<NEW_LINE>} | (isFinal ? 1 : 0)); |
1,612,591 | private void init() {<NEW_LINE>initFile(PhpUnitPreferences.isBootstrapEnabled(phpModule), PhpUnitPreferences.getBootstrapPath(phpModule), bootstrapCheckBox, bootstrapTextField);<NEW_LINE>bootstrapForCreateTestsCheckBox.setSelected(PhpUnitPreferences.isBootstrapForCreateTests(phpModule));<NEW_LINE>initFile(PhpUnitPreferences.isConfigurationEnabled(phpModule), PhpUnitPreferences.getConfigurationPath(phpModule), configurationCheckBox, configurationTextField);<NEW_LINE>initFile(PhpUnitPreferences.isCustomSuiteEnabled(phpModule), PhpUnitPreferences.getCustomSuitePath(phpModule), suiteCheckBox, suiteTextField);<NEW_LINE>initFile(PhpUnitPreferences.isPhpUnitEnabled(phpModule), PhpUnitPreferences.getPhpUnitPath(phpModule), scriptCheckBox, scriptTextField);<NEW_LINE>runPhpUnitOnlyCheckBox.setSelected(PhpUnitPreferences.getRunPhpUnitOnly(phpModule));<NEW_LINE>runTestUsingUnitCheckBox.setSelected(PhpUnitPreferences.getRunAllTestFiles(phpModule));<NEW_LINE>askForTestGroupsCheckBox.setSelected(PhpUnitPreferences.getAskForTestGroups(phpModule));<NEW_LINE>enableFile(bootstrapCheckBox.isSelected(), bootstrapLabel, bootstrapTextField, bootstrapGenerateButton, bootstrapBrowseButton, bootstrapForCreateTestsCheckBox);<NEW_LINE>enableFile(configurationCheckBox.isSelected(), <MASK><NEW_LINE>enableFile(suiteCheckBox.isSelected(), suiteLabel, suiteTextField, suiteBrowseButton, suiteInfoLabel);<NEW_LINE>enableFile(scriptCheckBox.isSelected(), scriptLabel, scriptTextField, scriptBrowseButton);<NEW_LINE>addListeners();<NEW_LINE>validateData();<NEW_LINE>category.setStoreListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>storeData();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | configurationLabel, configurationTextField, configurationGenerateButton, configurationBrowseButton); |
1,820,386 | public void prepare(FlinkEnvironment env) {<NEW_LINE>String path = config.getString(PATH);<NEW_LINE>FormatType format = FormatType.from(config.getString(SOURCE_FORMAT).trim().toLowerCase());<NEW_LINE>Path filePath = new Path(path);<NEW_LINE>switch(format) {<NEW_LINE>case JSON:<NEW_LINE>JSONObject jsonSchemaInfo = JSONObject.parseObject(config.getString(SCHEMA));<NEW_LINE>RowTypeInfo jsonInfo = SchemaUtil.getTypeInformation(jsonSchemaInfo);<NEW_LINE>inputFormat = new JsonRowInputFormat(filePath, null, jsonInfo);<NEW_LINE>break;<NEW_LINE>case PARQUET:<NEW_LINE>final Schema parse = new Schema.Parser().parse(config.getString(SCHEMA));<NEW_LINE>final MessageType messageType = new AvroSchemaConverter().convert(parse);<NEW_LINE>inputFormat = new ParquetRowInputFormat(filePath, messageType);<NEW_LINE>break;<NEW_LINE>case ORC:<NEW_LINE>this.inputFormat = new OrcRowInputFormat(path, config.getString<MASK><NEW_LINE>break;<NEW_LINE>case CSV:<NEW_LINE>List<Map<String, String>> csvSchemaInfo = JSONObject.parseObject(config.getString(SCHEMA), new TypeReference<List<Map<String, String>>>() {<NEW_LINE>});<NEW_LINE>TypeInformation<?>[] csvType = SchemaUtil.getCsvType(csvSchemaInfo);<NEW_LINE>this.inputFormat = new RowCsvInputFormat(filePath, csvType, true);<NEW_LINE>break;<NEW_LINE>case TEXT:<NEW_LINE>inputFormat = new TextRowInputFormat(filePath);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Format '" + format + "' is not supported");<NEW_LINE>}<NEW_LINE>} | (SCHEMA), null, DEFAULT_BATCH_SIZE); |
1,441,083 | public byte[] readFully() throws IOException, RemoteException {<NEW_LINE>try (ProxyInputStream stream = openRead()) {<NEW_LINE>int pos = 0;<NEW_LINE>int avail = stream.available();<NEW_LINE>byte[] data = new byte[avail];<NEW_LINE>while (true) {<NEW_LINE>int amt = stream.read(data, <MASK><NEW_LINE>// Log.i("foo", "Read " + amt + " bytes at " + pos<NEW_LINE>// + " of avail " + data.length);<NEW_LINE>if (amt <= 0) {<NEW_LINE>// Log.i("foo", "**** FINISHED READING: pos=" + pos<NEW_LINE>// + " len=" + data.length);<NEW_LINE>return data;<NEW_LINE>}<NEW_LINE>pos += amt;<NEW_LINE>avail = stream.available();<NEW_LINE>if (avail > data.length - pos) {<NEW_LINE>byte[] newData = new byte[pos + avail];<NEW_LINE>System.arraycopy(data, 0, newData, 0, pos);<NEW_LINE>data = newData;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | pos, data.length - pos); |
1,854,858 | private void checkWorld() throws ContradictionException {<NEW_LINE>int currentworld = model.getEnvironment().getWorldIndex();<NEW_LINE>long currentbt = model<MASK><NEW_LINE>long currentrestart = model.getSolver().getRestartCount();<NEW_LINE>// System.err.println("TIME STAMP : "+currentbt+" BT COUNT : "+solver.getBackTrackCount());<NEW_LINE>// assert (currentbt == model.getBackTrackCount());<NEW_LINE>if (currentworld < lastWorld || currentbt != lastNbOfBacktracks || currentrestart > lastNbOfRestarts) {<NEW_LINE>for (int i = 0; i <= nbR; i++) {<NEW_LINE>this.toUpdateLeft[i].clear();<NEW_LINE>this.toUpdateRight[i].clear();<NEW_LINE>}<NEW_LINE>this.toRemove.clear();<NEW_LINE>this.graph.inStack.clear();<NEW_LINE>this.getGraph().getPathFinder().computeShortestAndLongestPath(toRemove, z, this);<NEW_LINE>computed = true;<NEW_LINE>// assert(toRemove.size() == 0); // PAS SUR DE L'ASSERT<NEW_LINE>// this.graph.toUpdateLeft.reset();<NEW_LINE>// this.graph.toUpdateRight.reset();<NEW_LINE>}<NEW_LINE>lastWorld = currentworld;<NEW_LINE>lastNbOfBacktracks = currentbt;<NEW_LINE>lastNbOfRestarts = currentrestart;<NEW_LINE>} | .getSolver().getBackTrackCount(); |
1,241,132 | protected void performAction(final Node[] activatedNodes) {<NEW_LINE>RequestProcessor.getDefault().post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>final TableNode node = activatedNodes[0].getLookup().lookup(TableNode.class);<NEW_LINE>final DatabaseConnection connection = node.getLookup().lookup(DatabaseConnection.class);<NEW_LINE>try {<NEW_LINE>boolean columnAdded = AddTableColumnDialog.showDialogAndCreate(connection.getConnector().getDatabaseSpecification(), node);<NEW_LINE>if (columnAdded) {<NEW_LINE>SystemAction.get(RefreshAction.class).performAction(new Node[] { node });<NEW_LINE>}<NEW_LINE>} catch (Exception exc) {<NEW_LINE>LOGGER.log(Level.WARNING, <MASK><NEW_LINE>// NOI18N<NEW_LINE>DbUtilities.reportError(NbBundle.getMessage(AddColumnAction.class, "ERR_UnableToAddColumn"), exc.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | exc.getLocalizedMessage(), exc); |
827,073 | public void update() {<NEW_LINE>panel.executablePathTextField.setText(SvnModuleConfig.getDefault().getExecutableBinaryPath());<NEW_LINE>panel.javahlPathTextField.setText(SvnModuleConfig.getDefault().getExecutableBinaryPath());<NEW_LINE>panel.annotationTextField.setText(SvnModuleConfig.getDefault().getAnnotationFormat());<NEW_LINE>panel.cbOpenOutputWindow.setSelected(SvnModuleConfig.getDefault().getAutoOpenOutput());<NEW_LINE>panel.cbGetRemoteLocks.setSelected(SvnModuleConfig.<MASK><NEW_LINE>panel.cbAutoLockFiles.setSelected(SvnModuleConfig.getDefault().isAutoLock());<NEW_LINE>annotationSettings.update();<NEW_LINE>if (repository != null) {<NEW_LINE>repository.refreshUrlHistory();<NEW_LINE>}<NEW_LINE>panel.excludeNewFiles.setSelected(SvnModuleConfig.getDefault().getExludeNewFiles());<NEW_LINE>panel.prefixRepositoryPath.setSelected(SvnModuleConfig.getDefault().isRepositoryPathPrefixed());<NEW_LINE>panel.cbDetermineBranches.setSelected(SvnModuleConfig.getDefault().isDetermineBranchesEnabled());<NEW_LINE>if (SvnClientFactory.isJavaHl()) {<NEW_LINE>panel.cmbPreferredClient.setSelectedItem(panel.panelJavahl);<NEW_LINE>} else if (SvnClientFactory.isSvnKit()) {<NEW_LINE>panel.cmbPreferredClient.setSelectedItem(panel.panelSvnkit);<NEW_LINE>} else {<NEW_LINE>panel.cmbPreferredClient.setSelectedItem(panel.panelCLI);<NEW_LINE>}<NEW_LINE>currentClient = panel.cmbPreferredClient.getSelectedItem();<NEW_LINE>} | getDefault().isGetRemoteLocks()); |
75,705 | private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String resourceName, String certificateName, 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.<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 (resourceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (certificateName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter certificateName 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.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, resourceName, certificateName, this.client.getApiVersion(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
563,186 | public static void discard(Nozzle nozzle) throws Exception {<NEW_LINE>if (nozzle.getPart() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, Object> globals = new HashMap<>();<NEW_LINE><MASK><NEW_LINE>Configuration.get().getScripting().on("Job.BeforeDiscard", globals);<NEW_LINE>Location discardLocation = Configuration.get().getMachine().getDiscardLocation();<NEW_LINE>if (nozzle.getRotationMode() == RotationMode.LimitedArticulation) {<NEW_LINE>// On a limited articulation nozzle, keep the rotation.<NEW_LINE>discardLocation = discardLocation.derive(nozzle.getLocation(), false, false, false, true);<NEW_LINE>}<NEW_LINE>// move to the discard location<NEW_LINE>nozzle.moveToPlacementLocation(discardLocation, null);<NEW_LINE>// discard the part<NEW_LINE>nozzle.place();<NEW_LINE>nozzle.moveToSafeZ();<NEW_LINE>Configuration.get().getScripting().on("Job.AfterDiscard", globals);<NEW_LINE>} | globals.put("nozzle", nozzle); |
593,884 | public UserSearchResults performMultiUserSearchFromForm(final Locale locale, final SearchConfiguration searchConfiguration, final int maxResults, final List<FormConfiguration> formItem, final SessionLabel sessionLabel) throws PwmUnrecoverableException, PwmOperationalException {<NEW_LINE>final Map<String, String> attributeHeaderMap = UserSearchResults.fromFormConfiguration(formItem, locale);<NEW_LINE>final Map<UserIdentity, Map<String, String>> searchResults = performMultiUserSearch(searchConfiguration, maxResults + 1, attributeHeaderMap.keySet(), sessionLabel);<NEW_LINE>final boolean resultsExceeded = searchResults.size() > maxResults;<NEW_LINE>final Map<UserIdentity, Map<String, String>> returnData = new LinkedHashMap<>(Math.min(maxResults, searchResults.size()));<NEW_LINE>for (final Map.Entry<UserIdentity, Map<String, String>> entry : searchResults.entrySet()) {<NEW_LINE>final <MASK><NEW_LINE>returnData.put(loopUser, entry.getValue());<NEW_LINE>if (returnData.size() >= maxResults) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new UserSearchResults(attributeHeaderMap, returnData, resultsExceeded);<NEW_LINE>} | UserIdentity loopUser = entry.getKey(); |
37,497 | protected boolean afterSave(boolean newRecord, boolean success) {<NEW_LINE>if (!success)<NEW_LINE>return false;<NEW_LINE>//<NEW_LINE>String sql = "SELECT count(*) FROM AD_Package_Exp_Detail WHERE AD_Package_Exp_ID = ?";<NEW_LINE>int recordCount = DB.getSQLValue(get_TrxName(), sql, getAD_Package_Exp_ID());<NEW_LINE>if (recordCount == 0) {<NEW_LINE>sql = "SELECT * FROM AD_Package_Exp_Common";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.<MASK><NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>int i = 1;<NEW_LINE>while (rs.next()) {<NEW_LINE>X_AD_Package_Exp_Detail PackDetail = new X_AD_Package_Exp_Detail(Env.getCtx(), 0, null);<NEW_LINE>PackDetail.setAD_Client_ID(this.getAD_Client_ID());<NEW_LINE>PackDetail.setAD_Org_ID(this.getAD_Org_ID());<NEW_LINE>PackDetail.setAD_Package_Exp_ID(getAD_Package_Exp_ID());<NEW_LINE>PackDetail.setType(rs.getString("TYPE"));<NEW_LINE>PackDetail.setFileName(rs.getString("FILENAME"));<NEW_LINE>PackDetail.setDescription(rs.getString("DESCRIPTION"));<NEW_LINE>PackDetail.setTarget_Directory(rs.getString("TARGET_DIRECTORY"));<NEW_LINE>PackDetail.setFile_Directory(rs.getString("FILE_DIRECTORY"));<NEW_LINE>PackDetail.setDestination_Directory(rs.getString("DESTINATION_DIRECTORY"));<NEW_LINE>PackDetail.setSQLStatement(rs.getString("SQLSTATEMENT"));<NEW_LINE>PackDetail.setAD_Workflow_ID(rs.getInt("AD_WORKFLOW_ID"));<NEW_LINE>PackDetail.setAD_Window_ID(rs.getInt("AD_WINDOW_ID"));<NEW_LINE>PackDetail.setAD_Role_ID(rs.getInt("AD_ROLE_ID"));<NEW_LINE>PackDetail.setAD_Process_ID(rs.getInt("AD_PROCESS_ID"));<NEW_LINE>PackDetail.setAD_Menu_ID(rs.getInt("AD_MENU_ID"));<NEW_LINE>PackDetail.setDBType(rs.getString("DBTYPE"));<NEW_LINE>PackDetail.setAD_ImpFormat_ID(rs.getInt("AD_IMPFORMAT_ID"));<NEW_LINE>PackDetail.setAD_Workbench_ID(rs.getInt("AD_WORKBENCH_ID"));<NEW_LINE>PackDetail.setAD_Table_ID(rs.getInt("AD_TABLE_ID"));<NEW_LINE>PackDetail.setAD_Form_ID(rs.getInt("AD_FORM_ID"));<NEW_LINE>PackDetail.setAD_ReportView_ID(rs.getInt("AD_REPORTVIEW_ID"));<NEW_LINE>PackDetail.setLine(i * 10);<NEW_LINE>PackDetail.saveEx();<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | prepareStatement(sql, get_TrxName()); |
885,929 | private Optional<SqlType> resolveCommonStructType(final TypedExpression exp, final SqlType targetType) {<NEW_LINE>final SqlType sourceType = exp.type().orElse(null);<NEW_LINE>if (targetType.baseType() != SqlBaseType.STRUCT) {<NEW_LINE>throw coercionFailureException(exp.expression(), sourceType, targetType, Optional.empty());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final SqlStruct targetStruct = (SqlStruct) targetType;<NEW_LINE>final CreateStructExpression sourceStruct = (CreateStructExpression) exp.expression();<NEW_LINE>final List<String> fieldNames = Streams.concat(sourceStruct.getFields().stream().map(Field::getName), targetStruct.fields().stream().map(SqlStruct.Field::name)).distinct().collect(Collectors.toList());<NEW_LINE>final Builder builder = SqlTypes.struct();<NEW_LINE>for (final String fieldName : fieldNames) {<NEW_LINE>final Optional<Expression> sourceFieldValue = sourceStruct.getFields().stream().filter(f -> f.getName().equals(fieldName)).findFirst().map(Field::getValue);<NEW_LINE>final Optional<SqlType> sourceFieldType = sourceFieldValue.map(sourceExpression -> typeManager.getExpressionSqlType(sourceExpression, lambdaTypeMapping));<NEW_LINE>final Optional<SqlType> targetFieldType = targetStruct.field(fieldName).map(SqlStruct.Field::type);<NEW_LINE>final SqlType fieldType;<NEW_LINE>if (!targetFieldType.isPresent()) {<NEW_LINE>fieldType = sourceFieldType.orElseThrow(IllegalStateException::new);<NEW_LINE>} else if (!sourceFieldType.isPresent()) {<NEW_LINE>fieldType = targetFieldType.orElseThrow(IllegalStateException::new);<NEW_LINE>} else {<NEW_LINE>fieldType = resolveCommonType(new TypedExpression(sourceFieldType.get(), sourceFieldValue.get()), targetFieldType).orElseThrow(IllegalStateException::new);<NEW_LINE>}<NEW_LINE>builder.field(fieldName, fieldType);<NEW_LINE>}<NEW_LINE>return Optional.of(builder.build());<NEW_LINE>} catch (final InvalidCoercionException e) {<NEW_LINE>throw coercionFailureException(exp.expression(), sourceType, targetType<MASK><NEW_LINE>}<NEW_LINE>} | , Optional.of(e)); |
829,518 | private void doShow(boolean navigate) {<NEW_LINE>ApplicationManager.getApplication().assertIsDispatchThread();<NEW_LINE>if (ApplicationManager.getApplication().isUnitTestMode())<NEW_LINE>return;<NEW_LINE>removeHighlighter();<NEW_LINE>OpenFileDescriptor fileDescriptor = myOpenFileDescriptor;<NEW_LINE>if (!navigate && myOpenFileDescriptor != null) {<NEW_LINE>fileDescriptor = new OpenFileDescriptor(myProject, myOpenFileDescriptor.getFile());<NEW_LINE>}<NEW_LINE>myEditor = null;<NEW_LINE>if (fileDescriptor != null) {<NEW_LINE>if (!navigate) {<NEW_LINE>FileEditor editor = FileEditorManager.getInstance(fileDescriptor.getProject()).<MASK><NEW_LINE>if (editor instanceof TextEditor) {<NEW_LINE>myEditor = ((TextEditor) editor).getEditor();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (myEditor == null) {<NEW_LINE>myEditor = XDebuggerUtilImpl.createEditor(fileDescriptor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (myEditor != null) {<NEW_LINE>addHighlighter();<NEW_LINE>}<NEW_LINE>} | getSelectedEditor(fileDescriptor.getFile()); |
1,271,036 | public Integer call() throws Exception {<NEW_LINE>try {<NEW_LINE>output.debug("Creating a new project with initial parameters: %s", this);<NEW_LINE>output.throwIfUnmatchedArguments(spec.commandLine());<NEW_LINE>setSingleProjectGAV(gav);<NEW_LINE>setTestOutputDirectory(output.getTestDirectory());<NEW_LINE>if (checkProjectRootAlreadyExists(runMode.isDryRun())) {<NEW_LINE>return CommandLine.ExitCode.USAGE;<NEW_LINE>}<NEW_LINE>BuildTool buildTool = targetBuildTool.getBuildTool(BuildTool.MAVEN);<NEW_LINE>SourceType sourceType = targetLanguage.getSourceType(spec, buildTool, extensions, output);<NEW_LINE>setJavaVersion(targetLanguage.getJavaVersion());<NEW_LINE>setSourceTypeExtensions(extensions, sourceType);<NEW_LINE>setCodegenOptions(codeGeneration);<NEW_LINE>QuarkusCommandInvocation invocation = build(buildTool, targetQuarkusVersion, propertiesOptions.properties, extensions);<NEW_LINE>boolean success = true;<NEW_LINE>if (runMode.isDryRun()) {<NEW_LINE>dryRun(buildTool, invocation, output);<NEW_LINE>} else if (buildTool == BuildTool.JBANG) {<NEW_LINE>success = new CreateJBangProjectCommandHandler().execute(invocation).isSuccess();<NEW_LINE>} else {<NEW_LINE>// maven or gradle<NEW_LINE>success = new CreateProjectCommandHandler().execute(invocation).isSuccess();<NEW_LINE>}<NEW_LINE>if (success) {<NEW_LINE>if (!runMode.isDryRun()) {<NEW_LINE>output.info("Navigate into this directory and get started: " + spec.root(<MASK><NEW_LINE>}<NEW_LINE>return CommandLine.ExitCode.OK;<NEW_LINE>}<NEW_LINE>return CommandLine.ExitCode.SOFTWARE;<NEW_LINE>} catch (Exception e) {<NEW_LINE>return output.handleCommandException(e, "Unable to create project: " + e.getMessage());<NEW_LINE>}<NEW_LINE>} | ).qualifiedName() + " dev"); |
1,546,170 | public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {<NEW_LINE>AMD64Kind kind = (AMD64Kind) source.getPlatformKind();<NEW_LINE>assert AVXKind.getRegisterSize(kind) == ZMM : "Can only extract 256 bits from ZMM register";<NEW_LINE>VexMRIOp op;<NEW_LINE>switch(kind.getScalar()) {<NEW_LINE>case DOUBLE:<NEW_LINE>op = VEXTRACTF64X4;<NEW_LINE>break;<NEW_LINE>case DWORD:<NEW_LINE>// the 32x8 versions require additional features (DQ),<NEW_LINE>// thus we fall back to the 64x4 versions unless provided<NEW_LINE>op = masm.supports(CPUFeature.AVX512DQ) ? VEXTRACTI32X8 : VEXTRACTI64X4;<NEW_LINE>break;<NEW_LINE>case QWORD:<NEW_LINE>op = VEXTRACTI64X4;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>op = masm.supports(CPUFeature.AVX512DQ) ? VEXTRACTF32X8 : VEXTRACTF64X4;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (isRegister(result)) {<NEW_LINE>op.emit(masm, AVXKind.getRegisterSize(kind), asRegister(result), asRegister(source), selector);<NEW_LINE>} else {<NEW_LINE>assert isStackSlot(result);<NEW_LINE>op.emit(masm, AVXKind.getRegisterSize(kind), (AMD64Address) crb.asAddress(result)<MASK><NEW_LINE>}<NEW_LINE>} | , asRegister(source), selector); |
287,051 | public void visitClassContext(ClassContext classContext) {<NEW_LINE>JavaClass javaClass = classContext.getJavaClass();<NEW_LINE>// The class extends WebChromeClient<NEW_LINE>boolean isWebChromeClient = InterfaceUtils.isSubtype(javaClass, "android.webkit.WebChromeClient");<NEW_LINE>// Not the target of this detector<NEW_LINE>if (!isWebChromeClient) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Method[<MASK><NEW_LINE>for (Method m : methodList) {<NEW_LINE>if (DEBUG) {<NEW_LINE>System.out.println(">>> Method: " + m.getName());<NEW_LINE>}<NEW_LINE>// The presence of onGeolocationPermissionsShowPrompt is not enforce for the moment<NEW_LINE>if (!m.getName().equals("onGeolocationPermissionsShowPrompt")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Since the logic implemented need to be analyze by a human, all implementation will be flagged.<NEW_LINE>//<NEW_LINE>bugReporter.//<NEW_LINE>reportBug(new BugInstance(this, ANDROID_GEOLOCATION_TYPE, Priorities.NORMAL_PRIORITY).addClassAndMethod(javaClass, m));<NEW_LINE>}<NEW_LINE>} | ] methodList = javaClass.getMethods(); |
195,735 | private void checkForAreaUpdate() {<NEW_LINE>if (client.getLocalPlayer() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int playerRegionID = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation()).getRegionID();<NEW_LINE>if (playerRegionID == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final EnumSet<WorldType<MASK><NEW_LINE>if (worldType.contains(WorldType.DEADMAN)) {<NEW_LINE>discordState.triggerEvent(DiscordGameEventType.PLAYING_DEADMAN);<NEW_LINE>return;<NEW_LINE>} else if (WorldType.isPvpWorld(worldType)) {<NEW_LINE>discordState.triggerEvent(DiscordGameEventType.PLAYING_PVP);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DiscordGameEventType discordGameEventType = DiscordGameEventType.fromRegion(playerRegionID);<NEW_LINE>// NMZ uses the same region ID as KBD. KBD is always on plane 0 and NMZ is always above plane 0<NEW_LINE>// Since KBD requires going through the wilderness there is no EventType for it<NEW_LINE>if (DiscordGameEventType.MG_NIGHTMARE_ZONE == discordGameEventType && client.getLocalPlayer().getWorldLocation().getPlane() == 0) {<NEW_LINE>discordGameEventType = null;<NEW_LINE>}<NEW_LINE>if (discordGameEventType == null) {<NEW_LINE>// Unknown region, reset to default in-game<NEW_LINE>discordState.triggerEvent(DiscordGameEventType.IN_GAME);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!showArea(discordGameEventType)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>discordState.triggerEvent(discordGameEventType);<NEW_LINE>} | > worldType = client.getWorldType(); |
1,592,283 | final DescribeDomainChangeProgressResult executeDescribeDomainChangeProgress(DescribeDomainChangeProgressRequest describeDomainChangeProgressRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDomainChangeProgressRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDomainChangeProgressRequest> request = null;<NEW_LINE>Response<DescribeDomainChangeProgressResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDomainChangeProgressRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDomainChangeProgressRequest));<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, "Elasticsearch Service");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDomainChangeProgressResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDomainChangeProgressResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDomainChangeProgress"); |
1,106,256 | public DescribeVpcAttributeResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeVpcAttributeResult describeVpcAttributeResult = new DescribeVpcAttributeResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>return describeVpcAttributeResult;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("vpcId", targetDepth)) {<NEW_LINE>describeVpcAttributeResult.setVpcId(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("enableDnsSupport/value", targetDepth)) {<NEW_LINE>describeVpcAttributeResult.setEnableDnsSupport(BooleanStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("enableDnsHostnames/value", targetDepth)) {<NEW_LINE>describeVpcAttributeResult.setEnableDnsHostnames(BooleanStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeVpcAttributeResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
1,606,428 | public void populateItem(final Item<PathModel> item) {<NEW_LINE>PathModel entry = item.getModelObject();<NEW_LINE>item.add(WicketUtils.newImage("docIcon", "file_world_16x16.png"));<NEW_LINE>item.add(new Label("docSize", byteFormat.format(entry.size)));<NEW_LINE>item.add(new LinkPanel("docName", "list", StringUtils.stripFileExtension(entry.name), DocPage.class, WicketUtils.newPathParameter(repositoryName, commitId, entry.path)));<NEW_LINE>// links<NEW_LINE>item.add(new BookmarkablePageLink<Void>("view", DocPage.class, WicketUtils.newPathParameter(repositoryName, commitId, entry.path)));<NEW_LINE>item.add(new BookmarkablePageLink<Void>("edit", EditFilePage.class, WicketUtils.newPathParameter(repositoryName, commitId, entry.path)).setEnabled(userCanEdit));<NEW_LINE>String rawUrl = RawServlet.asLink(getContextUrl(), repositoryName, commitId, entry.path);<NEW_LINE>item.add(<MASK><NEW_LINE>item.add(new BookmarkablePageLink<Void>("blame", BlamePage.class, WicketUtils.newPathParameter(repositoryName, commitId, entry.path)));<NEW_LINE>item.add(new BookmarkablePageLink<Void>("history", HistoryPage.class, WicketUtils.newPathParameter(repositoryName, commitId, entry.path)));<NEW_LINE>WicketUtils.setAlternatingBackground(item, counter);<NEW_LINE>counter++;<NEW_LINE>} | new ExternalLink("raw", rawUrl)); |
1,184,227 | private AlertDialog.Builder buildRemoteDeleteConfirmationDialog(Set<MessageRecord> messageRecords) {<NEW_LINE>Context context = requireActivity();<NEW_LINE>int messagesCount = messageRecords.size();<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());<NEW_LINE>builder.setTitle(getActivity().getResources().getQuantityString(R.plurals.ConversationFragment_delete_selected_messages, messagesCount, messagesCount));<NEW_LINE>builder.setCancelable(true);<NEW_LINE>builder.setPositiveButton(R.string.ConversationFragment_delete_for_me, (dialog, which) -> {<NEW_LINE>new ProgressDialogAsyncTask<Void, Void, Void>(getActivity(), R.string.ConversationFragment_deleting, R.string.ConversationFragment_deleting_messages) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Void doInBackground(Void... voids) {<NEW_LINE>for (MessageRecord messageRecord : messageRecords) {<NEW_LINE>boolean threadDeleted;<NEW_LINE>if (messageRecord.isMms()) {<NEW_LINE>threadDeleted = SignalDatabase.mms().deleteMessage(messageRecord.getId());<NEW_LINE>} else {<NEW_LINE>threadDeleted = SignalDatabase.sms().deleteMessage(messageRecord.getId());<NEW_LINE>}<NEW_LINE>if (threadDeleted) {<NEW_LINE>threadId = -1;<NEW_LINE>conversationViewModel.clearThreadId();<NEW_LINE>messageCountsViewModel.clearThreadId();<NEW_LINE>listener.setThreadId(threadId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);<NEW_LINE>});<NEW_LINE>if (RemoteDeleteUtil.isValidSend(messageRecords, System.currentTimeMillis())) {<NEW_LINE>builder.setNeutralButton(R.string.ConversationFragment_delete_for_everyone, (dialog, <MASK><NEW_LINE>}<NEW_LINE>builder.setNegativeButton(android.R.string.cancel, null);<NEW_LINE>return builder;<NEW_LINE>} | which) -> handleDeleteForEveryone(messageRecords)); |
573,357 | public GeometricResult triangulate(List<Point2D_F64> observations, List<DMatrixRMaj> cameraMatrices, Point4D_F64 found) {<NEW_LINE>if (observations.size() != cameraMatrices.size())<NEW_LINE>throw new IllegalArgumentException("Number of observations must match the number of motions");<NEW_LINE>LowLevelMultiViewOps.computeNormalization(observations, stats);<NEW_LINE>final int N = cameraMatrices.size();<NEW_LINE>A.reshape(2 * N, 4);<NEW_LINE>int index = 0;<NEW_LINE>for (int i = 0; i < N; i++) {<NEW_LINE>index = addView(cameraMatrices.get(i), observations.get(i), index);<NEW_LINE>}<NEW_LINE>if (!solverNull.process(A, 1, nullspace))<NEW_LINE>return GeometricResult.SOLVE_FAILED;<NEW_LINE>// if the second smallest singular value is the same size as the smallest there's problem<NEW_LINE>double[] sv = solverNull.getSingularValues();<NEW_LINE>Arrays.sort(sv);<NEW_LINE>if (sv[1] * singularThreshold <= sv[0]) {<NEW_LINE>return GeometricResult.GEOMETRY_POOR;<NEW_LINE>}<NEW_LINE>double[] ns = nullspace.data;<NEW_LINE>found.x = ns[0];<NEW_LINE>found.y = ns[1];<NEW_LINE>found.z = ns[2];<NEW_LINE><MASK><NEW_LINE>return GeometricResult.SUCCESS;<NEW_LINE>} | found.w = ns[3]; |
1,689,526 | public void encodeValues(Buffer valueBuffer, List<T> statDataPointList) {<NEW_LINE>Assert.isTrue(CollectionUtils.hasLength(statDataPointList), "statDataPointList must not be empty");<NEW_LINE>final int numValues = statDataPointList.size();<NEW_LINE>valueBuffer.putVInt(numValues);<NEW_LINE>List<Long> startTimestamps = new ArrayList<>(numValues);<NEW_LINE>List<Long> timestamps = new ArrayList<>(numValues);<NEW_LINE>CodecEncoder<T> encoder = codecFactory.createCodecEncoder();<NEW_LINE>for (T statDataPoint : statDataPointList) {<NEW_LINE>startTimestamps.add(statDataPoint.getStartTimestamp());<NEW_LINE>timestamps.add(statDataPoint.getTimestamp());<NEW_LINE>encoder.addValue(statDataPoint);<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>codec.encodeValues(valueBuffer, UnsignedLongEncodingStrategy.REPEAT_COUNT, startTimestamps);<NEW_LINE>codec.encodeTimestamps(valueBuffer, timestamps);<NEW_LINE>encoder.encode(valueBuffer);<NEW_LINE>} | AgentStatDataPointCodec codec = codecFactory.getCodec(); |
1,657,640 | private synchronized byte[] readExternalPage(long pos, ReadType readType) throws IOException {<NEW_LINE>long pageStart = pos - (pos % mPageSize);<NEW_LINE>FileInStream stream = getExternalFileInStream(pageStart);<NEW_LINE>int pageSize = (int) Math.min(mPageSize, mStatus.getLength() - pageStart);<NEW_LINE>byte[<MASK><NEW_LINE>ByteBuffer buffer = readType == ReadType.READ_INTO_BYTE_BUFFER ? ByteBuffer.wrap(page) : null;<NEW_LINE>int totalBytesRead = 0;<NEW_LINE>while (totalBytesRead < pageSize) {<NEW_LINE>int bytesRead;<NEW_LINE>switch(readType) {<NEW_LINE>case READ_INTO_BYTE_ARRAY:<NEW_LINE>bytesRead = stream.read(page, totalBytesRead, pageSize - totalBytesRead);<NEW_LINE>break;<NEW_LINE>case READ_INTO_BYTE_BUFFER:<NEW_LINE>bytesRead = stream.read(buffer);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IOException("unsupported read type = " + readType);<NEW_LINE>}<NEW_LINE>if (bytesRead <= 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>totalBytesRead += bytesRead;<NEW_LINE>}<NEW_LINE>// Bytes read from external, may be larger than requests due to reading complete pages<NEW_LINE>MetricsSystem.meter(MetricKey.CLIENT_CACHE_BYTES_READ_EXTERNAL.getName()).mark(totalBytesRead);<NEW_LINE>if (totalBytesRead != pageSize) {<NEW_LINE>throw new IOException("Failed to read complete page from external storage. Bytes read: " + totalBytesRead + " Page size: " + pageSize);<NEW_LINE>}<NEW_LINE>return page;<NEW_LINE>} | ] page = new byte[pageSize]; |
1,163,356 | public void deleteById(String id) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String automationAccountName = Utils.getValueFromIdByName(id, "automationAccounts");<NEW_LINE>if (automationAccountName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'automationAccounts'.", id)));<NEW_LINE>}<NEW_LINE>String connectionTypeName = Utils.getValueFromIdByName(id, "connectionTypes");<NEW_LINE>if (connectionTypeName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'connectionTypes'.", id)));<NEW_LINE>}<NEW_LINE>this.deleteWithResponse(resourceGroupName, automationAccountName, connectionTypeName, <MASK><NEW_LINE>} | Context.NONE).getValue(); |
1,127,494 | private static boolean multiplyAndSubtractUnsignedMultiPrecision(int[] left, int leftOffset, int[] right, int length, int multiplier) {<NEW_LINE>long unsignedMultiplier = multiplier & LONG_MASK;<NEW_LINE>int leftIndex = leftOffset - length;<NEW_LINE>long multiplyAccumulator = 0;<NEW_LINE>long subtractAccumulator = INT_BASE;<NEW_LINE>for (int rightIndex = 0; rightIndex < length; rightIndex++, leftIndex++) {<NEW_LINE>multiplyAccumulator = (right[rightIndex] & LONG_MASK) * unsignedMultiplier + multiplyAccumulator;<NEW_LINE>subtractAccumulator = (subtractAccumulator + (left[leftIndex] & LONG_MASK)) - (lowInt(multiplyAccumulator) & LONG_MASK);<NEW_LINE>multiplyAccumulator <MASK><NEW_LINE>left[leftIndex] = lowInt(subtractAccumulator);<NEW_LINE>subtractAccumulator = (subtractAccumulator >>> 32) + INT_BASE - 1;<NEW_LINE>}<NEW_LINE>subtractAccumulator += (left[leftIndex] & LONG_MASK) - multiplyAccumulator;<NEW_LINE>left[leftIndex] = lowInt(subtractAccumulator);<NEW_LINE>return highInt(subtractAccumulator) == 0;<NEW_LINE>} | = (multiplyAccumulator >>> 32); |
972,250 | protected int xPositionForValue(final int value) {<NEW_LINE>final int min = component.getMinimum();<NEW_LINE>final int max = component.getMaximum();<NEW_LINE>final int trackLength = trackRect.width;<NEW_LINE>final double valueRange = (double) max - (double) min;<NEW_LINE>final double pixelsPerValue = (double) trackLength / valueRange;<NEW_LINE>final int trackLeft = trackRect.x;<NEW_LINE>final int trackRight = trackRect.x + trackRect.width - 1;<NEW_LINE>int xPosition;<NEW_LINE>if (!drawInverted()) {<NEW_LINE>xPosition = trackLeft;<NEW_LINE>xPosition += Math.round(pixelsPerValue * ((double) value - min));<NEW_LINE>} else {<NEW_LINE>xPosition = trackRight;<NEW_LINE>xPosition -= Math.round(pixelsPerValue * (<MASK><NEW_LINE>}<NEW_LINE>xPosition = Math.max(trackLeft, xPosition);<NEW_LINE>xPosition = Math.min(trackRight, xPosition);<NEW_LINE>return xPosition;<NEW_LINE>} | (double) value - min)); |
134,493 | public Request<DescribeListenersRequest> marshall(DescribeListenersRequest describeListenersRequest) {<NEW_LINE>if (describeListenersRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DescribeListenersRequest> request = new DefaultRequest<DescribeListenersRequest>(describeListenersRequest, "AmazonElasticLoadBalancing");<NEW_LINE>request.addParameter("Action", "DescribeListeners");<NEW_LINE>request.addParameter("Version", "2015-12-01");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (describeListenersRequest.getLoadBalancerArn() != null) {<NEW_LINE>request.addParameter("LoadBalancerArn", StringUtils.fromString(describeListenersRequest.getLoadBalancerArn()));<NEW_LINE>}<NEW_LINE>if (describeListenersRequest.getListenerArns() != null) {<NEW_LINE>java.util.List<String> listenerArnsList = describeListenersRequest.getListenerArns();<NEW_LINE>if (listenerArnsList.isEmpty()) {<NEW_LINE>request.addParameter("ListenerArns", "");<NEW_LINE>} else {<NEW_LINE>int listenerArnsListIndex = 1;<NEW_LINE>for (String listenerArnsListValue : listenerArnsList) {<NEW_LINE>if (listenerArnsListValue != null) {<NEW_LINE>request.addParameter("ListenerArns.member." + listenerArnsListIndex<MASK><NEW_LINE>}<NEW_LINE>listenerArnsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (describeListenersRequest.getMarker() != null) {<NEW_LINE>request.addParameter("Marker", StringUtils.fromString(describeListenersRequest.getMarker()));<NEW_LINE>}<NEW_LINE>if (describeListenersRequest.getPageSize() != null) {<NEW_LINE>request.addParameter("PageSize", StringUtils.fromInteger(describeListenersRequest.getPageSize()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | , StringUtils.fromString(listenerArnsListValue)); |
888,952 | public void associate(final FastAccess<D> src, final FastAccess<D> dst) {<NEW_LINE>setupForAssociate(<MASK><NEW_LINE>final double ratioTest = this.ratioTest;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, src.size, i -> {<NEW_LINE>for (int i = 0; i < src.size; i++) {<NEW_LINE>D a = src.data[i];<NEW_LINE>double bestScore = maxFitError;<NEW_LINE>double secondBest = bestScore;<NEW_LINE>int bestIndex = -1;<NEW_LINE>final int workIdx = i * dst.size;<NEW_LINE>for (int j = 0; j < dst.size; j++) {<NEW_LINE>D b = dst.data[j];<NEW_LINE>double fit = score.score(a, b);<NEW_LINE>scoreMatrix.set(workIdx + j, fit);<NEW_LINE>if (fit <= bestScore) {<NEW_LINE>bestIndex = j;<NEW_LINE>secondBest = bestScore;<NEW_LINE>bestScore = fit;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ratioTest < 1.0 && bestIndex != -1 && bestScore != 0.0) {<NEW_LINE>// the second best could lie after the best was seen<NEW_LINE>for (int j = bestIndex + 1; j < dst.size; j++) {<NEW_LINE>double fit = scoreMatrix.get(workIdx + j);<NEW_LINE>if (fit < secondBest) {<NEW_LINE>secondBest = fit;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pairs.set(i, secondBest * ratioTest >= bestScore ? bestIndex : -1);<NEW_LINE>} else {<NEW_LINE>pairs.set(i, bestIndex);<NEW_LINE>}<NEW_LINE>fitQuality.set(i, bestScore);<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>if (backwardsValidation) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, src.size, i -> {<NEW_LINE>for (int i = 0; i < src.size; i++) {<NEW_LINE>forwardsBackwards(i, src.size, dst.size);<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}<NEW_LINE>} | src.size, dst.size); |
1,261,432 | public static String doPost(String url, String paramStr, Map<String, String> headers, String method) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>HttpURLConnection conn = (HttpURLConnection) u.openConnection();<NEW_LINE>addHeaders(conn, headers);<NEW_LINE>if (StringUtils.isBlank(method)) {<NEW_LINE>conn.setRequestMethod("POST");<NEW_LINE>} else {<NEW_LINE>conn.setRequestMethod(method);<NEW_LINE>}<NEW_LINE>conn.setDoInput(true);<NEW_LINE>conn.setDoOutput(true);<NEW_LINE>conn.setReadTimeout(READ_TIMEOUT);<NEW_LINE>conn.setConnectTimeout(CONNECT_TIMEOUT);<NEW_LINE>conn.connect();<NEW_LINE>if (StringUtils.isNotBlank(paramStr)) {<NEW_LINE>conn.getOutputStream().write(paramStr.getBytes());<NEW_LINE>conn.getOutputStream().flush();<NEW_LINE>}<NEW_LINE>int i = conn.getResponseCode();<NEW_LINE>if (i == HttpURLConnection.HTTP_OK) {<NEW_LINE>return IOUtils.toString(conn.getInputStream(), DEFAULT_ENCODING);<NEW_LINE>} else {<NEW_LINE>InputStream is = conn.getErrorStream();<NEW_LINE>String errorMsg = "response not ok,http status:" + i + ",url:" + url + ",params:" + (paramStr == null ? "" : paramStr);<NEW_LINE>if (is != null) {<NEW_LINE>errorMsg += ",responsed error msg is:" + IOUtils.toString(is, DEFAULT_ENCODING);<NEW_LINE>}<NEW_LINE>throw new RuntimeException(errorMsg);<NEW_LINE>}<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new IllegalArgumentException("url format error.the url is:" + url, e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException("connect to " + url + "error.", e);<NEW_LINE>}<NEW_LINE>} | URL u = new URL(url); |
883,135 | public static void requestPermissions(PermissionsSettings settings, com.ansca.corona.CoronaActivity.OnRequestPermissionsResultHandler resultHandler, PermissionsServices services) {<NEW_LINE>// Validate arguments!<NEW_LINE>if (settings == null || resultHandler == null || services == null) {<NEW_LINE>android.util.Log.i("Corona", "WARNING: PermissionServices.ApiLevel23.requestPermissions(): Invalid arguments!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Validate environment!<NEW_LINE>final com.ansca.corona.CoronaActivity activity = com.ansca.corona.CoronaEnvironment.getCoronaActivity();<NEW_LINE>if (activity == null) {<NEW_LINE>android.util.Log.v("Corona", "PermissionServices.ApiLevel23.requestPermissions(): Cannot request permissions with null CoronaActivity!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>java.util.HashSet<String> permissionsToRequest = settings.getPermissions();<NEW_LINE>if (permissionsToRequest == null || permissionsToRequest.isEmpty()) {<NEW_LINE>// Empty permission request, just return!<NEW_LINE>android.util.Log.v("Corona", "PermissionServices.ApiLevel23.requestPermissions(): No permissions to request!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Only request the permissions that are actually denied!<NEW_LINE>java.util.HashSet<String> filteredPermissionsToRequest = new java.util.HashSet<String>();<NEW_LINE>for (String permissionToRequest : permissionsToRequest) {<NEW_LINE>switch(services.getPermissionStateFor(permissionToRequest)) {<NEW_LINE>case MISSING:<NEW_LINE>// Compose message about this app missing a permission it's trying to request!<NEW_LINE>String applicationName = com.ansca.corona.CoronaEnvironment.getApplicationName();<NEW_LINE>activity.showPermissionMissingFromManifestAlert(permissionToRequest, applicationName + " cannot request " + permissionToRequest + " because it's missing from the build.settings/AndroidManifest.xml!");<NEW_LINE>return;<NEW_LINE>case DENIED:<NEW_LINE>filteredPermissionsToRequest.add(permissionToRequest);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// Permission is already granted, so don't bother requesting it.<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Only continue if something passed through the filter.<NEW_LINE>if (filteredPermissionsToRequest.isEmpty()) {<NEW_LINE>android.util.Log.v("Corona", "PermissionServices.ApiLevel23.requestPermissions(): All permissions that were requested have already been granted!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ApiLevel11.updatePreviouslyRequestedPermissions(filteredPermissionsToRequest);<NEW_LINE>activity.requestPermissions(filteredPermissionsToRequest.toArray(new String[0]), activity<MASK><NEW_LINE>} | .registerRequestPermissionsResultHandler(resultHandler, settings)); |
706,066 | final BatchGetCommitsResult executeBatchGetCommits(BatchGetCommitsRequest batchGetCommitsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchGetCommitsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchGetCommitsRequest> request = null;<NEW_LINE>Response<BatchGetCommitsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchGetCommitsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchGetCommitsRequest));<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, "CodeCommit");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchGetCommits");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchGetCommitsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new BatchGetCommitsResultJsonUnmarshaller()); |
1,527,846 | public void marshall(RoutingProfile routingProfile, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (routingProfile == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(routingProfile.getInstanceId(), INSTANCEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(routingProfile.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(routingProfile.getRoutingProfileArn(), ROUTINGPROFILEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(routingProfile.getRoutingProfileId(), ROUTINGPROFILEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(routingProfile.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(routingProfile.getDefaultOutboundQueueId(), DEFAULTOUTBOUNDQUEUEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(routingProfile.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | routingProfile.getMediaConcurrencies(), MEDIACONCURRENCIES_BINDING); |
1,076,437 | public static void vertical7(Kernel1D_S32 kernel, GrayU8 input, GrayI16 output, int skip) {<NEW_LINE>final byte[] dataSrc = input.data;<NEW_LINE>final short[] dataDst = output.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int k5 = kernel.data[4];<NEW_LINE>final int k6 = kernel.data[5];<NEW_LINE>final int k7 = kernel.data[6];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int width = input.width;<NEW_LINE>final int heightEnd = UtilDownConvolve.computeMaxSide(input.height, skip, radius);<NEW_LINE>final int offsetY = UtilDownConvolve.computeOffset(skip, radius);<NEW_LINE>for (int y = offsetY; y <= heightEnd; y += skip) {<NEW_LINE>int indexDst = output.startIndex + (y / skip) * output.stride;<NEW_LINE>int i = input.startIndex + (<MASK><NEW_LINE>final int iEnd = i + width;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>int total = (dataSrc[indexSrc] & 0xFF) * k1;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k2;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k3;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k4;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k5;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k6;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k7;<NEW_LINE>dataDst[indexDst++] = (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | y - radius) * input.stride; |
1,210,290 | private Mono<PagedResponse<ExternalSecuritySolutionInner>> listByHomeRegionSinglePageAsync(String ascLocation, 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 (ascLocation == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null."));<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.listByHomeRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue()<MASK><NEW_LINE>} | .nextLink(), null)); |
1,085,405 | private BuildResult run(Action<GradleExecutionResult> resultVerification) {<NEW_LINE>if (projectDirectory == null) {<NEW_LINE>throw new InvalidRunnerConfigurationException("Please specify a project directory before executing the build");<NEW_LINE>}<NEW_LINE>if (environment != null && debug) {<NEW_LINE>throw new InvalidRunnerConfigurationException("Debug mode is not allowed when environment variables are specified. " + "Debug mode runs 'in process' but we need to fork a separate process to pass environment variables. " + "To run with debug mode, please remove environment variables.");<NEW_LINE>}<NEW_LINE>File testKitDir = createTestKitDir(testKitDirProvider);<NEW_LINE>GradleProvider effectiveDistribution = gradleProvider == null ? findGradleInstallFromGradleRunner() : gradleProvider;<NEW_LINE>List<String> effectiveArguments = new ArrayList<>();<NEW_LINE>if (OperatingSystem.current().isWindows()) {<NEW_LINE>// When using file system watching in Windows tests it becomes harder to delete the project directory,<NEW_LINE>// since file system watching on Windows adds a lock on the watched directory, which is currently the project directory.<NEW_LINE>// After deleting the contents of the watched directory, Gradle will stop watching the directory and release the file lock.<NEW_LINE>// That may require a retry to delete the watched directory.<NEW_LINE>// To avoid those problems for TestKit tests on Windows, we disable file system watching there.<NEW_LINE>effectiveArguments.add("-D" + <MASK><NEW_LINE>}<NEW_LINE>effectiveArguments.addAll(arguments);<NEW_LINE>GradleExecutionResult execResult = gradleExecutor.run(new GradleExecutionParameters(effectiveDistribution, testKitDir, projectDirectory, effectiveArguments, jvmArguments, classpath, debug, standardOutput, standardError, standardInput, environment));<NEW_LINE>resultVerification.execute(execResult);<NEW_LINE>return createBuildResult(execResult);<NEW_LINE>} | StartParameterBuildOptions.WatchFileSystemOption.GRADLE_PROPERTY + "=false"); |
1,490,252 | private static void generateShadowsToXML2(LayersBridge layersBridge, StringBuffer sb, Map<String, ShortcutAction> shortcutToAction, String indentation) {<NEW_LINE>Iterator<String> it = shortcutToAction.keySet().iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>String key = it.next();<NEW_LINE>ShortcutAction value = shortcutToAction.get(key);<NEW_LINE>DataObject dob = layersBridge.getDataObject(value);<NEW_LINE>if (dob == null) {<NEW_LINE>System.out.println("no Dataobject " + value);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>FileObject fo = dob.getPrimaryFile();<NEW_LINE>Attribs attribs = new Attribs(true);<NEW_LINE>attribs.add("name", key + ".shadow");<NEW_LINE>XMLStorage.generateFolderStart(sb, "file", attribs, indentation);<NEW_LINE>Attribs attribs2 = new Attribs(true);<NEW_LINE>attribs2.add("name", "originalFile");<NEW_LINE>attribs2.add(<MASK><NEW_LINE>XMLStorage.generateLeaf(sb, "attr", attribs2, indentation + " ");<NEW_LINE>XMLStorage.generateFolderEnd(sb, "file", indentation);<NEW_LINE>}<NEW_LINE>} | "stringvalue", fo.getPath()); |
1,136,159 | private void onConfigExport() {<NEW_LINE>FileDialog dialog = new FileDialog(getControl().getShell(), SWT.SAVE);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String proposal = TextUtil.sanitizeFilename(currentConfigLabel != null ? currentConfigLabel : "csv-config");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>dialog.setFileName(proposal + ".json");<NEW_LINE>dialog.setOverwrite(true);<NEW_LINE>String fileName = dialog.open();<NEW_LINE>if (fileName == null)<NEW_LINE>return;<NEW_LINE>File file = new File(fileName);<NEW_LINE>try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8)) {<NEW_LINE>CSVConfig config = new CSVConfig();<NEW_LINE>config.setLabel(currentConfigLabel != null ? <MASK><NEW_LINE>config.readFrom(importer);<NEW_LINE>JSONValue.writeJSONString(config.toJSON(), writer);<NEW_LINE>} catch (IOException e) {<NEW_LINE>PortfolioPlugin.log(e);<NEW_LINE>MessageDialog.openError(getControl().getShell(), Messages.ExportWizardErrorExporting, e.getMessage());<NEW_LINE>}<NEW_LINE>} | currentConfigLabel : file.getName()); |
608,592 | protected void onActivityResult(int requestCode, int resultCode, Intent data) {<NEW_LINE>AppLog.d(T.MAIN, "LoginActivity: onActivity Result - requestCode" + requestCode);<NEW_LINE>super.onActivityResult(requestCode, resultCode, data);<NEW_LINE>switch(requestCode) {<NEW_LINE>case RequestCodes.SHOW_LOGIN_EPILOGUE_AND_RETURN:<NEW_LINE>case RequestCodes.SHOW_SIGNUP_EPILOGUE_AND_RETURN:<NEW_LINE>// we showed the epilogue screen as informational and sites got loaded so, just<NEW_LINE>// return to login caller now<NEW_LINE>setResult(RESULT_OK);<NEW_LINE>finish();<NEW_LINE>break;<NEW_LINE>case RequestCodes.SMART_LOCK_SAVE:<NEW_LINE>if (resultCode == RESULT_OK) {<NEW_LINE>mLoginAnalyticsListener.trackLoginAutofillCredentialsUpdated();<NEW_LINE>AppLog.d(AppLog.T.NUX, "Credentials saved");<NEW_LINE>} else {<NEW_LINE>AppLog.d(<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case RequestCodes.SMART_LOCK_READ:<NEW_LINE>if (resultCode == RESULT_OK) {<NEW_LINE>AppLog.d(AppLog.T.NUX, "Credentials retrieved");<NEW_LINE>Credential credential = data.getParcelableExtra(Credential.EXTRA_KEY);<NEW_LINE>onCredentialRetrieved(credential);<NEW_LINE>} else {<NEW_LINE>AppLog.e(AppLog.T.NUX, "Credential read failed");<NEW_LINE>onCredentialsUnavailable();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | AppLog.T.NUX, "Credentials save cancelled"); |
1,487,260 | private void assignRole(RoleAssignee ra, DataverseRole r) {<NEW_LINE>try {<NEW_LINE>String privateUrlToken = null;<NEW_LINE>commandEngine.submit(new AssignRoleCommand(ra, r, dvObject, dvRequestService.getDataverseRequest(), privateUrlToken));<NEW_LINE>List<String> args = Arrays.asList(r.getName(), ra.getDisplayInfo().getTitle(), StringEscapeUtils.escapeHtml4(dvObject.getDisplayName()));<NEW_LINE>JsfHelper.addSuccessMessage(BundleUtil<MASK><NEW_LINE>// don't notify if role = file downloader and object is not released<NEW_LINE>if (!(r.getAlias().equals(DataverseRole.FILE_DOWNLOADER) && !dvObject.isReleased())) {<NEW_LINE>notifyRoleChange(ra, UserNotification.Type.ASSIGNROLE);<NEW_LINE>}<NEW_LINE>} catch (PermissionException ex) {<NEW_LINE>JH.addMessage(FacesMessage.SEVERITY_ERROR, BundleUtil.getStringFromBundle("permission.roleNotAbleToBeAssigned"), BundleUtil.getStringFromBundle("permission.permissionsMissing", Arrays.asList(ex.getRequiredPermissions().toString())));<NEW_LINE>} catch (CommandException ex) {<NEW_LINE>List<String> args = Arrays.asList(r.getName(), ra.getDisplayInfo().getTitle(), StringEscapeUtils.escapeHtml4(dvObject.getDisplayName()));<NEW_LINE>String message = BundleUtil.getStringFromBundle("permission.roleNotAssignedFor", args);<NEW_LINE>JsfHelper.addErrorMessage(message);<NEW_LINE>// JH.addMessage(FacesMessage.SEVERITY_FATAL, "The role was not able to be assigned.");<NEW_LINE>logger.log(Level.SEVERE, "Error assiging role: " + ex.getMessage(), ex);<NEW_LINE>}<NEW_LINE>showAssignmentMessages();<NEW_LINE>} | .getStringFromBundle("permission.roleAssignedToFor", args)); |
1,728,397 | public static boolean initWalk(JavaStackWalk walk, IsolateThread thread) {<NEW_LINE>assert thread.notEqual(CurrentIsolate.getCurrentThread()) : "Cannot walk the current stack with this method, it would miss all frames after the last frame anchor";<NEW_LINE>assert VMOperation.isInProgressAtSafepoint() : "Walking the stack of another thread is only safe when that thread is stopped at a safepoint";<NEW_LINE>JavaFrameAnchor anchor = JavaFrameAnchors.getFrameAnchor(thread);<NEW_LINE>boolean result = anchor.isNonNull();<NEW_LINE>Pointer sp = WordFactory.nullPointer();<NEW_LINE>CodePointer ip = WordFactory.nullPointer();<NEW_LINE>if (result) {<NEW_LINE>sp = anchor.getLastJavaSP();<NEW_LINE>ip = anchor.getLastJavaIP();<NEW_LINE>}<NEW_LINE>walk.setSP(sp);<NEW_LINE>walk.setPossiblyStaleIP(ip);<NEW_LINE>walk.setStartSP(sp);<NEW_LINE>walk.setStartIP(ip);<NEW_LINE>walk.setAnchor(anchor);<NEW_LINE>walk.setEndSP(WordFactory.nullPointer());<NEW_LINE>// Storing the untethered object in a data structures requires that the caller and all<NEW_LINE>// places that use that value are uninterruptible as well.<NEW_LINE>walk.setIPCodeInfo<MASK><NEW_LINE>return result;<NEW_LINE>} | (CodeInfoTable.lookupCodeInfo(ip)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.