idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,449,319 | public static DescribeOssObjectDetailResponse unmarshall(DescribeOssObjectDetailResponse describeOssObjectDetailResponse, UnmarshallerContext context) {<NEW_LINE>describeOssObjectDetailResponse.setRequestId(context.stringValue("DescribeOssObjectDetailResponse.RequestId"));<NEW_LINE>OssObjectDetail ossObjectDetail = new OssObjectDetail();<NEW_LINE>ossObjectDetail.setName(context.stringValue("DescribeOssObjectDetailResponse.OssObjectDetail.Name"));<NEW_LINE>ossObjectDetail.setRegionId(context.stringValue("DescribeOssObjectDetailResponse.OssObjectDetail.RegionId"));<NEW_LINE>ossObjectDetail.setRiskLevelName(context.stringValue("DescribeOssObjectDetailResponse.OssObjectDetail.RiskLevelName"));<NEW_LINE>ossObjectDetail.setBucketName(context.stringValue("DescribeOssObjectDetailResponse.OssObjectDetail.BucketName"));<NEW_LINE>ossObjectDetail.setCategoryName(context.stringValue("DescribeOssObjectDetailResponse.OssObjectDetail.CategoryName"));<NEW_LINE>List<Rule> ruleList <MASK><NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeOssObjectDetailResponse.OssObjectDetail.RuleList.Length"); i++) {<NEW_LINE>Rule rule = new Rule();<NEW_LINE>rule.setRuleName(context.stringValue("DescribeOssObjectDetailResponse.OssObjectDetail.RuleList[" + i + "].RuleName"));<NEW_LINE>rule.setCount(context.longValue("DescribeOssObjectDetailResponse.OssObjectDetail.RuleList[" + i + "].Count"));<NEW_LINE>ruleList.add(rule);<NEW_LINE>}<NEW_LINE>ossObjectDetail.setRuleList(ruleList);<NEW_LINE>describeOssObjectDetailResponse.setOssObjectDetail(ossObjectDetail);<NEW_LINE>return describeOssObjectDetailResponse;<NEW_LINE>} | = new ArrayList<Rule>(); |
1,282,212 | public List<TypeInstanceReference> loadTypeInstanceReferences() throws CouldntLoadDataException {<NEW_LINE>final List<RawTypeInstanceReference> rawReferences = provider.loadTypeInstanceReferences(module);<NEW_LINE>final List<TypeInstanceReference> references = Lists.newArrayList();<NEW_LINE>for (final RawTypeInstanceReference rawReference : rawReferences) {<NEW_LINE>final TypeInstance typeInstance = instancesById.get(rawReference.getTypeInstanceId());<NEW_LINE>final INaviView view = ViewManager.get(provider).getView(rawReference.getViewId());<NEW_LINE>if (view != null) {<NEW_LINE>final Optional<INaviOperandTreeNode> node = Optional.absent();<NEW_LINE>final IAddress address = rawReference.getAddress();<NEW_LINE>final int position = rawReference.getOperandPosition();<NEW_LINE>final <MASK><NEW_LINE>final TypeInstanceReference reference = new TypeInstanceReference(address, position, node, typeInstance, view);<NEW_LINE>references.add(reference);<NEW_LINE>referenceLookup.put(new InstanceReferenceLookup(address, position, expressionId), reference);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return references;<NEW_LINE>} | int expressionId = rawReference.getExpressionId(); |
1,091,194 | final UpdateAssessmentFrameworkResult executeUpdateAssessmentFramework(UpdateAssessmentFrameworkRequest updateAssessmentFrameworkRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateAssessmentFrameworkRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateAssessmentFrameworkRequest> request = null;<NEW_LINE>Response<UpdateAssessmentFrameworkResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UpdateAssessmentFrameworkRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateAssessmentFrameworkRequest));<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, "AuditManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateAssessmentFramework");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateAssessmentFrameworkResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateAssessmentFrameworkResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,379,231 | public ListProjectsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListProjectsResult listProjectsResult = new ListProjectsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listProjectsResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listProjectsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("projects", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listProjectsResult.setProjects(new ListUnmarshaller<ProjectSummary>(ProjectSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listProjectsResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
239,936 | public DeclarationLocation run(final EditorFeatureContext context) {<NEW_LINE>final AtomicReference<DeclarationLocation> result = new AtomicReference<>();<NEW_LINE>context.getDocument().render(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>final TokenSequence<CssTokenId> ts = LexerUtils.getJoinedTokenSequence(context.getDocument(), context.getCaretOffset(), CssTokenId.language());<NEW_LINE>if (ts == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Token<CssTokenId> valueToken = ts.token();<NEW_LINE>String valueText = valueToken.text().toString();<NEW_LINE>// adjust the value if a part of an URI<NEW_LINE>if (valueToken.id() == CssTokenId.URI) {<NEW_LINE>Matcher m = Css3Utils.URI_PATTERN.matcher(valueToken.text());<NEW_LINE>if (m.matches()) {<NEW_LINE>int groupIndex = 1;<NEW_LINE>valueText = m.group(groupIndex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>valueText = WebUtils.unquotedValue(valueText);<NEW_LINE>FileObject resolved = WebUtils.resolve(context.getSource().getFileObject(), valueText);<NEW_LINE>result.set(resolved != null ? new DeclarationLocation(resolved<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>return result.get();<NEW_LINE>} | , 0) : DeclarationLocation.NONE); |
1,639,432 | public PGPPrivateKey extractPrivateKey(PBESecretKeyDecryptor decryptorFactory) throws PGPException {<NEW_LINE>if (isPrivateKeyEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>PublicKeyPacket pubPk = secret.getPublicKeyPacket();<NEW_LINE>try {<NEW_LINE>byte[] data = extractKeyData(decryptorFactory);<NEW_LINE>BCPGInputStream in = new BCPGInputStream(new ByteArrayInputStream(data));<NEW_LINE>switch(pubPk.getAlgorithm()) {<NEW_LINE>case PGPPublicKey.RSA_ENCRYPT:<NEW_LINE>case PGPPublicKey.RSA_GENERAL:<NEW_LINE>case PGPPublicKey.RSA_SIGN:<NEW_LINE><MASK><NEW_LINE>return new PGPPrivateKey(this.getKeyID(), pubPk, rsaPriv);<NEW_LINE>case PGPPublicKey.DSA:<NEW_LINE>DSASecretBCPGKey dsaPriv = new DSASecretBCPGKey(in);<NEW_LINE>return new PGPPrivateKey(this.getKeyID(), pubPk, dsaPriv);<NEW_LINE>case PGPPublicKey.ELGAMAL_ENCRYPT:<NEW_LINE>case PGPPublicKey.ELGAMAL_GENERAL:<NEW_LINE>ElGamalSecretBCPGKey elPriv = new ElGamalSecretBCPGKey(in);<NEW_LINE>return new PGPPrivateKey(this.getKeyID(), pubPk, elPriv);<NEW_LINE>case PGPPublicKey.ECDH:<NEW_LINE>case PGPPublicKey.ECDSA:<NEW_LINE>ECSecretBCPGKey ecPriv = new ECSecretBCPGKey(in);<NEW_LINE>return new PGPPrivateKey(this.getKeyID(), pubPk, ecPriv);<NEW_LINE>case PGPPublicKey.EDDSA:<NEW_LINE>EdSecretBCPGKey edPriv = new EdSecretBCPGKey(in);<NEW_LINE>return new PGPPrivateKey(this.getKeyID(), pubPk, edPriv);<NEW_LINE>default:<NEW_LINE>throw new PGPException("unknown public key algorithm encountered");<NEW_LINE>}<NEW_LINE>} catch (PGPException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new PGPException("Exception constructing key", e);<NEW_LINE>}<NEW_LINE>} | RSASecretBCPGKey rsaPriv = new RSASecretBCPGKey(in); |
1,444,486 | private static void putTableSortProperties(final serverObjects prop, final SortDirection sortDir, final String sortColumn) {<NEW_LINE>boolean sortedByAsc = WorkTables.TABLE_API_COL_TYPE.equals(sortColumn) && sortDir == SortDirection.ASC;<NEW_LINE>prop.put("showtable_sortedByType", WorkTables.TABLE_API_COL_TYPE.equals(sortColumn));<NEW_LINE>prop.put("showtable_sortedByType_asc", sortedByAsc);<NEW_LINE>prop.put("showtable_nextSortTypeDesc", sortedByAsc);<NEW_LINE>sortedByAsc = WorkTables.TABLE_API_COL_COMMENT.equals(sortColumn) && sortDir == SortDirection.ASC;<NEW_LINE>prop.put("showtable_sortedByComment", WorkTables.TABLE_API_COL_COMMENT.equals(sortColumn));<NEW_LINE>prop.put("showtable_sortedByComment_asc", sortedByAsc);<NEW_LINE>prop.put("showtable_nextSortCommentDesc", sortedByAsc);<NEW_LINE>sortedByAsc = WorkTables.TABLE_API_COL_APICALL_COUNT.equals(sortColumn) && sortDir == SortDirection.ASC;<NEW_LINE>prop.put("showtable_sortedByApiCallCount", WorkTables.TABLE_API_COL_APICALL_COUNT.equals(sortColumn));<NEW_LINE>prop.put("showtable_sortedByApiCallCount_asc", sortedByAsc);<NEW_LINE>prop.put("showtable_nextSortApiCallCountDesc", sortedByAsc);<NEW_LINE>sortedByAsc = WorkTables.TABLE_API_COL_DATE_RECORDING.equals(sortColumn) && sortDir == SortDirection.ASC;<NEW_LINE>prop.put("showtable_sortedByDateRecording", WorkTables.TABLE_API_COL_DATE_RECORDING.equals(sortColumn));<NEW_LINE>prop.put("showtable_sortedByDateRecording_asc", sortedByAsc);<NEW_LINE>prop.put("showtable_nextSortDateRecordingDesc", sortedByAsc);<NEW_LINE>sortedByAsc = WorkTables.TABLE_API_COL_DATE_LAST_EXEC.equals(sortColumn) && sortDir == SortDirection.ASC;<NEW_LINE>prop.put("showtable_sortedByDateLastExec", WorkTables.TABLE_API_COL_DATE_LAST_EXEC.equals(sortColumn));<NEW_LINE>prop.put("showtable_sortedByDateLastExec_asc", sortedByAsc);<NEW_LINE>prop.put("showtable_nextSortDateLastExecDesc", sortedByAsc);<NEW_LINE>sortedByAsc = WorkTables.TABLE_API_COL_DATE_NEXT_EXEC.equals(sortColumn) && sortDir == SortDirection.ASC;<NEW_LINE>prop.put("showtable_sortedByDateNextExec", WorkTables.TABLE_API_COL_DATE_NEXT_EXEC.equals(sortColumn));<NEW_LINE><MASK><NEW_LINE>prop.put("showtable_nextSortDateNextExecDesc", sortedByAsc);<NEW_LINE>} | prop.put("showtable_sortedByDateNextExec_asc", sortedByAsc); |
1,639,444 | protected StringBuilder runInServlet(LibertyServer server, String queryString) throws Exception {<NEW_LINE>URL url = new URL("http://" + server.getHostname() + ":" + server.getHttpDefaultPort() + "/multiServer?" + queryString);<NEW_LINE>Log.info(getClass(), "runInServlet", "URL is " + url);<NEW_LINE>HttpURLConnection con = (HttpURLConnection) url.openConnection();<NEW_LINE>try {<NEW_LINE>con.setDoInput(true);<NEW_LINE>con.setDoOutput(true);<NEW_LINE>con.setUseCaches(false);<NEW_LINE>con.setRequestMethod("GET");<NEW_LINE>InputStream is = con.getInputStream();<NEW_LINE>InputStreamReader isr = new InputStreamReader(is);<NEW_LINE>BufferedReader br = new BufferedReader(isr);<NEW_LINE>String <MASK><NEW_LINE>StringBuilder lines = new StringBuilder();<NEW_LINE>// Send output from servlet to console output<NEW_LINE>for (String line = br.readLine(); line != null; line = br.readLine()) {<NEW_LINE>lines.append(line).append(sep);<NEW_LINE>Log.info(getClass(), "runInServlet", line);<NEW_LINE>}<NEW_LINE>// Look for success message, otherwise fail test<NEW_LINE>if (lines.indexOf("COMPLETED SUCCESSFULLY") < 0) {<NEW_LINE>Log.info(getClass(), "runInServlet", "failed to find completed successfully message");<NEW_LINE>fail("Missing success message in output. " + lines);<NEW_LINE>}<NEW_LINE>return lines;<NEW_LINE>} finally {<NEW_LINE>con.disconnect();<NEW_LINE>Log.info(getClass(), "runInServlet", "disconnected from servlet");<NEW_LINE>}<NEW_LINE>} | sep = System.getProperty("line.separator"); |
1,345,932 | private void loadNextPage() {<NEW_LINE>new Handler().postDelayed(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>List<MyMessage> list = new ArrayList<>();<NEW_LINE>Resources res = getResources();<NEW_LINE>String[] messages = res.getStringArray(R.array.conversation);<NEW_LINE>for (int i = 0; i < messages.length; i++) {<NEW_LINE>MyMessage message;<NEW_LINE>if (i % 2 == 0) {<NEW_LINE>message = new MyMessage(messages[i], IMessage.<MASK><NEW_LINE>message.setUserInfo(new DefaultUser("0", "DeadPool", "R.drawable.deadpool"));<NEW_LINE>} else {<NEW_LINE>message = new MyMessage(messages[i], IMessage.MessageType.SEND_TEXT.ordinal());<NEW_LINE>message.setUserInfo(new DefaultUser("1", "IronMan", "R.drawable.ironman"));<NEW_LINE>}<NEW_LINE>message.setTimeString(new SimpleDateFormat("HH:mm", Locale.getDefault()).format(new Date()));<NEW_LINE>list.add(message);<NEW_LINE>}<NEW_LINE>// Collections.reverse(list);<NEW_LINE>// MessageList 0.7.2 add this method, add messages chronologically.<NEW_LINE>mAdapter.addToEndChronologically(list);<NEW_LINE>mChatView.getPtrLayout().refreshComplete();<NEW_LINE>}<NEW_LINE>}, 1500);<NEW_LINE>} | MessageType.RECEIVE_TEXT.ordinal()); |
1,178,520 | private void writeChunkToOutputStream(byte[] chunk, int offset, int length) {<NEW_LINE>if (compressor == null && !dwrfEncryptor.isPresent()) {<NEW_LINE>compressedOutputStream.write(chunk, offset, length);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>checkArgument(length <= maxBufferSize, "Write chunk length must be less than max compression buffer size");<NEW_LINE>boolean isCompressed = false;<NEW_LINE>byte[] compressionBuffer = null;<NEW_LINE>try {<NEW_LINE>if (compressor != null && length >= minCompressibleSize) {<NEW_LINE>int minCompressionBufferSize = compressor.maxCompressedLength(length);<NEW_LINE>compressionBuffer = compressionBufferPool.checkOut(minCompressionBufferSize);<NEW_LINE>int compressedSize = compressor.compress(chunk, offset, length, compressionBuffer, 0, compressionBuffer.length);<NEW_LINE>if (compressedSize < length) {<NEW_LINE>isCompressed = true;<NEW_LINE>chunk = compressionBuffer;<NEW_LINE>length = compressedSize;<NEW_LINE>offset = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dwrfEncryptor.isPresent()) {<NEW_LINE>chunk = dwrfEncryptor.get().encrypt(chunk, offset, length);<NEW_LINE>length = chunk.length;<NEW_LINE>offset = 0;<NEW_LINE>// size after encryption should not exceed what the 3 byte header can hold (2^23)<NEW_LINE>if (length > 8388608) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>int header = isCompressed ? length << 1 : (length << 1) + 1;<NEW_LINE>writeChunkedOutput(chunk, offset, length, header);<NEW_LINE>} finally {<NEW_LINE>if (compressionBuffer != null) {<NEW_LINE>compressionBufferPool.checkIn(compressionBuffer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | throw new OrcEncryptionException("Encrypted data size %s exceeds limit of 2^23", length); |
1,302,614 | public void run() {<NEW_LINE>log.info("Running {}", getName());<NEW_LINE>try {<NEW_LINE>lockUniverseForUpdate(getUniverse().version);<NEW_LINE>XClusterConfig xClusterConfig = getXClusterConfig();<NEW_LINE>if (xClusterConfig.status != XClusterConfigStatusType.Init) {<NEW_LINE>throw new RuntimeException(String.format("XClusterConfig(%s) must be in `Init` state to create", xClusterConfig.uuid));<NEW_LINE>}<NEW_LINE>createXClusterConfigSetupTask().setSubTaskGroupType(UserTaskDetails.SubTaskGroupType.ConfigureUniverse);<NEW_LINE>createMarkUniverseUpdateSuccessTasks().<MASK><NEW_LINE>getRunnableTask().runSubTasks();<NEW_LINE>setXClusterConfigStatus(XClusterConfigStatusType.Running);<NEW_LINE>} catch (Exception e) {<NEW_LINE>setXClusterConfigStatus(XClusterConfigStatusType.Failed);<NEW_LINE>log.error("{} hit error : {}", getName(), e.getMessage());<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} finally {<NEW_LINE>unlockUniverseForUpdate();<NEW_LINE>}<NEW_LINE>log.info("Completed {}", getName());<NEW_LINE>} | setSubTaskGroupType(UserTaskDetails.SubTaskGroupType.ConfigureUniverse); |
1,826,312 | public static void main(String[] args) {<NEW_LINE>try {<NEW_LINE>ReladomoConnectionManager.getInstance().createTables();<NEW_LINE>} catch (Exception e1) {<NEW_LINE>e1.printStackTrace();<NEW_LINE>}<NEW_LINE>MithraManager mithraManager = MithraManagerProvider.getMithraManager();<NEW_LINE>mithraManager.setTransactionTimeout(120);<NEW_LINE>try (InputStream is = ReladomoApplication.class.getClassLoader().getResourceAsStream("ReladomoRuntimeConfig.xml")) {<NEW_LINE>MithraManagerProvider.<MASK><NEW_LINE>Department department = new Department(1, "IT");<NEW_LINE>Employee employee = new Employee(1, "John");<NEW_LINE>department.getEmployees().add(employee);<NEW_LINE>department.cascadeInsert();<NEW_LINE>Department depFound = DepartmentFinder.findByPrimaryKey(1);<NEW_LINE>System.out.println("Department Name:" + department.getName());<NEW_LINE>Employee empFound = EmployeeFinder.findOne(EmployeeFinder.name().eq("John"));<NEW_LINE>System.out.println("Employee Id:" + empFound.getId());<NEW_LINE>empFound.setName("Steven");<NEW_LINE>empFound.delete();<NEW_LINE>Department depDetached = DepartmentFinder.findByPrimaryKey(1).getDetachedCopy();<NEW_LINE>mithraManager.executeTransactionalCommand(tx -> {<NEW_LINE>Department dep = new Department(2, "HR");<NEW_LINE>Employee emp = new Employee(2, "Jim");<NEW_LINE>dep.getEmployees().add(emp);<NEW_LINE>dep.cascadeInsert();<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>} catch (java.io.IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | getMithraManager().readConfiguration(is); |
137,931 | public void itemClick(int position) {<NEW_LINE>if (adapter.isMultipleSelect()) {<NEW_LINE>adapter.toggleSelection(position);<NEW_LINE>List<MegaNode> selectedNodes = adapter.getSelectedNodes();<NEW_LINE>if (selectedNodes.size() > 0) {<NEW_LINE>updateActionModeTitle();<NEW_LINE>}<NEW_LINE>} else if (nodes.get(position).isFolder()) {<NEW_LINE>managerActivity.hideTabs(true, INCOMING_TAB);<NEW_LINE>managerActivity.increaseDeepBrowserTreeIncoming();<NEW_LINE>logDebug("Is folder deep: " + managerActivity.deepBrowserTreeIncoming);<NEW_LINE>MegaNode <MASK><NEW_LINE>int lastFirstVisiblePosition = 0;<NEW_LINE>if (managerActivity.isList) {<NEW_LINE>lastFirstVisiblePosition = mLayoutManager.findFirstCompletelyVisibleItemPosition();<NEW_LINE>} else {<NEW_LINE>lastFirstVisiblePosition = ((NewGridRecyclerView) recyclerView).findFirstCompletelyVisibleItemPosition();<NEW_LINE>if (lastFirstVisiblePosition == -1) {<NEW_LINE>lastFirstVisiblePosition = ((NewGridRecyclerView) recyclerView).findFirstVisibleItemPosition();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastPositionStack.push(lastFirstVisiblePosition);<NEW_LINE>managerActivity.setParentHandleIncoming(n.getHandle());<NEW_LINE>managerActivity.supportInvalidateOptionsMenu();<NEW_LINE>managerActivity.setToolbarTitle();<NEW_LINE>nodes = megaApi.getChildren(nodes.get(position), sortOrderManagement.getOrderCloud());<NEW_LINE>adapter.setNodes(nodes);<NEW_LINE>recyclerView.scrollToPosition(0);<NEW_LINE>visibilityFastScroller();<NEW_LINE>setEmptyView();<NEW_LINE>checkScroll();<NEW_LINE>managerActivity.showFabButton();<NEW_LINE>} else {<NEW_LINE>openFile(nodes.get(position), INCOMING_SHARES_ADAPTER, position);<NEW_LINE>}<NEW_LINE>} | n = nodes.get(position); |
948,783 | public static Trades adaptTrades(List<YoBitTrade> ctrades, CurrencyPair currencyPair) {<NEW_LINE>List<Trade> trades = new ArrayList<>(ctrades.size());<NEW_LINE>int lastTrade = 0;<NEW_LINE>for (int i = 0; i < ctrades.size(); i++) {<NEW_LINE>YoBitTrade <MASK><NEW_LINE>OrderType type = trade.getType().equals("bid") ? OrderType.BID : OrderType.ASK;<NEW_LINE>Trade t = new Trade.Builder().type(type).originalAmount(trade.getAmount()).currencyPair(currencyPair).price(trade.getPrice()).timestamp(parseDate(trade.getTimestamp())).id(String.valueOf(trade.getTid())).build();<NEW_LINE>trades.add(t);<NEW_LINE>lastTrade = i;<NEW_LINE>}<NEW_LINE>return new Trades(trades, ctrades.get(lastTrade).getTid(), TradeSortType.SortByID);<NEW_LINE>} | trade = ctrades.get(i); |
1,624,176 | static EnvoyServerProtoData.Listener parseServerSideListener(Listener proto, Set<String> rdsResources, TlsContextManager tlsContextManager, FilterRegistry filterRegistry, Set<String> certProviderInstances, boolean parseHttpFilter) throws ResourceInvalidException {<NEW_LINE>if (!proto.getTrafficDirection().equals(TrafficDirection.INBOUND)) {<NEW_LINE>throw new ResourceInvalidException("Listener " + proto.getName() + " with invalid traffic direction: " + proto.getTrafficDirection());<NEW_LINE>}<NEW_LINE>if (!proto.getListenerFiltersList().isEmpty()) {<NEW_LINE>throw new ResourceInvalidException("Listener " + proto.getName() + " cannot have listener_filters");<NEW_LINE>}<NEW_LINE>if (proto.hasUseOriginalDst()) {<NEW_LINE>throw new ResourceInvalidException("Listener " + proto.getName() + " cannot have use_original_dst set to true");<NEW_LINE>}<NEW_LINE>String address = null;<NEW_LINE>if (proto.getAddress().hasSocketAddress()) {<NEW_LINE>SocketAddress socketAddress = proto<MASK><NEW_LINE>address = socketAddress.getAddress();<NEW_LINE>switch(socketAddress.getPortSpecifierCase()) {<NEW_LINE>case NAMED_PORT:<NEW_LINE>address = address + ":" + socketAddress.getNamedPort();<NEW_LINE>break;<NEW_LINE>case PORT_VALUE:<NEW_LINE>address = address + ":" + socketAddress.getPortValue();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ImmutableList.Builder<FilterChain> filterChains = ImmutableList.builder();<NEW_LINE>Set<FilterChainMatch> uniqueSet = new HashSet<>();<NEW_LINE>for (io.envoyproxy.envoy.config.listener.v3.FilterChain fc : proto.getFilterChainsList()) {<NEW_LINE>filterChains.add(parseFilterChain(fc, rdsResources, tlsContextManager, filterRegistry, uniqueSet, certProviderInstances, parseHttpFilter));<NEW_LINE>}<NEW_LINE>FilterChain defaultFilterChain = null;<NEW_LINE>if (proto.hasDefaultFilterChain()) {<NEW_LINE>defaultFilterChain = parseFilterChain(proto.getDefaultFilterChain(), rdsResources, tlsContextManager, filterRegistry, null, certProviderInstances, parseHttpFilter);<NEW_LINE>}<NEW_LINE>return EnvoyServerProtoData.Listener.create(proto.getName(), address, filterChains.build(), defaultFilterChain);<NEW_LINE>} | .getAddress().getSocketAddress(); |
1,213,277 | public static List<TopicRequestTimeVO> convert2TopicRequestTimeMetricsVOList(List<TopicMetricsDO> metricsList) {<NEW_LINE>List<TopicRequestTimeVO> voList = new ArrayList<>();<NEW_LINE>for (TopicMetricsDO elem : metricsList) {<NEW_LINE>TopicRequestTimeVO vo = new TopicRequestTimeVO();<NEW_LINE>TopicMetrics metrics = MetricsConvertUtils.convert2TopicMetrics(elem);<NEW_LINE>vo.setProduceRequestTimeMean(metrics.getSpecifiedMetrics("ProduceTotalTimeMsMean"));<NEW_LINE>vo.setProduceRequestTime50thPercentile(metrics.getSpecifiedMetrics("ProduceTotalTimeMs50thPercentile"));<NEW_LINE>vo.setProduceRequestTime75thPercentile(metrics.getSpecifiedMetrics("ProduceTotalTimeMs75thPercentile"));<NEW_LINE>vo.setProduceRequestTime95thPercentile<MASK><NEW_LINE>vo.setProduceRequestTime99thPercentile(metrics.getSpecifiedMetrics("ProduceTotalTimeMs99thPercentile"));<NEW_LINE>vo.setFetchRequestTimeMean(metrics.getSpecifiedMetrics("FetchConsumerTotalTimeMsMean"));<NEW_LINE>vo.setFetchRequestTime50thPercentile(metrics.getSpecifiedMetrics("FetchConsumerTotalTimeMs50thPercentile"));<NEW_LINE>vo.setFetchRequestTime75thPercentile(metrics.getSpecifiedMetrics("FetchConsumerTotalTimeMs75thPercentile"));<NEW_LINE>vo.setFetchRequestTime95thPercentile(metrics.getSpecifiedMetrics("FetchConsumerTotalTimeMs95thPercentile"));<NEW_LINE>vo.setFetchRequestTime99thPercentile(metrics.getSpecifiedMetrics("FetchConsumerTotalTimeMs99thPercentile"));<NEW_LINE>vo.setGmtCreate(metrics.getSpecifiedMetrics(JmxConstant.CREATE_TIME, Long.class));<NEW_LINE>voList.add(vo);<NEW_LINE>}<NEW_LINE>return voList;<NEW_LINE>} | (metrics.getSpecifiedMetrics("ProduceTotalTimeMs95thPercentile")); |
909,503 | public synchronized void changeInputScale() {<NEW_LINE>calib = new StereoParameters(origCalib);<NEW_LINE>double scale = control.inputScale / 100.0;<NEW_LINE>PerspectiveOps.scaleIntrinsic(calib.left, scale);<NEW_LINE>PerspectiveOps.scaleIntrinsic(calib.right, scale);<NEW_LINE>int w = (int) (origLeft.getWidth() * scale);<NEW_LINE>int h = (int) (origLeft.getHeight() * scale);<NEW_LINE>colorLeft = new BufferedImage(w, h, BufferedImage.TYPE_INT_BGR);<NEW_LINE>colorRight = new BufferedImage(w, h, BufferedImage.TYPE_INT_BGR);<NEW_LINE>colorLeft.createGraphics().drawImage(origLeft, AffineTransform.getScaleInstance(scale, scale), null);<NEW_LINE>colorRight.createGraphics().drawImage(origRight, AffineTransform.getScaleInstance(scale, scale), null);<NEW_LINE>inputLeft = activeAlg.getInputType().createImage(w, h);<NEW_LINE>inputRight = activeAlg.getInputType().createImage(w, h);<NEW_LINE>rectLeft = activeAlg.getInputType().createImage(w, h);<NEW_LINE>rectRight = activeAlg.getInputType().createImage(w, h);<NEW_LINE>ConvertBufferedImage.<MASK><NEW_LINE>ConvertBufferedImage.convertFrom(colorRight, inputRight, true);<NEW_LINE>// When the input image has changed automatically scale and center<NEW_LINE>imagePanel.autoScaleCenterOnSetImage = true;<NEW_LINE>imagePanel.setPreferredSize(new Dimension(inputLeft.width, inputLeft.height));<NEW_LINE>imagePanel.resetRoi();<NEW_LINE>rectifyInputImages();<NEW_LINE>BoofSwingUtil.invokeNowOrLater(() -> control.setImageSize(rectLeft.width, rectLeft.height));<NEW_LINE>processDisparity();<NEW_LINE>} | convertFrom(colorLeft, inputLeft, true); |
65,630 | protected void presentResponse(ResponseContainer response, boolean verbose) {<NEW_LINE>StringBuilder b = new StringBuilder();<NEW_LINE>boolean isFirst = true;<NEW_LINE>List<AspectCliPresenter> aspectPresenters = plugins.loadOrderedSpiInstances(AspectCliPresenter.class);<NEW_LINE>for (AspectCliPresenter presenter : aspectPresenters) {<NEW_LINE>for (ResponseAspect aspect : response.getAspects()) {<NEW_LINE>if (presenter.canHandleAspect(aspect) && (verbose || presenter.isPrimary())) {<NEW_LINE>if (!isFirst) {<NEW_LINE>b.append(System.lineSeparator());<NEW_LINE>b.<MASK><NEW_LINE>}<NEW_LINE>if (verbose) {<NEW_LINE>b.append(aspect.getName()).append(":").append(System.lineSeparator());<NEW_LINE>}<NEW_LINE>b.append(presenter.getStringRepresentation(aspect));<NEW_LINE>isFirst = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (isOption("less")) {<NEW_LINE>InputStream inputStream = IOUtils.toInputStream(b.toString());<NEW_LINE>Commands.less(TerminalUi.getTerminal(), inputStream, System.out, System.err, null, new String[] { "-" });<NEW_LINE>} else {<NEW_LINE>System.out.println(b.toString());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | append(System.lineSeparator()); |
1,113,802 | public static void toJSON(OutputWriter jsonOutputWriter, GoDashboardPipeline model, Username username) {<NEW_LINE>String usernameString = username.getUsername().toString();<NEW_LINE>jsonOutputWriter.addLinks(linksWriter -> addLinks(linksWriter, model)).add("name", model.name().toString()).add("last_updated_timestamp", model.getLastUpdatedTimeStamp()).add("locked", model.model().getLatestPipelineInstance().isCurrentlyLocked()).addChild("pause_info", getPauseInfoNEW(model)).add("can_operate", model.isPipelineOperator(usernameString)).add("can_administer", model.canBeAdministeredBy(usernameString)).add("can_unlock", model.canBeOperatedBy(usernameString)).add("can_pause", model.canBeOperatedBy(usernameString)).add("from_config_repo", !model.isLocal());<NEW_LINE>if (model.getTrackingTool().isPresent()) {<NEW_LINE>TrackingTool trackingTool = model.getTrackingTool().get();<NEW_LINE>jsonOutputWriter.addChild("tracking_tool", childWriter -> {<NEW_LINE>childWriter.add("regex", trackingTool.getRegex()).add(<MASK><NEW_LINE>});<NEW_LINE>}<NEW_LINE>jsonOutputWriter.addChild("_embedded", childWriter -> {<NEW_LINE>childWriter.addChildList("instances", writeInstances(model));<NEW_LINE>});<NEW_LINE>} | "link", trackingTool.getLink()); |
313,145 | protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbContext[] ejbContexts) throws AnnotationProcessorException {<NEW_LINE>Remove remove = (Remove) ainfo.getAnnotation();<NEW_LINE>for (EjbContext next : ejbContexts) {<NEW_LINE>EjbSessionDescriptor sessionDescriptor = (EjbSessionDescriptor) next.getDescriptor();<NEW_LINE>Method m = <MASK><NEW_LINE>MethodDescriptor removeMethod = new MethodDescriptor(m, MethodDescriptor.EJB_BEAN);<NEW_LINE>EjbRemovalInfo removalInfo = sessionDescriptor.getRemovalInfo(removeMethod);<NEW_LINE>if (removalInfo == null) {<NEW_LINE>// if this element is not defined in xml<NEW_LINE>// use all information from annotation<NEW_LINE>removalInfo = new EjbRemovalInfo();<NEW_LINE>removalInfo.setRemoveMethod(removeMethod);<NEW_LINE>removalInfo.setRetainIfException(remove.retainIfException());<NEW_LINE>sessionDescriptor.addRemoveMethod(removalInfo);<NEW_LINE>} else {<NEW_LINE>// if this element is already defined in xml<NEW_LINE>// set the retainIfException only if this subelement<NEW_LINE>// is not defined in xml<NEW_LINE>if (!removalInfo.isRetainIfExceptionSet()) {<NEW_LINE>removalInfo.setRetainIfException(remove.retainIfException());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return getDefaultProcessedResult();<NEW_LINE>} | (Method) ainfo.getAnnotatedElement(); |
1,795,510 | public Renderable createImage(JasperReportsContext jasperReportsContext, JRComponentElement componentElement, BarcodeGenerator barcode, String message) {<NEW_LINE>try {<NEW_LINE>ByteArrayOutputStream out = new ByteArrayOutputStream();<NEW_LINE>int resolution = JRPropertiesUtil.getInstance(jasperReportsContext).getIntegerProperty(componentElement, PROPERTY_RESOLUTION, 300);<NEW_LINE>boolean gray = JRPropertiesUtil.getInstance(jasperReportsContext).getBooleanProperty(componentElement, PROPERTY_GRAY, true);<NEW_LINE>boolean antiAlias = JRPropertiesUtil.getInstance(jasperReportsContext).getBooleanProperty(componentElement, PROPERTY_ANTIALIAS, true);<NEW_LINE>int imageType = gray ? BufferedImage.TYPE_BYTE_GRAY : BufferedImage.TYPE_BYTE_BINARY;<NEW_LINE>BitmapCanvasProvider provider = new BitmapCanvasProvider(out, "image/x-png", resolution, imageType, antiAlias, ((Barcode4jComponent) componentElement.getComponent()).getOrientationValue().getValue());<NEW_LINE>barcode.generateBarcode(provider, message);<NEW_LINE>provider.finish();<NEW_LINE>byte[<MASK><NEW_LINE>return SimpleDataRenderer.getInstance(imageData);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new JRRuntimeException(e);<NEW_LINE>}<NEW_LINE>} | ] imageData = out.toByteArray(); |
416,209 | public long handle(Emulator<?> emulator) {<NEW_LINE>RegisterContext context = emulator.getContext();<NEW_LINE>UnidbgPointer clazz = context.getPointerArg(1);<NEW_LINE>UnidbgPointer jmethodID = context.getPointerArg(2);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("CallStaticFloatMethod clazz=" + clazz + ", jmethodID=" + jmethodID);<NEW_LINE>}<NEW_LINE>DvmClass dvmClass = classMap.get(clazz.toIntPeer());<NEW_LINE>DvmMethod dvmMethod = dvmClass == null ? null : dvmClass.getStaticMethod(jmethodID.toIntPeer());<NEW_LINE>if (dvmMethod == null) {<NEW_LINE>throw new BackendException();<NEW_LINE>} else {<NEW_LINE>VarArg varArg = ArmVarArg.create(emulator, DalvikVM.this, dvmMethod);<NEW_LINE>float ret = dvmMethod.callStaticFloatMethod(varArg);<NEW_LINE>if (verbose) {<NEW_LINE>System.out.printf("JNIEnv->CallStaticFloatMethod(%s, %s(%s) => %s) was called from %s%n", dvmClass, dvmMethod.methodName, varArg.formatArgs(), ret, context.getLRPointer());<NEW_LINE>}<NEW_LINE>ByteBuffer <MASK><NEW_LINE>buffer.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>buffer.putFloat(ret);<NEW_LINE>buffer.flip();<NEW_LINE>return (buffer.getInt() & 0xffffffffL);<NEW_LINE>}<NEW_LINE>} | buffer = ByteBuffer.allocate(4); |
1,452,597 | private void init() {<NEW_LINE>if (!Setup.appSettings().getDrawerShowIndicator())<NEW_LINE>_scrollBar.setVisibility(View.GONE);<NEW_LINE>_scrollBar.setIndicator(new AlphabetIndicator(getContext()), true);<NEW_LINE>_scrollBar.setClipToPadding(true);<NEW_LINE>_scrollBar.setDraggableFromAnywhere(true);<NEW_LINE>_scrollBar.setHandleColor(Setup.<MASK><NEW_LINE>_gridDrawerAdapter = new AppDrawerGridAdapter();<NEW_LINE>if (getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {<NEW_LINE>setPortraitValue();<NEW_LINE>} else {<NEW_LINE>setLandscapeValue();<NEW_LINE>}<NEW_LINE>_recyclerView.setAdapter(_gridDrawerAdapter);<NEW_LINE>_recyclerView.setLayoutManager(_layoutManager);<NEW_LINE>_recyclerView.setDrawingCacheEnabled(true);<NEW_LINE>getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onGlobalLayout() {<NEW_LINE>getViewTreeObserver().removeOnGlobalLayoutListener(this);<NEW_LINE>_itemWidth = getWidth() / _layoutManager.getSpanCount();<NEW_LINE>_itemHeightPadding = Tool.dp2px(20);<NEW_LINE>updateAdapter(Setup.appLoader().getAllApps(getContext(), false));<NEW_LINE>Setup.appLoader().addUpdateListener(new AppUpdateListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onAppUpdated(List<App> apps) {<NEW_LINE>updateAdapter(apps);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | appSettings().getDrawerFastScrollColor()); |
333,101 | public void init() throws DBException {<NEW_LINE>Properties props = getProperties();<NEW_LINE>String url = <MASK><NEW_LINE>String bucket = props.getProperty(BUCKET_PROPERTY, "default");<NEW_LINE>String password = props.getProperty(PASSWORD_PROPERTY, "");<NEW_LINE>checkFutures = props.getProperty(CHECKF_PROPERTY, "true").equals("true");<NEW_LINE>useJson = props.getProperty(JSON_PROPERTY, "true").equals("true");<NEW_LINE>persistTo = parsePersistTo(props.getProperty(PERSIST_PROPERTY, "0"));<NEW_LINE>replicateTo = parseReplicateTo(props.getProperty(REPLICATE_PROPERTY, "0"));<NEW_LINE>designDoc = getProperties().getProperty(DESIGN_DOC_PROPERTY);<NEW_LINE>viewName = getProperties().getProperty(VIEW_PROPERTY);<NEW_LINE>stale = Stale.valueOf(getProperties().getProperty(STALE_PROPERTY, STALE_PROPERTY_DEFAULT).toUpperCase());<NEW_LINE>Double scanproportion = Double.valueOf(props.getProperty(SCAN_PROPERTY, SCAN_PROPERTY_DEFAULT));<NEW_LINE>Properties systemProperties = System.getProperties();<NEW_LINE>systemProperties.put("net.spy.log.LoggerImpl", "net.spy.memcached.compat.log.SLF4JLogger");<NEW_LINE>System.setProperties(systemProperties);<NEW_LINE>try {<NEW_LINE>client = new com.couchbase.client.CouchbaseClient(Arrays.asList(new URI(url)), bucket, password);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DBException("Could not create CouchbaseClient object.", e);<NEW_LINE>}<NEW_LINE>if (scanproportion > 0) {<NEW_LINE>try {<NEW_LINE>view = client.getView(designDoc, viewName);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DBException(String.format("%s=%s and %s=%s provided, unable to connect to view.", DESIGN_DOC_PROPERTY, designDoc, VIEW_PROPERTY, viewName), e.getCause());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | props.getProperty(URL_PROPERTY, "http://127.0.0.1:8091/pools"); |
1,725,272 | public Router socketHandler(Handler<SockJSSocket> sockHandler) {<NEW_LINE>router.route("/").useNormalizedPath(false).handler(rc -> {<NEW_LINE>if (LOG.isTraceEnabled())<NEW_LINE>LOG.trace("Returning welcome response");<NEW_LINE>rc.response().putHeader(HttpHeaders.CONTENT_TYPE, "text/plain; charset=UTF-8").end("Welcome to SockJS!\n");<NEW_LINE>});<NEW_LINE>// Iframe handlers<NEW_LINE>String iframeHTML = IFRAME_TEMPLATE.replace("{{ sockjs_url }}", options.getLibraryURL());<NEW_LINE>Handler<RoutingContext> iframeHandler = createIFrameHandler(iframeHTML);<NEW_LINE>// Request exactly for iframe.html<NEW_LINE>router.get("/iframe.html").handler(iframeHandler);<NEW_LINE>// Versioned<NEW_LINE>router.getWithRegex("\\/iframe-[^\\/]*\\.html").handler(iframeHandler);<NEW_LINE>// Chunking test<NEW_LINE>router.post("/chunking_test"<MASK><NEW_LINE>router.options("/chunking_test").handler(BaseTransport.createCORSOptionsHandler(options, "OPTIONS, POST"));<NEW_LINE>// Info<NEW_LINE>router.get("/info").handler(BaseTransport.createInfoHandler(options, VertxContextPRNG.current(vertx)));<NEW_LINE>router.options("/info").handler(BaseTransport.createCORSOptionsHandler(options, "OPTIONS, GET"));<NEW_LINE>// Transports<NEW_LINE>Set<String> enabledTransports = new HashSet<>();<NEW_LINE>enabledTransports.add(Transport.EVENT_SOURCE.toString());<NEW_LINE>enabledTransports.add(Transport.HTML_FILE.toString());<NEW_LINE>enabledTransports.add(Transport.JSON_P.toString());<NEW_LINE>enabledTransports.add(Transport.WEBSOCKET.toString());<NEW_LINE>enabledTransports.add(Transport.XHR.toString());<NEW_LINE>Set<String> disabledTransports = options.getDisabledTransports();<NEW_LINE>if (disabledTransports == null) {<NEW_LINE>disabledTransports = new HashSet<>();<NEW_LINE>}<NEW_LINE>enabledTransports.removeAll(disabledTransports);<NEW_LINE>if (enabledTransports.contains(Transport.XHR.toString())) {<NEW_LINE>new XhrTransport(vertx, router, sessions, options, sockHandler);<NEW_LINE>}<NEW_LINE>if (enabledTransports.contains(Transport.EVENT_SOURCE.toString())) {<NEW_LINE>new EventSourceTransport(vertx, router, sessions, options, sockHandler);<NEW_LINE>}<NEW_LINE>if (enabledTransports.contains(Transport.HTML_FILE.toString())) {<NEW_LINE>new HtmlFileTransport(vertx, router, sessions, options, sockHandler);<NEW_LINE>}<NEW_LINE>if (enabledTransports.contains(Transport.JSON_P.toString())) {<NEW_LINE>new JsonPTransport(vertx, router, sessions, options, sockHandler);<NEW_LINE>}<NEW_LINE>if (enabledTransports.contains(Transport.WEBSOCKET.toString())) {<NEW_LINE>new WebSocketTransport(vertx, router, sessions, options, sockHandler);<NEW_LINE>new RawWebSocketTransport(vertx, router, options, sockHandler);<NEW_LINE>}<NEW_LINE>return router;<NEW_LINE>} | ).handler(createChunkingTestHandler()); |
469,577 | static Op04StructuredStatement buildNestedBlocks(List<Op04StructuredStatement> containers) {<NEW_LINE>Stack<BlockIdentifier> blocksCurrentlyIn = StackFactory.newStack();<NEW_LINE>LinkedList<Op04StructuredStatement> outerBlock = ListFactory.newLinkedList();<NEW_LINE>Stack<StackedBlock> stackedBlocks = StackFactory.newStack();<NEW_LINE>MutableProcessingBlockState mutableProcessingBlockState = new MutableProcessingBlockState();<NEW_LINE>mutableProcessingBlockState.currentBlock = outerBlock;<NEW_LINE>for (Op04StructuredStatement container : containers) {<NEW_LINE>Set<BlockIdentifier> endOfTheseBlocks = getEndingBlocks(blocksCurrentlyIn, container.blockMembership);<NEW_LINE>if (!endOfTheseBlocks.isEmpty()) {<NEW_LINE>processEndingBlocks(endOfTheseBlocks, blocksCurrentlyIn, stackedBlocks, mutableProcessingBlockState);<NEW_LINE>}<NEW_LINE>BlockIdentifier startsThisBlock = getStartingBlocks(blocksCurrentlyIn, container.blockMembership);<NEW_LINE>if (startsThisBlock != null) {<NEW_LINE>logger.fine("Starting block " + startsThisBlock);<NEW_LINE>BlockType blockType = startsThisBlock.getBlockType();<NEW_LINE>// A bit confusing. StartBlock for a while loop is the test.<NEW_LINE>// StartBlock for conditionals is the first element of the conditional.<NEW_LINE>// I need to refactor this......<NEW_LINE>Op04StructuredStatement blockClaimer = mutableProcessingBlockState.currentBlock.getLast();<NEW_LINE>stackedBlocks.push(new StackedBlock(mutableProcessingBlockState.currentBlockIdentifier<MASK><NEW_LINE>mutableProcessingBlockState.currentBlock = ListFactory.newLinkedList();<NEW_LINE>mutableProcessingBlockState.currentBlockIdentifier = startsThisBlock;<NEW_LINE>blocksCurrentlyIn.push(mutableProcessingBlockState.currentBlockIdentifier);<NEW_LINE>}<NEW_LINE>container.informBlockMembership(blocksCurrentlyIn);<NEW_LINE>mutableProcessingBlockState.currentBlock.add(container);<NEW_LINE>}<NEW_LINE>if (!stackedBlocks.isEmpty()) {<NEW_LINE>processEndingBlocks(SetFactory.newSet(blocksCurrentlyIn), blocksCurrentlyIn, stackedBlocks, mutableProcessingBlockState);<NEW_LINE>}<NEW_LINE>Block result = new Block(outerBlock, true);<NEW_LINE>return new Op04StructuredStatement(result);<NEW_LINE>} | , mutableProcessingBlockState.currentBlock, blockClaimer)); |
1,067,207 | public okhttp3.Call deployAPIProductRevisionCall(String apiProductId, String revisionId, List<APIRevisionDeploymentDTO> apIRevisionDeploymentDTO, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = apIRevisionDeploymentDTO;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api-products/{apiProductId}/deploy-revision".replaceAll("\\{" + "apiProductId" + "\\}", localVarApiClient.escapeString(apiProductId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (revisionId != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("revisionId", revisionId));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new <MASK><NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | HashMap<String, Object>(); |
632,878 | public void marshall(TableDescription tableDescription, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (tableDescription == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(tableDescription.getAttributeDefinitions(), ATTRIBUTEDEFINITIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getTableName(), TABLENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getKeySchema(), KEYSCHEMA_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getTableStatus(), TABLESTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getCreationDateTime(), CREATIONDATETIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getProvisionedThroughput(), PROVISIONEDTHROUGHPUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getTableSizeBytes(), TABLESIZEBYTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getItemCount(), ITEMCOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getTableArn(), TABLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(tableDescription.getBillingModeSummary(), BILLINGMODESUMMARY_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getLocalSecondaryIndexes(), LOCALSECONDARYINDEXES_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getGlobalSecondaryIndexes(), GLOBALSECONDARYINDEXES_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getStreamSpecification(), STREAMSPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getLatestStreamLabel(), LATESTSTREAMLABEL_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getLatestStreamArn(), LATESTSTREAMARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getGlobalTableVersion(), GLOBALTABLEVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getReplicas(), REPLICAS_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getRestoreSummary(), RESTORESUMMARY_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getSSEDescription(), SSEDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getArchivalSummary(), ARCHIVALSUMMARY_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableDescription.getTableClassSummary(), TABLECLASSSUMMARY_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | tableDescription.getTableId(), TABLEID_BINDING); |
1,841,111 | public static void drawBlockOverlayArrow(Matrix4f transform, MultiBufferSource buffers, Vec3 directionVec, Direction side, AABB targetedBB) {<NEW_LINE>Vec3[] translatedPositions = new Vec3[arrowCoords.length];<NEW_LINE>Matrix4 mat = new Matrix4();<NEW_LINE>Vec3 defaultDir = side.getAxis() == Axis.Y ? new Vec3(0, 0, 1) : new Vec3(0, 1, 0);<NEW_LINE>directionVec = directionVec.normalize();<NEW_LINE>double angle = Math.acos<MASK><NEW_LINE>Vec3 axis = defaultDir.cross(directionVec);<NEW_LINE>mat.rotate(angle, axis.x, axis.y, axis.z);<NEW_LINE>if (side.getAxis() == Axis.Z)<NEW_LINE>mat.rotate(Math.PI / 2, 1, 0, 0).rotate(Math.PI, 0, 1, 0);<NEW_LINE>else if (side.getAxis() == Axis.X)<NEW_LINE>mat.rotate(Math.PI / 2, 0, 0, 1).rotate(Math.PI / 2, 0, 1, 0);<NEW_LINE>for (int i = 0; i < translatedPositions.length; i++) {<NEW_LINE>Vec3 vec = mat.apply(new Vec3(arrowCoords[i][0], 0, arrowCoords[i][1])).add(.5, .5, .5);<NEW_LINE>if (targetedBB != null)<NEW_LINE>vec = new Vec3(side == Direction.WEST ? targetedBB.minX - .002 : side == Direction.EAST ? targetedBB.maxX + .002 : vec.x, side == Direction.DOWN ? targetedBB.minY - .002 : side == Direction.UP ? targetedBB.maxY + .002 : vec.y, side == Direction.NORTH ? targetedBB.minZ - .002 : side == Direction.SOUTH ? targetedBB.maxZ + .002 : vec.z);<NEW_LINE>translatedPositions[i] = vec;<NEW_LINE>}<NEW_LINE>VertexConsumer triBuilder = buffers.getBuffer(IERenderTypes.TRANSLUCENT_TRIANGLES);<NEW_LINE>Vec3 center = translatedPositions[0];<NEW_LINE>for (int i = 2; i < translatedPositions.length; i++) {<NEW_LINE>Vec3 point = translatedPositions[i];<NEW_LINE>Vec3 prevPoint = translatedPositions[i - 1];<NEW_LINE>for (Vec3 p : new Vec3[] { center, prevPoint, point }) triBuilder.vertex(transform, (float) p.x, (float) p.y, (float) p.z).color(Lib.COLOUR_F_ImmersiveOrange[0], Lib.COLOUR_F_ImmersiveOrange[1], Lib.COLOUR_F_ImmersiveOrange[2], 0.4F).endVertex();<NEW_LINE>}<NEW_LINE>VertexConsumer lineBuilder = buffers.getBuffer(IERenderTypes.TRANSLUCENT_LINES);<NEW_LINE>for (int i = 0; i <= translatedPositions.length; i++) {<NEW_LINE>Vec3 point = translatedPositions[i % translatedPositions.length];<NEW_LINE>int max = i == 0 || i == translatedPositions.length ? 1 : 2;<NEW_LINE>for (int j = 0; j < max; ++j) lineBuilder.vertex(transform, (float) point.x, (float) point.y, (float) point.z).color(0, 0, 0, 0.4F).endVertex();<NEW_LINE>}<NEW_LINE>} | (defaultDir.dot(directionVec)); |
674,372 | void doUpgrade(WalletAccount accountToUpgrade, InMemoryPrivateKey privateKey) {<NEW_LINE>final InMemoryPrivateKey key = privateKey;<NEW_LINE>final WalletAccount accToUpgrade = accountToUpgrade;<NEW_LINE>// scanned the private key of a watch only single address account<NEW_LINE>final String existingAccountName = _mbwManager.getMetadataStorage().getLabelByAccount(accountToUpgrade.getId());<NEW_LINE>new AlertDialog.Builder(AddAdvancedAccountActivity.this).setTitle(R.string.priv_key_of_watch_only_account).setMessage(getString(R.string.want_to_add_priv_key_to_watch_account, existingAccountName)).setNegativeButton(R.string.cancel, (dialogInterface, i) -> finishAlreadyExist(accToUpgrade.getReceiveAddress())).setPositiveButton(R.string.ok, (dialogInterface, i) -> {<NEW_LINE>UUID accountId = accToUpgrade.getId();<NEW_LINE>WalletManager <MASK><NEW_LINE>walletManager.deleteAccount(accToUpgrade.getId());<NEW_LINE>if (accToUpgrade instanceof SingleAddressAccount) {<NEW_LINE>accountId = walletManager.createAccounts(new PrivateSingleConfig(key, AesKeyCipher.defaultKeyCipher(), existingAccountName)).get(0);<NEW_LINE>} else {<NEW_LINE>walletManager.createAccounts(new PrivateColuConfig(key, (ColuMain) accToUpgrade.getCoinType(), AesKeyCipher.defaultKeyCipher()));<NEW_LINE>}<NEW_LINE>finishOk(accountId, true);<NEW_LINE>}).create().show();<NEW_LINE>} | walletManager = _mbwManager.getWalletManager(false); |
31,467 | private SettingsGroup makeDeobfuscationGroup() {<NEW_LINE>JCheckBox deobfOn = new JCheckBox();<NEW_LINE>deobfOn.setSelected(settings.isDeobfuscationOn());<NEW_LINE>deobfOn.addItemListener(e -> {<NEW_LINE>settings.setDeobfuscationOn(e.getStateChange() == ItemEvent.SELECTED);<NEW_LINE>needReload();<NEW_LINE>});<NEW_LINE>SpinnerNumberModel minLenModel = new SpinnerNumberModel(settings.getDeobfuscationMinLength(), 0, Integer.MAX_VALUE, 1);<NEW_LINE>JSpinner minLenSpinner = new JSpinner(minLenModel);<NEW_LINE>minLenSpinner.addChangeListener(e -> {<NEW_LINE>settings.setDeobfuscationMinLength((Integer) minLenSpinner.getValue());<NEW_LINE>needReload();<NEW_LINE>});<NEW_LINE>SpinnerNumberModel maxLenModel = new SpinnerNumberModel(settings.getDeobfuscationMaxLength(), 0, Integer.MAX_VALUE, 1);<NEW_LINE>JSpinner maxLenSpinner = new JSpinner(maxLenModel);<NEW_LINE>maxLenSpinner.addChangeListener(e -> {<NEW_LINE>settings.setDeobfuscationMaxLength((Integer) maxLenSpinner.getValue());<NEW_LINE>needReload();<NEW_LINE>});<NEW_LINE>JCheckBox deobfSourceAlias = new JCheckBox();<NEW_LINE>deobfSourceAlias.setSelected(settings.isDeobfuscationUseSourceNameAsAlias());<NEW_LINE>deobfSourceAlias.addItemListener(e -> {<NEW_LINE>settings.setDeobfuscationUseSourceNameAsAlias(e.getStateChange() == ItemEvent.SELECTED);<NEW_LINE>needReload();<NEW_LINE>});<NEW_LINE>JCheckBox deobfKotlinMetadata = new JCheckBox();<NEW_LINE>deobfKotlinMetadata.setSelected(settings.isDeobfuscationParseKotlinMetadata());<NEW_LINE>deobfKotlinMetadata.addItemListener(e -> {<NEW_LINE>settings.setDeobfuscationParseKotlinMetadata(e.getStateChange() == ItemEvent.SELECTED);<NEW_LINE>needReload();<NEW_LINE>});<NEW_LINE>JComboBox<DeobfuscationMapFileMode> deobfMapFileModeCB = new JComboBox<>(DeobfuscationMapFileMode.values());<NEW_LINE>deobfMapFileModeCB.setSelectedItem(settings.getDeobfuscationMapFileMode());<NEW_LINE>deobfMapFileModeCB.addActionListener(e -> {<NEW_LINE>DeobfuscationMapFileMode newValue = <MASK><NEW_LINE>if (newValue != settings.getDeobfuscationMapFileMode()) {<NEW_LINE>settings.setDeobfuscationMapFileMode(newValue);<NEW_LINE>needReload();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>SettingsGroup deobfGroup = new SettingsGroup(NLS.str("preferences.deobfuscation"));<NEW_LINE>deobfGroup.addRow(NLS.str("preferences.deobfuscation_on"), deobfOn);<NEW_LINE>deobfGroup.addRow(NLS.str("preferences.deobfuscation_min_len"), minLenSpinner);<NEW_LINE>deobfGroup.addRow(NLS.str("preferences.deobfuscation_max_len"), maxLenSpinner);<NEW_LINE>deobfGroup.addRow(NLS.str("preferences.deobfuscation_source_alias"), deobfSourceAlias);<NEW_LINE>deobfGroup.addRow(NLS.str("preferences.deobfuscation_kotlin_metadata"), deobfKotlinMetadata);<NEW_LINE>deobfGroup.addRow(NLS.str("preferences.deobfuscation_map_file_mode"), deobfMapFileModeCB);<NEW_LINE>deobfGroup.end();<NEW_LINE>Collection<JComponent> connectedComponents = Arrays.asList(minLenSpinner, maxLenSpinner, deobfSourceAlias, deobfKotlinMetadata);<NEW_LINE>deobfOn.addItemListener(e -> enableComponentList(connectedComponents, e.getStateChange() == ItemEvent.SELECTED));<NEW_LINE>enableComponentList(connectedComponents, settings.isDeobfuscationOn());<NEW_LINE>return deobfGroup;<NEW_LINE>} | (DeobfuscationMapFileMode) deobfMapFileModeCB.getSelectedItem(); |
1,502,781 | public Builder mergeFrom(io.kubernetes.client.proto.V1.ConfigMapProjection other) {<NEW_LINE>if (other == io.kubernetes.client.proto.V1.ConfigMapProjection.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (other.hasLocalObjectReference()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (itemsBuilder_ == null) {<NEW_LINE>if (!other.items_.isEmpty()) {<NEW_LINE>if (items_.isEmpty()) {<NEW_LINE>items_ = other.items_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>} else {<NEW_LINE>ensureItemsIsMutable();<NEW_LINE>items_.addAll(other.items_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.items_.isEmpty()) {<NEW_LINE>if (itemsBuilder_.isEmpty()) {<NEW_LINE>itemsBuilder_.dispose();<NEW_LINE>itemsBuilder_ = null;<NEW_LINE>items_ = other.items_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>itemsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getItemsFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE>itemsBuilder_.addAllMessages(other.items_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (other.hasOptional()) {<NEW_LINE>setOptional(other.getOptional());<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>} | mergeLocalObjectReference(other.getLocalObjectReference()); |
953,831 | private RefactoringStatus initialize(JavaRefactoringArguments arguments) {<NEW_LINE>final String selection = arguments.getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION);<NEW_LINE>if (selection != null) {<NEW_LINE>int offset = -1;<NEW_LINE>int length = -1;<NEW_LINE>final StringTokenizer tokenizer = new StringTokenizer(selection);<NEW_LINE>if (tokenizer.hasMoreTokens()) {<NEW_LINE>offset = Integer.valueOf(tokenizer.nextToken()).intValue();<NEW_LINE>}<NEW_LINE>if (tokenizer.hasMoreTokens()) {<NEW_LINE>length = Integer.valueOf(tokenizer.nextToken()).intValue();<NEW_LINE>}<NEW_LINE>if (offset >= 0 && length >= 0) {<NEW_LINE>fSelectionStart = offset;<NEW_LINE>fSelectionLength = length;<NEW_LINE>} else {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION));<NEW_LINE>}<NEW_LINE>final String handle = arguments.getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);<NEW_LINE>if (handle != null) {<NEW_LINE>final IJavaElement element = JavaRefactoringDescriptorUtil.handleToElement(arguments.getProject(), handle, false);<NEW_LINE>if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT) {<NEW_LINE>return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, getName(), IJavaRefactorings.EXTRACT_CONSTANT);<NEW_LINE>} else {<NEW_LINE>fCu = (ICompilationUnit) element;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));<NEW_LINE>}<NEW_LINE>final String visibility = arguments.getAttribute(ATTRIBUTE_VISIBILITY);<NEW_LINE>if (visibility != null && !"".equals(visibility)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>int flag = 0;<NEW_LINE>try {<NEW_LINE>flag = Integer.parseInt(visibility);<NEW_LINE>} catch (NumberFormatException exception) {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ATTRIBUTE_VISIBILITY));<NEW_LINE>}<NEW_LINE>fVisibility = JdtFlags.getVisibilityString(flag);<NEW_LINE>}<NEW_LINE>final String name = arguments.getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);<NEW_LINE>if (name != null && !"".equals(name)) {<NEW_LINE>fConstantName = name;<NEW_LINE>} else {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));<NEW_LINE>}<NEW_LINE>final String replace = arguments.getAttribute(ATTRIBUTE_REPLACE);<NEW_LINE>if (replace != null) {<NEW_LINE>fReplaceAllOccurrences = Boolean.valueOf(replace).booleanValue();<NEW_LINE>} else {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ATTRIBUTE_REPLACE));<NEW_LINE>}<NEW_LINE>final String declareFinal = arguments.getAttribute(ATTRIBUTE_QUALIFY);<NEW_LINE>if (declareFinal != null) {<NEW_LINE>fQualifyReferencesWithDeclaringClassName = Boolean.valueOf(declareFinal).booleanValue();<NEW_LINE>} else {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ATTRIBUTE_QUALIFY));<NEW_LINE>}<NEW_LINE>return new RefactoringStatus();<NEW_LINE>} | selection, JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION })); |
1,431,983 | public void fortunesHandler(final RoutingContext ctx) {<NEW_LINE>client.preparedQuery(SELECT_FORTUNE).execute(ar -> {<NEW_LINE>if (ar.succeeded()) {<NEW_LINE>final RowIterator<Row> resultSet = ar.result().iterator();<NEW_LINE>if (!resultSet.hasNext()) {<NEW_LINE>ctx.fail(404);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<Fortune> <MASK><NEW_LINE>while (resultSet.hasNext()) {<NEW_LINE>final Row row = resultSet.next();<NEW_LINE>fortunes.add(new Fortune(row.getInteger(0), row.getString(1)));<NEW_LINE>}<NEW_LINE>fortunes.add(new Fortune(0, "Additional fortune added at request time."));<NEW_LINE>Collections.sort(fortunes);<NEW_LINE>ctx.put("fortunes", fortunes);<NEW_LINE>// and now delegate to the engine to render it.<NEW_LINE>engine.render(ctx.data(), "templates/Fortunes.rocker.html", res -> {<NEW_LINE>if (res.succeeded()) {<NEW_LINE>ctx.response().putHeader(HttpHeaders.SERVER, SERVER).putHeader(HttpHeaders.DATE, date).putHeader(HttpHeaders.CONTENT_TYPE, "text/html; charset=UTF-8").end(res.result());<NEW_LINE>} else {<NEW_LINE>ctx.fail(res.cause());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>ctx.fail(ar.cause());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | fortunes = new ArrayList<>(); |
1,356,393 | private JTextArea createLogPanel(JComboBox<Level> logFilter) {<NEW_LINE>JTextArea logTextArea = new JTextArea();<NEW_LINE>logTextArea.setEditable(false);<NEW_LINE>// Hook into live data from the circular log buffer and update the initial state.<NEW_LINE>Function<CircularLogBufferHandler.ImmutableLogRecord, String> formatter = new LogRecordFormatter();<NEW_LINE>CircularLogBufferHandler.LogUpdateListener updater = records -> {<NEW_LINE>// Create an immutable copy of the logs to display in the gui thread.<NEW_LINE>ArrayList<CircularLogBufferHandler.ImmutableLogRecord> clonedCopy = new ArrayList<>(records);<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>Level level = (Level) Objects.requireNonNull(logFilter.getSelectedItem());<NEW_LINE>String logContent = clonedCopy.stream().filter(record -> record.getLevel().intValue() >= level.intValue()).map(formatter).collect(Collectors.joining("\n"));<NEW_LINE>logTextArea.setText(logContent);<NEW_LINE>});<NEW_LINE>};<NEW_LINE>var logBuffer = <MASK><NEW_LINE>// Update state on filter change.<NEW_LINE>logFilter.addActionListener(e -> {<NEW_LINE>updater.accept(logBuffer.getLogRecords());<NEW_LINE>});<NEW_LINE>// Subscribe to log events and update state only when actually displayed.<NEW_LINE>logTextArea.addHierarchyListener((HierarchyEvent e) -> {<NEW_LINE>if (e.getComponent() == logTextArea && (e.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0) {<NEW_LINE>if (logTextArea.isDisplayable()) {<NEW_LINE>logBuffer.addUpdateListener(updater);<NEW_LINE>updater.accept(logBuffer.getLogRecords());<NEW_LINE>} else {<NEW_LINE>logBuffer.removeUpdateListener(updater);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return logTextArea;<NEW_LINE>} | Objects.requireNonNull(LoggerFactory.circularBuffer); |
1,356,488 | public void init(ClassProperties properties) {<NEW_LINE>String platform = properties.getProperty("platform");<NEW_LINE>List<String> preloadpaths = properties.get("platform.preloadpath");<NEW_LINE>String ucrtsdkdir = System.getenv("UniversalCRTSdkDir");<NEW_LINE>String ucrtversion = System.getenv("UCRTVersion");<NEW_LINE>if (ucrtsdkdir != null && ucrtsdkdir.length() > 0 && ucrtversion != null && ucrtversion.length() > 0) {<NEW_LINE>switch(platform) {<NEW_LINE>case "windows-x86":<NEW_LINE>preloadpaths.add(0, ucrtsdkdir + "\\Redist\\" + ucrtversion + "\\ucrt\\DLLs\\x86");<NEW_LINE>break;<NEW_LINE>case "windows-x86_64":<NEW_LINE>preloadpaths.add(0, ucrtsdkdir + "\\Redist\\" + ucrtversion + "\\ucrt\\DLLs\\x64");<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String vcredistdir = System.getenv("VCToolsRedistDir");<NEW_LINE>if (vcredistdir != null && vcredistdir.length() > 0) {<NEW_LINE>switch(platform) {<NEW_LINE>case "windows-x86":<NEW_LINE>preloadpaths.add(0, vcredistdir + "\\x86\\Microsoft.VC142.CRT");<NEW_LINE>preloadpaths.add(1, vcredistdir + "\\x86\\Microsoft.VC142.OpenMP");<NEW_LINE>preloadpaths.add(2, vcredistdir + "\\x86\\Microsoft.VC141.CRT");<NEW_LINE>preloadpaths.add(3, vcredistdir + "\\x86\\Microsoft.VC141.OpenMP");<NEW_LINE>break;<NEW_LINE>case "windows-x86_64":<NEW_LINE>preloadpaths.<MASK><NEW_LINE>preloadpaths.add(1, vcredistdir + "\\x64\\Microsoft.VC142.OpenMP");<NEW_LINE>preloadpaths.add(2, vcredistdir + "\\x64\\Microsoft.VC141.CRT");<NEW_LINE>preloadpaths.add(3, vcredistdir + "\\x64\\Microsoft.VC141.OpenMP");<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | add(0, vcredistdir + "\\x64\\Microsoft.VC142.CRT"); |
375,523 | final GetMacieSessionResult executeGetMacieSession(GetMacieSessionRequest getMacieSessionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getMacieSessionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetMacieSessionRequest> request = null;<NEW_LINE>Response<GetMacieSessionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetMacieSessionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getMacieSessionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Macie2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetMacieSession");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetMacieSessionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetMacieSessionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,231,316 | public long writeSeeds(Path sampleSeedPath) throws Exception {<NEW_LINE>int fileNo = 0;<NEW_LINE>// total number of samples<NEW_LINE>long numTotal = this.numSamples;<NEW_LINE>// number of initial centroids<NEW_LINE>int centriodNum = genParams.length;<NEW_LINE>long numPerCluster = (long) Math.ceil(numTotal / (double) centriodNum);<NEW_LINE>// num of files per cluster<NEW_LINE>long numFiles = (long) Math.ceil(numPerCluster / (double) SAMPLES_PER_FILE);<NEW_LINE>for (int k = 0; k < genParams.length; k++) {<NEW_LINE>if (genParams[k].length != dimension)<NEW_LINE>throw new Exception("The dimension of mean vector or std vector does not match desired dimension!");<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (int d = 0; d < dimension; d++) {<NEW_LINE>if (genParams[k][d].length != 2)<NEW_LINE>throw new Exception("The dimension of mean vector or std vector does not match desired dimension");<NEW_LINE>sb.append("\t" + Double.toString(genParams[k][d][0]) + "\t" + Double.toString(genParams[k][d][1]));<NEW_LINE>}<NEW_LINE>for (long i = 0; i < numFiles; i++) {<NEW_LINE>SequenceFile.Writer out = createNewFile(new Path(sampleSeedPath, "seed" + (fileNo++)), IntWritable.class, Text.class);<NEW_LINE>out.append(new IntWritable(k), new Text(Long.toString(SAMPLES_PER_FILE) + sb.toString()));<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>if (numFiles * SAMPLES_PER_FILE < numPerCluster) {<NEW_LINE>long left = numPerCluster - numFiles * SAMPLES_PER_FILE;<NEW_LINE>SequenceFile.Writer out = createNewFile(new Path(sampleSeedPath, "seed" + (fileNo++)), <MASK><NEW_LINE>out.append(new IntWritable(k), new Text(Long.toString(left) + sb.toString()));<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return numPerCluster * centriodNum;<NEW_LINE>} | IntWritable.class, Text.class); |
1,673,001 | private Map<String, LineageSpec> buildLineageSpecs(EntityRegistry entityRegistry) {<NEW_LINE>// 1. Flatten relationship annotations into a list of lineage edges (source, dest, type, isUpstream)<NEW_LINE>Collection<LineageEdge> lineageEdges = // If there are multiple edges with the same source, dest, edge type, get one of them<NEW_LINE>entityRegistry.getEntitySpecs().entrySet().stream().flatMap(entry -> entry.getValue().getRelationshipFieldSpecs().stream().flatMap(spec -> getLineageEdgesFromRelationshipAnnotation(entry.getKey(), spec.getRelationshipAnnotation()))).collect(Collectors.toMap(edge -> Triple.of(edge.getSourceEntity(), edge.getDestEntity(), edge.getType()), Function.identity(), (x1, x2) -> x1)).values();<NEW_LINE>// 2. Figure out the upstream and downstream edges of each entity type<NEW_LINE>Map<String, Set<EdgeInfo>> upstreamPerEntity = new HashMap<>();<NEW_LINE>Map<String, Set<EdgeInfo>> downstreamPerEntity = new HashMap<>();<NEW_LINE>// A downstreamOf B : A -> upstream (downstreamOf, OUTGOING), B -> downstream (downstreamOf, INCOMING)<NEW_LINE>// A produces B : A -> downstream (produces, OUTGOING), B -> upstream (produces, INCOMING)<NEW_LINE>for (LineageEdge edge : lineageEdges) {<NEW_LINE>if (edge.isUpstream()) {<NEW_LINE>upstreamPerEntity.computeIfAbsent(edge.sourceEntity.toLowerCase(), (k) -> new HashSet<>()).add(new EdgeInfo(edge.type, RelationshipDirection.OUTGOING));<NEW_LINE>downstreamPerEntity.computeIfAbsent(edge.destEntity.toLowerCase(), (k) -> new HashSet<>()).add(new EdgeInfo(edge.type, RelationshipDirection.INCOMING));<NEW_LINE>} else {<NEW_LINE>downstreamPerEntity.computeIfAbsent(edge.sourceEntity.toLowerCase(), (k) -> new HashSet<>()).add(new EdgeInfo(edge.type, RelationshipDirection.OUTGOING));<NEW_LINE>upstreamPerEntity.computeIfAbsent(edge.destEntity.toLowerCase(), (k) -> new HashSet<>()).add(new EdgeInfo(edge.type, RelationshipDirection.INCOMING));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return entityRegistry.getEntitySpecs().keySet().stream().collect(Collectors.toMap(String::toLowerCase, entityName -> new LineageSpec(new ArrayList<>(upstreamPerEntity.getOrDefault(entityName.toLowerCase(), Collections.emptySet())), new ArrayList<>(downstreamPerEntity.getOrDefault(entityName.toLowerCase(), Collections.<MASK><NEW_LINE>} | emptySet()))))); |
1,710,081 | void resolveVersion(double timeout, VersionHandler handler) {<NEW_LINE>boolean hasVersion = false;<NEW_LINE>boolean shouldInvoke = false;<NEW_LINE>boolean shouldLog = log.isLoggable(Level.FINE);<NEW_LINE>synchronized (this) {<NEW_LINE>if (version != null) {<NEW_LINE>if (shouldLog) {<NEW_LINE>log.log(Level.FINE, "Version already available for target '" + name + "' (version " + version + ").");<NEW_LINE>}<NEW_LINE>hasVersion = true;<NEW_LINE>} else {<NEW_LINE>if (shouldLog) {<NEW_LINE>log.log(Level.FINE, "Registering version handler '" + handler + "' for target '" + name + "'.");<NEW_LINE>}<NEW_LINE>versionHandlers.add(handler);<NEW_LINE>if (!targetInvoked) {<NEW_LINE>targetInvoked = true;<NEW_LINE>shouldInvoke = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasVersion) {<NEW_LINE>handler.handleVersion(version);<NEW_LINE>} else if (shouldInvoke) {<NEW_LINE>if (shouldLog) {<NEW_LINE>log.log(Level.FINE, "Invoking mbus.getVersion() on target '" + name + "'");<NEW_LINE>}<NEW_LINE>Request req = new Request("mbus.getVersion");<NEW_LINE>target.<MASK><NEW_LINE>}<NEW_LINE>} | invokeAsync(req, timeout, this); |
1,604,438 | private void innerMeasure(ConstraintWidget constraintWidget, BasicMeasure.Measure measure) {<NEW_LINE>Component component = (Component) constraintWidget.getCompanionWidget();<NEW_LINE>int measuredWidth = constraintWidget.getWidth();<NEW_LINE><MASK><NEW_LINE>if (DEBUG) {<NEW_LINE>Utils.log(" measure " + measuredWidth + " " + measuredHeight);<NEW_LINE>}<NEW_LINE>if (measure.horizontalBehavior == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {<NEW_LINE>measuredWidth = component.getMinimumSize().width;<NEW_LINE>} else if (measure.horizontalBehavior == ConstraintWidget.DimensionBehaviour.MATCH_PARENT) {<NEW_LINE>measuredWidth = mLayout.getWidth();<NEW_LINE>}<NEW_LINE>if (measure.verticalBehavior == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {<NEW_LINE>measuredHeight = component.getMinimumSize().height;<NEW_LINE>} else if (measure.verticalBehavior == ConstraintWidget.DimensionBehaviour.MATCH_PARENT) {<NEW_LINE>measuredHeight = mLayout.getHeight();<NEW_LINE>}<NEW_LINE>measure.measuredWidth = measuredWidth;<NEW_LINE>measure.measuredHeight = measuredHeight;<NEW_LINE>} | int measuredHeight = constraintWidget.getHeight(); |
1,157,057 | public Object calculate(Context ctx) {<NEW_LINE>if (param == null || param.isLeaf() || param.getSubSize() < 3) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("Fnper:" <MASK><NEW_LINE>}<NEW_LINE>int size = param.getSubSize();<NEW_LINE>Object[] result = new Object[size];<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>IParam sub = param.getSub(i);<NEW_LINE>if (sub != null) {<NEW_LINE>result[i] = sub.getLeafExpression().calculate(ctx);<NEW_LINE>if (result[i] != null && !(result[i] instanceof Number)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("The " + i + "th param of Fnper:" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return pmt(result);<NEW_LINE>} | + mm.getMessage("function.missingParam")); |
1,514,364 | Map<List<TableId>, Long> calculateUsage() {<NEW_LINE>// Bitset of tables that contain a file and total usage by all files that share that usage<NEW_LINE>Map<List<Integer>, Long> usage = new HashMap<>();<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("fileSizes {}", fileSizes);<NEW_LINE>}<NEW_LINE>// For each file w/ referenced-table bitset<NEW_LINE>for (Entry<String, Integer[]> entry : tableFiles.entrySet()) {<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("file {} table bitset {}", entry.getKey(), Arrays.toString(entry.getValue()));<NEW_LINE>}<NEW_LINE>List<Integer> key = Arrays.asList(entry.getValue());<NEW_LINE>Long size = fileSizes.get(entry.getKey());<NEW_LINE>Long tablesUsage = usage.get(key);<NEW_LINE>if (tablesUsage == null)<NEW_LINE>tablesUsage = 0L;<NEW_LINE>tablesUsage += size;<NEW_LINE>usage.put(key, tablesUsage);<NEW_LINE>}<NEW_LINE>Map<List<TableId>, Long> externalUsage = new HashMap<>();<NEW_LINE>for (Entry<List<Integer>, Long> entry : usage.entrySet()) {<NEW_LINE>List<TableId> externalKey = new ArrayList<>();<NEW_LINE>List<Integer> key = entry.getKey();<NEW_LINE>// table bitset<NEW_LINE>for (int i = 0; i < key.size(); i++) if (key.get(i) != 0)<NEW_LINE>// Convert by internal id to the table id<NEW_LINE>externalKey.add<MASK><NEW_LINE>// list of table ids and size of files shared across the tables<NEW_LINE>externalUsage.put(externalKey, entry.getValue());<NEW_LINE>}<NEW_LINE>// mapping of all enumerations of files being referenced by tables and total size of files who<NEW_LINE>// share the same reference<NEW_LINE>return externalUsage;<NEW_LINE>} | (externalIds.get(i)); |
938,329 | private List<Map<String, Object>> generateConfigReferencedPaths(String baseRef) {<NEW_LINE>List<Map<String, Object>> referencedPaths = new ArrayList<Map<String, Object>>();<NEW_LINE>for (String key : crawlJob.getConfigPaths().keySet()) {<NEW_LINE>ConfigPath cp = crawlJob.getConfigPaths().get(key);<NEW_LINE>Map<String, Object> configMap = new LinkedHashMap<String, Object>();<NEW_LINE>configMap.put("key", key);<NEW_LINE>configMap.put("name", cp.getName());<NEW_LINE>configMap.put("path", FileUtils.tryToCanonicalize(cp.getFile()).getAbsolutePath());<NEW_LINE>configMap.put("url", baseRef + "engine/anypath/" <MASK><NEW_LINE>configMap.put("editable", EDIT_FILTER.accept(cp.getFile()));<NEW_LINE>referencedPaths.add(configMap);<NEW_LINE>}<NEW_LINE>return referencedPaths;<NEW_LINE>} | + configMap.get("path")); |
1,323,176 | public List<Node> nodes() {<NEW_LINE>try {<NEW_LINE>Map<String, String> params = new HashMap<>();<NEW_LINE>params.put("format", "json");<NEW_LINE>params.put("full_id", "true");<NEW_LINE>params.put("h", "id,ip,name,http_address,master");<NEW_LINE>Response res = withRetry(() -> client.performRequest("GET", "/_cat/nodes", params), retries);<NEW_LINE>try (InputStreamReader reader = new InputStreamReader(res.getEntity().getContent(), UTF_8)) {<NEW_LINE>JsonArray array = Json.parse(reader).asArray();<NEW_LINE>List<Node> nodes = new ArrayList<>(array.size());<NEW_LINE>for (JsonValue value : array) {<NEW_LINE>Optional<Node> shard = convertToNode(value);<NEW_LINE>shard.ifPresent(nodes::add);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return nodes;<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new JetException("Could not get ES cluster nodes", e);<NEW_LINE>}<NEW_LINE>} | LOG.fine("Nodes: " + nodes); |
975,927 | private void postProcess() {<NEW_LINE>if (myContext.hasDefaultTypeForProfile()) {<NEW_LINE>IBaseMetaType meta = myInstance.getMeta();<NEW_LINE>Class<? extends IBaseResource> wantedProfileType = null;<NEW_LINE>String usedProfile = null;<NEW_LINE>for (IPrimitiveType<String> next : meta.getProfile()) {<NEW_LINE>if (isNotBlank(next.getValue())) {<NEW_LINE>wantedProfileType = myContext.getDefaultTypeForProfile(next.getValue());<NEW_LINE>if (wantedProfileType != null) {<NEW_LINE>usedProfile = next.getValue();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (wantedProfileType != null && !wantedProfileType.equals(myInstance.getClass())) {<NEW_LINE>if (myResourceType == null || myResourceType.isAssignableFrom(wantedProfileType)) {<NEW_LINE>ourLog.debug("Converting resource of type {} to type defined for profile \"{}\": {}", myInstance.getClass().getName(), usedProfile, wantedProfileType);<NEW_LINE>FhirTerser t = myContext.newTerser();<NEW_LINE>// Clean up the cached resources<NEW_LINE>myGlobalResources.remove(myInstance);<NEW_LINE>myGlobalReferences.removeAll(t.getAllPopulatedChildElementsOfType(myInstance, IBaseReference.class));<NEW_LINE>IParser parser = myContext.newJsonParser();<NEW_LINE>String <MASK><NEW_LINE>myInstance = parser.parseResource(wantedProfileType, asString);<NEW_LINE>// Add newly created instance<NEW_LINE>myGlobalResources.add(myInstance);<NEW_LINE>myGlobalReferences.addAll(t.getAllPopulatedChildElementsOfType(myInstance, IBaseReference.class));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myInstance.setUserData(BaseParser.RESOURCE_CREATED_BY_PARSER, Boolean.TRUE);<NEW_LINE>populateTarget();<NEW_LINE>} | asString = parser.encodeResourceToString(myInstance); |
1,224,464 | public Object organizeImports(List<Object> arguments) throws CoreException {<NEW_LINE>WorkspaceEdit edit = new WorkspaceEdit();<NEW_LINE>if (arguments != null && !arguments.isEmpty() && arguments.get(0) instanceof String) {<NEW_LINE>final String fileUri = (String) arguments.get(0);<NEW_LINE>final IPath rootPath = ResourceUtils.filePathFromURI(fileUri);<NEW_LINE>if (rootPath == null) {<NEW_LINE>throw new CoreException(new Status(IStatus.ERROR, IConstants.PLUGIN_ID, "URI is not found"));<NEW_LINE>}<NEW_LINE>final IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();<NEW_LINE>IResource <MASK><NEW_LINE>if (resource == null) {<NEW_LINE>resource = wsroot.getContainerForLocation(rootPath);<NEW_LINE>}<NEW_LINE>if (resource != null) {<NEW_LINE>final OrganizeImportsCommand command = new OrganizeImportsCommand();<NEW_LINE>int type = resource.getType();<NEW_LINE>switch(type) {<NEW_LINE>case IResource.PROJECT:<NEW_LINE>edit = command.organizeImportsInProject(resource.getAdapter(IProject.class));<NEW_LINE>break;<NEW_LINE>case IResource.FOLDER:<NEW_LINE>edit = command.organizeImportsInDirectory(fileUri, resource.getProject());<NEW_LINE>break;<NEW_LINE>case IResource.FILE:<NEW_LINE>edit = command.organizeImportsInFile(fileUri);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// This can only be IResource.ROOT. Which is not relevant to jdt.ls<NEW_LINE>// do nothing allow to return the empty WorkspaceEdit.<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return edit;<NEW_LINE>} | resource = wsroot.getFileForLocation(rootPath); |
1,668,060 | public final T doCheckValid(RuleComponentModel data) {<NEW_LINE>Map<String, ParameterModel<MASK><NEW_LINE>String key = null;<NEW_LINE>try {<NEW_LINE>for (Map.Entry<String, ParameterDefinition> entry : this.getParameterDefinitions().entrySet()) {<NEW_LINE>key = entry.getKey();<NEW_LINE>entry.getValue().checkValid(params.get(key));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuleConstructionFailedException(e, "Could not create Component Instance of type %s from provided model %s: " + "validation failed for parameter '%s'", this.getId(), data.toString(), key);<NEW_LINE>}<NEW_LINE>T instance;<NEW_LINE>try {<NEW_LINE>instance = instanceFrom(params);<NEW_LINE>} catch (RuleEngineException | InvalidRuleParameterException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.warn(RuleComponentDefinition.class, "Unexpected error creating component.", e);<NEW_LINE>throw new RuleConstructionFailedException(e, "Could not create Component Instance of type %s from provided model %s.", this.getId(), data.toString());<NEW_LINE>}<NEW_LINE>return instance;<NEW_LINE>} | > params = data.getParameters(); |
104,205 | public static void endSocket(Object stat, Throwable thr) {<NEW_LINE>if (stat == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>LocalContext lctx = (LocalContext) stat;<NEW_LINE>TraceContext tctx = lctx.context;<NEW_LINE>SocketStep step = (SocketStep) lctx.stepSingle;<NEW_LINE>step.elapsed = (int) (System.currentTimeMillis() - tctx.startTime) - step.start_time;<NEW_LINE>if (thr != null) {<NEW_LINE>String msg = thr.toString();<NEW_LINE>step.error = DataProxy.sendError(msg);<NEW_LINE>if (tctx.error == 0) {<NEW_LINE>tctx.error = step.error;<NEW_LINE>}<NEW_LINE>tctx.offerErrorEntity(ErrorEntity.of(thr, step.error, 0, 0));<NEW_LINE>}<NEW_LINE>tctx.profile.add(step);<NEW_LINE>SocketTable.add(step.ipaddr, step.port, tctx.serviceHash, tctx.txid);<NEW_LINE>Configure conf = Configure.getInstance();<NEW_LINE>if (conf.profile_socket_open_fullstack_enabled) {<NEW_LINE>if (conf.profile_socket_open_fullstack_port == 0 || conf.profile_socket_open_fullstack_port == step.port) {<NEW_LINE>tctx.profile.add(new MessageStep(step.start_time, ThreadUtil.getThreadStack()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>Logger.<MASK><NEW_LINE>}<NEW_LINE>} | println("A142", "socket trace close error", t); |
790,104 | public Void visitNewClass(NewClassTree node, Void p) {<NEW_LINE>if (checker.shouldSkipUses(TreeUtils.constructor(node))) {<NEW_LINE>return super.visitNewClass(node, p);<NEW_LINE>}<NEW_LINE>ParameterizedExecutableType fromUse = atypeFactory.constructorFromUse(node);<NEW_LINE>AnnotatedExecutableType constructorType = fromUse.executableType;<NEW_LINE>List<AnnotatedTypeMirror> typeargs = fromUse.typeArgs;<NEW_LINE>List<? extends ExpressionTree> passedArguments = node.getArguments();<NEW_LINE>List<AnnotatedTypeMirror> params = AnnotatedTypes.expandVarArgsParameters(atypeFactory, constructorType, passedArguments);<NEW_LINE>ExecutableElement constructor = constructorType.getElement();<NEW_LINE>CharSequence constructorName = ElementUtils.getSimpleNameOrDescription(constructor);<NEW_LINE>checkArguments(params, passedArguments, constructorName, constructor.getParameters());<NEW_LINE>checkVarargs(constructorType, node);<NEW_LINE>List<AnnotatedTypeParameterBounds> paramBounds = CollectionsPlume.mapList(AnnotatedTypeVariable::getBounds, constructorType.getTypeVariables());<NEW_LINE>checkTypeArguments(node, paramBounds, typeargs, node.getTypeArguments(), constructorName, constructor.getTypeParameters());<NEW_LINE>boolean valid = validateTypeOf(node);<NEW_LINE>if (valid) {<NEW_LINE>AnnotatedDeclaredType <MASK><NEW_LINE>atypeFactory.getDependentTypesHelper().checkTypeForErrorExpressions(dt, node);<NEW_LINE>checkConstructorInvocation(dt, constructorType, node);<NEW_LINE>}<NEW_LINE>// Do not call super, as that would observe the arguments without<NEW_LINE>// a set assignment context.<NEW_LINE>scan(node.getEnclosingExpression(), p);<NEW_LINE>scan(node.getIdentifier(), p);<NEW_LINE>scan(node.getClassBody(), p);<NEW_LINE>return null;<NEW_LINE>} | dt = atypeFactory.getAnnotatedType(node); |
718,198 | public void registerEntityComponentFactories(EntityComponentFactoryRegistry registry) {<NEW_LINE>for (Class<? extends Monster> clz : SubTileLoonuim.VALID_MOBS) {<NEW_LINE>registry.registerFor(clz, LOONIUM_DROP, e -> new CCALooniumComponent());<NEW_LINE>}<NEW_LINE>registry.registerFor(PrimedTnt.class, TNT_ETHICAL, CCAEthicalComponent::new);<NEW_LINE>registry.registerFor(Slime.class, NARSLIMMUS, e -> new CCANarslimmusComponent());<NEW_LINE>registry.registerFor(ItemEntity.class, INTERNAL_ITEM<MASK><NEW_LINE>registry.registerFor(AbstractMinecart.class, GHOST_RAIL, e -> new CCAGhostRailComponent());<NEW_LINE>registry.registerFor(Creeper.class, TIGERSEYE, creeper -> new CCATigerseyeComponent());<NEW_LINE>// Never copy as we handle it ourselves in ItemKeepIvy.onPlayerRespawn<NEW_LINE>registry.registerForPlayers(KEPT_ITEMS, e -> new CCAKeptItemsComponent(), RespawnCopyStrategy.NEVER_COPY);<NEW_LINE>} | , e -> new CCAItemFlagsComponent()); |
366,322 | public void reduceByName(Merger merger) {<NEW_LINE>if (size > 0) {<NEW_LINE>int[] sortedIndices = SortUtil.argsort(featureNames, 0, size, true);<NEW_LINE>String[] newNames = new String[featureNames.length];<NEW_LINE>int[] newIDs = new int[featureIDs.length];<NEW_LINE>double[] newValues = new double[featureNames.length];<NEW_LINE>for (int i = 0; i < sortedIndices.length; i++) {<NEW_LINE>newNames[i] = featureNames[sortedIndices[i]];<NEW_LINE>newIDs[i] = featureIDs[sortedIndices[i]];<NEW_LINE>newValues[i] = featureValues[sortedIndices[i]];<NEW_LINE>}<NEW_LINE>featureNames<MASK><NEW_LINE>featureIDs[0] = newIDs[0];<NEW_LINE>featureValues[0] = newValues[0];<NEW_LINE>int dest = 0;<NEW_LINE>for (int i = 1; i < size; i++) {<NEW_LINE>while ((i < size) && newNames[i].equals(featureNames[dest])) {<NEW_LINE>featureValues[dest] = merger.merge(featureValues[dest], newValues[i]);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>if (i < size) {<NEW_LINE>dest++;<NEW_LINE>featureNames[dest] = newNames[i];<NEW_LINE>featureIDs[dest] = newIDs[i];<NEW_LINE>featureValues[dest] = newValues[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>size = dest + 1;<NEW_LINE>}<NEW_LINE>} | [0] = newNames[0]; |
1,550,739 | FlowDisposition computeDisposition(String hostname, String outgoingInterfaceName, Ip dstIp) {<NEW_LINE>IpSpaceContainsIp containsIp = _containsIp.computeIfAbsent(dstIp, ip -> new IpSpaceContainsIp(ip, ImmutableMap.of()));<NEW_LINE>String vrfName = _configurations.get(hostname).getAllInterfaces().get(outgoingInterfaceName).getVrfName();<NEW_LINE>InterfaceForwardingBehavior interfaceForwardingBehavior = _forwardingAnalysis.getVrfForwardingBehavior().get(hostname).get(vrfName).getInterfaceForwardingBehavior().get(outgoingInterfaceName);<NEW_LINE>if (containsIp.visit(interfaceForwardingBehavior.getDeliveredToSubnet())) {<NEW_LINE>return FlowDisposition.DELIVERED_TO_SUBNET;<NEW_LINE>} else if (containsIp.visit(interfaceForwardingBehavior.getExitsNetwork())) {<NEW_LINE>return FlowDisposition.EXITS_NETWORK;<NEW_LINE>} else if (containsIp.visit(interfaceForwardingBehavior.getInsufficientInfo())) {<NEW_LINE>return FlowDisposition.INSUFFICIENT_INFO;<NEW_LINE>} else if (containsIp.visit(interfaceForwardingBehavior.getNeighborUnreachable())) {<NEW_LINE>return FlowDisposition.NEIGHBOR_UNREACHABLE;<NEW_LINE>} else {<NEW_LINE>throw new BatfishException(String.format("No disposition at hostname=%s outgoingInterface=%s for destIp=%s"<MASK><NEW_LINE>}<NEW_LINE>} | , hostname, outgoingInterfaceName, dstIp)); |
927,494 | private void prune(final long maxAge) {<NEW_LINE>final long now = System.currentTimeMillis();<NEW_LINE>final long timestampBoundary = now - maxAge;<NEW_LINE>synchronized (mLock) {<NEW_LINE>final Iterator<Map.Entry<String, Entry>> iterator = mEntries.entrySet().iterator();<NEW_LINE>final SortedMap<Long, String> byTimestamp = new TreeMap<>();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>final Map.Entry<String, Entry> entry = iterator.next();<NEW_LINE>final long timestamp = entry.getValue().mTimestamp;<NEW_LINE>byTimestamp.put(timestamp, entry.getKey());<NEW_LINE>if (timestamp < timestampBoundary) {<NEW_LINE>Log.i(TAG, String.format("Pruning '%s' (%d hours old)", entry.getKey(), (now - timestamp) / (<MASK><NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Limit total number of entries to limit our memory usage. This is meant as a<NEW_LINE>// safeguard, as the time-based pruning above should have removed enough already.<NEW_LINE>final Iterator<Map.Entry<Long, String>> iter2 = byTimestamp.entrySet().iterator();<NEW_LINE>while (iter2.hasNext()) {<NEW_LINE>if (mEntries.size() <= MAX_ENTRY_COUNT) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>final Map.Entry<Long, String> entry = iter2.next();<NEW_LINE>Log.i(TAG, String.format("Evicting '%s' (%d hours old)", entry.getValue(), (now - entry.getKey()) / (60L * 60L * 1000L)));<NEW_LINE>mEntries.remove(entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | 60L * 60L * 1000L))); |
1,530,922 | public static <CommitId> PermanentLinearGraphBuilder<CommitId> newInstance(@Nonnull List<? extends GraphCommit<CommitId>> graphCommits) {<NEW_LINE>graphCommits = fixDuplicateParentCommits(graphCommits);<NEW_LINE>Flags simpleNodes = new BitSetFlags(graphCommits.size());<NEW_LINE>int longEdgesCount = 0;<NEW_LINE>for (int nodeIndex = 0; nodeIndex < graphCommits.size(); nodeIndex++) {<NEW_LINE>GraphCommit<CommitId> commit = graphCommits.get(nodeIndex);<NEW_LINE>CommitId <MASK><NEW_LINE>List parents = commit.getParents();<NEW_LINE>if (parents.size() == 1 && parents.get(0).equals(nextCommitHashIndex)) {<NEW_LINE>simpleNodes.set(nodeIndex, true);<NEW_LINE>} else {<NEW_LINE>longEdgesCount += parents.size();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new PermanentLinearGraphBuilder<>(graphCommits, simpleNodes, longEdgesCount);<NEW_LINE>} | nextCommitHashIndex = nextCommitHashIndex(graphCommits, nodeIndex); |
645,396 | public RDSDatabaseCredentials unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RDSDatabaseCredentials rDSDatabaseCredentials = new RDSDatabaseCredentials();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Username", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>rDSDatabaseCredentials.setUsername(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Password", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>rDSDatabaseCredentials.setPassword(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return rDSDatabaseCredentials;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,776,294 | public static IndexMetadata readFrom(StreamInput in) throws IOException {<NEW_LINE>Builder builder = new Builder(in.readString());<NEW_LINE>builder.version(in.readLong());<NEW_LINE>builder.mappingVersion(in.readVLong());<NEW_LINE>builder.settingsVersion(in.readVLong());<NEW_LINE>builder.setRoutingNumShards(in.readInt());<NEW_LINE>builder.state(State.fromId(in.readByte()));<NEW_LINE>builder.settings(readSettingsFromStream(in));<NEW_LINE>builder.primaryTerms(in.readVLongArray());<NEW_LINE>int mappingsSize = in.readVInt();<NEW_LINE>for (int i = 0; i < mappingsSize; i++) {<NEW_LINE>MappingMetadata mappingMd = new MappingMetadata(in);<NEW_LINE>builder.putMapping(mappingMd);<NEW_LINE>}<NEW_LINE>int aliasesSize = in.readVInt();<NEW_LINE>for (int i = 0; i < aliasesSize; i++) {<NEW_LINE>AliasMetadata aliasMd = new AliasMetadata(in);<NEW_LINE>builder.putAlias(aliasMd);<NEW_LINE>}<NEW_LINE>int customSize = in.readVInt();<NEW_LINE>for (int i = 0; i < customSize; i++) {<NEW_LINE>String key = in.readString();<NEW_LINE>DiffableStringMap custom = new DiffableStringMap(in);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>int inSyncAllocationIdsSize = in.readVInt();<NEW_LINE>for (int i = 0; i < inSyncAllocationIdsSize; i++) {<NEW_LINE>int key = in.readVInt();<NEW_LINE>Set<String> allocationIds = DiffableUtils.StringSetValueSerializer.getInstance().read(in, key);<NEW_LINE>builder.putInSyncAllocationIds(key, allocationIds);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | builder.putCustom(key, custom); |
398,848 | private KafkaProducer createKafkaProducer() {<NEW_LINE>final Properties props = new Properties();<NEW_LINE>props.put(ProducerConfig.CLIENT_ID_CONFIG, "datahub-frontend");<NEW_LINE>props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, _config.getString("analytics.kafka.bootstrap.server"));<NEW_LINE>// Actor urn.<NEW_LINE>props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer");<NEW_LINE>// JSON object.<NEW_LINE>props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer");<NEW_LINE>final String securityProtocolConfig = "analytics.kafka.security.protocol";<NEW_LINE>if (_config.hasPath(securityProtocolConfig) && KAFKA_SSL_PROTOCOLS.contains(_config.getString(securityProtocolConfig))) {<NEW_LINE>props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG<MASK><NEW_LINE>setConfig(props, SslConfigs.SSL_KEY_PASSWORD_CONFIG, "analytics.kafka.ssl.key.password");<NEW_LINE>setConfig(props, SslConfigs.SSL_KEYSTORE_TYPE_CONFIG, "analytics.kafka.ssl.keystore.type");<NEW_LINE>setConfig(props, SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, "analytics.kafka.ssl.keystore.location");<NEW_LINE>setConfig(props, SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, "analytics.kafka.ssl.keystore.password");<NEW_LINE>setConfig(props, SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG, "analytics.kafka.ssl.truststore.type");<NEW_LINE>setConfig(props, SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, "analytics.kafka.ssl.truststore.location");<NEW_LINE>setConfig(props, SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, "analytics.kafka.ssl.truststore.password");<NEW_LINE>setConfig(props, SslConfigs.SSL_PROTOCOL_CONFIG, "analytics.kafka.ssl.protocol");<NEW_LINE>setConfig(props, SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG, "analytics.kafka.ssl.endpoint.identification.algorithm");<NEW_LINE>final String securityProtocol = _config.getString(securityProtocolConfig);<NEW_LINE>if (securityProtocol.equals(SecurityProtocol.SASL_SSL.name()) || securityProtocol.equals(SecurityProtocol.SASL_PLAINTEXT.name())) {<NEW_LINE>setConfig(props, SaslConfigs.SASL_MECHANISM, "analytics.kafka.sasl.mechanism");<NEW_LINE>setConfig(props, SaslConfigs.SASL_JAAS_CONFIG, "analytics.kafka.sasl.jaas.config");<NEW_LINE>setConfig(props, SaslConfigs.SASL_KERBEROS_SERVICE_NAME, "analytics.kafka.sasl.kerberos.service.name");<NEW_LINE>setConfig(props, SaslConfigs.SASL_LOGIN_CALLBACK_HANDLER_CLASS, "analytics.kafka.sasl.login.callback.handler.class");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new KafkaProducer(props);<NEW_LINE>} | , _config.getString(securityProtocolConfig)); |
1,249,705 | private void installEPF(String epfString) {<NEW_LINE>try {<NEW_LINE>Properties properties = new Properties();<NEW_LINE>properties.load(new ByteArrayInputStream(epfString.getBytes("ISO-8859-1")));<NEW_LINE>IJTPreset defaultPreset = JThemesCore.getDefault().getPresetManager().getDefaultPreset();<NEW_LINE>properties = PropertiesUtil.merge(defaultPreset.getProperties(), properties);<NEW_LINE>JThemePreferenceStore store = JThemesCore.getDefault().getPreferenceStore();<NEW_LINE>for (Object keyObj : properties.keySet()) {<NEW_LINE>String key = (String) keyObj;<NEW_LINE>String value = properties.getProperty(key);<NEW_LINE>if (key.equals(JTPConstants.Layout.TAB_HEIGHT)) {<NEW_LINE>int intValue = Integer.parseInt(value);<NEW_LINE>store.setValue(key, Math.max(intValue, SWTExtensions.INSTANCE.getMinimumToolBarHeight()));<NEW_LINE>} else {<NEW_LINE>store.setValue(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>new <MASK><NEW_LINE>MApplication application = (MApplication) PlatformUI.getWorkbench().getService(MApplication.class);<NEW_LINE>IEclipseContext context = application.getContext();<NEW_LINE>IThemeEngine engine = context.get(IThemeEngine.class);<NEW_LINE>if (engine.getActiveTheme() == null || !engine.getActiveTheme().getId().equals(JThemesCore.CUSTOM_THEME_ID)) {<NEW_LINE>engine.setTheme(JThemesCore.CUSTOM_THEME_ID, true);<NEW_LINE>}<NEW_LINE>store.setValue(JTPConstants.Memento.LAST_CHOOSED_PRESET, "");<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | RewriteCustomTheme(true).rewrite(); |
1,827,962 | // pakcage private for tests<NEW_LINE>static PluginPolicyInfo readPolicyInfo(Path pluginRoot) throws IOException {<NEW_LINE>Path policyFile = pluginRoot.resolve(PluginInfo.ES_PLUGIN_POLICY);<NEW_LINE>if (Files.exists(policyFile) == false) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// first get a list of URLs for the plugins' jars:<NEW_LINE>// we resolve symlinks so map is keyed on the normalize codebase name<NEW_LINE>// order is already lost, but some filesystems have it<NEW_LINE>Set<URL> jars = new LinkedHashSet<>();<NEW_LINE>try (DirectoryStream<Path> jarStream = Files.newDirectoryStream(pluginRoot, "*.jar")) {<NEW_LINE>for (Path jar : jarStream) {<NEW_LINE>URL url = jar.toRealPath().toUri().toURL();<NEW_LINE>if (jars.add(url) == false) {<NEW_LINE>throw new IllegalStateException("duplicate module/plugin: " + url);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// also add spi jars<NEW_LINE>// TODO: move this to a shared function, or fix plugin layout to have jar files in lib directory<NEW_LINE>Path spiDir = pluginRoot.resolve("spi");<NEW_LINE>if (Files.exists(spiDir)) {<NEW_LINE>try (DirectoryStream<Path> jarStream = Files.newDirectoryStream(spiDir, "*.jar")) {<NEW_LINE>for (Path jar : jarStream) {<NEW_LINE>URL url = jar.toRealPath().toUri().toURL();<NEW_LINE>if (jars.add(url) == false) {<NEW_LINE>throw new IllegalStateException("duplicate module/plugin: " + url);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// parse the plugin's policy file into a set of permissions<NEW_LINE>Policy policy = readPolicy(policyFile.toUri().toURL<MASK><NEW_LINE>return new PluginPolicyInfo(policyFile, jars, policy);<NEW_LINE>} | (), getCodebaseJarMap(jars)); |
230,130 | private static void doRawReceiveFile(File path, int size, InputStream clientInput) throws IOException {<NEW_LINE>// Create a temp file to receive the payload, so we don't need to worry about<NEW_LINE>// partially-received files. The host takes care of deleting temp files.<NEW_LINE>File tempfile = File.createTempFile(AgentUtil.TEMP_PREFIX + path.getName() + "-", ".tmp", path.getParentFile());<NEW_LINE>FileOutputStream output = new FileOutputStream(tempfile);<NEW_LINE>// Keep track of our starting time so we can enforce a timeout on slow but steady uploads.<NEW_LINE>long receiveStartMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());<NEW_LINE>// Keep track of the total received size to verify the payload.<NEW_LINE>long totalSize = 0;<NEW_LINE>long totalReceiveTimeoutMs = RECEIVE_TIMEOUT_MS + TOTAL_RECEIVE_TIMEOUT_MS_PER_MB * (size / 1024 / 1024);<NEW_LINE>try {<NEW_LINE>int bufferSize = 128 * 1024;<NEW_LINE>byte[] buf = new byte[bufferSize];<NEW_LINE>while (true) {<NEW_LINE>long currentTimeMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());<NEW_LINE>if (currentTimeMs - receiveStartMs > totalReceiveTimeoutMs) {<NEW_LINE>throw new RuntimeException("Receive failed to complete before timeout.");<NEW_LINE>}<NEW_LINE>int remaining = size - (int) totalSize;<NEW_LINE>if (remaining == 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int want = bufferSize;<NEW_LINE>if (want > remaining) {<NEW_LINE>want = remaining;<NEW_LINE>}<NEW_LINE>int got = clientInput.read(buf, 0, want);<NEW_LINE>if (got == -1) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>output.<MASK><NEW_LINE>totalSize += got;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>output.close();<NEW_LINE>}<NEW_LINE>if (totalSize != size) {<NEW_LINE>throw new RuntimeException("Received only " + totalSize + " of " + size + " bytes.");<NEW_LINE>}<NEW_LINE>boolean success = tempfile.renameTo(path);<NEW_LINE>if (!success) {<NEW_LINE>throw new RuntimeException("Failed to rename temp file.");<NEW_LINE>}<NEW_LINE>} | write(buf, 0, got); |
1,111,547 | public void processOpts() {<NEW_LINE>super.processOpts();<NEW_LINE>if (additionalProperties.containsKey(CURL_OPTIONS)) {<NEW_LINE>setCurlOptions(additionalProperties.get<MASK><NEW_LINE>additionalProperties.put("x-codegen-curl-options", this.curlOptions);<NEW_LINE>}<NEW_LINE>if (additionalProperties.containsKey(PROCESS_MARKDOWN)) {<NEW_LINE>setProcessMarkdown(convertPropertyToBooleanAndWriteBack(PROCESS_MARKDOWN));<NEW_LINE>}<NEW_LINE>if (additionalProperties.containsKey(GENERATE_BASH_COMPLETION)) {<NEW_LINE>setGenerateBashCompletion(convertPropertyToBooleanAndWriteBack(GENERATE_BASH_COMPLETION));<NEW_LINE>}<NEW_LINE>if (additionalProperties.containsKey(GENERATE_ZSH_COMPLETION)) {<NEW_LINE>setGenerateZshCompletion(convertPropertyToBooleanAndWriteBack(GENERATE_ZSH_COMPLETION));<NEW_LINE>}<NEW_LINE>if (additionalProperties.containsKey(SCRIPT_NAME)) {<NEW_LINE>setScriptName(additionalProperties.get(SCRIPT_NAME).toString());<NEW_LINE>}<NEW_LINE>additionalProperties.put("x-codegen-script-name", scriptName);<NEW_LINE>if (additionalProperties.containsKey(HOST_ENVIRONMENT_VARIABLE_NAME)) {<NEW_LINE>setHostEnvironmentVariable(additionalProperties.get(HOST_ENVIRONMENT_VARIABLE_NAME).toString());<NEW_LINE>additionalProperties.put("x-codegen-host-env", hostEnvironmentVariable);<NEW_LINE>}<NEW_LINE>if (additionalProperties.containsKey(BASIC_AUTH_ENVIRONMENT_VARIABLE_NAME)) {<NEW_LINE>setBasicAuthEnvironmentVariable(additionalProperties.get(BASIC_AUTH_ENVIRONMENT_VARIABLE_NAME).toString());<NEW_LINE>additionalProperties.put("x-codegen-basicauth-env", basicAuthEnvironmentVariable);<NEW_LINE>}<NEW_LINE>if (additionalProperties.containsKey(APIKEY_AUTH_ENVIRONMENT_VARIABLE_NAME)) {<NEW_LINE>setApiKeyAuthEnvironmentVariable(additionalProperties.get(APIKEY_AUTH_ENVIRONMENT_VARIABLE_NAME).toString());<NEW_LINE>additionalProperties.put("x-codegen-apikey-env", apiKeyAuthEnvironmentVariable);<NEW_LINE>}<NEW_LINE>supportingFiles.add(new SupportingFile("client.mustache", "", scriptName));<NEW_LINE>supportingFiles.add(new SupportingFile("bash-completion.mustache", "", scriptName + ".bash-completion"));<NEW_LINE>supportingFiles.add(new SupportingFile("zsh-completion.mustache", "", "_" + scriptName));<NEW_LINE>supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));<NEW_LINE>supportingFiles.add(new SupportingFile("Dockerfile.mustache", "", "Dockerfile"));<NEW_LINE>} | (CURL_OPTIONS).toString()); |
38,728 | public ModelRepresentation duplicateModel(@PathVariable String modelId, @RequestBody ModelRepresentation modelRepresentation) {<NEW_LINE>String json = null;<NEW_LINE>Model model = null;<NEW_LINE>if (modelId != null) {<NEW_LINE>model = modelService.getModel(modelId);<NEW_LINE>json = model.getModelEditorJson();<NEW_LINE>}<NEW_LINE>if (model == null) {<NEW_LINE>throw new InternalServerErrorException("Error duplicating model : Unknown original model");<NEW_LINE>}<NEW_LINE>modelRepresentation.setKey(modelRepresentation.getKey().replaceAll(" ", ""));<NEW_LINE>checkForDuplicateKey(modelRepresentation);<NEW_LINE>if (modelRepresentation.getModelType() == null || modelRepresentation.getModelType().equals(AbstractModel.MODEL_TYPE_BPMN)) {<NEW_LINE>// BPMN model<NEW_LINE>ObjectNode editorNode = null;<NEW_LINE>try {<NEW_LINE>editorNode = (ObjectNode) objectMapper.readTree(json);<NEW_LINE>ObjectNode propertiesNode = (ObjectNode) editorNode.get("properties");<NEW_LINE>String processId = modelRepresentation.getKey().replaceAll(" ", "");<NEW_LINE>propertiesNode.put("process_id", processId);<NEW_LINE>propertiesNode.put("name", modelRepresentation.getName());<NEW_LINE>if (StringUtils.isNotEmpty(modelRepresentation.getDescription())) {<NEW_LINE>propertiesNode.put("documentation", modelRepresentation.getDescription());<NEW_LINE>}<NEW_LINE>editorNode.set("properties", propertiesNode);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>if (editorNode != null) {<NEW_LINE>json = editorNode.toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String currentUserId = SecurityUtils.getCurrentUserId();<NEW_LINE>// create the new model<NEW_LINE>Model newModel = modelService.createModel(modelRepresentation, json, currentUserId);<NEW_LINE>// copy also the thumbnail<NEW_LINE>byte[] imageBytes = model.getThumbnail();<NEW_LINE>newModel = modelService.saveModel(newModel, newModel.getModelEditorJson(), imageBytes, false, <MASK><NEW_LINE>return new ModelRepresentation(newModel);<NEW_LINE>} | newModel.getComment(), currentUserId); |
1,099,664 | private void emitLoopBegin(final LoopBeginNode loopBeginNode) {<NEW_LINE>Logger.traceBuildLIR(Logger.BACKEND.SPIRV, "visiting emitLoopBegin %s", loopBeginNode);<NEW_LINE>final Block block = <MASK><NEW_LINE>final Block predBlock = block.getFirstPredecessor();<NEW_LINE>Block dependentPhiValueBlock = getPhiDependentBlock(block);<NEW_LINE>final LIR lir = getGen().getResult().getLIR();<NEW_LINE>final LabelOp label = (LabelOp) lir.getLIRforBlock(block).get(0);<NEW_LINE>List<ValuePhiNode> valuePhis = loopBeginNode.valuePhis().snapshot();<NEW_LINE>LIRPhiVars phiVars = null;<NEW_LINE>for (ValuePhiNode phi : valuePhis) {<NEW_LINE>final Value value = operand(phi.firstValue());<NEW_LINE>if (phi.singleBackValueOrThis() == phi && value instanceof Variable) {<NEW_LINE>setResult(phi, value);<NEW_LINE>} else if (TornadoOptions.OPTIMIZE_LOAD_STORE_SPIRV) {<NEW_LINE>if (phiVars == null) {<NEW_LINE>phiVars = new LIRPhiVars();<NEW_LINE>}<NEW_LINE>// Assign the Phi to a new value and pass-over the result to the next<NEW_LINE>// instruction.<NEW_LINE>final AllocatableValue result = (AllocatableValue) operandForPhi(phi);<NEW_LINE>append(new SPIRVLIRStmt.PassValuePhi(result, value));<NEW_LINE>phiVars.insertPhiValue(result, value);<NEW_LINE>} else {<NEW_LINE>final AllocatableValue result = (AllocatableValue) operandForPhi(phi);<NEW_LINE>append(new SPIRVLIRStmt.AssignStmtWithLoad(result, value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Emit label of the Loop<NEW_LINE>append(new SPIRVControlFlow.LoopBeginLabel(block.toString()));<NEW_LINE>// Emit pending Phi values<NEW_LINE>if (phiVars != null) {<NEW_LINE>generateOpPhiInstruction(phiVars, dependentPhiValueBlock, predBlock);<NEW_LINE>}<NEW_LINE>label.clearIncomingValues();<NEW_LINE>} | (Block) gen.getCurrentBlock(); |
864,344 | private ImmutableList<SuggestedFix> buildFixes(List<TreePath> removals) {<NEW_LINE>boolean encounteredSideEffects = false;<NEW_LINE>SuggestedFix.Builder withoutSideEffects = SuggestedFix.builder().setShortDescription("remove unused variable and any side effects");<NEW_LINE>SuggestedFix.Builder withSideEffects = SuggestedFix.builder().setShortDescription("remove unused variable");<NEW_LINE>for (TreePath usageSite : Iterables.concat(removals, usageSites)) {<NEW_LINE>List<String> keepingSideEffects = new ArrayList<>();<NEW_LINE>for (TreePath path = usageSite; !(path.getLeaf() instanceof StatementTree); path = path.getParentPath()) {<NEW_LINE>List<? extends ExpressionTree> arguments;<NEW_LINE>if (path.getLeaf() instanceof MethodInvocationTree) {<NEW_LINE>arguments = ((MethodInvocationTree) path.getLeaf()).getArguments();<NEW_LINE>} else if (path.getLeaf() instanceof NewClassTree) {<NEW_LINE>arguments = ((NewClassTree) path.getLeaf()).getArguments();<NEW_LINE>} else {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>arguments.stream().filter(SideEffectAnalysis::hasSideEffect).map(e -> state.getSourceForNode(e) + ";").forEach(keepingSideEffects::add);<NEW_LINE>}<NEW_LINE>StatementTree enclosingStatement = state.withPath(usageSite).findEnclosing(StatementTree.class);<NEW_LINE>if (!keepingSideEffects.isEmpty()) {<NEW_LINE>encounteredSideEffects = true;<NEW_LINE>withSideEffects.replace(enclosingStatement, keepingSideEffects.stream().<MASK><NEW_LINE>} else {<NEW_LINE>withSideEffects.replace(enclosingStatement, "");<NEW_LINE>}<NEW_LINE>withoutSideEffects.replace(enclosingStatement, "");<NEW_LINE>}<NEW_LINE>return encounteredSideEffects ? ImmutableList.of(withoutSideEffects.build(), withSideEffects.build()) : ImmutableList.of(withoutSideEffects.build());<NEW_LINE>} | collect(joining(""))); |
371,727 | public Object apply(TypeSystem t, Record r) {<NEW_LINE>if (r.size() == 1) {<NEW_LINE>Value value = r.get(0);<NEW_LINE>if (value.hasType(t.LIST())) {<NEW_LINE>aggregated.compareAndSet(false, true);<NEW_LINE>return aggregateList(t, value);<NEW_LINE>} else if (value.hasType(t.PATH())) {<NEW_LINE>aggregated.compareAndSet(false, true);<NEW_LINE>return aggregatePath(t, value, Collections.emptyList());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return <MASK><NEW_LINE>} catch (NoRootNodeMappingException e) {<NEW_LINE>// We didn't find anything on the top level. It still can be a path plus some additional information<NEW_LINE>// to enrich the nodes on the path with.<NEW_LINE>Map<Boolean, List<Map.Entry<String, Value>>> pathValues = r.asMap(Function.identity()).entrySet().stream().collect(Collectors.partitioningBy(entry -> entry.getValue().hasType(t.PATH())));<NEW_LINE>if (pathValues.get(true).size() == 1) {<NEW_LINE>aggregated.compareAndSet(false, true);<NEW_LINE>return aggregatePath(t, pathValues.get(true).get(0).getValue(), pathValues.get(false));<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | target.apply(t, r); |
566,333 | public Channel openAuxChannel(String auxItemTag, DataAccessOption... options) throws IOException {<NEW_LINE>Path auxPath = getAuxObjectAsPath(auxItemTag);<NEW_LINE>if (isWriteAccessRequested(options)) {<NEW_LINE>if (dvObject instanceof Dataset && !this.canWrite()) {<NEW_LINE>// If this is a dataset-level auxilary file (a cached metadata export,<NEW_LINE>// dataset logo, etc.) there's a chance that no "real" files<NEW_LINE>// have been saved for this dataset yet, and thus the filesystem<NEW_LINE>// directory does not exist yet. Let's force a proper .open() on<NEW_LINE>// this StorageIO, that will ensure it is created:<NEW_LINE>open(DataAccessOption.WRITE_ACCESS);<NEW_LINE>}<NEW_LINE>FileOutputStream auxOut = new FileOutputStream(auxPath.toFile());<NEW_LINE>if (auxOut == null) {<NEW_LINE>throw new IOException("Failed to open Auxiliary File " + dvObject.getStorageIdentifier() + "." + auxItemTag + " for writing.");<NEW_LINE>}<NEW_LINE>return auxOut.getChannel();<NEW_LINE>}<NEW_LINE>// Read access requested.<NEW_LINE>// Check if this Aux object is cached; and if so, open for reading:<NEW_LINE>if (!auxPath.toFile().exists()) {<NEW_LINE>throw new FileNotFoundException("Auxiliary File " + dvObject.getStorageIdentifier() + "." + auxItemTag + " does not exist.");<NEW_LINE>}<NEW_LINE>FileInputStream auxIn = new <MASK><NEW_LINE>if (auxIn == null) {<NEW_LINE>throw new IOException("Failed to open Auxiliary File " + dvObject.getStorageIdentifier() + "." + auxItemTag + " for reading");<NEW_LINE>}<NEW_LINE>return auxIn.getChannel();<NEW_LINE>} | FileInputStream(auxPath.toFile()); |
684,082 | public JSONObject createRatingObject(String skill_stars) {<NEW_LINE>JSONObject skillName = new JSONObject();<NEW_LINE>skillName.put("positive", "0");<NEW_LINE>skillName.put("negative", "0");<NEW_LINE>skillName.put("feedback_count", 0);<NEW_LINE>skillName.put("bookmark_count", 0);<NEW_LINE>JSONObject skillStars = new JSONObject();<NEW_LINE>skillStars.put("one_star", 0);<NEW_LINE>skillStars.put("two_star", 0);<NEW_LINE>skillStars.put("three_star", 0);<NEW_LINE>skillStars.put("four_star", 0);<NEW_LINE>skillStars.put("five_star", 0);<NEW_LINE><MASK><NEW_LINE>skillStars.put("total_star", 0);<NEW_LINE>if (skill_stars.equals("1")) {<NEW_LINE>skillStars.put("one_star", skillStars.getInt("one_star") + 1);<NEW_LINE>} else if (skill_stars.equals("2")) {<NEW_LINE>skillStars.put("two_star", skillStars.getInt("two_star") + 1);<NEW_LINE>} else if (skill_stars.equals("3")) {<NEW_LINE>skillStars.put("three_star", skillStars.getInt("three_star") + 1);<NEW_LINE>} else if (skill_stars.equals("4")) {<NEW_LINE>skillStars.put("four_star", skillStars.getInt("four_star") + 1);<NEW_LINE>} else if (skill_stars.equals("5")) {<NEW_LINE>skillStars.put("five_star", skillStars.getInt("five_star") + 1);<NEW_LINE>}<NEW_LINE>float totalStars = skillStars.getInt("one_star") + skillStars.getInt("two_star") + skillStars.getInt("three_star") + skillStars.getInt("four_star") + skillStars.getInt("five_star");<NEW_LINE>float avgStar = (1 * skillStars.getInt("one_star") + 2 * skillStars.getInt("two_star") + 3 * skillStars.getInt("three_star") + 4 * skillStars.getInt("four_star") + 5 * skillStars.getInt("five_star")) / totalStars;<NEW_LINE>// Format avgStar to keep 2 places after decimal<NEW_LINE>String roundAvgStars = String.format("%.02f", avgStar);<NEW_LINE>skillStars.put("total_star", Math.round(totalStars));<NEW_LINE>skillStars.put("avg_star", Float.parseFloat(roundAvgStars));<NEW_LINE>skillName.put("stars", skillStars);<NEW_LINE>return skillName;<NEW_LINE>} | skillStars.put("avg_star", 0); |
1,484,020 | public static DescribeLiveDomainFrameRateAndBitRateDataResponse unmarshall(DescribeLiveDomainFrameRateAndBitRateDataResponse describeLiveDomainFrameRateAndBitRateDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLiveDomainFrameRateAndBitRateDataResponse.setRequestId<MASK><NEW_LINE>List<FrameRateAndBitRateInfo> frameRateAndBitRateInfos = new ArrayList<FrameRateAndBitRateInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLiveDomainFrameRateAndBitRateDataResponse.FrameRateAndBitRateInfos.Length"); i++) {<NEW_LINE>FrameRateAndBitRateInfo frameRateAndBitRateInfo = new FrameRateAndBitRateInfo();<NEW_LINE>frameRateAndBitRateInfo.setVideoFrameRate(_ctx.floatValue("DescribeLiveDomainFrameRateAndBitRateDataResponse.FrameRateAndBitRateInfos[" + i + "].VideoFrameRate"));<NEW_LINE>frameRateAndBitRateInfo.setStreamUrl(_ctx.stringValue("DescribeLiveDomainFrameRateAndBitRateDataResponse.FrameRateAndBitRateInfos[" + i + "].StreamUrl"));<NEW_LINE>frameRateAndBitRateInfo.setAudioFrameRate(_ctx.floatValue("DescribeLiveDomainFrameRateAndBitRateDataResponse.FrameRateAndBitRateInfos[" + i + "].AudioFrameRate"));<NEW_LINE>frameRateAndBitRateInfo.setBitRate(_ctx.floatValue("DescribeLiveDomainFrameRateAndBitRateDataResponse.FrameRateAndBitRateInfos[" + i + "].BitRate"));<NEW_LINE>frameRateAndBitRateInfos.add(frameRateAndBitRateInfo);<NEW_LINE>}<NEW_LINE>describeLiveDomainFrameRateAndBitRateDataResponse.setFrameRateAndBitRateInfos(frameRateAndBitRateInfos);<NEW_LINE>return describeLiveDomainFrameRateAndBitRateDataResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeLiveDomainFrameRateAndBitRateDataResponse.RequestId")); |
1,145,169 | public static Object fromBase16(BString str) {<NEW_LINE>if (str.length() % 2 != 0) {<NEW_LINE>return ErrorCreator.createError(StringUtils.fromString("Invalid base16 string"), StringUtils.fromString("Expected an even length string, but the length of the string" + " was: " + str.length()));<NEW_LINE>}<NEW_LINE>char[] chars = str.getValue().toCharArray();<NEW_LINE>byte[] bytes = new byte[chars.length / 2];<NEW_LINE>List<Character> <MASK><NEW_LINE>for (int i = 0, j = 0; i < chars.length; i += 2, j++) {<NEW_LINE>int upperHalf = Character.digit(chars[i], 16);<NEW_LINE>int lowerHalf = Character.digit(chars[i + 1], 16);<NEW_LINE>if (upperHalf < 0) {<NEW_LINE>invalidChars.add(chars[i]);<NEW_LINE>}<NEW_LINE>if (lowerHalf < 0) {<NEW_LINE>invalidChars.add(chars[i]);<NEW_LINE>}<NEW_LINE>bytes[j] = (byte) (upperHalf << 4 | lowerHalf);<NEW_LINE>}<NEW_LINE>if (!invalidChars.isEmpty()) {<NEW_LINE>return ErrorCreator.createError(StringUtils.fromString("Invalid base16 string"), StringUtils.fromString("Invalid character(s): " + invalidChars.toString()));<NEW_LINE>}<NEW_LINE>return ValueCreator.createArrayValue(bytes);<NEW_LINE>} | invalidChars = new ArrayList<>(); |
1,400,098 | private void importUserColors() throws IOException {<NEW_LINE>FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);<NEW_LINE>dialog.setText(Messages.ColoursPreferencePage_22);<NEW_LINE>if (!PlatformUtils.isMac()) {<NEW_LINE>// Single file filtering in the Open dialog doesn't work on Mac<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$<NEW_LINE>dialog.setFilterExtensions(new String[] { "ArchiColours.prefs", "*.prefs", "*.*" });<NEW_LINE>// $NON-NLS-1$<NEW_LINE>dialog.setFileName("ArchiColours.prefs");<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>dialog.setFilterExtensions(new String[] { "*.prefs", "*.*" });<NEW_LINE>}<NEW_LINE>String path = dialog.open();<NEW_LINE>if (path == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PreferenceStore store = new PreferenceStore(path);<NEW_LINE>store.load();<NEW_LINE>// Fill Colors / Folder Colors<NEW_LINE>for (Entry<Object, Color> entry : fColorsCache.entrySet()) {<NEW_LINE>String key = DEFAULT_FILL_COLOR_PREFIX + getColorKey(entry.getKey());<NEW_LINE>String value = store.getString(key);<NEW_LINE>if (StringUtils.isSet(value)) {<NEW_LINE>setColor(entry.getKey(), ColorFactory.convertStringToRGB(value));<NEW_LINE>}<NEW_LINE>key = FOLDER_COLOUR_PREFIX + getColorKey(entry.getKey());<NEW_LINE>value = store.getString(key);<NEW_LINE>if (StringUtils.isSet(value)) {<NEW_LINE>setColor(entry.getKey()<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Element Line Color<NEW_LINE>String key = DEFAULT_ELEMENT_LINE_COLOR;<NEW_LINE>String value = store.getString(key);<NEW_LINE>if (StringUtils.isSet(value)) {<NEW_LINE>setColor(key, ColorFactory.convertStringToRGB(value));<NEW_LINE>}<NEW_LINE>// Connection Line Color<NEW_LINE>key = DEFAULT_CONNECTION_LINE_COLOR;<NEW_LINE>value = store.getString(key);<NEW_LINE>if (StringUtils.isSet(value)) {<NEW_LINE>setColor(key, ColorFactory.convertStringToRGB(value));<NEW_LINE>}<NEW_LINE>} | , ColorFactory.convertStringToRGB(value)); |
1,802,795 | private void maintainMachines(BrevityScheduleType scheduleType) {<NEW_LINE>List<Map<String, Object>> addList = shouldAddMachinesOfType(scheduleType.getType());<NEW_LINE>if (CollectionUtils.isNotEmpty(addList)) {<NEW_LINE>for (Map<String, Object> map : addList) {<NEW_LINE>BrevityScheduleTask task = BrevityScheduleTask.builder().type(scheduleType.getType()).version(getVersion()).host(MapUtils.getString(map, "host")).port(MapUtils.getIntValue(map, "port", 0)).createTime(new Date()).build();<NEW_LINE>int result = insertBrevityScheduler(task);<NEW_LINE>if (result > 0) {<NEW_LINE>log.warn("shouldAddMachinesOfType: task={}", task);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Map<String, Object>> removeList = shouldRemoveMachinesOfType(scheduleType.getType());<NEW_LINE>if (CollectionUtils.isNotEmpty(removeList)) {<NEW_LINE>for (Map<String, Object> map : removeList) {<NEW_LINE>int id = <MASK><NEW_LINE>int result = delBrevityScheduler(id);<NEW_LINE>if (result > 0) {<NEW_LINE>log.warn("shouldRemoveMachinesOfType: type={} id={}", scheduleType, id);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | MapUtils.getIntValue(map, "id"); |
328,919 | private void editSelectedGeneralSubtree() {<NEW_LINE>int selectedRow = jtGeneralSubtrees.getSelectedRow();<NEW_LINE>if (selectedRow != -1) {<NEW_LINE>GeneralSubtree generalSubtree = (GeneralSubtree) jtGeneralSubtrees.getValueAt(selectedRow, 0);<NEW_LINE>Container container = getTopLevelAncestor();<NEW_LINE>DGeneralSubtreeChooser dGeneralSubtreeChooser = null;<NEW_LINE>if (container instanceof JDialog) {<NEW_LINE>dGeneralSubtreeChooser = new DGeneralSubtreeChooser((JDialog) container, title, generalSubtree);<NEW_LINE>} else {<NEW_LINE>dGeneralSubtreeChooser = new DGeneralSubtreeChooser((JFrame) container, title, generalSubtree);<NEW_LINE>}<NEW_LINE>dGeneralSubtreeChooser.setLocationRelativeTo(container);<NEW_LINE>dGeneralSubtreeChooser.setVisible(true);<NEW_LINE>GeneralSubtree newGeneralSubtree = dGeneralSubtreeChooser.getGeneralSubtree();<NEW_LINE>if (newGeneralSubtree == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>generalSubtrees.<MASK><NEW_LINE>generalSubtrees.getGeneralSubtrees().add(newGeneralSubtree);<NEW_LINE>populate();<NEW_LINE>selectGeneralSubtreeInTable(newGeneralSubtree);<NEW_LINE>}<NEW_LINE>} | getGeneralSubtrees().remove(generalSubtree); |
1,792,432 | private LogicalExpression handleDateTruncFunction(final List<LogicalExpression> args) {<NEW_LINE>// Assert that the first argument to extract is a QuotedString<NEW_LINE>assert args.get(0) instanceof ValueExpressions.QuotedString;<NEW_LINE>// Get the unit of time to be extracted<NEW_LINE>String timeUnitStr = ((ValueExpressions.QuotedString) args.get(0)).value.toUpperCase();<NEW_LINE>TimeUnit <MASK><NEW_LINE>switch(timeUnit) {<NEW_LINE>case YEAR:<NEW_LINE>case MONTH:<NEW_LINE>case DAY:<NEW_LINE>case HOUR:<NEW_LINE>case MINUTE:<NEW_LINE>case SECOND:<NEW_LINE>case WEEK:<NEW_LINE>case QUARTER:<NEW_LINE>case DECADE:<NEW_LINE>case CENTURY:<NEW_LINE>case MILLENNIUM:<NEW_LINE>final String functionPostfix = StringUtils.capitalize(timeUnitStr.toLowerCase());<NEW_LINE>return FunctionCallFactory.createExpression("date_trunc_" + functionPostfix, args.subList(1, 2));<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("date_trunc function supports the following time units: " + "YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, WEEK, QUARTER, DECADE, CENTURY, MILLENNIUM");<NEW_LINE>}<NEW_LINE>} | timeUnit = TimeUnit.valueOf(timeUnitStr); |
175,884 | public void onBackPressed() {<NEW_LINE>// SketchFragment<NEW_LINE>Fragment f = checkFragmentInstance(R.<MASK><NEW_LINE>if (f != null) {<NEW_LINE>((SketchFragment) f).save();<NEW_LINE>// Removes forced portrait orientation for this fragment<NEW_LINE>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);<NEW_LINE>getFragmentManagerInstance().popBackStack();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// DetailFragment<NEW_LINE>f = checkFragmentInstance(R.id.fragment_container, DetailFragment.class);<NEW_LINE>if (f != null) {<NEW_LINE>((DetailFragment) f).goBack = true;<NEW_LINE>((DetailFragment) f).saveAndExit((DetailFragment) f);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// ListFragment<NEW_LINE>f = checkFragmentInstance(R.id.fragment_container, ListFragment.class);<NEW_LINE>if (f != null) {<NEW_LINE>// Before exiting from app the navigation drawer is opened<NEW_LINE>if (Prefs.getBoolean("settings_navdrawer_on_exit", false) && getDrawerLayout() != null && !getDrawerLayout().isDrawerOpen(GravityCompat.START)) {<NEW_LINE>getDrawerLayout().openDrawer(GravityCompat.START);<NEW_LINE>} else if (!Prefs.getBoolean("settings_navdrawer_on_exit", false) && getDrawerLayout() != null && getDrawerLayout().isDrawerOpen(GravityCompat.START)) {<NEW_LINE>getDrawerLayout().closeDrawer(GravityCompat.START);<NEW_LINE>} else {<NEW_LINE>if (!((ListFragment) f).closeFab()) {<NEW_LINE>isPasswordAccepted = false;<NEW_LINE>super.onBackPressed();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>super.onBackPressed();<NEW_LINE>} | id.fragment_container, SketchFragment.class); |
846,325 | public PointSensitivities presentValueSensitivityRatesStickyStrike(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities) {<NEW_LINE>if (volatilities.relativeTime(option.getExpiry()) < 0d) {<NEW_LINE>return PointSensitivities.empty();<NEW_LINE>}<NEW_LINE>ResolvedFxSingle underlying = option.getUnderlying();<NEW_LINE>double fwdDelta = undiscountedDelta(option, ratesProvider, volatilities);<NEW_LINE>double discountFactor = ratesProvider.discountFactor(option.getCounterCurrency(), underlying.getPaymentDate());<NEW_LINE>double notional = signedNotional(option);<NEW_LINE>PointSensitivityBuilder fwdSensi = fxPricer.forwardFxRatePointSensitivity(option.getPutCall().isCall() ? underlying : underlying.inverse(), ratesProvider).<MASK><NEW_LINE>double fwdPrice = undiscountedPrice(option, ratesProvider, volatilities);<NEW_LINE>PointSensitivityBuilder dscSensi = ratesProvider.discountFactors(option.getCounterCurrency()).zeroRatePointSensitivity(underlying.getPaymentDate()).multipliedBy(notional * fwdPrice);<NEW_LINE>return fwdSensi.combinedWith(dscSensi).build().convertedTo(option.getCounterCurrency(), ratesProvider);<NEW_LINE>} | multipliedBy(notional * discountFactor * fwdDelta); |
702,412 | private AppendMessageResult doAppendData(final LogSegment segment, final ByteBuffer data) {<NEW_LINE>int currentPos = segment.getWrotePosition();<NEW_LINE>final int freeSize = segment.getFileSize() - currentPos;<NEW_LINE>int remaining = data.remaining();<NEW_LINE>ByteBuf to = ByteBufAllocator.DEFAULT.ioBuffer(Math.min(remaining, freeSize));<NEW_LINE>try {<NEW_LINE>AppendMessageStatus status = copy(data, to);<NEW_LINE>if (status == DATA_OVERFLOW) {<NEW_LINE>fillZero(to);<NEW_LINE>}<NEW_LINE>if (!segment.appendData(to.nioBuffer()))<NEW_LINE>throw new RuntimeException("append index data failed.");<NEW_LINE>if (status == DATA_OVERFLOW) {<NEW_LINE>return new AppendMessageResult(END_OF_FILE, segment.getBaseOffset(<MASK><NEW_LINE>} else {<NEW_LINE>return new AppendMessageResult(SUCCESS, segment.getBaseOffset() + segment.getWrotePosition());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>ReferenceCountUtil.release(to);<NEW_LINE>}<NEW_LINE>} | ) + segment.getFileSize()); |
1,387,595 | public static <T extends EnumLite, CC extends ClientConnection, HS extends MessageLite, HR extends MessageLite> void prepareSaslHandshake(final RpcConnectionHandler<CC> connectionHandler, List<String> serverAuthMechanisms, CC connection, BitConnectionConfig config, DrillbitEndpoint endpoint, final BasicClient<T, CC, HS, HR> client, T saslRpcType) {<NEW_LINE>try {<NEW_LINE>final Map<String, String> saslProperties = SaslProperties.getSaslProperties(connection.isEncryptionEnabled(<MASK><NEW_LINE>final UserGroupInformation ugi = UserGroupInformation.getLoginUser();<NEW_LINE>final AuthenticatorFactory factory = config.getAuthFactory(serverAuthMechanisms);<NEW_LINE>client.startSaslHandshake(connectionHandler, config.getSaslClientProperties(endpoint, saslProperties), ugi, factory, saslRpcType);<NEW_LINE>} catch (final IOException e) {<NEW_LINE>logger.error("Failed while doing setup for starting sasl handshake for connection {}", connection.getName());<NEW_LINE>final Exception ex = new RpcException(String.format("Failed to initiate authentication to %s", endpoint.getAddress()), e);<NEW_LINE>connectionHandler.connectionFailed(RpcConnectionHandler.FailureType.AUTHENTICATION, ex);<NEW_LINE>}<NEW_LINE>} | ), connection.getMaxWrappedSize()); |
1,371,091 | protected void awaitLatch(CountDownLatch countDownLatch, InternalCompletableFuture future) {<NEW_LINE>try {<NEW_LINE>long currentTimeoutMs = MAX_COMPLETION_LATCH_WAIT_TIME;<NEW_LINE>// Call latch await in small steps to be able to check if node is still active.<NEW_LINE>// If not active then throw HazelcastInstanceNotActiveException,<NEW_LINE>// If closed or destroyed then throw IllegalStateException,<NEW_LINE>// otherwise continue to wait until `MAX_COMPLETION_LATCH_WAIT_TIME` passes.<NEW_LINE>//<NEW_LINE>// Warning: Silently ignoring if latch does not countDown in time.<NEW_LINE>while (currentTimeoutMs > 0 && !countDownLatch.await(COMPLETION_LATCH_WAIT_TIME_STEP, TimeUnit.MILLISECONDS)) {<NEW_LINE>currentTimeoutMs -= COMPLETION_LATCH_WAIT_TIME_STEP;<NEW_LINE>if (!cacheProxy.getNodeEngine().isRunning()) {<NEW_LINE>throw new HazelcastInstanceNotActiveException();<NEW_LINE>} else if (cacheProxy.isClosed()) {<NEW_LINE>throw new IllegalStateException("Cache (" + <MASK><NEW_LINE>} else if (cacheProxy.isDestroyed()) {<NEW_LINE>throw new IllegalStateException("Cache (" + cacheProxy.getPrefixedName() + ") is destroyed!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>currentThread().interrupt();<NEW_LINE>ExceptionUtil.sneakyThrow(e);<NEW_LINE>}<NEW_LINE>} | cacheProxy.getPrefixedName() + ") is closed!"); |
1,211,316 | void add(SegmentWithState segmentWithState) {<NEW_LINE>final <MASK><NEW_LINE>final Pair<SegmentWithState, List<SegmentWithState>> pair = intervalToSegments.get(identifier);<NEW_LINE>final List<SegmentWithState> appendFinishedSegments = pair == null || pair.rhs == null ? new ArrayList<>() : pair.rhs;<NEW_LINE>// always keep APPENDING segments for an interval start millis in the front<NEW_LINE>if (segmentWithState.getState() == SegmentState.APPENDING) {<NEW_LINE>if (pair != null && pair.lhs != null) {<NEW_LINE>throw new ISE("appendingSegment[%s] existed before adding an appendingSegment[%s]", pair.lhs, segmentWithState);<NEW_LINE>}<NEW_LINE>intervalToSegments.put(identifier, Pair.of(segmentWithState, appendFinishedSegments));<NEW_LINE>} else {<NEW_LINE>final SegmentWithState appendingSegment = pair == null ? null : pair.lhs;<NEW_LINE>appendFinishedSegments.add(segmentWithState);<NEW_LINE>intervalToSegments.put(identifier, Pair.of(appendingSegment, appendFinishedSegments));<NEW_LINE>}<NEW_LINE>} | SegmentIdWithShardSpec identifier = segmentWithState.getSegmentIdentifier(); |
533,816 | private boolean applicationOverrideRuleValid(ApplicationOverrideRule rule) {<NEW_LINE>String ruleName = rule.getName();<NEW_LINE>boolean valid = true;<NEW_LINE>if (rule.getApplication() == null) {<NEW_LINE>_w.redFlag(String<MASK><NEW_LINE>valid = false;<NEW_LINE>}<NEW_LINE>if (rule.getDestination().isEmpty()) {<NEW_LINE>_w.redFlag(String.format("No destination set for application-override rule %s", ruleName));<NEW_LINE>valid = false;<NEW_LINE>}<NEW_LINE>if (rule.getSource().isEmpty()) {<NEW_LINE>_w.redFlag(String.format("No source set for application-override rule %s", ruleName));<NEW_LINE>valid = false;<NEW_LINE>}<NEW_LINE>if (rule.getFrom().isEmpty()) {<NEW_LINE>_w.redFlag(String.format("No from-zone set for application-override rule %s", ruleName));<NEW_LINE>valid = false;<NEW_LINE>}<NEW_LINE>if (rule.getTo().isEmpty()) {<NEW_LINE>_w.redFlag(String.format("No to-zone set for application-override rule %s", ruleName));<NEW_LINE>valid = false;<NEW_LINE>}<NEW_LINE>if (rule.getPort().equals(IntegerSpace.EMPTY)) {<NEW_LINE>_w.redFlag(String.format("No port set for application-override rule %s", ruleName));<NEW_LINE>valid = false;<NEW_LINE>}<NEW_LINE>if (rule.getIpProtocol() == null) {<NEW_LINE>_w.redFlag(String.format("No protocol set for application-override rule %s", ruleName));<NEW_LINE>valid = false;<NEW_LINE>}<NEW_LINE>return valid;<NEW_LINE>} | .format("No application set for application-override rule %s", ruleName)); |
1,062,882 | public WeightedPath findSinglePath(Node start, Node end) {<NEW_LINE>lastMetadata = new Metadata();<NEW_LINE>AStarIterator iterator = new AStarIterator(start, end);<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Node node = iterator.next();<NEW_LINE>if (node.equals(end)) {<NEW_LINE>// Hit, return path<NEW_LINE>double weight = iterator.visitData.get(node.getId()).wayLength;<NEW_LINE>final Path path;<NEW_LINE>if (start.getId() == end.getId()) {<NEW_LINE>// Nothing to iterate over<NEW_LINE>path = PathImpl.singular(start);<NEW_LINE>} else {<NEW_LINE>LinkedList<Relationship> rels = new LinkedList<>();<NEW_LINE>var transaction = context.transaction();<NEW_LINE>Relationship rel = transaction.getRelationshipById(iterator.visitData.get(node.getId()).cameFromRelationship);<NEW_LINE>while (rel != null) {<NEW_LINE>rels.addFirst(rel);<NEW_LINE>node = rel.getOtherNode(node);<NEW_LINE>long nextRelId = iterator.visitData.get(node.getId()).cameFromRelationship;<NEW_LINE>rel = nextRelId == -1 ? <MASK><NEW_LINE>}<NEW_LINE>path = toPath(start, rels);<NEW_LINE>}<NEW_LINE>lastMetadata.paths++;<NEW_LINE>return new WeightedPathImpl(weight, path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | null : transaction.getRelationshipById(nextRelId); |
1,751,698 | final CreateEventDestinationResult executeCreateEventDestination(CreateEventDestinationRequest createEventDestinationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createEventDestinationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateEventDestinationRequest> request = null;<NEW_LINE>Response<CreateEventDestinationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateEventDestinationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createEventDestinationRequest));<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, "Pinpoint SMS Voice V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateEventDestination");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateEventDestinationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateEventDestinationResultJsonUnmarshaller());<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,663,919 | public SetMultimap<PaymentId, InvoiceId> retrieveInvoiceIdsByPaymentIds(@NonNull final Collection<PaymentId> paymentIds) {<NEW_LINE>if (paymentIds.isEmpty()) {<NEW_LINE>return ImmutableSetMultimap.of();<NEW_LINE>}<NEW_LINE>final IQuery<I_C_AllocationHdr> completedAllocations = queryBL.createQueryBuilder(I_C_AllocationHdr.class).addOnlyActiveRecordsFilter().addInArrayFilter(I_C_AllocationHdr.COLUMNNAME_DocStatus, DocStatus.Completed, <MASK><NEW_LINE>return queryBL.createQueryBuilder(I_C_AllocationLine.class).addOnlyActiveRecordsFilter().addNotNull(I_C_AllocationLine.COLUMNNAME_C_Invoice_ID).addNotNull(I_C_AllocationLine.COLUMNNAME_C_Payment_ID).addInArrayFilter(I_C_AllocationLine.COLUMNNAME_C_Payment_ID, paymentIds).addInSubQueryFilter(I_C_AllocationLine.COLUMN_C_AllocationHdr_ID, I_C_AllocationHdr.COLUMN_C_AllocationHdr_ID, completedAllocations).create().list().stream().collect(ImmutableSetMultimap.toImmutableSetMultimap(record -> PaymentId.ofRepoId(record.getC_Payment_ID()), record -> InvoiceId.ofRepoIdOrNull(record.getC_Invoice_ID())));<NEW_LINE>} | DocStatus.Closed).create(); |
1,579,409 | ElementValue createOrUpdate(@NonNull final ElementValueCreateOrUpdateRequest request) {<NEW_LINE>//<NEW_LINE>// Validate<NEW_LINE>if (request.getParentId() != null) {<NEW_LINE>final ElementValue parent = <MASK><NEW_LINE>if (!parent.isSummary()) {<NEW_LINE>throw new AdempiereException("Parent element value must be a summary element value: " + parent.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Actual update & save<NEW_LINE>final ElementValueId existingElementValueId = request.getExistingElementValueId();<NEW_LINE>final I_C_ElementValue record = existingElementValueId != null ? getRecordById(existingElementValueId) : InterfaceWrapperHelper.newInstance(I_C_ElementValue.class);<NEW_LINE>record.setAD_Org_ID(request.getOrgId().getRepoId());<NEW_LINE>record.setC_Element_ID(request.getChartOfAccountsId().getRepoId());<NEW_LINE>record.setValue(request.getValue());<NEW_LINE>record.setName(request.getName());<NEW_LINE>record.setAccountSign(request.getAccountSign());<NEW_LINE>record.setAccountType(request.getAccountType());<NEW_LINE>record.setIsSummary(request.isSummary());<NEW_LINE>record.setIsDocControlled(request.isDocControlled());<NEW_LINE>record.setPostActual(request.isPostActual());<NEW_LINE>record.setPostBudget(request.isPostBudget());<NEW_LINE>record.setPostStatistical(request.isPostStatistical());<NEW_LINE>record.setParent_ID(ElementValueId.toRepoId(request.getParentId()));<NEW_LINE>if (request.getSeqNo() != null) {<NEW_LINE>record.setSeqNo(request.getSeqNo());<NEW_LINE>}<NEW_LINE>record.setDefault_Account(request.getDefaultAccountName());<NEW_LINE>InterfaceWrapperHelper.saveRecord(record);<NEW_LINE>return toElementValue(record);<NEW_LINE>} | getById(request.getParentId()); |
1,288,853 | private Object splitDocument(Document document) throws ParserConfigurationException, TransformerException {<NEW_LINE>Object nodes = splitNode(document);<NEW_LINE>final Transformer transformer;<NEW_LINE>synchronized (this.transformerFactory) {<NEW_LINE>transformer <MASK><NEW_LINE>}<NEW_LINE>if (this.outputProperties != null) {<NEW_LINE>transformer.setOutputProperties(this.outputProperties);<NEW_LINE>}<NEW_LINE>if (nodes instanceof List) {<NEW_LINE>List<Node> items = (List<Node>) nodes;<NEW_LINE>List<String> splitStrings = new ArrayList<>(items.size());<NEW_LINE>for (Node nodeFromList : items) {<NEW_LINE>StringResult result = new StringResult();<NEW_LINE>transformer.transform(new DOMSource(nodeFromList), result);<NEW_LINE>splitStrings.add(result.toString());<NEW_LINE>}<NEW_LINE>return splitStrings;<NEW_LINE>} else {<NEW_LINE>return new TransformFunctionIterator((Iterator<Node>) nodes, node -> {<NEW_LINE>StringResult result = new StringResult();<NEW_LINE>try {<NEW_LINE>transformer.transform(new DOMSource(node), result);<NEW_LINE>} catch (TransformerException e) {<NEW_LINE>throw new IllegalStateException("failed to create DocumentBuilder", e);<NEW_LINE>}<NEW_LINE>return result.toString();<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | = this.transformerFactory.newTransformer(); |
520,510 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String createEpl = namedWindow ? "@public create window MyInfraNWT#unique(theString) as (theString string, intPrimitive int)" : "@public create table MyInfraNWT(theString string primary key, intPrimitive int)";<NEW_LINE>if (enableIndexShareCreate) {<NEW_LINE>createEpl = "@Hint('enable_window_subquery_indexshare') " + createEpl;<NEW_LINE>}<NEW_LINE>env.compileDeploy(createEpl, path);<NEW_LINE>env.compileDeploy("insert into MyInfraNWT select theString, intPrimitive from SupportBean", path);<NEW_LINE>if (createExplicitIndex) {<NEW_LINE>env.compileDeploy("@name('index') create index MyIndex on MyInfraNWT (theString)", path);<NEW_LINE>}<NEW_LINE>String consumeEpl = "@name('s0') select status.*, (select * from MyInfraNWT where theString = SupportBean_S0.p00) @eventbean as details from SupportBean_S0 as status";<NEW_LINE>if (disableIndexShareConsumer) {<NEW_LINE>consumeEpl = "@Hint('disable_window_subquery_indexshare') " + consumeEpl;<NEW_LINE>}<NEW_LINE>if (setNoindex) {<NEW_LINE>consumeEpl = "@Hint('set_noindex') " + consumeEpl;<NEW_LINE>}<NEW_LINE>env.compileDeploy(consumeEpl, path).addListener("s0");<NEW_LINE>String[] fields = "id,details[0].theString,details[0].intPrimitive".split(",");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 10));<NEW_LINE>env.sendEventBean(new SupportBean("E2", 20));<NEW_LINE>env.sendEventBean(new SupportBean("E3", 30));<NEW_LINE>env.sendEventBean(new SupportBean_S0(1, "E1"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 1, "E1", 10 });<NEW_LINE>env.sendEventBean(new SupportBean_S0(2, "E2"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 2, "E2", 20 });<NEW_LINE>// test late start<NEW_LINE>env.undeployModuleContaining("s0");<NEW_LINE>env.compileDeploy(consumeEpl<MASK><NEW_LINE>env.sendEventBean(new SupportBean_S0(1, "E1"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 1, "E1", 10 });<NEW_LINE>env.sendEventBean(new SupportBean_S0(2, "E2"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 2, "E2", 20 });<NEW_LINE>env.undeployModuleContaining("s0");<NEW_LINE>if (createExplicitIndex) {<NEW_LINE>env.undeployModuleContaining("index");<NEW_LINE>}<NEW_LINE>env.undeployAll();<NEW_LINE>} | , path).addListener("s0"); |
1,101,734 | final CreateCustomMetricResult executeCreateCustomMetric(CreateCustomMetricRequest createCustomMetricRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createCustomMetricRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateCustomMetricRequest> request = null;<NEW_LINE>Response<CreateCustomMetricResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateCustomMetricRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createCustomMetricRequest));<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, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCustomMetric");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateCustomMetricResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateCustomMetricResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
525,502 | private void incrementFastFail(String metric, Call call) {<NEW_LINE>final String name = metric + call.name();<NEW_LINE>Counter counter = counterMap.get(name);<NEW_LINE>if (counter == null) {<NEW_LINE>final List<Tag> tagList = new ArrayList<Tag>(tags.size() + 3);<NEW_LINE>tagList.addAll(tags);<NEW_LINE>if (call != null) {<NEW_LINE>final String operation = call.name();<NEW_LINE>final String operationType;<NEW_LINE>switch(call) {<NEW_LINE>case GET:<NEW_LINE>case GET_AND_TOUCH:<NEW_LINE>case GETL:<NEW_LINE>case BULK:<NEW_LINE>case ASYNC_GET:<NEW_LINE>operationType = EVCacheMetricsFactory.READ;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>operationType = EVCacheMetricsFactory.WRITE;<NEW_LINE>}<NEW_LINE>if (operation != null)<NEW_LINE>tagList.add(new BasicTag(EVCacheMetricsFactory.CALL_TAG, operation));<NEW_LINE>if (operationType != null)<NEW_LINE>tagList.add(new BasicTag<MASK><NEW_LINE>}<NEW_LINE>tagList.add(new BasicTag(EVCacheMetricsFactory.FAILURE_REASON, metric));<NEW_LINE>counter = EVCacheMetricsFactory.getInstance().getCounter(EVCacheMetricsFactory.FAST_FAIL, tagList);<NEW_LINE>counterMap.put(name, counter);<NEW_LINE>}<NEW_LINE>counter.increment();<NEW_LINE>} | (EVCacheMetricsFactory.CALL_TYPE_TAG, operationType)); |
949,997 | private String validateUserName(String userName) {<NEW_LINE>// return error message or null on good name<NEW_LINE>if (userName.equals("Admin")) {<NEW_LINE>// virtual user for admin console<NEW_LINE>return "User name Admin already in use";<NEW_LINE>}<NEW_LINE>ConfigSettings config = managerFactory.configSettings();<NEW_LINE>if (userName.length() < config.getMinUserNameLength()) {<NEW_LINE>return "User name may not be shorter than " + config.getMinUserNameLength() + " characters";<NEW_LINE>}<NEW_LINE>if (userName.length() > config.getMaxUserNameLength()) {<NEW_LINE>return "User name may not be longer than " <MASK><NEW_LINE>}<NEW_LINE>Pattern invalidUserNamePattern = Pattern.compile(managerFactory.configSettings().getInvalidUserNamePattern(), Pattern.CASE_INSENSITIVE);<NEW_LINE>Matcher m = invalidUserNamePattern.matcher(userName);<NEW_LINE>if (m.find()) {<NEW_LINE>return "User name '" + userName + "' includes not allowed characters: use a-z, A-Z and 0-9";<NEW_LINE>}<NEW_LINE>AuthorizedUser authorizedUser = AuthorizedUserRepository.getInstance().getByName(userName);<NEW_LINE>if (authorizedUser != null) {<NEW_LINE>return "User name '" + userName + "' already in use";<NEW_LINE>}<NEW_LINE>// all fine<NEW_LINE>return null;<NEW_LINE>} | + config.getMaxUserNameLength() + " characters"; |
989,240 | protected void updateTable(boolean pack) {<NEW_LINE>ServerStatus status = gitblit.getStatus();<NEW_LINE>header.setText(Translation.get("gb.status"));<NEW_LINE>version.setText(Constants.NAME + (status.isGO ? " GO v" : " WAR v") + status.version);<NEW_LINE>releaseDate.setText(status.releaseDate);<NEW_LINE>bootDate.setText(status.bootDate.toString() + " (" + Translation.getTimeUtils().timeAgo(status.bootDate) + ")");<NEW_LINE>url.setText(gitblit.url);<NEW_LINE>servletContainer.setText(status.servletContainer);<NEW_LINE>ByteFormat byteFormat = new ByteFormat();<NEW_LINE>heapMaximum.setText(byteFormat.format(status.heapMaximum));<NEW_LINE>heapAllocated.setText(byteFormat.format(status.heapAllocated));<NEW_LINE>heapUsed.setText(byteFormat.format(status.heapAllocated - status.heapFree) + " (" + byteFormat.format(status.heapFree) + " " + Translation.get("gb.free") + ")");<NEW_LINE><MASK><NEW_LINE>tableModel.fireTableDataChanged();<NEW_LINE>} | tableModel.setProperties(status.systemProperties); |
537,543 | public ImportModelResult importModel(ImportModelRequest importModelRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(importModelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ImportModelRequest> request = null;<NEW_LINE>Response<ImportModelResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ImportModelRequestMarshaller().marshall(importModelRequest);<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<ImportModelResult, <MASK><NEW_LINE>JsonResponseHandler<ImportModelResult> responseHandler = new JsonResponseHandler<ImportModelResult>(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>} | JsonUnmarshallerContext> unmarshaller = new ImportModelResultJsonUnmarshaller(); |
40,921 | private void handle(final PingHostMsg msg) {<NEW_LINE>thdf.chainSubmit(new ChainTask(msg) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getSyncSignature() {<NEW_LINE>return "do-ping-host";<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(SyncTaskChain chain) {<NEW_LINE>doPingHost(msg, new ReturnValueCompletion<PingHostReply>(msg, chain) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(PingHostReply reply) {<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>chain.next();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>PingHostReply reply = new PingHostReply();<NEW_LINE>reply.setError(errorCode);<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>chain.next();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getName() {<NEW_LINE>return String.format("do-ping-host-%s", msg.getHostUuid());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected int getSyncLevel() {<NEW_LINE>return HostGlobalConfig.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | HOST_TRACK_PARALLELISM_DEGREE.value(Integer.class); |
1,070,854 | protected Object processField(Field f, Object o) {<NEW_LINE>if (o == null)<NEW_LINE>return null;<NEW_LINE>if (f.fieldImpl == null) {<NEW_LINE>try {<NEW_LINE>f.fieldImpl = o.getClass(<MASK><NEW_LINE>} catch (Exception ex) {<NEW_LINE>com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ws.cache.config.CacheProcessor.processField", "301", this);<NEW_LINE>Tr.error(tc, "DYNA0035E", new Object[] { f.name, o.getClass().getName(), ex.getMessage() });<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "Exception", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Object result = null;<NEW_LINE>try {<NEW_LINE>result = f.fieldImpl.get(o);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ws.cache.config.CacheProcessor.processField", "310", this);<NEW_LINE>Tr.error(tc, "DYNA0036E", new Object[] { f.name, o.getClass().getName(), ex.getMessage() });<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "Exception", ex);<NEW_LINE>}<NEW_LINE>if (f.method != null)<NEW_LINE>result = processMethod(f.method, result);<NEW_LINE>else if (f.field != null)<NEW_LINE>result = processField(f.field, result);<NEW_LINE>if (f.index > -1) {<NEW_LINE>if (result instanceof Collection) {<NEW_LINE>result = ((Collection) result).toArray();<NEW_LINE>}<NEW_LINE>if (result instanceof Object[]) {<NEW_LINE>if (((Object[]) result).length > f.index)<NEW_LINE>result = ((Object[]) result)[f.index];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | ).getField(f.name); |
387,715 | public static void main(String[] args) throws IOException {<NEW_LINE>final TravelingSalesman tsm = new TravelingSalesman(districtCapitals().subSeq(0, 10));<NEW_LINE>final Engine<EnumGene<WayPoint>, Double> engine = Engine.builder(tsm).optimize(Optimize.MINIMUM).alterers(new SwapMutator<>(0.15), new PartiallyMatchedCrossover<>(0.15)).build();<NEW_LINE>// Create evolution statistics consumer.<NEW_LINE>final EvolutionStatistics<Double, ?> statistics = EvolutionStatistics.ofNumber();<NEW_LINE>final Phenotype<EnumGene<WayPoint>, Double> best = engine.stream().limit(1_000).peek(statistics).collect(toBestPhenotype());<NEW_LINE>final ISeq<WayPoint> path = best.genotype().chromosome().stream().map(Gene::allele).collect(ISeq.toISeq());<NEW_LINE>final GPX gpx = GPX.builder().addTrack(track -> track.name("Best Track").addSegment(s -> s.points(path.asList(<MASK><NEW_LINE>final double km = tsm.fitness(best.genotype()) / 1_000.0;<NEW_LINE>GPX.writer(" ").write(gpx, format("%s/out_%d.gpx", getProperty("user.home"), (int) km));<NEW_LINE>System.out.println(statistics);<NEW_LINE>System.out.println("Length: " + km);<NEW_LINE>} | )))).build(); |
940,807 | public boolean createTenantVDCPFRule(String tenantName, long ruleId, String policyIdentifier, String protocol, String publicIp, String startPort, String endPort) throws ExecutionException {<NEW_LINE>String xml = VnmcXml.CREATE_PF_RULE.getXml();<NEW_LINE>String service = VnmcXml.CREATE_PF_RULE.getService();<NEW_LINE>String identifier = Long.toString(ruleId);<NEW_LINE>xml = replaceXmlValue(xml, "cookie", _cookie);<NEW_LINE>xml = replaceXmlValue(xml, "natruledn", getDnForPFRule(tenantName, identifier, policyIdentifier));<NEW_LINE>xml = replaceXmlValue(xml, "natrulename", getNameForPFRule(tenantName, identifier));<NEW_LINE>xml = replaceXmlValue(xml, "descr", "PF rule for Tenant VDC " + tenantName);<NEW_LINE>xml = replaceXmlValue(xml, "ippoolname", getNameForPFIpPool(tenantName, identifier));<NEW_LINE>xml = replaceXmlValue(xml, "portpoolname", getNameForPFPortPool(tenantName, identifier));<NEW_LINE>xml = replaceXmlValue(xml, "ip", publicIp);<NEW_LINE>xml = replaceXmlValue(xml, "startport", startPort);<NEW_LINE>xml = replaceXmlValue(xml, "endport", endPort);<NEW_LINE>xml = replaceXmlValue(xml, "protocolvalue", protocol);<NEW_LINE>long order = 100 + ruleId;<NEW_LINE>xml = replaceXmlValue(xml, "order", Long.toString(order));<NEW_LINE>String <MASK><NEW_LINE>return verifySuccess(response);<NEW_LINE>} | response = sendRequest(service, xml); |
436,823 | ArrayList<Object> new106() /* reduce AThrowStatement */<NEW_LINE>{<NEW_LINE>@SuppressWarnings("hiding")<NEW_LINE>ArrayList<Object> nodeList = new ArrayList<Object>();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList3 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<MASK><NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList1 = pop();<NEW_LINE>PStatement pstatementNode1;<NEW_LINE>{<NEW_LINE>// Block<NEW_LINE>TThrow tthrowNode2;<NEW_LINE>PImmediate pimmediateNode3;<NEW_LINE>TSemicolon tsemicolonNode4;<NEW_LINE>tthrowNode2 = (TThrow) nodeArrayList1.get(0);<NEW_LINE>pimmediateNode3 = (PImmediate) nodeArrayList2.get(0);<NEW_LINE>tsemicolonNode4 = (TSemicolon) nodeArrayList3.get(0);<NEW_LINE>pstatementNode1 = new AThrowStatement(tthrowNode2, pimmediateNode3, tsemicolonNode4);<NEW_LINE>}<NEW_LINE>nodeList.add(pstatementNode1);<NEW_LINE>return nodeList;<NEW_LINE>} | <Object> nodeArrayList2 = pop(); |
1,816,887 | public ListNetworksResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListNetworksResult listNetworksResult = new ListNetworksResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listNetworksResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Networks", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listNetworksResult.setNetworks(new ListUnmarshaller<NetworkSummary>(NetworkSummaryJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listNetworksResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listNetworksResult;<NEW_LINE>} | )).unmarshall(context)); |
511,181 | public PathSet forward(boolean all) {<NEW_LINE>PathSet results = new PathSet();<NEW_LINE>long degree = this.skipDegree > 0L ? this.skipDegree : this.degree;<NEW_LINE>this.record.startOneLayer(true);<NEW_LINE>while (this.record.hasNextKey()) {<NEW_LINE>Id source = this.record.nextKey();<NEW_LINE>Iterator<Edge> edges = edgesOfVertex(source, this.<MASK><NEW_LINE>edges = skipSuperNodeIfNeeded(edges, this.degree, this.skipDegree);<NEW_LINE>while (edges.hasNext()) {<NEW_LINE>HugeEdge edge = (HugeEdge) edges.next();<NEW_LINE>Id target = edge.id().otherVertexId();<NEW_LINE>PathSet paths = this.record.findPath(target, t -> !this.superNode(t, this.direction), all, false);<NEW_LINE>if (paths.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>results.addAll(paths);<NEW_LINE>if (!all) {<NEW_LINE>return paths;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.record.finishOneLayer();<NEW_LINE>return results;<NEW_LINE>} | direction, this.labels, degree); |
1,127,739 | public boolean onContextItemSelected(MenuItem item) {<NEW_LINE>ContextMenuAwareRecyclerView.RecyclerContextMenuInfo info = (ContextMenuAwareRecyclerView.RecyclerContextMenuInfo) item.getMenuInfo();<NEW_LINE>if (info.position >= mAdapter.getItemCount()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Content contents = <MASK><NEW_LINE>switch(item.getItemId()) {<NEW_LINE>case R.id.history:<NEW_LINE>Intent intent = CommitHistoryActivity.makeIntent(getActivity(), mRepository.owner().login(), mRepository.name(), mRef, contents.path(), true);<NEW_LINE>mFileHistoryLauncher.launch(intent);<NEW_LINE>return true;<NEW_LINE>case R.id.download:<NEW_LINE>String url = IntentUtils.createRawFileUrl(mRepository.owner().login(), mRepository.name(), mRef, contents.path());<NEW_LINE>DownloadUtils.enqueueDownloadWithPermissionCheck(getBaseActivity(), url, FileUtils.getMimeTypeFor(contents.name()), contents.name(), null);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return super.onContextItemSelected(item);<NEW_LINE>} | mAdapter.getItemFromAdapterPosition(info.position); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.