idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,169,351 | boolean execute(Object test, InteropLibrary interop, HostContext context) {<NEW_LINE>for (int i = 0; i < otherMappingNodes.length; i++) {<NEW_LINE>HostTargetMapping mapping = otherMappings[i];<NEW_LINE>if (mapping.hostPriority > priority) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Object result = otherMappingNodes[i].execute(test, mapping, context, interop, true);<NEW_LINE>if (result == Boolean.TRUE) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < mappingNodes.length; i++) {<NEW_LINE>HostTargetMapping mapping = mappings[i];<NEW_LINE>if (mapping.hostPriority > priority) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Object result = mappingNodes[i].execute(test, <MASK><NEW_LINE>if (result == Boolean.TRUE) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return fallback.execute(test, interop, context);<NEW_LINE>} | mapping, context, interop, true); |
1,703,469 | private void read00(RevisionDataInput source, CreateReaderGroupEventBuilder eb) throws IOException {<NEW_LINE>eb.requestId(source.readLong());<NEW_LINE>eb.scope(source.readUTF());<NEW_LINE>eb.rgName(source.readUTF());<NEW_LINE>eb.createTimeStamp(source.readLong());<NEW_LINE>eb.groupRefreshTimeMillis(source.readLong());<NEW_LINE>eb.automaticCheckpointIntervalMillis(source.readLong());<NEW_LINE>eb.maxOutstandingCheckpointRequest(source.readInt());<NEW_LINE>eb.retentionTypeOrdinal(source.readCompactInt());<NEW_LINE>eb.generation(source.readLong());<NEW_LINE>eb.<MASK><NEW_LINE>ImmutableMap.Builder<String, RGStreamCutRecord> startStreamCutBuilder = ImmutableMap.builder();<NEW_LINE>source.readMap(DataInput::readUTF, RGStreamCutRecord.SERIALIZER::deserialize, startStreamCutBuilder);<NEW_LINE>eb.startingStreamCuts(startStreamCutBuilder.build());<NEW_LINE>ImmutableMap.Builder<String, RGStreamCutRecord> endStreamCutBuilder = ImmutableMap.builder();<NEW_LINE>source.readMap(DataInput::readUTF, RGStreamCutRecord.SERIALIZER::deserialize, endStreamCutBuilder);<NEW_LINE>eb.endingStreamCuts(endStreamCutBuilder.build());<NEW_LINE>} | readerGroupId(source.readUUID()); |
1,026,808 | private void removeUnnecessaryWhitespaceAroundDiagram() {<NEW_LINE>Rectangle diaWithoutWhite = getContentBounds(0, getGridElements());<NEW_LINE>Dimension viewSize = getViewableDiagrampanelSize();<NEW_LINE>int horSbPos = _scr.getHorizontalScrollBar().getValue();<NEW_LINE>int verSbPos = _scr<MASK><NEW_LINE>horSbPos = handler.realignToGrid(false, horSbPos);<NEW_LINE>verSbPos = handler.realignToGrid(false, verSbPos);<NEW_LINE>int newX = 0;<NEW_LINE>if (_scr.getHorizontalScrollBar().isShowing()) {<NEW_LINE>if (horSbPos > diaWithoutWhite.getX()) {<NEW_LINE>newX = diaWithoutWhite.getX();<NEW_LINE>} else {<NEW_LINE>newX = horSbPos;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int newY = 0;<NEW_LINE>if (_scr.getVerticalScrollBar().isShowing()) {<NEW_LINE>if (verSbPos > diaWithoutWhite.getY()) {<NEW_LINE>newY = diaWithoutWhite.getY();<NEW_LINE>} else {<NEW_LINE>newY = verSbPos;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int newWidth = (int) (horSbPos + viewSize.getWidth());<NEW_LINE>// If the diagram exceeds the right viewable border the width must be adjusted<NEW_LINE>if (diaWithoutWhite.getX() + diaWithoutWhite.getWidth() > horSbPos + viewSize.getWidth()) {<NEW_LINE>newWidth = diaWithoutWhite.getX() + diaWithoutWhite.getWidth();<NEW_LINE>}<NEW_LINE>int newHeight = (int) (verSbPos + viewSize.getHeight());<NEW_LINE>// If the diagram exceeds the lower viewable border the width must be adjusted<NEW_LINE>if (diaWithoutWhite.getY() + diaWithoutWhite.getHeight() > verSbPos + viewSize.getHeight()) {<NEW_LINE>newHeight = diaWithoutWhite.getY() + diaWithoutWhite.getHeight();<NEW_LINE>}<NEW_LINE>moveOrigin(newX, newY);<NEW_LINE>for (GridElement ge : getGridElements()) {<NEW_LINE>ge.setLocation(handler.realignToGrid(false, ge.getRectangle().x - newX), handler.realignToGrid(false, ge.getRectangle().y - newY));<NEW_LINE>}<NEW_LINE>changeViewPosition(-newX, -newY);<NEW_LINE>setPreferredSize(new Dimension(newWidth - newX, newHeight - newY));<NEW_LINE>checkIfScrollbarsAreNecessary();<NEW_LINE>} | .getVerticalScrollBar().getValue(); |
461,359 | private boolean refresh(final Set<BaseFileObj> all2Refresh, RefreshSlow slow, final boolean expected, File[] files) {<NEW_LINE>int add = 0;<NEW_LINE>Iterator<BaseFileObj<MASK><NEW_LINE>while (it.hasNext()) {<NEW_LINE>BaseFileObj fo = null;<NEW_LINE>if (slow != null) {<NEW_LINE>BaseFileObj pref = slow.preferrable();<NEW_LINE>if (pref != null && all2Refresh.remove(pref)) {<NEW_LINE>LOG_REFRESH.log(Level.FINER, "Preferring {0}", pref);<NEW_LINE>fo = pref;<NEW_LINE>it = all2Refresh.iterator();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fo == null) {<NEW_LINE>fo = it.next();<NEW_LINE>it.remove();<NEW_LINE>}<NEW_LINE>add++;<NEW_LINE>if (!isInFiles(fo, files)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (slow != null) {<NEW_LINE>if (!slow.refreshFileObject(fo, expected, add)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>add = 0;<NEW_LINE>} else {<NEW_LINE>fo.refresh(expected);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | > it = all2Refresh.iterator(); |
1,727,182 | private JoinNode makeBNFJoin(JoinRelationDag root, Comparator<JoinRelationDag> joinCmp) {<NEW_LINE>List<JoinRelationDag> <MASK><NEW_LINE>for (JoinRelationDag tree : root.rightNodes) {<NEW_LINE>if (--tree.degree == 0) {<NEW_LINE>zeroDegreeList.add(tree);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final JoinNodeBuilder joinNodeBuilder = new JoinNodeBuilder(root.node);<NEW_LINE>while (!zeroDegreeList.isEmpty()) {<NEW_LINE>zeroDegreeList.sort(joinCmp);<NEW_LINE>// zeroDegreeList contains no er relations<NEW_LINE>boolean cleanList = zeroDegreeList.get(0).relations.erRelationLst.size() == 0;<NEW_LINE>Iterator<JoinRelationDag> zeroDegreeIterator = zeroDegreeList.iterator();<NEW_LINE>List<JoinRelationDag> newZeroDegreeList = new ArrayList<>();<NEW_LINE>while (zeroDegreeIterator.hasNext()) {<NEW_LINE>JoinRelationDag rightNode = zeroDegreeIterator.next();<NEW_LINE>if (cleanList || rightNode.relations.erRelationLst.size() > 0) {<NEW_LINE>zeroDegreeIterator.remove();<NEW_LINE>joinNodeBuilder.appendNodeToRight(rightNode);<NEW_LINE>for (JoinRelationDag tree : rightNode.rightNodes) {<NEW_LINE>if (--tree.degree == 0) {<NEW_LINE>newZeroDegreeList.add(tree);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// not have any er-node, other nodes will sort with new 0 degree nodes<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>zeroDegreeList.addAll(newZeroDegreeList);<NEW_LINE>}<NEW_LINE>return joinNodeBuilder.build();<NEW_LINE>} | zeroDegreeList = new ArrayList<>(); |
676,123 | public void initializeGraphDB(AuditLog auditLog) throws OpenLineageException {<NEW_LINE>this.auditLog = auditLog;<NEW_LINE>try {<NEW_LINE>this.graphHelper = new GraphHelper();<NEW_LINE>this.graphHelper.openGraph(connectionProperties.getConnectorType().getConnectorProviderClassName(), connectionProperties.getConfigurationProperties(), auditLog);<NEW_LINE>this.graphStorageHelper = new LineageGraphStorageService(graphHelper, auditLog);<NEW_LINE>this.lineageGraphQueryService = new LineageGraphQueryService(graphHelper, auditLog);<NEW_LINE>} catch (JanusConnectorException error) {<NEW_LINE>log.error(THE_LINEAGE_GRAPH_COULD_NOT_BE_INITIALIZED_DUE_TO_AN_ERROR, error);<NEW_LINE>throw new OpenLineageException(500, error.getReportingClassName(), error.getReportingActionDescription(), error.getReportedErrorMessage(), error.getReportedSystemAction(<MASK><NEW_LINE>}<NEW_LINE>} | ), error.getReportedUserAction()); |
689,483 | final UpdateEnvironmentResult executeUpdateEnvironment(UpdateEnvironmentRequest updateEnvironmentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateEnvironmentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateEnvironmentRequest> request = null;<NEW_LINE>Response<UpdateEnvironmentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateEnvironmentRequestMarshaller().marshall(super.beforeMarshalling(updateEnvironmentRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Elastic Beanstalk");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateEnvironment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<UpdateEnvironmentResult> responseHandler = new StaxResponseHandler<UpdateEnvironmentResult>(new UpdateEnvironmentResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
495,152 | protected boolean createKeys(List<BlackboardArtifactTag> keys) {<NEW_LINE>try {<NEW_LINE>// Use the blackboard artifact tags bearing the specified tag name as the keys.<NEW_LINE>List<BlackboardArtifactTag> artifactTags = (filteringDSObjId > 0) ? Case.getCurrentCaseThrows().getServices().getTagsManager().getBlackboardArtifactTagsByTagName(tagName, filteringDSObjId) : Case.getCurrentCaseThrows().getServices().getTagsManager().getBlackboardArtifactTagsByTagName(tagName);<NEW_LINE>if (UserPreferences.showOnlyCurrentUserTags()) {<NEW_LINE>String <MASK><NEW_LINE>for (BlackboardArtifactTag tag : artifactTags) {<NEW_LINE>if (userName.equals(tag.getUserName())) {<NEW_LINE>keys.add(tag);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>keys.addAll(artifactTags);<NEW_LINE>}<NEW_LINE>} catch (TskCoreException | NoCurrentCaseException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>Logger.getLogger(BlackboardArtifactTagNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | userName = System.getProperty(USER_NAME_PROPERTY); |
959,477 | private void readMap(DataReader reader) throws IOException {<NEW_LINE>logger.fine("Map section; at offset " + reader.getByteOffset());<NEW_LINE>reader.readOpeningTag(TAG_MAP);<NEW_LINE>dtaMap = new DTADataMap();<NEW_LINE>long dta_offset_stata_data = reader.readULong();<NEW_LINE>logger.fine("dta_offset_stata_data: " + dta_offset_stata_data);<NEW_LINE>dtaMap.setOffset_head(dta_offset_stata_data);<NEW_LINE>long dta_offset_map = reader.readULong();<NEW_LINE>logger.fine("dta_offset_map: " + dta_offset_map);<NEW_LINE>dtaMap.setOffset_map(dta_offset_map);<NEW_LINE>long dta_offset_variable_types = reader.readULong();<NEW_LINE>logger.fine("dta_offset_variable_types: " + dta_offset_variable_types);<NEW_LINE>dtaMap.setOffset_types(dta_offset_variable_types);<NEW_LINE>long dta_offset_varnames = reader.readULong();<NEW_LINE>logger.fine("dta_offset_varnames: " + dta_offset_varnames);<NEW_LINE>dtaMap.setOffset_varnames(dta_offset_varnames);<NEW_LINE>long dta_offset_sortlist = reader.readULong();<NEW_LINE>logger.fine("dta_offset_sortlist: " + dta_offset_sortlist);<NEW_LINE>dtaMap.setOffset_srtlist(dta_offset_sortlist);<NEW_LINE>long dta_offset_formats = reader.readULong();<NEW_LINE>logger.fine("dta_offset_formats: " + dta_offset_formats);<NEW_LINE>dtaMap.setOffset_fmts(dta_offset_formats);<NEW_LINE>long dta_offset_value_label_names = reader.readULong();<NEW_LINE>logger.fine("dta_offset_value_label_names: " + dta_offset_value_label_names);<NEW_LINE>dtaMap.setOffset_vlblnames(dta_offset_value_label_names);<NEW_LINE><MASK><NEW_LINE>logger.fine("dta_offset_variable_labels: " + dta_offset_variable_labels);<NEW_LINE>dtaMap.setOffset_varlabs(dta_offset_variable_labels);<NEW_LINE>long dta_offset_characteristics = reader.readULong();<NEW_LINE>logger.fine("dta_offset_characteristics: " + dta_offset_characteristics);<NEW_LINE>dtaMap.setOffset_characteristics(dta_offset_characteristics);<NEW_LINE>long dta_offset_data = reader.readULong();<NEW_LINE>logger.fine("dta_offset_data: " + dta_offset_data);<NEW_LINE>dtaMap.setOffset_data(dta_offset_data);<NEW_LINE>long dta_offset_strls = reader.readULong();<NEW_LINE>logger.fine("dta_offset_strls: " + dta_offset_strls);<NEW_LINE>dtaMap.setOffset_strls(dta_offset_strls);<NEW_LINE>long dta_offset_value_labels = reader.readULong();<NEW_LINE>logger.fine("dta_offset_value_labels: " + dta_offset_value_labels);<NEW_LINE>dtaMap.setOffset_vallabs(dta_offset_value_labels);<NEW_LINE>long dta_offset_data_close = reader.readULong();<NEW_LINE>logger.fine("dta_offset_data_close: " + dta_offset_data_close);<NEW_LINE>dtaMap.setOffset_data_close(dta_offset_data_close);<NEW_LINE>long dta_offset_eof = reader.readULong();<NEW_LINE>logger.fine("dta_offset_eof: " + dta_offset_eof);<NEW_LINE>dtaMap.setOffset_eof(dta_offset_eof);<NEW_LINE>reader.readClosingTag(TAG_MAP);<NEW_LINE>} | long dta_offset_variable_labels = reader.readULong(); |
110,222 | public static void putValue(final SharedPreferences.Editor editor, final SettingsType type, final String key, final String value) throws XmlPullParserException, NumberFormatException {<NEW_LINE>switch(type) {<NEW_LINE>case TYPE_STRING:<NEW_LINE>editor.putString(key, value);<NEW_LINE>break;<NEW_LINE>case TYPE_LONG:<NEW_LINE>editor.putLong(key, Long.parseLong(value));<NEW_LINE>break;<NEW_LINE>case TYPE_INTEGER:<NEW_LINE>case TYPE_INTEGER_COMPATIBILITY:<NEW_LINE>editor.putInt(key, Integer.parseInt(value));<NEW_LINE>break;<NEW_LINE>case TYPE_BOOLEAN:<NEW_LINE>// do not use Boolean.parseBoolean as it silently ignores malformed values<NEW_LINE>if ("true".equalsIgnoreCase(value) || "1".equals(value)) {<NEW_LINE>editor.putBoolean(key, true);<NEW_LINE>} else if ("false".equalsIgnoreCase(value) || "0".equals(value)) {<NEW_LINE>editor.putBoolean(key, false);<NEW_LINE>} else {<NEW_LINE>throw new NumberFormatException();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case TYPE_FLOAT:<NEW_LINE>editor.putFloat(key<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new XmlPullParserException("unknown type");<NEW_LINE>}<NEW_LINE>} | , Float.parseFloat(value)); |
1,193,062 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String vpnSiteName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (vpnSiteName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, vpnSiteName, apiVersion, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter vpnSiteName is required and cannot be null.")); |
1,821,985 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>setTitle(R.string.activity_main_title);<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>mBluetoothAdapter = ((BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE)).getAdapter();<NEW_LINE>// Is Bluetooth supported on this device?<NEW_LINE>if (mBluetoothAdapter != null) {<NEW_LINE>// Is Bluetooth turned on?<NEW_LINE>if (mBluetoothAdapter.isEnabled()) {<NEW_LINE>// Are Bluetooth Advertisements supported on this device?<NEW_LINE>if (mBluetoothAdapter.isMultipleAdvertisementSupported()) {<NEW_LINE>// Everything is supported and enabled, load the fragments.<NEW_LINE>setupFragments();<NEW_LINE>} else {<NEW_LINE>// Bluetooth Advertisements are not supported.<NEW_LINE>showErrorText(R.string.bt_ads_not_supported);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Prompt user to turn on Bluetooth (logic continues in onActivityResult()).<NEW_LINE>Intent enableBtIntent <MASK><NEW_LINE>startActivityForResult(enableBtIntent, Constants.REQUEST_ENABLE_BT);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Bluetooth is not supported.<NEW_LINE>showErrorText(R.string.bt_not_supported);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); |
152,606 | private void sendBatches() {<NEW_LINE>List<Map.Entry<String, AddDocumentsRequest>> requests;<NEW_LINE>synchronized (this.records) {<NEW_LINE>requests = this.records.entrySet().stream().filter(e -> e.getValue().size() > 0).map((e) -> {<NEW_LINE>AddDocumentsRequest adr = new AddDocumentsRequest();<NEW_LINE>e.getValue().forEach(adr::addDataItem);<NEW_LINE>return Map.entry(<MASK><NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>this.records.clear();<NEW_LINE>}<NEW_LINE>List<AddDocumentsResponse> responses;<NEW_LINE>responses = requests.stream().map((e) -> Exceptions.toRuntime(() -> new DocumentsApi(client).add(workspace, e.getKey(), e.getValue()))).collect(Collectors.toList());<NEW_LINE>responses.stream().flatMap(d -> d.getData().stream()).collect(Collectors.groupingBy(DocumentStatus::getStatus)).entrySet().stream().forEach((e) -> LOGGER.info("{} documents added with a status of {}", e.getValue().size(), e.getKey()));<NEW_LINE>} | e.getKey(), adr); |
1,519,415 | void configureReturner(Query q, SqlObjectStatementConfiguration cfg) {<NEW_LINE>UseRowMapper useRowMapper = getMethod().getAnnotation(UseRowMapper.class);<NEW_LINE>UseRowReducer useRowReducer = getMethod(<MASK><NEW_LINE>if (useRowReducer != null && useRowMapper != null) {<NEW_LINE>throw new IllegalStateException("Cannot declare @UseRowMapper and @UseRowReducer on the same method.");<NEW_LINE>}<NEW_LINE>cfg.setReturner(() -> {<NEW_LINE>StatementContext ctx = q.getContext();<NEW_LINE>QualifiedType<?> elementType = magic.elementType(ctx.getConfig());<NEW_LINE>if (useRowReducer != null) {<NEW_LINE>return magic.reducedResult(q.reduceRows(rowReducerFor(useRowReducer)), ctx);<NEW_LINE>}<NEW_LINE>ResultIterable<?> iterable = useRowMapper == null ? q.mapTo(elementType) : q.map(rowMapperFor(useRowMapper));<NEW_LINE>return magic.mappedResult(iterable, ctx);<NEW_LINE>});<NEW_LINE>} | ).getAnnotation(UseRowReducer.class); |
377,183 | protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>Parser parser = new Parser(PATTERN, (String) msg);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>position.setValid(parser.nextInt(0) == 1);<NEW_LINE>position.setTime(parser.nextDateTime());<NEW_LINE>position.setLongitude(parser.nextCoordinate<MASK><NEW_LINE>position.setLatitude(parser.nextCoordinate(Parser.CoordinateFormat.HEM_DEG_MIN));<NEW_LINE>position.setSpeed(parser.nextDouble(0));<NEW_LINE>position.setCourse(parser.nextDouble(0));<NEW_LINE>position.set(Position.KEY_RSSI, parser.nextDouble());<NEW_LINE>position.set(Position.KEY_EVENT, parser.nextInt(0));<NEW_LINE>position.set(Position.PREFIX_ADC + 1, parser.nextInt(0));<NEW_LINE>position.set(Position.KEY_BATTERY, parser.nextInt(0));<NEW_LINE>position.set(Position.KEY_INPUT, parser.next());<NEW_LINE>position.set(Position.KEY_STATUS, parser.next());<NEW_LINE>return position;<NEW_LINE>} | (Parser.CoordinateFormat.HEM_DEG_MIN)); |
1,250,990 | final public Void visit(final ASTGraphGraphPattern node, Object data) throws VisitorException {<NEW_LINE>final <MASK><NEW_LINE>final Scope oldScope = graphPattern.getStatementPatternScope();<NEW_LINE>final TermNode newContext = (TermNode) node.jjtGetChild(0).jjtAccept(this, null);<NEW_LINE>// @see https://jira.blazegraph.com/browse/BLZG-1176<NEW_LINE>// moved to ASTDeferredIVResolution.fillInIV(AST2BOpContext, BOp)<NEW_LINE>// if (!context.tripleStore.isQuads()) {<NEW_LINE>// if (newContext!=null) {<NEW_LINE>// throw new QuadsOperationInTriplesModeException(<NEW_LINE>// "Use of GRAPH construct in query body is not supported "<NEW_LINE>// + "in triples mode.");<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>graphPattern.setContextVar(newContext);<NEW_LINE>graphPattern.setStatementPatternScope(Scope.NAMED_CONTEXTS);<NEW_LINE>node.jjtGetChild(1).jjtAccept(this, null);<NEW_LINE>graphPattern.setContextVar(oldContext);<NEW_LINE>graphPattern.setStatementPatternScope(oldScope);<NEW_LINE>return null;<NEW_LINE>} | TermNode oldContext = graphPattern.getContext(); |
87,293 | public TransferDomainToAnotherAwsAccountResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TransferDomainToAnotherAwsAccountResult transferDomainToAnotherAwsAccountResult = new TransferDomainToAnotherAwsAccountResult();<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 transferDomainToAnotherAwsAccountResult;<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("OperationId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>transferDomainToAnotherAwsAccountResult.setOperationId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Password", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>transferDomainToAnotherAwsAccountResult.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 transferDomainToAnotherAwsAccountResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,027,388 | final UpdateApplicationResult executeUpdateApplication(UpdateApplicationRequest updateApplicationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateApplicationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateApplicationRequest> request = null;<NEW_LINE>Response<UpdateApplicationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateApplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateApplicationRequest));<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, "AppConfig");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateApplicationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateApplicationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateApplication"); |
1,396,610 | public static DynamicConfigAddMapConfigCodec.RequestParameters decodeRequest(ClientMessage clientMessage) {<NEW_LINE>ClientMessage.ForwardFrameIterator iterator = clientMessage.frameIterator();<NEW_LINE>RequestParameters request = new RequestParameters();<NEW_LINE>ClientMessage.Frame initialFrame = iterator.next();<NEW_LINE>request.backupCount = decodeInt(initialFrame.content, REQUEST_BACKUP_COUNT_FIELD_OFFSET);<NEW_LINE>request.asyncBackupCount = decodeInt(initialFrame.content, REQUEST_ASYNC_BACKUP_COUNT_FIELD_OFFSET);<NEW_LINE>request.timeToLiveSeconds = decodeInt(initialFrame.content, REQUEST_TIME_TO_LIVE_SECONDS_FIELD_OFFSET);<NEW_LINE>request.maxIdleSeconds = decodeInt(initialFrame.content, REQUEST_MAX_IDLE_SECONDS_FIELD_OFFSET);<NEW_LINE>request.readBackupData = decodeBoolean(initialFrame.content, REQUEST_READ_BACKUP_DATA_FIELD_OFFSET);<NEW_LINE>request.mergeBatchSize = decodeInt(initialFrame.content, REQUEST_MERGE_BATCH_SIZE_FIELD_OFFSET);<NEW_LINE>request.statisticsEnabled = decodeBoolean(initialFrame.content, REQUEST_STATISTICS_ENABLED_FIELD_OFFSET);<NEW_LINE>request.metadataPolicy = decodeInt(initialFrame.content, REQUEST_METADATA_POLICY_FIELD_OFFSET);<NEW_LINE>if (initialFrame.content.length >= REQUEST_PER_ENTRY_STATS_ENABLED_FIELD_OFFSET + BOOLEAN_SIZE_IN_BYTES) {<NEW_LINE>request.perEntryStatsEnabled = decodeBoolean(initialFrame.content, REQUEST_PER_ENTRY_STATS_ENABLED_FIELD_OFFSET);<NEW_LINE>request.isPerEntryStatsEnabledExists = true;<NEW_LINE>} else {<NEW_LINE>request.isPerEntryStatsEnabledExists = false;<NEW_LINE>}<NEW_LINE>request.name = StringCodec.decode(iterator);<NEW_LINE>request.evictionConfig = CodecUtil.decodeNullable(iterator, EvictionConfigHolderCodec::decode);<NEW_LINE>request.cacheDeserializedValues = StringCodec.decode(iterator);<NEW_LINE>request.mergePolicy = StringCodec.decode(iterator);<NEW_LINE>request.<MASK><NEW_LINE>request.listenerConfigs = ListMultiFrameCodec.decodeNullable(iterator, ListenerConfigHolderCodec::decode);<NEW_LINE>request.partitionLostListenerConfigs = ListMultiFrameCodec.decodeNullable(iterator, ListenerConfigHolderCodec::decode);<NEW_LINE>request.splitBrainProtectionName = CodecUtil.decodeNullable(iterator, StringCodec::decode);<NEW_LINE>request.mapStoreConfig = CodecUtil.decodeNullable(iterator, MapStoreConfigHolderCodec::decode);<NEW_LINE>request.nearCacheConfig = CodecUtil.decodeNullable(iterator, NearCacheConfigHolderCodec::decode);<NEW_LINE>request.wanReplicationRef = CodecUtil.decodeNullable(iterator, WanReplicationRefCodec::decode);<NEW_LINE>request.indexConfigs = ListMultiFrameCodec.decodeNullable(iterator, IndexConfigCodec::decode);<NEW_LINE>request.attributeConfigs = ListMultiFrameCodec.decodeNullable(iterator, AttributeConfigCodec::decode);<NEW_LINE>request.queryCacheConfigs = ListMultiFrameCodec.decodeNullable(iterator, QueryCacheConfigHolderCodec::decode);<NEW_LINE>request.partitioningStrategyClassName = CodecUtil.decodeNullable(iterator, StringCodec::decode);<NEW_LINE>request.partitioningStrategyImplementation = CodecUtil.decodeNullable(iterator, DataCodec::decode);<NEW_LINE>request.hotRestartConfig = CodecUtil.decodeNullable(iterator, HotRestartConfigCodec::decode);<NEW_LINE>request.eventJournalConfig = CodecUtil.decodeNullable(iterator, EventJournalConfigCodec::decode);<NEW_LINE>request.merkleTreeConfig = CodecUtil.decodeNullable(iterator, MerkleTreeConfigCodec::decode);<NEW_LINE>return request;<NEW_LINE>} | inMemoryFormat = StringCodec.decode(iterator); |
610,702 | public final ClassIdentifierContext classIdentifier() throws RecognitionException {<NEW_LINE>ClassIdentifierContext _localctx = new ClassIdentifierContext(_ctx, getState());<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>int _alt;<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(2859);<NEW_LINE>((ClassIdentifierContext) _localctx).i1 = escapableStr();<NEW_LINE>setState(2864);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().adaptivePredict(_input, 377, _ctx);<NEW_LINE>while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {<NEW_LINE>if (_alt == 1) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(2860);<NEW_LINE>match(DOT);<NEW_LINE>setState(2861);<NEW_LINE>((ClassIdentifierContext) _localctx).i2 = escapableStr();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(2866);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().adaptivePredict(_input, 377, _ctx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | enterRule(_localctx, 418, RULE_classIdentifier); |
909,543 | public SubjectAreaOMASAPIResponse<UsedInContext> updateUsedInContext(String serverName, String userId, String guid, UsedInContext usedInContext, boolean isReplace) {<NEW_LINE>String restAPIName = "updateUsedInContext";<NEW_LINE>RESTCallToken token = restCallLogger.<MASK><NEW_LINE>SubjectAreaOMASAPIResponse<UsedInContext> response = new SubjectAreaOMASAPIResponse<>();<NEW_LINE>AuditLog auditLog = null;<NEW_LINE>// should not be called without a supplied relationship - the calling layer should not allow this.<NEW_LINE>try {<NEW_LINE>auditLog = instanceHandler.getAuditLog(userId, serverName, restAPIName);<NEW_LINE>RelationshipHandler handler = instanceHandler.getRelationshipHandler(serverName, userId, restAPIName);<NEW_LINE>if (isReplace) {<NEW_LINE>UsedInContext updatedUsedInContext = handler.replaceUsedInContextRelationship(userId, guid, usedInContext);<NEW_LINE>response.addResult(updatedUsedInContext);<NEW_LINE>} else {<NEW_LINE>UsedInContext updatedUsedInContext = handler.updateUsedInContextRelationship(userId, guid, usedInContext);<NEW_LINE>response.addResult(updatedUsedInContext);<NEW_LINE>}<NEW_LINE>} catch (Exception exception) {<NEW_LINE>response = getResponseForException(exception, auditLog, className, restAPIName);<NEW_LINE>}<NEW_LINE>restCallLogger.logRESTCallReturn(token, response.toString());<NEW_LINE>return response;<NEW_LINE>} | logRESTCall(serverName, userId, restAPIName); |
683,331 | public void updateTopicUnitSubFlag(final String topic, final boolean hasUnitSub) {<NEW_LINE>TopicConfig topicConfig = <MASK><NEW_LINE>if (topicConfig != null) {<NEW_LINE>int oldTopicSysFlag = topicConfig.getTopicSysFlag();<NEW_LINE>if (hasUnitSub) {<NEW_LINE>topicConfig.setTopicSysFlag(TopicSysFlag.setUnitSubFlag(oldTopicSysFlag));<NEW_LINE>} else {<NEW_LINE>topicConfig.setTopicSysFlag(TopicSysFlag.clearUnitSubFlag(oldTopicSysFlag));<NEW_LINE>}<NEW_LINE>log.info("update topic sys flag. oldTopicSysFlag={}, newTopicSysFlag={}", oldTopicSysFlag, topicConfig.getTopicSysFlag());<NEW_LINE>this.topicConfigTable.put(topic, topicConfig);<NEW_LINE>this.dataVersion.nextVersion();<NEW_LINE>this.persist();<NEW_LINE>this.brokerController.registerBrokerAll(false, true, true);<NEW_LINE>}<NEW_LINE>} | this.topicConfigTable.get(topic); |
107,031 | private void processParenPad(Map<String, String> moduleProps, Properties props) {<NEW_LINE>String option = getPropertyValue(moduleProps, "option", "nospace");<NEW_LINE>String space = "space".equals(option) ? "true" : "false";<NEW_LINE>List<Token> tokens = getApplicableTokens(moduleProps, "tokens");<NEW_LINE>if (tokens.contains(Token.METHOD_CALL)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (tokens.contains(Token.LPAREN) || tokens.contains(Token.RPAREN)) {<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_ANN_PAREN, space);<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_CAST_PAREN, space);<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_CATCH_PAREN, space);<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_FOR_PAREN, space);<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_IF_PAREN, space);<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_METHOD_DECL_PAREN, space);<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_SWITCH_PAREN, space);<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_SYNC_PAREN, space);<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_WHILE_PAREN, space);<NEW_LINE>}<NEW_LINE>} | props.setProperty(PROP_SPACE_WITHIN_METHOD_CALL_PAREN, space); |
675,210 | public AirbyteConnectionStatus check(final JsonNode config) {<NEW_LINE>try {<NEW_LINE>final PulsarDestinationConfig pulsarConfig = PulsarDestinationConfig.getPulsarDestinationConfig(config);<NEW_LINE>final String testTopic = pulsarConfig.getTestTopic();<NEW_LINE>if (!testTopic.isBlank()) {<NEW_LINE>final String key = UUID.randomUUID().toString();<NEW_LINE>final GenericRecord value = Schema.generic(PulsarDestinationConfig.getSchemaInfo()).newRecordBuilder().set(PulsarDestination.COLUMN_NAME_AB_ID, key).set(PulsarDestination.COLUMN_NAME_STREAM, "test-topic-stream").set(PulsarDestination.COLUMN_NAME_EMITTED_AT, System.currentTimeMillis()).set(PulsarDestination.COLUMN_NAME_DATA, Jsons.jsonNode(ImmutableMap.of("test-key", "test-value"))).build();<NEW_LINE>try (final PulsarClient client = PulsarUtils.buildClient(pulsarConfig.getServiceUrl());<NEW_LINE>final Producer<GenericRecord> producer = PulsarUtils.buildProducer(client, Schema.generic(PulsarDestinationConfig.getSchemaInfo()), pulsarConfig.getProducerConfig(), pulsarConfig.uriForTopic(testTopic))) {<NEW_LINE>final MessageId <MASK><NEW_LINE>producer.flush();<NEW_LINE>LOGGER.info("Successfully sent message id '{}' to Pulsar brokers for topic '{}'.", messageId, testTopic);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new AirbyteConnectionStatus().withStatus(Status.SUCCEEDED);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOGGER.error("Exception attempting to connect to the Pulsar brokers: ", e);<NEW_LINE>return new AirbyteConnectionStatus().withStatus(Status.FAILED).withMessage("Could not connect to the Pulsar brokers with provided configuration. \n" + e.getMessage());<NEW_LINE>}<NEW_LINE>} | messageId = producer.send(value); |
183,082 | public void initialize(CmdLineOpts configuration) {<NEW_LINE>CommandLine commandLine = configuration.getCommandLine();<NEW_LINE>// --------------------- Setting Input source (Cassandra table or file) -----------------------\\<NEW_LINE>if (commandLine.hasOption("wordcount_input_file") && commandLine.hasOption("wordcount_input_table")) {<NEW_LINE>LOG.fatal("Input source can be EITHER file or table: found both options set");<NEW_LINE>System.exit(1);<NEW_LINE>} else if (commandLine.hasOption("wordcount_input_file")) {<NEW_LINE>inputFile = commandLine.getOptionValue("wordcount_input_file");<NEW_LINE>useCassandraInput = false;<NEW_LINE>LOG.info("Using wordcount_input_file: " + inputFile);<NEW_LINE>} else if (commandLine.hasOption("wordcount_input_table")) {<NEW_LINE><MASK><NEW_LINE>useCassandraInput = true;<NEW_LINE>LOG.info("Using wordcount_input_table: " + inputTableName);<NEW_LINE>} else {<NEW_LINE>// defaults<NEW_LINE>LOG.info("No input given, will create sample table and use it as input.");<NEW_LINE>inputTableName = defaultInputTableName;<NEW_LINE>useCassandraInput = true;<NEW_LINE>// Setting up sample table<NEW_LINE>Session session = getCassandraClient();<NEW_LINE>// Drop the sample table if it already exists.<NEW_LINE>dropCassandraTable(inputTableName);<NEW_LINE>// Create the input table.<NEW_LINE>executeAndLog(session, "CREATE TABLE IF NOT EXISTS " + inputTableName + " (id int, line varchar, primary key(id));");<NEW_LINE>// Insert some rows.<NEW_LINE>String insert_stmt = "INSERT INTO " + inputTableName + "(id, line) VALUES (%d, '%s');";<NEW_LINE>executeAndLog(session, String.format(insert_stmt, 1, "ten nine eight seven six five four three two one"));<NEW_LINE>executeAndLog(session, String.format(insert_stmt, 2, "ten nine eight seven six five four three two"));<NEW_LINE>executeAndLog(session, String.format(insert_stmt, 3, "ten nine eight seven six five four three"));<NEW_LINE>executeAndLog(session, String.format(insert_stmt, 4, "ten nine eight seven six five four"));<NEW_LINE>executeAndLog(session, String.format(insert_stmt, 5, "ten nine eight seven six five"));<NEW_LINE>executeAndLog(session, String.format(insert_stmt, 6, "ten nine eight seven six"));<NEW_LINE>executeAndLog(session, String.format(insert_stmt, 7, "ten nine eight seven"));<NEW_LINE>executeAndLog(session, String.format(insert_stmt, 8, "ten nine eight"));<NEW_LINE>executeAndLog(session, String.format(insert_stmt, 9, "ten nine"));<NEW_LINE>executeAndLog(session, String.format(insert_stmt, 10, "ten"));<NEW_LINE>LOG.info("Created sample table " + inputTableName);<NEW_LINE>}<NEW_LINE>// ----------------------- Setting Output location (Cassandra table) --------------------------\\<NEW_LINE>if (commandLine.hasOption("wordcount_output_table")) {<NEW_LINE>outputTableName = commandLine.getOptionValue("wordcount_input_table");<NEW_LINE>LOG.info("Using wordcount_output_table: " + outputTableName);<NEW_LINE>} else {<NEW_LINE>// defaults<NEW_LINE>outputTableName = defaultOutputTableName;<NEW_LINE>}<NEW_LINE>} | inputTableName = commandLine.getOptionValue("wordcount_input_table"); |
682,621 | public void showSource(Field v, final boolean reportUnknownSource) {<NEW_LINE>String fieldName = ((Field) v).getName();<NEW_LINE>String url = null;<NEW_LINE>JPDAClassType declaringClass = v.getDeclaringClass();<NEW_LINE>if (declaringClass != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>final String className = ((Field) v).getClassName();<NEW_LINE>final String sourcePath = EditorContextBridge.getRelativePath(className);<NEW_LINE>if (url == null) {<NEW_LINE>url = getURL(sourcePath, true);<NEW_LINE>}<NEW_LINE>if (url == null)<NEW_LINE>return;<NEW_LINE>int lineNumber = lineNumber = EditorContextBridge.getContext().getFieldLineNumber(url, className, fieldName);<NEW_LINE>if (lineNumber < 1)<NEW_LINE>lineNumber = 1;<NEW_LINE>final int ln = lineNumber;<NEW_LINE>final String u = url;<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>boolean success = EditorContextBridge.getContext().showSource(u, ln, debugger);<NEW_LINE>if (reportUnknownSource && !success) {<NEW_LINE>String message = NbBundle.getMessage(SourcePath.class, "No_URL_Warning", sourcePath);<NEW_LINE>NotifyDescriptor d = new NotifyDescriptor.Message(message, NotifyDescriptor.WARNING_MESSAGE);<NEW_LINE>DialogDisplayer.getDefault().notifyLater(d);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | url = getClassURL(declaringClass, null); |
36,868 | protected void checkImport() {<NEW_LINE>for (ImportInfo parameters : ((OntologyImportWizard) getWizard()).getImports()) {<NEW_LINE>if (parameters.getOntologyID() != null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>MasterOntologyIDExtractor extractor = new MasterOntologyIDExtractor();<NEW_LINE>Optional<OWLOntologyID> id = extractor.getOntologyId(parameters.getPhysicalLocation());<NEW_LINE>if (id.isPresent()) {<NEW_LINE>parameters.<MASK><NEW_LINE>} else {<NEW_LINE>parameters.setOntologyID(null);<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>LoggerFactory.getLogger(AnticipateOntologyIdPage.class).error("An error occurred whilst extracting the Ontology Id from the imported ontology: {}", t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>getWizard().setCurrentPanel(getNextPanelDescriptor());<NEW_LINE>});<NEW_LINE>} | setOntologyID(id.get()); |
110,625 | @Operation(summary = "List database service versions", tags = "services", description = "Get a list of all the versions of a database service identified by `id`", responses = { @ApiResponse(responseCode = "200", description = "List of database service versions", content = @Content(mediaType = "application/json", schema = @Schema(implementation = EntityHistory.class))) })<NEW_LINE>public EntityHistory listVersions(@Context UriInfo uriInfo, @Context SecurityContext securityContext, @Parameter(description = "database service Id", schema = @Schema(type = "string")) @PathParam("id") String id) throws IOException {<NEW_LINE>EntityHistory entityHistory = dao.listVersions(id);<NEW_LINE>List<Object> versions = entityHistory.getVersions().stream().map(json -> {<NEW_LINE>try {<NEW_LINE>DatabaseService databaseService = JsonUtils.readValue((String) json, DatabaseService.class);<NEW_LINE>return JsonUtils.pojoToJson<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>return json;<NEW_LINE>}<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>entityHistory.setVersions(versions);<NEW_LINE>return entityHistory;<NEW_LINE>} | (decryptOrNullify(securityContext, databaseService)); |
1,684,431 | protected void mutate(BackendAction item) {<NEW_LINE>BackendEntry e = item.entry();<NEW_LINE>assert e instanceof TextBackendEntry;<NEW_LINE>TextBackendEntry entry = (TextBackendEntry) e;<NEW_LINE>InMemoryDBTable table = this.table(entry.type());<NEW_LINE>switch(item.action()) {<NEW_LINE>case INSERT:<NEW_LINE>LOG.debug("[store {}] add entry: {}", this.store, entry);<NEW_LINE>table.insert(null, entry);<NEW_LINE>break;<NEW_LINE>case DELETE:<NEW_LINE>LOG.debug("[store {}] remove id: {}", this.<MASK><NEW_LINE>table.delete(null, entry);<NEW_LINE>break;<NEW_LINE>case APPEND:<NEW_LINE>LOG.debug("[store {}] append entry: {}", this.store, entry);<NEW_LINE>table.append(null, entry);<NEW_LINE>break;<NEW_LINE>case ELIMINATE:<NEW_LINE>LOG.debug("[store {}] eliminate entry: {}", this.store, entry);<NEW_LINE>table.eliminate(null, entry);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new BackendException("Unsupported mutate type: %s", item.action());<NEW_LINE>}<NEW_LINE>} | store, entry.id()); |
982,761 | public void update(String gatewayId, UpdateGatewayBean gatewayToUpdate) throws GatewayNotFoundException, NotAuthorizedException {<NEW_LINE>securityContext.checkAdminPermissions();<NEW_LINE>try {<NEW_LINE>storage.beginTx();<NEW_LINE>Date now = new Date();<NEW_LINE>GatewayBean gateway = storage.getGateway(gatewayId);<NEW_LINE>if (gateway == null) {<NEW_LINE>throw ExceptionFactory.gatewayNotFoundException(gatewayId);<NEW_LINE>}<NEW_LINE>gateway.setModifiedBy(securityContext.getCurrentUser());<NEW_LINE>gateway.setModifiedOn(now);<NEW_LINE>if (gatewayToUpdate.getDescription() != null)<NEW_LINE>gateway.setDescription(gatewayToUpdate.getDescription());<NEW_LINE>if (gatewayToUpdate.getType() != null)<NEW_LINE>gateway.setType(gatewayToUpdate.getType());<NEW_LINE>if (gatewayToUpdate.getConfiguration() != null)<NEW_LINE>gateway.<MASK><NEW_LINE>encryptPasswords(gateway);<NEW_LINE>storage.updateGateway(gateway);<NEW_LINE>storage.commitTx();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>log.debug(String.format("Successfully updated gateway %s: %s", gateway.getName(), gateway));<NEW_LINE>} catch (AbstractRestException e) {<NEW_LINE>storage.rollbackTx();<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>storage.rollbackTx();<NEW_LINE>throw new SystemErrorException(e);<NEW_LINE>}<NEW_LINE>} | setConfiguration(gatewayToUpdate.getConfiguration()); |
621,095 | public void load(PolicyMappings policyMappings) {<NEW_LINE>ASN1Sequence policyMappingsSeq = (ASN1Sequence) policyMappings.toASN1Primitive();<NEW_LINE>// convert and sort<NEW_LINE>ASN1Encodable[] asn1EncArray = policyMappingsSeq.toArray();<NEW_LINE>PolicyMapping[] policyMappingsArray = new PolicyMapping[asn1EncArray.length];<NEW_LINE>for (int i = 0; i < asn1EncArray.length; i++) {<NEW_LINE>policyMappingsArray[i] = PolicyMapping.getInstance(asn1EncArray[i]);<NEW_LINE>}<NEW_LINE>Arrays.sort(policyMappingsArray, new IssuerDomainPolicyComparator());<NEW_LINE>data = new Object[policyMappingsArray.length][2];<NEW_LINE>int i = 0;<NEW_LINE>for (PolicyMapping policyMapping : policyMappingsArray) {<NEW_LINE>data[i][0] = policyMapping;<NEW_LINE>data<MASK><NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>fireTableDataChanged();<NEW_LINE>} | [i][1] = policyMapping; |
1,093,336 | public void writeReturn(final ReturnStatement statement) {<NEW_LINE>controller.getAcg().onLineNumber(statement, "visitReturnStatement");<NEW_LINE>writeStatementLabel(statement);<NEW_LINE>MethodVisitor mv = controller.getMethodVisitor();<NEW_LINE>OperandStack operandStack = controller.getOperandStack();<NEW_LINE>ClassNode returnType = controller.getReturnType();<NEW_LINE>if (returnType == ClassHelper.VOID_TYPE) {<NEW_LINE>if (!(statement.isReturningNullOrVoid())) {<NEW_LINE>// TODO: move to Verifier<NEW_LINE>controller.getAcg().throwException("Cannot use return statement with an expression on a method that returns void");<NEW_LINE>}<NEW_LINE>controller.getCompileStack().applyBlockRecorder();<NEW_LINE>mv.visitInsn(RETURN);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Expression expression = statement.getExpression();<NEW_LINE>expression.visit(controller.getAcg());<NEW_LINE>operandStack.doGroovyCast(returnType);<NEW_LINE>if (controller.getCompileStack().hasBlockRecorder()) {<NEW_LINE>ClassNode type = operandStack.getTopOperand();<NEW_LINE>int returnValueIdx = controller.getCompileStack().defineTemporaryVariable("returnValue", returnType, true);<NEW_LINE>controller.getCompileStack().applyBlockRecorder();<NEW_LINE>operandStack.load(type, returnValueIdx);<NEW_LINE>controller.getCompileStack().removeVar(returnValueIdx);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>operandStack.remove(1);<NEW_LINE>} | BytecodeHelper.doReturn(mv, returnType); |
711,924 | private double completeCalculation() {<NEW_LINE>if (charsIndex == 0 || (charsIndex == 1 && chars[0] == '-')) {<NEW_LINE>// "" or "-"<NEW_LINE>// Strict requires at least one digit.<NEW_LINE>strictError();<NEW_LINE>// Treated as 0.0 (not -0.0) in non-strict.<NEW_LINE>return 0.0;<NEW_LINE>} else if (isExponent((byte) chars[charsIndex - 1])) {<NEW_LINE>// Covers 12.0efrog<NEW_LINE>strictError();<NEW_LINE>addExponentToResult(adjustExponent);<NEW_LINE>} else if (isStrict && !isEOS()) {<NEW_LINE>// We know it is not whitespace at this point<NEW_LINE>strictError();<NEW_LINE>} else if (!wroteExponent && adjustExponent != 0) {<NEW_LINE>addToResult((byte) 'E');<NEW_LINE>addExponentToResult(adjustExponent);<NEW_LINE>}<NEW_LINE>return SafeDoubleParser.parseDouble(new String<MASK><NEW_LINE>} | (chars, 0, charsIndex)); |
1,278,947 | public void create(Properties ctx, TransformerHandler document) throws SAXException {<NEW_LINE>int referenceId = Env.getContextAsInt(ctx, X_AD_Reference.COLUMNNAME_AD_Reference_ID);<NEW_LINE>PackOut packOut = (PackOut) ctx.get("PackOutProcess");<NEW_LINE>if (packOut == null) {<NEW_LINE>packOut = new PackOut();<NEW_LINE>packOut.setLocalContext(ctx);<NEW_LINE>}<NEW_LINE>// Reference<NEW_LINE>X_AD_Reference reference = new <MASK><NEW_LINE>packOut.createGenericPO(document, reference, true, null);<NEW_LINE>if (reference.getValidationType().equals(X_AD_Reference.VALIDATIONTYPE_ListValidation)) {<NEW_LINE>List<X_AD_Ref_List> referenceListAsList = new Query(ctx, I_AD_Ref_List.Table_Name, I_AD_Ref_List.COLUMNNAME_AD_Reference_ID + " = ?", null).setParameters(referenceId).setOnlyActiveRecords(true).list();<NEW_LINE>for (X_AD_Ref_List referenceList : referenceListAsList) {<NEW_LINE>packOut.createGenericPO(document, referenceList, true, null);<NEW_LINE>}<NEW_LINE>} else if (reference.getValidationType().equals(X_AD_Reference.VALIDATIONTYPE_TableValidation)) {<NEW_LINE>List<X_AD_Ref_Table> referenceTableAsList = new Query(ctx, I_AD_Ref_Table.Table_Name, I_AD_Ref_Table.COLUMNNAME_AD_Reference_ID + " = ?", null).setParameters(referenceId).setOnlyActiveRecords(true).list();<NEW_LINE>for (X_AD_Ref_Table referenceTable : referenceTableAsList) {<NEW_LINE>packOut.createGenericPO(document, referenceTable, true, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | X_AD_Reference(ctx, referenceId, null); |
1,811,388 | private Mono<Response<Object>> validateContainerSettingsWithResponseAsync(String resourceGroupName, ValidateContainerSettingsRequest validateContainerSettingsRequest, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (validateContainerSettingsRequest == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter validateContainerSettingsRequest is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>validateContainerSettingsRequest.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.validateContainerSettings(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), validateContainerSettingsRequest, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
552,031 | int hitTest(final float[] src) {<NEW_LINE>if (mContent == null) {<NEW_LINE>return super.hitTest(src);<NEW_LINE>}<NEW_LINE>if (mPath == null || !mInvertible || !mTransformInvertible) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>float[] dst = new float[2];<NEW_LINE>mInvMatrix.mapPoints(dst, src);<NEW_LINE>mInvTransform.mapPoints(dst);<NEW_LINE>int x = Math<MASK><NEW_LINE>int y = Math.round(dst[1]);<NEW_LINE>initBounds();<NEW_LINE>if ((mRegion == null || !mRegion.contains(x, y)) && (mStrokeRegion == null || !mStrokeRegion.contains(x, y))) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>Path clipPath = getClipPath();<NEW_LINE>if (clipPath != null) {<NEW_LINE>if (!mClipRegion.contains(x, y)) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return getId();<NEW_LINE>} | .round(dst[0]); |
669,930 | public static void execute(ServerConnection c, String sql) {<NEW_LINE>String subSql = sql.substring(sql.indexOf("SELECT") + 6);<NEW_LINE>List<String> splitVar = Splitter.on(",").omitEmptyStrings().trimResults().splitToList(subSql);<NEW_LINE>splitVar = convert(splitVar);<NEW_LINE>int FIELD_COUNT = splitVar.size();<NEW_LINE>ResultSetHeaderPacket header = PacketUtil.getHeader(FIELD_COUNT);<NEW_LINE>FieldPacket[] fields = new FieldPacket[FIELD_COUNT];<NEW_LINE>int i = 0;<NEW_LINE>byte packetId = 0;<NEW_LINE>header.packetId = ++packetId;<NEW_LINE>for (int i1 = 0, splitVarSize = splitVar.size(); i1 < splitVarSize; i1++) {<NEW_LINE>String s = splitVar.get(i1);<NEW_LINE>fields[i] = PacketUtil.getField(s, Fields.FIELD_TYPE_VAR_STRING);<NEW_LINE>fields[i++].packetId = ++packetId;<NEW_LINE>}<NEW_LINE>ByteBuffer buffer = c.allocate();<NEW_LINE>// write header<NEW_LINE>buffer = header.write(buffer, c, true);<NEW_LINE>// write fields<NEW_LINE>for (FieldPacket field : fields) {<NEW_LINE>buffer = field.write(buffer, c, true);<NEW_LINE>}<NEW_LINE>EOFPacket eof = new EOFPacket();<NEW_LINE>eof.packetId = ++packetId;<NEW_LINE>// write eof<NEW_LINE>buffer = eof.write(buffer, c, true);<NEW_LINE>// write rows<NEW_LINE>// byte packetId = eof.packetId;<NEW_LINE>RowDataPacket row = new RowDataPacket(FIELD_COUNT);<NEW_LINE>for (int i1 = 0, splitVarSize = splitVar.size(); i1 < splitVarSize; i1++) {<NEW_LINE>String s = splitVar.get(i1);<NEW_LINE>String value = variables.get(s) == null ? "" : variables.get(s);<NEW_LINE>row.add(value.getBytes());<NEW_LINE>}<NEW_LINE>row.packetId = ++packetId;<NEW_LINE>buffer = row.<MASK><NEW_LINE>// write lastEof<NEW_LINE>EOFPacket lastEof = new EOFPacket();<NEW_LINE>lastEof.packetId = ++packetId;<NEW_LINE>buffer = lastEof.write(buffer, c, true);<NEW_LINE>// write buffer<NEW_LINE>c.write(buffer);<NEW_LINE>} | write(buffer, c, true); |
777,274 | public static CheckToStringResponse checkToStringStatus(IType type, IProgressMonitor monitor) {<NEW_LINE>CheckToStringResponse response = new CheckToStringResponse();<NEW_LINE>if (type == null) {<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>CompilationUnit astRoot = CoreASTProvider.getInstance().getAST(type.getCompilationUnit(<MASK><NEW_LINE>if (astRoot == null) {<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>ITypeBinding typeBinding = ASTNodes.getTypeBinding(astRoot, type);<NEW_LINE>if (typeBinding != null) {<NEW_LINE>response.type = type.getTypeQualifiedName();<NEW_LINE>response.fields = JdtDomModels.getDeclaredFields(typeBinding, false);<NEW_LINE>response.exists = Stream.of(typeBinding.getDeclaredMethods()).anyMatch(method -> method.getName().equals(METHODNAME_TOSTRING) && method.getParameterTypes().length == 0);<NEW_LINE>}<NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>JavaLanguageServerPlugin.logException("Failed to check toString status", e);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | ), CoreASTProvider.WAIT_YES, monitor); |
1,552,224 | public Builder mergeFrom(io.grpc.examples.routeguide.FeatureDatabase other) {<NEW_LINE>if (other == io.grpc.examples.routeguide.FeatureDatabase.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (featureBuilder_ == null) {<NEW_LINE>if (!other.feature_.isEmpty()) {<NEW_LINE>if (feature_.isEmpty()) {<NEW_LINE>feature_ = other.feature_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>} else {<NEW_LINE>ensureFeatureIsMutable();<NEW_LINE>feature_.addAll(other.feature_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.feature_.isEmpty()) {<NEW_LINE>if (featureBuilder_.isEmpty()) {<NEW_LINE>featureBuilder_.dispose();<NEW_LINE>featureBuilder_ = null;<NEW_LINE>feature_ = other.feature_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>featureBuilder_ = com.google.protobuf.GeneratedMessageV3<MASK><NEW_LINE>} else {<NEW_LINE>featureBuilder_.addAllMessages(other.feature_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>} | .alwaysUseFieldBuilders ? getFeatureFieldBuilder() : null; |
853,448 | public Relationship createRelationshipTo(final Node endNode, final RelationshipType relationshipType, final Map<String, Object> properties) {<NEW_LINE>dontUseCache = true;<NEW_LINE>assertNotStale();<NEW_LINE>final SessionTransaction tx = db.getCurrentTransaction();<NEW_LINE>final Map<String, Object> map = new HashMap<>();<NEW_LINE>final NodeWrapper otherNode = (NodeWrapper) endNode;<NEW_LINE>final String tenantIdentifier = getTenantIdentifer(db);<NEW_LINE>final StringBuilder buf = new StringBuilder();<NEW_LINE>map.put("id1", id);<NEW_LINE>map.put("id2", db.unwrap<MASK><NEW_LINE>map.put("relProperties", properties);<NEW_LINE>buf.append("MATCH (n");<NEW_LINE>buf.append(tenantIdentifier);<NEW_LINE>buf.append("), (m");<NEW_LINE>buf.append(tenantIdentifier);<NEW_LINE>buf.append(") WHERE ID(n) = $id1 AND ID(m) = $id2 ");<NEW_LINE>buf.append("MERGE (n)-[r:");<NEW_LINE>buf.append(relationshipType.name());<NEW_LINE>buf.append("]->(m)");<NEW_LINE>buf.append(" SET r += $relProperties RETURN r");<NEW_LINE>final org.neo4j.driver.types.Relationship rel = tx.getRelationship(buf.toString(), map);<NEW_LINE>setModified();<NEW_LINE>otherNode.setModified();<NEW_LINE>// clear caches<NEW_LINE>((NodeWrapper) endNode).relationshipCache.clear();<NEW_LINE>relationshipCache.clear();<NEW_LINE>final RelationshipWrapper createdRelationship = RelationshipWrapper.newInstance(db, rel);<NEW_LINE>createdRelationship.setModified();<NEW_LINE>return createdRelationship;<NEW_LINE>} | (endNode.getId())); |
1,580,525 | public Map<Integer, Map<Integer, Integer>> createXKerningMapEncoded() {<NEW_LINE>if (!hasKerning()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Map<Integer, Map<Integer, Integer>> m = new java.util.HashMap<Integer, Map<MASK><NEW_LINE>for (Map.Entry<String, Map<String, Dimension2D>> entryFrom : this.kerningMap.entrySet()) {<NEW_LINE>String name1 = entryFrom.getKey();<NEW_LINE>AFMCharMetrics chm1 = getChar(name1);<NEW_LINE>if (chm1 == null || !chm1.hasCharCode()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Map<Integer, Integer> container = null;<NEW_LINE>Map<String, Dimension2D> entriesTo = entryFrom.getValue();<NEW_LINE>for (Map.Entry<String, Dimension2D> entryTo : entriesTo.entrySet()) {<NEW_LINE>String name2 = entryTo.getKey();<NEW_LINE>AFMCharMetrics chm2 = getChar(name2);<NEW_LINE>if (chm2 == null || !chm2.hasCharCode()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (container == null) {<NEW_LINE>Integer k1 = chm1.getCharCode();<NEW_LINE>container = m.get(k1);<NEW_LINE>if (container == null) {<NEW_LINE>container = new java.util.HashMap<Integer, Integer>();<NEW_LINE>m.put(k1, container);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Dimension2D dim = entryTo.getValue();<NEW_LINE>container.put(chm2.getCharCode(), (int) Math.round(dim.getWidth()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return m;<NEW_LINE>} | <Integer, Integer>>(); |
49,777 | private void expandSubmissionReply(final View l) {<NEW_LINE><MASK><NEW_LINE>final int widthSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);<NEW_LINE>final int heightSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);<NEW_LINE>l.measure(widthSpec, heightSpec);<NEW_LINE>mAnimator = AnimatorUtil.slideAnimator(0, l.getMeasuredHeight(), l);<NEW_LINE>mAnimator.addListener(new AnimatorListenerAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAnimationEnd(Animator animation) {<NEW_LINE>LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) l.getLayoutParams();<NEW_LINE>params.height = RelativeLayout.LayoutParams.WRAP_CONTENT;<NEW_LINE>l.setLayoutParams(params);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAnimationCancel(Animator animation) {<NEW_LINE>LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) l.getLayoutParams();<NEW_LINE>params.height = RelativeLayout.LayoutParams.WRAP_CONTENT;<NEW_LINE>l.setLayoutParams(params);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mAnimator.start();<NEW_LINE>} | l.setVisibility(View.VISIBLE); |
1,573,550 | public Map<String, List<PipelineDao>> groupByRuleName(@Nonnull Supplier<Collection<PipelineDao>> pipelines, @Nonnull Set<String> ruleNames) {<NEW_LINE>if (ruleNames.isEmpty()) {<NEW_LINE>return ImmutableMap.of();<NEW_LINE>}<NEW_LINE>final Map<String, List<PipelineDao>> result = new HashMap<>();<NEW_LINE>pipelines.get().stream().flatMap(pipelineDao -> {<NEW_LINE>try {<NEW_LINE>final Pipeline parsedPipeline = pipelineParser.parsePipeline(pipelineDao.id(), pipelineDao.source());<NEW_LINE>return Stream.of(new ParsedPipelineWithSource(pipelineDao, parsedPipeline));<NEW_LINE>} catch (ParseException e) {<NEW_LINE>logger.warn("Ignoring non-parseable pipeline <{}/{}> with errors <{}>", pipelineDao.title(), pipelineDao.id(), e.getErrors());<NEW_LINE>return Stream.empty();<NEW_LINE>}<NEW_LINE>}).forEach(pp -> {<NEW_LINE>for (String ruleName : ruleNames) {<NEW_LINE>if (!result.containsKey(ruleName)) {<NEW_LINE>result.put(ruleName<MASK><NEW_LINE>}<NEW_LINE>if (pp.parsed.containsRule(ruleName)) {<NEW_LINE>result.get(ruleName).add(pp.source);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return ImmutableMap.copyOf(result);<NEW_LINE>} | , new ArrayList<>()); |
1,792,226 | private Operand buildAttrAssign(Variable result, AttrAssignNode attrAssignNode) {<NEW_LINE>boolean containsAssignment = attrAssignNode.containsVariableAssignment();<NEW_LINE>Operand obj = buildWithOrder(attrAssignNode.getReceiverNode(), containsAssignment);<NEW_LINE>Label lazyLabel = null;<NEW_LINE>Label endLabel = null;<NEW_LINE>if (result == null)<NEW_LINE>result = createTemporaryVariable();<NEW_LINE>if (attrAssignNode.isLazy()) {<NEW_LINE>lazyLabel = getNewLabel();<NEW_LINE>endLabel = getNewLabel();<NEW_LINE>addInstr(new BNilInstr(lazyLabel, obj));<NEW_LINE>}<NEW_LINE>List<Operand> args = new ArrayList<>();<NEW_LINE>Node argsNode = attrAssignNode.getArgsNode();<NEW_LINE>Operand lastArg = buildAttrAssignCallArgs(args, argsNode, containsAssignment);<NEW_LINE>Operand block = setupCallClosure(attrAssignNode.getBlockNode());<NEW_LINE>addInstr(AttrAssignInstr.create(scope, obj, attrAssignNode.getName(), args.toArray(new Operand[args.size()]), block, scope.maybeUsingRefinements()));<NEW_LINE>addInstr(<MASK><NEW_LINE>if (attrAssignNode.isLazy()) {<NEW_LINE>addInstr(new JumpInstr(endLabel));<NEW_LINE>addInstr(new LabelInstr(lazyLabel));<NEW_LINE>addInstr(new CopyInstr(result, manager.getNil()));<NEW_LINE>addInstr(new LabelInstr(endLabel));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | new CopyInstr(result, lastArg)); |
1,516,948 | private void addAssociation(@NonNull final I_C_Invoice_Candidate ic, final int icId, @NonNull final IInvoiceLineRW il, @NonNull final StockQtyAndUOMQty allocatedQty) {<NEW_LINE>Check.assume(icId > 0, "Param 'ic' has C_Invoice_Candidate_ID>0");<NEW_LINE>Check.assume(!isAssociated(icId, il), ic + " with ID=" + icId + " is not yet associated with " + il);<NEW_LINE>List<Integer> candidateIds = line2candidates.get(il);<NEW_LINE>if (candidateIds == null) {<NEW_LINE>candidateIds <MASK><NEW_LINE>line2candidates.put(il, candidateIds);<NEW_LINE>}<NEW_LINE>candidateIds.add(icId);<NEW_LINE>candIDs2Cands.put(icId, ic);<NEW_LINE>allCands.add(ic);<NEW_LINE>List<IInvoiceLineRW> invoiceLines = candidateId2lines.get(icId);<NEW_LINE>if (invoiceLines == null) {<NEW_LINE>invoiceLines = new ArrayList<IInvoiceLineRW>();<NEW_LINE>candidateId2lines.put(icId, invoiceLines);<NEW_LINE>}<NEW_LINE>if (!invoiceLines.contains(il)) {<NEW_LINE>invoiceLines.add(il);<NEW_LINE>}<NEW_LINE>allLines.add(il);<NEW_LINE>Map<IInvoiceLineRW, StockQtyAndUOMQty> il2Qty = candIdAndLine2AllocatedQty.get(icId);<NEW_LINE>if (il2Qty == null) {<NEW_LINE>// it's important to have an IdentityHashMap, because we don't guarantee that IInvoiceLineRW is immutable!<NEW_LINE>il2Qty = new IdentityHashMap<IInvoiceLineRW, StockQtyAndUOMQty>();<NEW_LINE>candIdAndLine2AllocatedQty.put(icId, il2Qty);<NEW_LINE>}<NEW_LINE>il2Qty.put(il, allocatedQty);<NEW_LINE>} | = new ArrayList<Integer>(); |
1,792,448 | public static boolean createDirectoryIfNotExists(final String promptPrefix, String directoryPath, boolean promptUser) {<NEW_LINE>File dir = new File(directoryPath);<NEW_LINE>if (!dir.exists()) {<NEW_LINE>if (promptUser) {<NEW_LINE>final int answer = Messages.showOkCancelDialog(IdeBundle.message("promot.projectwizard.directory.does.not.exist", promptPrefix, dir.getPath(), ApplicationNamesInfo.getInstance().getFullProductName()), IdeBundle.message("title.directory.does.not.exist"), Messages.getQuestionIcon());<NEW_LINE>if (answer != 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>VfsUtil.<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>Messages.showErrorDialog(IdeBundle.message("error.failed.to.create.directory", dir.getPath()), CommonBundle.getErrorTitle());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | createDirectories(dir.getPath()); |
1,566,895 | final UpdateDatasetEntriesResult executeUpdateDatasetEntries(UpdateDatasetEntriesRequest updateDatasetEntriesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDatasetEntriesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateDatasetEntriesRequest> request = null;<NEW_LINE>Response<UpdateDatasetEntriesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateDatasetEntriesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDatasetEntriesRequest));<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, "Rekognition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDatasetEntries");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateDatasetEntriesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDatasetEntriesResultJsonUnmarshaller());<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); |
938,210 | public okhttp3.Call fakeOuterStringSerializeCall(String body, final ApiCallback _callback) throws ApiException {<NEW_LINE>String basePath = null;<NEW_LINE>// Operation Servers<NEW_LINE>String[] localBasePaths = new String[] {};<NEW_LINE>// Determine Base Path to Use<NEW_LINE>if (localCustomBaseUrl != null) {<NEW_LINE>basePath = localCustomBaseUrl;<NEW_LINE>} else if (localBasePaths.length > 0) {<NEW_LINE>basePath = localBasePaths[localHostIndex];<NEW_LINE>} else {<NEW_LINE>basePath = null;<NEW_LINE>}<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/fake/outer/string";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<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 HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "*/*" };<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>if (localVarContentType != null) {<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, <MASK><NEW_LINE>} | localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); |
1,727,693 | private void checkValidFile(Core core) {<NEW_LINE>String fileName = txtFile.getText();<NEW_LINE>String error_message = null;<NEW_LINE>try {<NEW_LINE>File f = new File(fileName);<NEW_LINE>if (f.isFile() && (f.getName().endsWith(".jar") || f.getName().endsWith(".zip") || f.getName().endsWith(".biglybt"))) {<NEW_LINE>wizard.setErrorMessage("");<NEW_LINE>wizard.setNextEnabled(true);<NEW_LINE>List<InstallablePlugin> list = new ArrayList<InstallablePlugin>();<NEW_LINE>InstallablePlugin plugin = core.getPluginManager().<MASK><NEW_LINE>list.add(plugin);<NEW_LINE>wizard.plugins = list;<NEW_LINE>valid = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (PluginException e) {<NEW_LINE>error_message = e.getMessage();<NEW_LINE>} catch (Exception e) {<NEW_LINE>error_message = null;<NEW_LINE>Debug.printStackTrace(e);<NEW_LINE>}<NEW_LINE>valid = false;<NEW_LINE>if (!fileName.equals("")) {<NEW_LINE>String error_message_full;<NEW_LINE>if (new File(fileName).isFile()) {<NEW_LINE>error_message_full = MessageText.getString("installPluginsWizard.file.invalidfile");<NEW_LINE>} else {<NEW_LINE>error_message_full = MessageText.getString("installPluginsWizard.file.no_such_file");<NEW_LINE>}<NEW_LINE>if (error_message != null) {<NEW_LINE>error_message_full += " (" + error_message + ")";<NEW_LINE>}<NEW_LINE>wizard.setErrorMessage(error_message_full);<NEW_LINE>wizard.setNextEnabled(false);<NEW_LINE>}<NEW_LINE>} | getPluginInstaller().installFromFile(f); |
1,296,225 | public static void main(String[] args) {<NEW_LINE>final String USAGE = "\n" + "Usage:\n" + " <groupName> <groupDesc> <vpcId> \n\n" + "Where:\n" + " groupName - a group name (for example, TestKeyPair). \n\n" + " groupDesc - a group description (for example, TestKeyPair). \n\n" + " vpcId - a VPC ID that you can obtain from the AWS Management Console (for example, vpc-xxxxxf2f). \n\n";<NEW_LINE>if (args.length != 3) {<NEW_LINE>System.out.println(USAGE);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>String groupName = args[0];<NEW_LINE>String groupDesc = args[1];<NEW_LINE>String vpcId = args[2];<NEW_LINE>// snippet-start:[ec2.java2.create_security_group.client]<NEW_LINE>Region region = Region.US_WEST_2;<NEW_LINE>Ec2Client ec2 = Ec2Client.builder().region(region).build();<NEW_LINE>// snippet-end:[ec2.java2.create_security_group.client]<NEW_LINE>String id = createEC2SecurityGroup(<MASK><NEW_LINE>System.out.printf("Successfully created Security Group with this ID %s", id);<NEW_LINE>ec2.close();<NEW_LINE>} | ec2, groupName, groupDesc, vpcId); |
251,572 | public static CustomRegion fromJson(@NonNull Context ctx, JSONObject object) throws JSONException {<NEW_LINE>String scopeId = object.optString("scope-id", null);<NEW_LINE>String path = object.optString("path", null);<NEW_LINE>String type = object.optString("type", null);<NEW_LINE>CustomRegion region = new CustomRegion(scopeId, path, type);<NEW_LINE>region.subfolder = object.optString("subfolder", null);<NEW_LINE>int index = path.lastIndexOf(File.separator);<NEW_LINE>if (index != -1) {<NEW_LINE>region.parentPath = path.substring(0, index);<NEW_LINE>}<NEW_LINE>region.names = JsonUtils.getLocalizedMapFromJson("name", object);<NEW_LINE>if (!Algorithms.isEmpty(region.names)) {<NEW_LINE>region.regionName = region.names.get("");<NEW_LINE>region.regionNameEn = region.names.get("en");<NEW_LINE>region.regionFullName = region.names.get("");<NEW_LINE>region.regionNameLocale = JsonUtils.getLocalizedResFromMap(ctx, region.names, region.regionName);<NEW_LINE>}<NEW_LINE>region.icons = JsonUtils.getLocalizedMapFromJson("icon", object);<NEW_LINE>region.headers = JsonUtils.getLocalizedMapFromJson("header", object);<NEW_LINE>region.downloadItemsJson = object.optJSONArray("items");<NEW_LINE>region.dynamicItemsJson = object.optJSONArray("dynamic-items");<NEW_LINE>JSONObject <MASK><NEW_LINE>if (urlItemsJson != null) {<NEW_LINE>region.dynamicDownloadItems = DynamicDownloadItems.fromJson(urlItemsJson);<NEW_LINE>}<NEW_LINE>String headerColor = object.optString("header-color", null);<NEW_LINE>try {<NEW_LINE>region.headerColor = Algorithms.isEmpty(headerColor) ? INVALID_ID : Algorithms.parseColor(headerColor);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>region.headerColor = INVALID_ID;<NEW_LINE>}<NEW_LINE>region.descriptionInfo = DownloadDescriptionInfo.fromJson(object.optJSONObject("description"));<NEW_LINE>return region;<NEW_LINE>} | urlItemsJson = object.optJSONObject("items-url"); |
1,644,733 | public NodeAgentContext nextContext() throws InterruptedException {<NEW_LINE>synchronized (monitor) {<NEW_LINE>// Reset any previous context and wait for the next one<NEW_LINE>nextContext = null;<NEW_LINE>isWaitingForNextContext = true;<NEW_LINE>monitor.notify();<NEW_LINE>Duration untilNextContext = Duration.ZERO;<NEW_LINE>while (setAndGetIsFrozen(wantFrozen) || nextContext == null || (untilNextContext = Duration.between(Instant.now(), nextContextAt)).toMillis() > 0) {<NEW_LINE>if (pendingInterrupt) {<NEW_LINE>pendingInterrupt = false;<NEW_LINE>throw new InterruptedException("interrupt() was called before next context was scheduled");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Wait until scheduler provides a new context<NEW_LINE>monitor.wait(Math.max(untilNextContext<MASK><NEW_LINE>} catch (InterruptedException ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>isWaitingForNextContext = false;<NEW_LINE>currentContext = nextContext;<NEW_LINE>return currentContext;<NEW_LINE>}<NEW_LINE>} | .toMillis(), 0L)); |
56,759 | private static ArrayList<WizardPage<RSConnectPublishInput, RSConnectPublishResult>> createPages(RSConnectPublishInput input, boolean asMultiple) {<NEW_LINE>ArrayList<WizardPage<RSConnectPublishInput, RSConnectPublishResult>> pages = new ArrayList<>();<NEW_LINE>String descriptor = constants_.documentLowercase();<NEW_LINE>if (asMultiple)<NEW_LINE>descriptor = constants_.documentsLowercasePlural();<NEW_LINE>if (input.isWebsiteRmd())<NEW_LINE>descriptor = constants_.websiteLowercase();<NEW_LINE>pages.add(new PublishFilesPage(constants_.publishFilesPageTitle(descriptor), constants_.publishReportSourcePageSubTitle(asMultiple ? constants_.scheduledReportsPlural() : constants_.scheduledReportsSingular(), descriptor), new ImageResource2x(RSConnectResources.INSTANCE.publishDocWithSource2x()), input, asMultiple, false));<NEW_LINE>String staticTitle = constants_.publishReportSourcePageStaticTitle(descriptor);<NEW_LINE><MASK><NEW_LINE>pages.add(new PublishFilesPage(staticTitle, staticSubtitle, new ImageResource2x(RSConnectResources.INSTANCE.publishDocWithoutSource2x()), input, asMultiple, true));<NEW_LINE>return pages;<NEW_LINE>} | String staticSubtitle = constants_.publishReportSourcePageStaticSubtitle(); |
1,463,794 | public void paint(Graphics2D g2D) {<NEW_LINE>icon.paintIcon(null, g2D, 0, 0);<NEW_LINE>// Paint Text<NEW_LINE><MASK><NEW_LINE>Font base = new Font(null);<NEW_LINE>Font font = new Font(base.getName(), Font.ITALIC | Font.BOLD, base.getSize());<NEW_LINE>//<NEW_LINE>AttributedString aString = new AttributedString(node.getName(true));<NEW_LINE>aString.addAttribute(TextAttribute.FONT, font);<NEW_LINE>aString.addAttribute(TextAttribute.FOREGROUND, Color.BLACK);<NEW_LINE>AttributedCharacterIterator iter = aString.getIterator();<NEW_LINE>//<NEW_LINE>LineBreakMeasurer measurer = new LineBreakMeasurer(iter, g2D.getFontRenderContext());<NEW_LINE>float width = s_size.width - icon.getIconWidth() - 2;<NEW_LINE>TextLayout layout = measurer.nextLayout(width);<NEW_LINE>float xPos = icon.getIconWidth();<NEW_LINE>float yPos = layout.getAscent() + 2;<NEW_LINE>//<NEW_LINE>layout.draw(g2D, xPos, yPos);<NEW_LINE>// 2 pt<NEW_LINE>width = s_size.width - 4;<NEW_LINE>while (measurer.getPosition() < iter.getEndIndex()) {<NEW_LINE>layout = measurer.nextLayout(width);<NEW_LINE>yPos += layout.getAscent() + layout.getDescent() + layout.getLeading();<NEW_LINE>layout.draw(g2D, 2, yPos);<NEW_LINE>}<NEW_LINE>} | g2D.setPaint(Color.BLACK); |
655,911 | private Property toProperty(EntityType entityType, String name, TypeMirror type, Annotations annotations) {<NEW_LINE>// type<NEW_LINE>Type propertyType = typeFactory.getType(type, true);<NEW_LINE>if (annotations.isAnnotationPresent(QueryType.class)) {<NEW_LINE>PropertyType propertyTypeAnn = annotations.getAnnotation(QueryType.class).value();<NEW_LINE>if (propertyTypeAnn != PropertyType.NONE) {<NEW_LINE>TypeCategory typeCategory = TypeCategory.valueOf(annotations.getAnnotation(QueryType.class).value().name());<NEW_LINE>if (typeCategory == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>propertyType = propertyType.as(typeCategory);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// inits<NEW_LINE>List<String<MASK><NEW_LINE>if (annotations.isAnnotationPresent(QueryInit.class)) {<NEW_LINE>inits = Arrays.asList(annotations.getAnnotation(QueryInit.class).value());<NEW_LINE>}<NEW_LINE>return new Property(entityType, name, propertyType, inits);<NEW_LINE>} | > inits = Collections.emptyList(); |
1,364,838 | protected MultiGetResult<K, V> do_GET_ALL(Set<? extends K> keys) {<NEW_LINE>RedisConnection con = null;<NEW_LINE>try {<NEW_LINE>con = connectionFactory.getConnection();<NEW_LINE>ArrayList<K> keyList = new ArrayList<>(keys);<NEW_LINE>byte[][] newKeys = keyList.stream().map((k) -> buildKey(k)).toArray(byte[][]::new);<NEW_LINE>Map<K, CacheGetResult<V>> resultMap = new HashMap<>();<NEW_LINE>if (newKeys.length > 0) {<NEW_LINE>List mgetResults = con.mGet(newKeys);<NEW_LINE>for (int i = 0; i < mgetResults.size(); i++) {<NEW_LINE>Object value = mgetResults.get(i);<NEW_LINE>K key = keyList.get(i);<NEW_LINE>if (value != null) {<NEW_LINE>CacheValueHolder<V> holder = (CacheValueHolder<V>) valueDecoder.apply((byte[]) value);<NEW_LINE>if (System.currentTimeMillis() >= holder.getExpireTime()) {<NEW_LINE>resultMap.put(key, CacheGetResult.EXPIRED_WITHOUT_MSG);<NEW_LINE>} else {<NEW_LINE>CacheGetResult<V> r = new CacheGetResult<>(CacheResultCode.SUCCESS, null, holder);<NEW_LINE>resultMap.put(key, r);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>resultMap.put(key, CacheGetResult.NOT_EXISTS_WITHOUT_MSG);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new MultiGetResult<>(CacheResultCode.SUCCESS, null, resultMap);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logError("GET_ALL", "keys(" + keys.size() + ")", ex);<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>closeConnection(con);<NEW_LINE>}<NEW_LINE>} | return new MultiGetResult<>(ex); |
1,309,118 | protected NodeSnapshotStatus nodeOperation(NodeRequest request, Task task) {<NEW_LINE>Map<Snapshot, Map<ShardId, SnapshotIndexShardStatus>> snapshotMapBuilder = new HashMap<>();<NEW_LINE>try {<NEW_LINE>final String nodeId = clusterService.localNode().getId();<NEW_LINE>for (Snapshot snapshot : request.snapshots) {<NEW_LINE>Map<ShardId, IndexShardSnapshotStatus> shardsStatus = snapshotShardsService.currentSnapshotShards(snapshot);<NEW_LINE>if (shardsStatus == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Map<ShardId, SnapshotIndexShardStatus> shardMapBuilder = new HashMap<>();<NEW_LINE>for (Map.Entry<ShardId, IndexShardSnapshotStatus> shardEntry : shardsStatus.entrySet()) {<NEW_LINE>final ShardId shardId = shardEntry.getKey();<NEW_LINE>final IndexShardSnapshotStatus.Copy lastSnapshotStatus = shardEntry.getValue().asCopy();<NEW_LINE>final IndexShardSnapshotStatus.Stage stage = lastSnapshotStatus.getStage();<NEW_LINE>String shardNodeId = null;<NEW_LINE>if (stage != IndexShardSnapshotStatus.Stage.DONE && stage != IndexShardSnapshotStatus.Stage.FAILURE) {<NEW_LINE>// Store node id for the snapshots that are currently running.<NEW_LINE>shardNodeId = nodeId;<NEW_LINE>}<NEW_LINE>shardMapBuilder.put(shardEntry.getKey(), new SnapshotIndexShardStatus(shardId, lastSnapshotStatus, shardNodeId));<NEW_LINE>}<NEW_LINE>snapshotMapBuilder.put(snapshot, unmodifiableMap(shardMapBuilder));<NEW_LINE>}<NEW_LINE>return new NodeSnapshotStatus(clusterService.localNode<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ElasticsearchException("failed to load metadata", e);<NEW_LINE>}<NEW_LINE>} | (), unmodifiableMap(snapshotMapBuilder)); |
1,401,749 | public void onVehicleMove(VehicleMoveEvent event) {<NEW_LINE>Vehicle vehicle = event.getVehicle();<NEW_LINE>if (vehicle.getPassengers().isEmpty())<NEW_LINE>return;<NEW_LINE>List<Player> playerPassengers = vehicle.getPassengers().stream().filter(ent -> ent instanceof Player).map(ent -> (Player) ent).<MASK><NEW_LINE>if (playerPassengers.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>World world = vehicle.getWorld();<NEW_LINE>WorldConfiguration wcfg = getWorldConfig(world);<NEW_LINE>if (wcfg.useRegions) {<NEW_LINE>// Did we move a block?<NEW_LINE>if (Locations.isDifferentBlock(BukkitAdapter.adapt(event.getFrom()), BukkitAdapter.adapt(event.getTo()))) {<NEW_LINE>for (Player player : playerPassengers) {<NEW_LINE>LocalPlayer localPlayer = getPlugin().wrapPlayer(player);<NEW_LINE>Location lastValid;<NEW_LINE>if ((lastValid = WorldGuard.getInstance().getPlatform().getSessionManager().get(localPlayer).testMoveTo(localPlayer, BukkitAdapter.adapt(event.getTo()), MoveType.RIDE)) != null) {<NEW_LINE>vehicle.setVelocity(new Vector(0, 0, 0));<NEW_LINE>vehicle.teleport(event.getFrom());<NEW_LINE>if (Locations.isDifferentBlock(lastValid, BukkitAdapter.adapt(event.getFrom()))) {<NEW_LINE>Vector dir = player.getLocation().getDirection();<NEW_LINE>player.teleport(BukkitAdapter.adapt(lastValid).setDirection(dir));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | collect(Collectors.toList()); |
1,341,296 | public static QueryCardFlowInfoResponse unmarshall(QueryCardFlowInfoResponse queryCardFlowInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryCardFlowInfoResponse.setRequestId(_ctx.stringValue("QueryCardFlowInfoResponse.RequestId"));<NEW_LINE>queryCardFlowInfoResponse.setCode(_ctx.stringValue("QueryCardFlowInfoResponse.Code"));<NEW_LINE>queryCardFlowInfoResponse.setMessage(_ctx.stringValue("QueryCardFlowInfoResponse.Message"));<NEW_LINE>List<CardFlowInfo> cardFlowInfos = new ArrayList<CardFlowInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryCardFlowInfoResponse.CardFlowInfos.Length"); i++) {<NEW_LINE>CardFlowInfo cardFlowInfo = new CardFlowInfo();<NEW_LINE>cardFlowInfo.setResourceType(_ctx.stringValue("QueryCardFlowInfoResponse.CardFlowInfos[" + i + "].ResourceType"));<NEW_LINE>cardFlowInfo.setResName(_ctx.stringValue("QueryCardFlowInfoResponse.CardFlowInfos[" + i + "].ResName"));<NEW_LINE>cardFlowInfo.setFlowResource(_ctx.longValue("QueryCardFlowInfoResponse.CardFlowInfos[" + i + "].FlowResource"));<NEW_LINE>cardFlowInfo.setRestOfFlow(_ctx.longValue("QueryCardFlowInfoResponse.CardFlowInfos[" + i + "].RestOfFlow"));<NEW_LINE>cardFlowInfo.setFlowUsed(_ctx.longValue("QueryCardFlowInfoResponse.CardFlowInfos[" + i + "].FlowUsed"));<NEW_LINE>cardFlowInfo.setValidDate(_ctx.stringValue("QueryCardFlowInfoResponse.CardFlowInfos[" + i + "].ValidDate"));<NEW_LINE>cardFlowInfo.setExpireDate(_ctx.stringValue("QueryCardFlowInfoResponse.CardFlowInfos[" + i + "].ExpireDate"));<NEW_LINE>cardFlowInfo.setSmsUsed(_ctx.longValue<MASK><NEW_LINE>cardFlowInfo.setVoiceUsed(_ctx.longValue("QueryCardFlowInfoResponse.CardFlowInfos[" + i + "].VoiceUsed"));<NEW_LINE>cardFlowInfo.setVoiceTotal(_ctx.longValue("QueryCardFlowInfoResponse.CardFlowInfos[" + i + "].VoiceTotal"));<NEW_LINE>cardFlowInfos.add(cardFlowInfo);<NEW_LINE>}<NEW_LINE>queryCardFlowInfoResponse.setCardFlowInfos(cardFlowInfos);<NEW_LINE>return queryCardFlowInfoResponse;<NEW_LINE>} | ("QueryCardFlowInfoResponse.CardFlowInfos[" + i + "].SmsUsed")); |
619,125 | private void initTagMenuButton() {<NEW_LINE>addFXCallback(exec.submit(() -> new TagGroupAction(controller.getTagsManager().getFollowUpTagName(), controller)), followUpGroupAction -> {<NEW_LINE>// on fx thread<NEW_LINE>tagGroupMenuButton.setOnAction(followUpGroupAction);<NEW_LINE>tagGroupMenuButton.setText(followUpGroupAction.getText());<NEW_LINE>tagGroupMenuButton.setGraphic(followUpGroupAction.getGraphic());<NEW_LINE>}, throwable -> {<NEW_LINE>if (Case.isCaseOpen()) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(<MASK><NEW_LINE>} else {<NEW_LINE>// don't add stack trace to log because it makes looking for real errors harder<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.INFO, "Unable to get tag name. Case is closed.");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>tagGroupMenuButton.showingProperty().addListener(showing -> {<NEW_LINE>if (tagGroupMenuButton.isShowing()) {<NEW_LINE>ListenableFuture<List<MenuItem>> getTagsFuture = exec.submit(() -> {<NEW_LINE>return Lists.transform(controller.getTagsManager().getNonCategoryTagNames(), tagName -> GuiUtils.createAutoAssigningMenuItem(tagGroupMenuButton, new TagGroupAction(tagName, controller)));<NEW_LINE>});<NEW_LINE>addFXCallback(getTagsFuture, menuItems -> tagGroupMenuButton.getItems().setAll(menuItems), throwable -> logger.log(Level.SEVERE, "Error getting non-gategory tag names.", throwable));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | Level.WARNING, "Could not create Follow Up tag menu item", throwable); |
54,063 | protected ShardUpgradeStatus shardOperation(UpgradeStatusRequest request, ShardRouting shardRouting) {<NEW_LINE>IndexService indexService = indicesService.indexServiceSafe(shardRouting.shardId().getIndex());<NEW_LINE>IndexShard <MASK><NEW_LINE>List<Segment> segments = indexShard.segments(false);<NEW_LINE>long total_bytes = 0;<NEW_LINE>long to_upgrade_bytes = 0;<NEW_LINE>long to_upgrade_bytes_ancient = 0;<NEW_LINE>for (Segment seg : segments) {<NEW_LINE>total_bytes += seg.sizeInBytes;<NEW_LINE>if (seg.version.major != Version.CURRENT.luceneVersion.major) {<NEW_LINE>to_upgrade_bytes_ancient += seg.sizeInBytes;<NEW_LINE>to_upgrade_bytes += seg.sizeInBytes;<NEW_LINE>} else if (seg.version.minor != Version.CURRENT.luceneVersion.minor) {<NEW_LINE>// TODO: this comparison is bogus! it would cause us to upgrade even with the same format<NEW_LINE>// instead, we should check if the codec has changed<NEW_LINE>to_upgrade_bytes += seg.sizeInBytes;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ShardUpgradeStatus(indexShard.routingEntry(), total_bytes, to_upgrade_bytes, to_upgrade_bytes_ancient);<NEW_LINE>} | indexShard = indexService.getShard(0); |
734,759 | protected Map<String, Object> toMap() throws IOException {<NEW_LINE>try {<NEW_LINE>Map<String, Object> map = new HashMap<>();<NEW_LINE>synchronized (this) {<NEW_LINE>MapUtils.exportInt(map, "state", state);<NEW_LINE>MapUtils.setMapString(map, "error", error);<NEW_LINE>MapUtils.setMapString(map, "target", target.getID());<NEW_LINE>MapUtils.setMapString(map, "profile", profile.getUID());<NEW_LINE>try {<NEW_LINE>Download download = file.getDownload();<NEW_LINE>MapUtils.setMapString(map, "dl_hash", ByteFormatter.encodeString(download.getTorrent().getHash()));<NEW_LINE>MapUtils.exportInt(map, "file_index", file.getIndex());<NEW_LINE>} catch (DownloadException e) {<NEW_LINE>// external file<NEW_LINE>MapUtils.setMapString(map, "file", file.getFile().getAbsolutePath());<NEW_LINE>}<NEW_LINE>MapUtils.exportInt(map, "trans_req", transcode_requirement);<NEW_LINE>MapUtils.exportBooleanAsLong(map, "ar_enable", auto_retry_enabled);<NEW_LINE>MapUtils.exportBooleanAsLong(map, "pdi", prefer_direct_input);<NEW_LINE>}<NEW_LINE>return (map);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw (new IOException("Export failed: " + <MASK><NEW_LINE>}<NEW_LINE>} | Debug.getNestedExceptionMessage(e))); |
487,060 | final UpdateReplicationConfigurationTemplateResult executeUpdateReplicationConfigurationTemplate(UpdateReplicationConfigurationTemplateRequest updateReplicationConfigurationTemplateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateReplicationConfigurationTemplateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateReplicationConfigurationTemplateRequest> request = null;<NEW_LINE>Response<UpdateReplicationConfigurationTemplateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateReplicationConfigurationTemplateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateReplicationConfigurationTemplateRequest));<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, "drs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateReplicationConfigurationTemplate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateReplicationConfigurationTemplateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new UpdateReplicationConfigurationTemplateResultJsonUnmarshaller()); |
1,177,514 | public void onClick(View v) {<NEW_LINE>AlertDialogs.showDialog(getActivity(), getActivity().getString(R.string.restore_defaults_full), getString(R.string.ok), new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>AppState.get().isPrefFormatMode = false;<NEW_LINE>AppState.get().prefScrollMode = AppState.PREF_SCROLL_MODE;<NEW_LINE>AppState.get().prefBookMode = AppState.PREF_BOOK_MODE;<NEW_LINE>AppState.get().prefMusicianMode = AppState.PREF_MUSIC_MODE;<NEW_LINE>isPrefFormatMode.setChecked(<MASK><NEW_LINE>prefScrollMode.setText(AppState.get().prefScrollMode);<NEW_LINE>prefBookMode.setText(AppState.get().prefBookMode);<NEW_LINE>prefMusicianMode.setText(AppState.get().prefMusicianMode);<NEW_LINE>}<NEW_LINE>}, null);<NEW_LINE>} | AppState.get().isPrefFormatMode); |
530,845 | private <T> void putArray(RecordDataSchema.Field field, FieldDef<T> fieldDef, T value) {<NEW_LINE>DataList data = new DataList();<NEW_LINE>Class<?> itemType = null;<NEW_LINE>ArrayDataSchema arrayDataSchema = null;<NEW_LINE>if (fieldDef.getDataSchema() instanceof ArrayDataSchema) {<NEW_LINE>arrayDataSchema = (ArrayDataSchema) fieldDef.getDataSchema();<NEW_LINE>DataSchema itemSchema = arrayDataSchema.getItems();<NEW_LINE>if (itemSchema instanceof TyperefDataSchema) {<NEW_LINE>itemType = DataSchemaUtil.dataSchemaTypeToPrimitiveDataSchemaClass(itemSchema.getDereferencedType());<NEW_LINE>} else {<NEW_LINE>itemType = fieldDef.getType().getComponentType();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Field " + fieldDef.getName() + " does not have an array schema; although the data is an array.");<NEW_LINE>}<NEW_LINE>boolean isDataTemplate = <MASK><NEW_LINE>List<Object> items;<NEW_LINE>if (value instanceof DataList) {<NEW_LINE>items = (List<Object>) value;<NEW_LINE>} else {<NEW_LINE>items = Arrays.asList((Object[]) value);<NEW_LINE>}<NEW_LINE>for (Object item : items) {<NEW_LINE>if (isDataTemplate) {<NEW_LINE>Object itemData;<NEW_LINE>if (item instanceof DataMap) {<NEW_LINE>itemData = item;<NEW_LINE>} else {<NEW_LINE>itemData = ((DataTemplate) item).data();<NEW_LINE>}<NEW_LINE>data.add(itemData);<NEW_LINE>} else {<NEW_LINE>data.add(DataTemplateUtil.coerceInput(item, (Class<Object>) item.getClass(), itemType.isEnum() ? String.class : itemType));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>putDirect(field, DataList.class, data, SetMode.DISALLOW_NULL);<NEW_LINE>} | DataTemplate.class.isAssignableFrom(itemType); |
701,023 | public Object createObject(Attributes atts) {<NEW_LINE>JasperPrint jasperPrint = (JasperPrint) digester.peek(digester.getCount() - 2);<NEW_LINE>JRBasePrintImage image = new JRBasePrintImage(jasperPrint.getDefaultStyleProvider());<NEW_LINE>// get image attributes<NEW_LINE>ScaleImageEnum scaleImage = ScaleImageEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_scaleImage));<NEW_LINE>if (scaleImage != null) {<NEW_LINE>image.setScaleImage(scaleImage);<NEW_LINE>}<NEW_LINE>RotationEnum rotation = RotationEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_rotation));<NEW_LINE>if (rotation != null) {<NEW_LINE>image.setRotation(rotation);<NEW_LINE>}<NEW_LINE>HorizontalImageAlignEnum horizontalImageAlign = HorizontalImageAlignEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_hAlign));<NEW_LINE>if (horizontalImageAlign != null) {<NEW_LINE>image.setHorizontalImageAlign(horizontalImageAlign);<NEW_LINE>}<NEW_LINE>VerticalImageAlignEnum verticalImageAlign = VerticalImageAlignEnum.getByName(atts<MASK><NEW_LINE>if (verticalImageAlign != null) {<NEW_LINE>image.setVerticalImageAlign(verticalImageAlign);<NEW_LINE>}<NEW_LINE>OnErrorTypeEnum onErrorType = OnErrorTypeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_onErrorType));<NEW_LINE>if (onErrorType != null) {<NEW_LINE>image.setOnErrorType(onErrorType);<NEW_LINE>}<NEW_LINE>image.setLinkType(atts.getValue(JRXmlConstants.ATTRIBUTE_hyperlinkType));<NEW_LINE>image.setLinkTarget(atts.getValue(JRXmlConstants.ATTRIBUTE_hyperlinkTarget));<NEW_LINE>image.setAnchorName(atts.getValue(JRXmlConstants.ATTRIBUTE_anchorName));<NEW_LINE>image.setHyperlinkReference(atts.getValue(JRXmlConstants.ATTRIBUTE_hyperlinkReference));<NEW_LINE>image.setHyperlinkAnchor(atts.getValue(JRXmlConstants.ATTRIBUTE_hyperlinkAnchor));<NEW_LINE>String hyperlinkPage = atts.getValue(JRXmlConstants.ATTRIBUTE_hyperlinkPage);<NEW_LINE>if (hyperlinkPage != null) {<NEW_LINE>image.setHyperlinkPage(Integer.valueOf(hyperlinkPage));<NEW_LINE>}<NEW_LINE>image.setHyperlinkTooltip(atts.getValue(JRXmlConstants.ATTRIBUTE_hyperlinkTooltip));<NEW_LINE>String bookmarkLevelAttr = atts.getValue(JRXmlConstants.ATTRIBUTE_bookmarkLevel);<NEW_LINE>if (bookmarkLevelAttr != null) {<NEW_LINE>image.setBookmarkLevel(Integer.parseInt(bookmarkLevelAttr));<NEW_LINE>}<NEW_LINE>String isLazy = atts.getValue(JRXmlConstants.ATTRIBUTE_isLazy);<NEW_LINE>if (isLazy != null && isLazy.length() > 0) {<NEW_LINE>// we use a resource renderer just to pass the value of isLazy flag to image source factory<NEW_LINE>image.setRenderer(ResourceRenderer.getInstance("", Boolean.valueOf(isLazy)));<NEW_LINE>}<NEW_LINE>return image;<NEW_LINE>} | .getValue(JRXmlConstants.ATTRIBUTE_vAlign)); |
1,664,199 | private void createSetMenuEntries(JMenu edit) {<NEW_LINE>edit.add(new ToolTipAction(Lang.get("menu_table_setXTo0")) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>modifyTable(v -> <MASK><NEW_LINE>}<NEW_LINE>}.setToolTip(Lang.get("menu_table_setXTo0_tt")).createJMenuItem());<NEW_LINE>edit.add(new ToolTipAction(Lang.get("menu_table_setXTo1")) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>modifyTable(v -> v > 1 ? 1 : v);<NEW_LINE>}<NEW_LINE>}.setToolTip(Lang.get("menu_table_setXTo1_tt")).createJMenuItem());<NEW_LINE>edit.add(new ToolTipAction(Lang.get("menu_table_setAllToX")) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>modifyTable(v -> (byte) 2);<NEW_LINE>}<NEW_LINE>}.setToolTip(Lang.get("menu_table_setAllToX_tt")).createJMenuItem());<NEW_LINE>edit.add(new ToolTipAction(Lang.get("menu_table_setAllTo0")) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>modifyTable(v -> (byte) 0);<NEW_LINE>}<NEW_LINE>}.setToolTip(Lang.get("menu_table_setAllTo0_tt")).createJMenuItem());<NEW_LINE>edit.add(new ToolTipAction(Lang.get("menu_table_setAllTo1")) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>modifyTable(v -> (byte) 1);<NEW_LINE>}<NEW_LINE>}.setToolTip(Lang.get("menu_table_setAllTo1_tt")).createJMenuItem());<NEW_LINE>edit.add(new ToolTipAction(Lang.get("menu_table_invert")) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>modifyTable(v -> v > 1 ? v : (byte) (1 - v));<NEW_LINE>}<NEW_LINE>}.setToolTip(Lang.get("menu_table_invert_tt")).createJMenuItem());<NEW_LINE>} | v > 1 ? 0 : v); |
1,049,243 | public void finished() {<NEW_LINE>policyStats.setPercentAdaption((maxWindow / (double) maximumSize<MASK><NEW_LINE>printSegmentSizes();<NEW_LINE>long actualWindowSize = data.values().stream().filter(n -> n.queue == WINDOW).count();<NEW_LINE>long actualProbationSize = data.values().stream().filter(n -> n.queue == PROBATION).count();<NEW_LINE>long actualProtectedSize = data.values().stream().filter(n -> n.queue == PROTECTED).count();<NEW_LINE>long calculatedProbationSize = data.size() - actualWindowSize - actualProtectedSize;<NEW_LINE>checkState((long) windowSize == actualWindowSize, "Window: %s != %s", (long) windowSize, actualWindowSize);<NEW_LINE>checkState((long) protectedSize == actualProtectedSize, "Protected: %s != %s", (long) protectedSize, actualProtectedSize);<NEW_LINE>checkState(actualProbationSize == calculatedProbationSize, "Probation: %s != %s", actualProbationSize, calculatedProbationSize);<NEW_LINE>checkState(data.size() <= maximumSize, "Maximum: %s > %s", data.size(), maximumSize);<NEW_LINE>} | ) - (1.0 - initialPercentMain)); |
1,578,260 | public MemberSetPlus filter2(RolapLevel seekLevel, RolapLevel level, RolapMember lower, RolapMember upper) {<NEW_LINE>if (level == seekLevel) {<NEW_LINE>return new RangeMemberSet(lower, lowerInclusive, upper, upperInclusive, false);<NEW_LINE>} else if (descendants && level.getHierarchy() == seekLevel.getHierarchy() && level.getDepth() < seekLevel.getDepth()) {<NEW_LINE>final MemberReader memberReader = level.getHierarchy().getMemberReader();<NEW_LINE>final List<RolapMember> list = new ArrayList<RolapMember>();<NEW_LINE>memberReader.getMemberChildren(lower, list);<NEW_LINE>if (list.isEmpty()) {<NEW_LINE>return EmptyMemberSet.INSTANCE;<NEW_LINE>}<NEW_LINE>RolapMember <MASK><NEW_LINE>list.clear();<NEW_LINE>memberReader.getMemberChildren(upper, list);<NEW_LINE>if (list.isEmpty()) {<NEW_LINE>return EmptyMemberSet.INSTANCE;<NEW_LINE>}<NEW_LINE>RolapMember upperChild = list.get(list.size() - 1);<NEW_LINE>return filter2(seekLevel, (RolapLevel) level.getChildLevel(), lowerChild, upperChild);<NEW_LINE>} else {<NEW_LINE>return EmptyMemberSet.INSTANCE;<NEW_LINE>}<NEW_LINE>} | lowerChild = list.get(0); |
211,011 | private void parseOrdering(String ordering) {<NEW_LINE>final String comma = ",";<NEW_LINE>final String space = " ";<NEW_LINE>StringTokenizer tokenizer = new StringTokenizer(ordering, comma);<NEW_LINE>sortOrders = new <MASK><NEW_LINE>while (tokenizer.hasMoreTokens()) {<NEW_LINE>String order = (String) tokenizer.nextElement();<NEW_LINE>StringTokenizer token = new StringTokenizer(order, space);<NEW_LINE>SortOrder orderType = SortOrder.ASC;<NEW_LINE>String colName = (String) token.nextElement();<NEW_LINE>while (token.hasMoreElements()) {<NEW_LINE>String nextOrder = (String) token.nextElement();<NEW_LINE>// more spaces given.<NEW_LINE>if (StringUtils.isNotBlank(nextOrder)) {<NEW_LINE>try {<NEW_LINE>orderType = SortOrder.valueOf(nextOrder.toUpperCase());<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>logger.error("Error while parsing order by clause:");<NEW_LINE>throw new JPQLParseException("Invalid sort order provided:" + nextOrder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sortOrders.add(new SortOrdering(colName, orderType));<NEW_LINE>}<NEW_LINE>} | ArrayList<KunderaQuery.SortOrdering>(); |
712,461 | private void showUsageView(@Nonnull UsageViewDescriptor viewDescriptor, @Nonnull Factory<UsageSearcher> factory, @Nonnull UsageInfo[] usageInfos) {<NEW_LINE>UsageViewManager viewManager = UsageViewManager.getInstance(myProject);<NEW_LINE>final PsiElement[] initialElements = viewDescriptor.getElements();<NEW_LINE>final UsageTarget[] targets = PsiElement2UsageTargetAdapter.convert(initialElements);<NEW_LINE>final Ref<Usage[]> <MASK><NEW_LINE>if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> ApplicationManager.getApplication().runReadAction(() -> convertUsagesRef.set(UsageInfo2UsageAdapter.convert(usageInfos))), "Preprocess Usages", true, myProject))<NEW_LINE>return;<NEW_LINE>if (convertUsagesRef.isNull())<NEW_LINE>return;<NEW_LINE>final Usage[] usages = convertUsagesRef.get();<NEW_LINE>final UsageViewPresentation presentation = createPresentation(viewDescriptor, usages);<NEW_LINE>if (myUsageView == null) {<NEW_LINE>myUsageView = viewManager.showUsages(targets, usages, presentation, factory);<NEW_LINE>customizeUsagesView(viewDescriptor, myUsageView);<NEW_LINE>} else {<NEW_LINE>myUsageView.removeUsagesBulk(myUsageView.getUsages());<NEW_LINE>((UsageViewImpl) myUsageView).appendUsagesInBulk(Arrays.asList(usages));<NEW_LINE>}<NEW_LINE>Set<UnloadedModuleDescription> unloadedModules = computeUnloadedModulesFromUseScope(viewDescriptor);<NEW_LINE>if (!unloadedModules.isEmpty()) {<NEW_LINE>myUsageView.appendUsage(new UnknownUsagesInUnloadedModules(unloadedModules));<NEW_LINE>}<NEW_LINE>} | convertUsagesRef = new Ref<>(); |
739,004 | public CompletableFuture<List<Acl>> searchAcls(String clusterId, Acl.ResourceType resourceType, @Nullable String resourceName, Acl.PatternType patternType, @Nullable String principal, @Nullable String host, Acl.Operation operation, Acl.Permission permission) {<NEW_LINE>AclBindingFilter aclBindingFilter = new AclBindingFilter(new ResourcePatternFilter(resourceType.toAdminResourceType(), resourceName, patternType.toAdminPatternType()), new AccessControlEntryFilter(principal, host, operation.toAclOperation(), permission.toAclPermissionType()));<NEW_LINE>return clusterManager.getCluster(clusterId).thenApply(cluster -> checkEntityExists(cluster, "Cluster %s cannot be found.", clusterId)).thenApply(cluster -> adminClient.describeAcls(aclBindingFilter)).thenCompose(describeAclsResult -> KafkaFutures.toCompletableFuture(describeAclsResult.values())).thenApply(aclBindings -> aclBindings.stream().map(aclBinding -> toAcl(clusterId, aclBinding)).collect<MASK><NEW_LINE>} | (Collectors.toList())); |
1,585,655 | public NetworkAdminASN lookupCurrentASN(InetAddress address) throws NetworkAdminException {<NEW_LINE>NetworkAdminASN current = getCurrentASN();<NEW_LINE>if (current.matchesCIDR(address)) {<NEW_LINE>return (current);<NEW_LINE>}<NEW_LINE>List asns = COConfigurationManager.getListParameter("ASN Details", new ArrayList());<NEW_LINE>for (int i = 0; i < asns.size(); i++) {<NEW_LINE>Map m = (Map) asns.get(i);<NEW_LINE>NetworkAdminASN x = ASNFromMap(m);<NEW_LINE>if (x.matchesCIDR(address)) {<NEW_LINE>asns.remove(i);<NEW_LINE>asns.add(0, m);<NEW_LINE>firePropertyChange(PR_AS);<NEW_LINE>return (x);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (asn_ips_checked.contains(address)) {<NEW_LINE>return (current);<NEW_LINE>}<NEW_LINE>long now = SystemTime.getCurrentTime();<NEW_LINE>if (now < last_asn_lookup_time || now - last_asn_lookup_time > ASN_MIN_CHECK) {<NEW_LINE>last_asn_lookup_time = now;<NEW_LINE>NetworkAdminASNLookupImpl lookup = new NetworkAdminASNLookupImpl(address);<NEW_LINE>NetworkAdminASNImpl x = lookup.lookup();<NEW_LINE>asn_ips_checked.add(address);<NEW_LINE>asns.add<MASK><NEW_LINE>firePropertyChange(PR_AS);<NEW_LINE>return (x);<NEW_LINE>}<NEW_LINE>return (current);<NEW_LINE>} | (0, ASNToMap(x)); |
1,780,203 | protected void handleOpenAction() {<NEW_LINE>getContainer().getShell().setVisible(false);<NEW_LINE>FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);<NEW_LINE>dialog.setText(Messages.NewModelFromTemplateWizardPage_4);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>dialog.setFilterExtensions(new String[] { "*" + fTemplateManager.getTemplateFileExtension(), "*.*" });<NEW_LINE>String path = dialog.open();<NEW_LINE>if (path == null) {<NEW_LINE>selectFirstTableItem();<NEW_LINE>getContainer().getShell().setVisible(true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final File file = new File(path);<NEW_LINE>// Create template and Finish<NEW_LINE>BusyIndicator.showWhile(null, new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>ITemplate <MASK><NEW_LINE>template.setFile(file);<NEW_LINE>fSelectedTemplate = template;<NEW_LINE>((ExtendedWizardDialog) getContainer()).finishPressed();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>MessageDialog.openError(getShell(), Messages.NewModelFromTemplateWizardPage_5, ex.getMessage());<NEW_LINE>selectFirstTableItem();<NEW_LINE>getContainer().getShell().setVisible(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | template = fTemplateManager.createTemplate(file); |
1,104,141 | private void rebuildTagList(File directory) {<NEW_LINE>this.<MASK><NEW_LINE>try (org.eclipse.jgit.lib.Repository repository = getJGitRepository(directory.getAbsolutePath())) {<NEW_LINE>try (Git git = new Git(repository)) {<NEW_LINE>// refs sorted according to tag names<NEW_LINE>List<Ref> refList = git.tagList().call();<NEW_LINE>Map<RevCommit, String> commit2Tags = new HashMap<>();<NEW_LINE>for (Ref ref : refList) {<NEW_LINE>try {<NEW_LINE>RevCommit commit = getCommit(repository, ref);<NEW_LINE>String tagName = ref.getName().replace("refs/tags/", "");<NEW_LINE>commit2Tags.merge(commit, tagName, (oldValue, newValue) -> oldValue + TAGS_SEPARATOR + newValue);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.log(Level.FINEST, String.format("cannot get tags for \"%s\"", directory.getAbsolutePath()), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<RevCommit, String> entry : commit2Tags.entrySet()) {<NEW_LINE>int commitTime = entry.getKey().getCommitTime();<NEW_LINE>Date date = new Date((long) (commitTime) * 1000);<NEW_LINE>GitTagEntry tagEntry = new GitTagEntry(entry.getKey().getName(), date, entry.getValue());<NEW_LINE>this.tagList.add(tagEntry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException | GitAPIException e) {<NEW_LINE>LOGGER.log(Level.WARNING, String.format("cannot get tags for \"%s\"", directory.getAbsolutePath()), e);<NEW_LINE>// In case of partial success, do not null-out tagList here.<NEW_LINE>}<NEW_LINE>if (LOGGER.isLoggable(Level.FINER)) {<NEW_LINE>LOGGER.log(Level.FINER, "Read tags count={0} for {1}", new Object[] { tagList.size(), directory });<NEW_LINE>}<NEW_LINE>} | tagList = new TreeSet<>(); |
697,210 | public void copyFrom(final CopyFrom o) {<NEW_LINE>final YWeatherModuleImpl from = (YWeatherModuleImpl) o;<NEW_LINE>setAstronomy(from.getAstronomy() != null ? (Astronomy) from.getAstronomy().clone() : null);<NEW_LINE>setCondition(from.getCondition() != null ? (Condition) from.getCondition(<MASK><NEW_LINE>setLocation(from.getLocation() != null ? (Location) from.getLocation().clone() : null);<NEW_LINE>setUnits(from.getUnits() != null ? (Units) from.getUnits().clone() : null);<NEW_LINE>setWind(from.getWind() != null ? (Wind) from.getWind().clone() : null);<NEW_LINE>setAtmosphere(from.getAtmosphere() != null ? (Atmosphere) from.getAtmosphere().clone() : null);<NEW_LINE>if (from.getForecasts() != null) {<NEW_LINE>forecasts = new Forecast[from.forecasts.length];<NEW_LINE>for (int i = 0; i < from.forecasts.length; i++) {<NEW_LINE>forecasts[i] = from.forecasts[i] != null ? (Forecast) from.forecasts[i].clone() : null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>forecasts = null;<NEW_LINE>}<NEW_LINE>} | ).clone() : null); |
843,039 | public static ListNode<Integer> overlappingLists(ListNode<Integer> l0, ListNode<Integer> l1) {<NEW_LINE>// Store the start of cycle if any.<NEW_LINE>ListNode<Integer> root0 = IsListCyclic.hasCycle(l0);<NEW_LINE>ListNode<Integer> root1 = IsListCyclic.hasCycle(l1);<NEW_LINE>if (root0 == null && root1 == null) {<NEW_LINE>// Both lists don't have cycles.<NEW_LINE>return DoTerminatedListsOverlap.overlappingNoCycleLists(l0, l1);<NEW_LINE>} else if ((root0 != null && root1 == null) || (root0 == null && root1 != null)) {<NEW_LINE>// One list has cycle, and one list has no cycle.<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Both lists have cycles.<NEW_LINE>ListNode<Integer> temp = root1;<NEW_LINE>do {<NEW_LINE>temp = temp.next;<NEW_LINE>} while (temp != root0 && temp != root1);<NEW_LINE><MASK><NEW_LINE>} | return temp == root0 ? root1 : null; |
1,498,687 | private static String unionPreambleToString(final Memory mem, final Family family, final int preLongs) {<NEW_LINE>final ResizeFactor rf = ResizeFactor.getRF(extractResizeFactor(mem));<NEW_LINE><MASK><NEW_LINE>// Flags<NEW_LINE>final int flags = extractFlags(mem);<NEW_LINE>final String flagsStr = zeroPad(Integer.toBinaryString(flags), 8) + ", " + (flags);<NEW_LINE>// final boolean bigEndian = (flags & BIG_ENDIAN_FLAG_MASK) > 0;<NEW_LINE>// final String nativeOrder = ByteOrder.nativeOrder().toString();<NEW_LINE>// final boolean readOnly = (flags & READ_ONLY_FLAG_MASK) > 0;<NEW_LINE>final boolean isEmpty = (flags & EMPTY_FLAG_MASK) > 0;<NEW_LINE>final int k;<NEW_LINE>if (serVer == 1) {<NEW_LINE>final short encK = extractEncodedReservoirSize(mem);<NEW_LINE>k = ReservoirSize.decodeValue(encK);<NEW_LINE>} else {<NEW_LINE>k = extractK(mem);<NEW_LINE>}<NEW_LINE>final long dataBytes = mem.getCapacity() - (preLongs << 3);<NEW_LINE>return // + " BIG_ENDIAN_STORAGE : " + bigEndian + LS<NEW_LINE>LS + "### END " + family.getFamilyName().toUpperCase() + " PREAMBLE SUMMARY" + LS + "Byte 0: Preamble Longs : " + preLongs + LS + "Byte 0: ResizeFactor : " + rf.toString() + LS + "Byte 1: Serialization Version : " + serVer + LS + "Byte 2: Family : " + family.toString() + LS + "Byte 3: Flags Field : " + flagsStr + LS + // + " (Native Byte Order) : " + nativeOrder + LS<NEW_LINE>// + " READ_ONLY : " + readOnly + LS<NEW_LINE>" EMPTY : " + isEmpty + LS + "Bytes 4-7: Max Sketch Size (maxK): " + k + LS + "TOTAL Sketch Bytes : " + mem.getCapacity() + LS + " Preamble Bytes : " + (preLongs << 3) + LS + " Sketch Bytes : " + dataBytes + LS + "### END " + family.getFamilyName().toUpperCase() + " PREAMBLE SUMMARY" + LS;<NEW_LINE>} | final int serVer = extractSerVer(mem); |
301,835 | public static void main(String[] args) {<NEW_LINE>Exercise12 exercise12 = new Exercise12();<NEW_LINE>EdgeWeightedDigraph edgeWeightedDigraphWithCycle = new EdgeWeightedDigraph(8);<NEW_LINE>edgeWeightedDigraphWithCycle.addEdge(new DirectedEdge(0, 1, 0.35));<NEW_LINE>edgeWeightedDigraphWithCycle.addEdge(new DirectedEdge(1, 2, 0.35));<NEW_LINE>edgeWeightedDigraphWithCycle.addEdge(new DirectedEdge(2, 3, 0.37));<NEW_LINE>edgeWeightedDigraphWithCycle.addEdge(new DirectedEdge<MASK><NEW_LINE>edgeWeightedDigraphWithCycle.addEdge(new DirectedEdge(4, 1, 0.28));<NEW_LINE>edgeWeightedDigraphWithCycle.addEdge(new DirectedEdge(6, 7, 0.32));<NEW_LINE>edgeWeightedDigraphWithCycle.addEdge(new DirectedEdge(7, 5, 0.38));<NEW_LINE>EdgeWeightedDigraph edgeWeightedDAG = new EdgeWeightedDigraph(5);<NEW_LINE>edgeWeightedDAG.addEdge(new DirectedEdge(0, 1, 0.35));<NEW_LINE>edgeWeightedDAG.addEdge(new DirectedEdge(1, 2, 0.22));<NEW_LINE>edgeWeightedDAG.addEdge(new DirectedEdge(3, 4, 0.31));<NEW_LINE>edgeWeightedDAG.addEdge(new DirectedEdge(4, 0, 0.29));<NEW_LINE>StdOut.println("Cycle:");<NEW_LINE>EdgeWeightedDirectedCycle edgeWeightedDirectedCycle = exercise12.new EdgeWeightedDirectedCycle(edgeWeightedDigraphWithCycle);<NEW_LINE>for (DirectedEdge edge : edgeWeightedDirectedCycle.cycle()) {<NEW_LINE>StdOut.print(edge.from() + "->" + edge.to() + " ");<NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected: 1->2 2->3 3->4 4->1 ");<NEW_LINE>Topological topological = exercise12.new Topological(edgeWeightedDAG);<NEW_LINE>StdOut.println("\nTopological order:");<NEW_LINE>for (int vertex : topological.order()) {<NEW_LINE>StdOut.print(vertex + " ");<NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected: 3 4 0 1 2");<NEW_LINE>} | (3, 4, 0.28)); |
1,717,501 | public static IntLiteral buildIntLiteral(char[] token, int s, int e) {<NEW_LINE>// remove '_' and prefix '0' first<NEW_LINE>char[] intReducedToken = removePrefixZerosAndUnderscores(token, false);<NEW_LINE>switch(intReducedToken.length) {<NEW_LINE>case 10:<NEW_LINE>// 0x80000000<NEW_LINE>if (CharOperation.equals(intReducedToken, HEXA_MIN_VALUE)) {<NEW_LINE>return new IntLiteralMinValue(token, intReducedToken != token ? <MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 12:<NEW_LINE>// 020000000000<NEW_LINE>if (CharOperation.equals(intReducedToken, OCTAL_MIN_VALUE)) {<NEW_LINE>return new IntLiteralMinValue(token, intReducedToken != token ? intReducedToken : null, s, e);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return new IntLiteral(token, intReducedToken != token ? intReducedToken : null, s, e);<NEW_LINE>} | intReducedToken : null, s, e); |
915,700 | public Object calculate(Context ctx) {<NEW_LINE>if (param == null) {<NEW_LINE><MASK><NEW_LINE>if (n < Integer.MAX_VALUE) {<NEW_LINE>return new Integer((int) n);<NEW_LINE>} else {<NEW_LINE>return new Long(n);<NEW_LINE>}<NEW_LINE>} else if (param.isLeaf()) {<NEW_LINE>Object obj = param.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(obj instanceof Number)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("skip" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>long n = ((Number) obj).longValue();<NEW_LINE>n = cursor.skip(n);<NEW_LINE>if (n < Integer.MAX_VALUE) {<NEW_LINE>return new Integer((int) n);<NEW_LINE>} else {<NEW_LINE>return new Long(n);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (param.getType() != IParam.Semicolon || param.getSubSize() != 2) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("skip" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Expression[] exps;<NEW_LINE>IParam sub = param.getSub(1);<NEW_LINE>if (sub == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("skip" + mm.getMessage("function.invalidParam"));<NEW_LINE>} else if (sub.isLeaf()) {<NEW_LINE>exps = new Expression[] { sub.getLeafExpression() };<NEW_LINE>} else {<NEW_LINE>int count = sub.getSubSize();<NEW_LINE>exps = new Expression[count];<NEW_LINE>for (int i = 0; i < count; ++i) {<NEW_LINE>IParam p = sub.getSub(i);<NEW_LINE>if (p == null || !p.isLeaf()) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("skip" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>exps[i] = p.getLeafExpression();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int n = cursor.skipGroup(exps, ctx);<NEW_LINE>return new Integer(n);<NEW_LINE>}<NEW_LINE>} | long n = cursor.skip(); |
1,849,948 | final DescribeKeyPhrasesDetectionJobResult executeDescribeKeyPhrasesDetectionJob(DescribeKeyPhrasesDetectionJobRequest describeKeyPhrasesDetectionJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeKeyPhrasesDetectionJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeKeyPhrasesDetectionJobRequest> request = null;<NEW_LINE>Response<DescribeKeyPhrasesDetectionJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeKeyPhrasesDetectionJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeKeyPhrasesDetectionJobRequest));<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, "Comprehend");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeKeyPhrasesDetectionJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeKeyPhrasesDetectionJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeKeyPhrasesDetectionJobResultJsonUnmarshaller());<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.endEvent(Field.RequestMarshallTime); |
1,824,210 | public // when a column heading is clicked in the JTable.<NEW_LINE>void addMouseListenerToHeaderInTable(JTable table) {<NEW_LINE>final TableSorter sorter = this;<NEW_LINE>final JTable tableView = table;<NEW_LINE>tableView.setColumnSelectionAllowed(false);<NEW_LINE>new ClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onClick(MouseEvent e, int clickCount) {<NEW_LINE>TableColumnModel columnModel = tableView.getColumnModel();<NEW_LINE>int viewColumn = columnModel.getColumnIndexAtX(e.getX());<NEW_LINE>int column = tableView.convertColumnIndexToModel(viewColumn);<NEW_LINE>if (clickCount == 1 && column != -1) {<NEW_LINE>// System.out.println("Sorting ...");<NEW_LINE>int shiftPressed = e.getModifiers() & InputEvent.SHIFT_MASK;<NEW_LINE>boolean ascending = (shiftPressed == 0);<NEW_LINE>sorter.sortByColumn(column, ascending);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}.<MASK><NEW_LINE>} | installOn(tableView.getTableHeader()); |
479,246 | public CreateRulesetResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateRulesetResult createRulesetResult = new CreateRulesetResult();<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 createRulesetResult;<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("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createRulesetResult.setName(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 createRulesetResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,640,137 | private boolean shouldPush(Mcp.RequestResources requestResources, AbstractConnection<Mcp.Resources> connection) {<NEW_LINE>String type = requestResources.getCollection();<NEW_LINE><MASK><NEW_LINE>if (requestResources.getErrorDetail().getCode() != 0) {<NEW_LINE>Loggers.MAIN.error("mcp: ACK error, connection-id: {}, code: {}, message: {}", connectionId, requestResources.getErrorDetail().getCode(), requestResources.getErrorDetail().getMessage());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>WatchedStatus watchedStatus;<NEW_LINE>if (requestResources.getResponseNonce().isEmpty()) {<NEW_LINE>Loggers.MAIN.info("mcp: init request, type {}, connection-id {}, is incremental {}", type, connectionId, requestResources.getIncremental());<NEW_LINE>watchedStatus = new WatchedStatus();<NEW_LINE>watchedStatus.setType(type);<NEW_LINE>connection.addWatchedResource(type, watchedStatus);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>watchedStatus = connection.getWatchedStatusByType(type);<NEW_LINE>if (watchedStatus == null) {<NEW_LINE>Loggers.MAIN.info("mcp: reconnect, type {}, connection-id {}, is incremental {}", type, connectionId, requestResources.getIncremental());<NEW_LINE>watchedStatus = new WatchedStatus();<NEW_LINE>watchedStatus.setType(type);<NEW_LINE>connection.addWatchedResource(type, watchedStatus);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!watchedStatus.getLatestNonce().equals(requestResources.getResponseNonce())) {<NEW_LINE>Loggers.MAIN.warn("mcp: request dis match, type {}, connection-id {}", type, connectionId);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// This request is ack, we should record nonce.<NEW_LINE>watchedStatus.setAckedNonce(requestResources.getResponseNonce());<NEW_LINE>Loggers.MAIN.info("mcp: ack, type {}, connection-id {}, nonce {}", type, connectionId, requestResources.getResponseNonce());<NEW_LINE>return false;<NEW_LINE>} | String connectionId = connection.getConnectionId(); |
453,586 | public OperationResult<SchemaChangeResult> updateColumnFamily(final Map<String, Object> options) throws ConnectionException {<NEW_LINE>if (options.containsKey("keyspace") && !options.get("keyspace").equals(getKeyspaceName())) {<NEW_LINE>throw new RuntimeException(String.format("'keyspace' attribute must match keyspace name. Expected '%s' but got '%s'", getKeyspaceName(), options.get("keyspace")));<NEW_LINE>}<NEW_LINE>return connectionPool.executeWithFailover(new AbstractKeyspaceOperationImpl<SchemaChangeResult>(tracerFactory.newTracer(CassandraOperationType.UPDATE_COLUMN_FAMILY), getKeyspaceName()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public SchemaChangeResult internalExecute(Client client, ConnectionContext context) throws Exception {<NEW_LINE>ThriftColumnFamilyDefinitionImpl def = new ThriftColumnFamilyDefinitionImpl();<NEW_LINE>def.setFields(options);<NEW_LINE><MASK><NEW_LINE>return new SchemaChangeResponseImpl().setSchemaId(client.system_update_column_family(def.getThriftColumnFamilyDefinition()));<NEW_LINE>}<NEW_LINE>}, RunOnce.get());<NEW_LINE>} | def.setKeyspace(getKeyspaceName()); |
116,458 | public int compare(PluginInterface if0, PluginInterface if1) {<NEW_LINE>int result = 0;<NEW_LINE>switch(field) {<NEW_LINE>case FIELD_LOAD:<NEW_LINE>{<NEW_LINE>boolean b0 = if0.getPluginState().isLoadedAtStartup();<NEW_LINE>boolean b1 = if1.getPluginState().isLoadedAtStartup();<NEW_LINE>result = (b0 == b1 ? 0 : (<MASK><NEW_LINE>// Use the plugin ID name to sort by instead.<NEW_LINE>if (result == 0) {<NEW_LINE>result = if0.getPluginID().compareToIgnoreCase(if1.getPluginID());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case FIELD_TYPE:<NEW_LINE>case FIELD_DIRECTORY:<NEW_LINE>{<NEW_LINE>result = getFieldValue(field, if0).compareToIgnoreCase(getFieldValue(field, if1));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case FIELD_VERSION:<NEW_LINE>{<NEW_LINE>// XXX Not really right..<NEW_LINE>String s0 = if0.getPluginVersion();<NEW_LINE>String s1 = if1.getPluginVersion();<NEW_LINE>if (s0 == null)<NEW_LINE>s0 = "";<NEW_LINE>if (s1 == null)<NEW_LINE>s1 = "";<NEW_LINE>result = s0.compareToIgnoreCase(s1);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case FIELD_UNLOADABLE:<NEW_LINE>{<NEW_LINE>boolean b0 = if0.getPluginState().isUnloadable();<NEW_LINE>boolean b1 = if1.getPluginState().isUnloadable();<NEW_LINE>result = (b0 == b1 ? 0 : (b0 ? -1 : 1));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result == 0)<NEW_LINE>result = if0.getPluginName().compareToIgnoreCase(if1.getPluginName());<NEW_LINE>if (!ascending)<NEW_LINE>result *= -1;<NEW_LINE>return result;<NEW_LINE>} | b0 ? -1 : 1)); |
1,597,127 | public Object onTraversalSuccess() {<NEW_LINE>final SAMSequenceDictionary sequenceDictionary = getBestAvailableSequenceDictionary();<NEW_LINE>final List<SimpleInterval> inputIntervals = // if the user didn't add any intervals,<NEW_LINE>hasUserSuppliedIntervals() ? // if the user didn't add any intervals,<NEW_LINE>intervalArgumentCollection.getIntervals(sequenceDictionary) : IntervalUtils.getAllIntervalsForReference(sequenceDictionary);<NEW_LINE>// we assume that they wanted to do whole genome sequencing<NEW_LINE>logger.info("Padding intervals...");<NEW_LINE>final IntervalList paddedIntervalList = padIntervals(inputIntervals, padding, sequenceDictionary);<NEW_LINE>logger.info("Generating bins...");<NEW_LINE>final IntervalList unfilteredBins = generateBins(paddedIntervalList, binLength, sequenceDictionary);<NEW_LINE>logger.info("Filtering bins containing only Ns...");<NEW_LINE>final ReferenceDataSource reference = ReferenceDataSource.of(referenceArguments.getReferencePath());<NEW_LINE>final IntervalList <MASK><NEW_LINE>logger.info(String.format("Writing bins to %s...", outputPreprocessedIntervalsFile.getAbsolutePath()));<NEW_LINE>bins.write(outputPreprocessedIntervalsFile);<NEW_LINE>logger.info(String.format("%s complete.", getClass().getSimpleName()));<NEW_LINE>return null;<NEW_LINE>} | bins = filterBinsContainingOnlyNs(unfilteredBins, reference); |
1,528,364 | private void logXmlExtraProblem(CategorizedProblem problem, int globalErrorCount, int localErrorCount) {<NEW_LINE>final int sourceStart = problem.getSourceStart();<NEW_LINE>final int sourceEnd = problem.getSourceEnd();<NEW_LINE>boolean isError = problem.isError();<NEW_LINE>HashMap<String, Object> <MASK><NEW_LINE>parameters.put(Logger.PROBLEM_SEVERITY, isError ? Logger.ERROR : (problem.isInfo() ? Logger.INFO : Logger.WARNING));<NEW_LINE>parameters.put(Logger.PROBLEM_LINE, Integer.valueOf(problem.getSourceLineNumber()));<NEW_LINE>parameters.put(Logger.PROBLEM_SOURCE_START, Integer.valueOf(sourceStart));<NEW_LINE>parameters.put(Logger.PROBLEM_SOURCE_END, Integer.valueOf(sourceEnd));<NEW_LINE>printTag(Logger.EXTRA_PROBLEM_TAG, parameters, true, false);<NEW_LINE>parameters.put(Logger.VALUE, problem.getMessage());<NEW_LINE>printTag(Logger.PROBLEM_MESSAGE, parameters, true, true);<NEW_LINE>extractContext(problem, null);<NEW_LINE>endTag(Logger.EXTRA_PROBLEM_TAG);<NEW_LINE>} | parameters = new HashMap<>(); |
629,753 | public List<ExpressInfo> query(ExpressCompany company, String num) {<NEW_LINE>String appId = JPressOptions.get("express_api_appid");<NEW_LINE>String appSecret = JPressOptions.get("express_api_appsecret");<NEW_LINE>String param = "{\"com\":\"" + company.getCode() + "\",\"num\":\"" + num + "\"}";<NEW_LINE>String sign = HashKit.md5(param + appSecret + appId).toUpperCase();<NEW_LINE>HashMap params = new HashMap();<NEW_LINE>params.put("param", param);<NEW_LINE>params.put("sign", sign);<NEW_LINE>params.put("customer", appId);<NEW_LINE>String result = HttpUtil.httpPost("http://poll.kuaidi100.com/poll/query.do", params);<NEW_LINE>if (StrUtil.isBlank(result)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>JSONObject jsonObject = JSON.parseObject(result);<NEW_LINE>JSONArray jsonArray = jsonObject.getJSONArray("data");<NEW_LINE>if (jsonArray != null && jsonArray.size() > 0) {<NEW_LINE>List<ExpressInfo> list = new ArrayList<>();<NEW_LINE>for (int i = 0; i < jsonArray.size(); i++) {<NEW_LINE>JSONObject expObject = jsonArray.getJSONObject(i);<NEW_LINE>ExpressInfo ei = new ExpressInfo();<NEW_LINE>ei.setInfo(expObject.getString("context"));<NEW_LINE>ei.setTime<MASK><NEW_LINE>list.add(ei);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOG.error(ex.toString(), ex);<NEW_LINE>}<NEW_LINE>LOG.error(result);<NEW_LINE>return null;<NEW_LINE>} | (expObject.getString("time")); |
563,192 | protected static void generateRegisterSleigh(List<String> result, Language language, AddressSpace space, SemisparseByteArray array) {<NEW_LINE>byte[] data = new byte[8];<NEW_LINE>RangeSet<UnsignedLong> remains = TreeRangeSet.create(array.getInitialized(0, -1));<NEW_LINE>while (!remains.isEmpty()) {<NEW_LINE>Range<UnsignedLong> span = remains.span();<NEW_LINE>assert span.lowerBoundType() == BoundType.CLOSED;<NEW_LINE>Address min = space.getAddress(span.lowerEndpoint().longValue());<NEW_LINE>Register register = Stream.of(language.getRegisters(min)).filter(r -> r.getAddress().equals(min)).filter(r -> r.getNumBytes() <= data.length).filter(r -> isContained(r, remains)).sorted(Comparator.comparing(r -> -r.getNumBytes())).findFirst().orElse(null);<NEW_LINE>if (register == null) {<NEW_LINE>throw new IllegalArgumentException("Could not find a register for " + min);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>array.getData(min.getOffset(), data, 0, length);<NEW_LINE>BigInteger value = Utils.bytesToBigInteger(data, length, language.isBigEndian(), false);<NEW_LINE>result.add(String.format("%s=0x%s", register, value.toString(16)));<NEW_LINE>remains.remove(rangeOfRegister(register));<NEW_LINE>}<NEW_LINE>} | int length = register.getNumBytes(); |
1,489,847 | private ThreadPoolExecutor createPriorityExecutor(ScanExecutorConfig sec, Map<String, Queue<Runnable>> scanExecQueues) {<NEW_LINE>BlockingQueue<Runnable> queue;<NEW_LINE>if (sec.prioritizerClass.orElse("").isEmpty()) {<NEW_LINE>queue = new LinkedBlockingQueue<>();<NEW_LINE>} else {<NEW_LINE>ScanPrioritizer factory = null;<NEW_LINE>try {<NEW_LINE>factory = ConfigurationTypeHelper.getClassInstance(null, sec.prioritizerClass.get(), ScanPrioritizer.class);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>if (factory == null) {<NEW_LINE>queue = new LinkedBlockingQueue<>();<NEW_LINE>} else {<NEW_LINE>Comparator<ScanInfo> comparator = factory.createComparator(new ScanPrioritizer.CreateParameters() {<NEW_LINE><NEW_LINE>private final ServiceEnvironment senv = new ServiceEnvironmentImpl(context);<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Map<String, String> getOptions() {<NEW_LINE>return sec.prioritizerOpts;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ServiceEnvironment getServiceEnv() {<NEW_LINE>return senv;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// function to extract scan session from runnable<NEW_LINE>Function<Runnable, ScanInfo> extractor = r -> ((ScanSession.ScanMeasurer) TraceUtil.unwrap(r)).getScanInfo();<NEW_LINE>queue = new PriorityBlockingQueue<>(sec.maxThreads, Comparator.comparing(extractor, comparator));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>scanExecQueues.put(sec.name, queue);<NEW_LINE>ThreadPoolExecutor es = ThreadPools.getServerThreadPools().createThreadPool(sec.getCurrentMaxThreads(), sec.getCurrentMaxThreads(), 0L, TimeUnit.MILLISECONDS, "scan-" + sec.name, queue, sec.priority, true);<NEW_LINE>modifyThreadPoolSizesAtRuntime(sec::getCurrentMaxThreads, <MASK><NEW_LINE>return es;<NEW_LINE>} | "scan-" + sec.name, es); |
743,865 | /*<NEW_LINE>* Store the URI redirect key,value map for this provider<NEW_LINE>*/<NEW_LINE>public static synchronized boolean initRewrites(String providerID, String[] providerRewrites) {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE><MASK><NEW_LINE>boolean hasRewrites = (providerRewrites != null) && (providerRewrites.length > 0);<NEW_LINE>if (hasRewrites) {<NEW_LINE>HashMap<String, String> rewriteMap = new HashMap<String, String>();<NEW_LINE>for (String key : providerRewrites) {<NEW_LINE>String newValue = key;<NEW_LINE>try {<NEW_LINE>newValue = PlatformServiceFactory.getPlatformService().getRewrite(key);<NEW_LINE>} catch (OAuthProviderException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>rewriteMap.put(key, newValue);<NEW_LINE>}<NEW_LINE>uriRewrites.put(providerID, rewriteMap);<NEW_LINE>}<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "initRewrites");<NEW_LINE>return hasRewrites;<NEW_LINE>} | Tr.entry(tc, "initRewrites"); |
276,596 | private static void decodeByteSegment(BitSource bits, StringBuffer result, int count, CharacterSetECI currentCharacterSetECI, Vector byteSegments, Hashtable hints) throws FormatException {<NEW_LINE>byte[<MASK><NEW_LINE>if (count << 3 > bits.available()) {<NEW_LINE>throw FormatException.getFormatInstance();<NEW_LINE>}<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>readBytes[i] = (byte) bits.readBits(8);<NEW_LINE>}<NEW_LINE>String encoding;<NEW_LINE>if (currentCharacterSetECI == null) {<NEW_LINE>// The spec isn't clear on this mode; see<NEW_LINE>// section 6.4.5: t does not say which encoding to assuming<NEW_LINE>// upon decoding. I have seen ISO-8859-1 used as well as<NEW_LINE>// Shift_JIS -- without anything like an ECI designator to<NEW_LINE>// give a hint.<NEW_LINE>encoding = StringUtils.guessEncoding(readBytes, hints);<NEW_LINE>} else {<NEW_LINE>encoding = currentCharacterSetECI.getEncodingName();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>result.append(new String(readBytes, encoding));<NEW_LINE>} catch (UnsupportedEncodingException uce) {<NEW_LINE>throw FormatException.getFormatInstance();<NEW_LINE>}<NEW_LINE>byteSegments.addElement(readBytes);<NEW_LINE>} | ] readBytes = new byte[count]; |
1,609,851 | private void walkLocalTable(PrintStream out) throws CorruptDataException {<NEW_LINE>int totalWeight = 0;<NEW_LINE>J9DbgStringInternTablePointer stringInternTablePtr = getRomClassBuilderPtr(out);<NEW_LINE>if (stringInternTablePtr.isNull()) {<NEW_LINE>out.append("StringInternTable is null" + nl);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (currentEntryPtr.isNull()) {<NEW_LINE>out.append("HeadNode is null" + nl);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int counter = 1;<NEW_LINE>out.append("=================================================================================" + nl);<NEW_LINE>out.append(tab(2) + "WALKING LOCAL INTERN HASHTABLE (stringInternTable )" + stringInternTablePtr.getHexAddress() + ")" + nl);<NEW_LINE>out.append(tab(2) + "FROM: MRU (MOST RECENTLY USED)" + nl);<NEW_LINE>out.append(tab(2) + "TO: LRU (LEAST RECENTLY USED)" + nl);<NEW_LINE>out.append("=================================================================================" + nl);<NEW_LINE>while (!currentEntryPtr.isNull()) {<NEW_LINE>out.append(counter + "." + tab + "Local Table Entry < !J9InternHashTableEntry " + currentEntryPtr.getHexAddress() + " Flags: " + currentEntryPtr.flags().getHexValue() + " IWeight: " + currentEntryPtr.internWeight().longValue() + " ClassLoader: " + "!J9ClassLoader " + currentEntryPtr.classLoader().getHexAddress() + ">" + tab + "UTF8 <Add: " + currentEntryPtr.utf8().getHexAddress() + " Data: \"" + J9UTF8Helper.stringValue(currentEntryPtr.utf8()) + "\">" + nl);<NEW_LINE>totalWeight += currentEntryPtr.internWeight().longValue();<NEW_LINE>currentEntryPtr = currentEntryPtr.nextNode();<NEW_LINE>counter++;<NEW_LINE>}<NEW_LINE>out.append("Total Weight = " + totalWeight + nl);<NEW_LINE>out.append("=================================================================================" + nl);<NEW_LINE>out.append(tab(2) + "WALKING LOCAL INTERN HASHTABLE COMPLETED" + nl);<NEW_LINE>out.append("=================================================================================" + nl);<NEW_LINE>} | J9InternHashTableEntryPointer currentEntryPtr = stringInternTablePtr.headNode(); |
521,701 | public void showJavadoc() {<NEW_LINE>String relativeName = FileUtil.getRelativePath(cpRoot, resource);<NEW_LINE>URL[] urls = JavadocForBinaryQuery.findJavadoc(cpRoot.toURL()).getRoots();<NEW_LINE>URL pageURL;<NEW_LINE>if (relativeName.length() == 0) {<NEW_LINE>// NOI18N<NEW_LINE>pageURL = ShowJavadocAction.findJavadoc("overview-summary.html", urls);<NEW_LINE>if (pageURL == null) {<NEW_LINE>// NOI18N<NEW_LINE>pageURL = ShowJavadocAction.findJavadoc("index.html", urls);<NEW_LINE>}<NEW_LINE>} else if (resource.isFolder()) {<NEW_LINE>// XXX Are the names the same also in the localized javadoc?<NEW_LINE>// NOI18N<NEW_LINE>pageURL = ShowJavadocAction.findJavadoc(relativeName + "/package-summary.html", urls);<NEW_LINE>} else {<NEW_LINE>// NOI18Ns<NEW_LINE>String javadocFileName = relativeName.substring(0, relativeName<MASK><NEW_LINE>pageURL = ShowJavadocAction.findJavadoc(javadocFileName, urls);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>ShowJavadocAction.showJavaDoc(pageURL, relativeName.replace('/', '.'));<NEW_LINE>} | .lastIndexOf('.')) + ".html"; |
542,504 | public static Order adaptOrder(BinanceOrder order) {<NEW_LINE>OrderType type = convert(order.side);<NEW_LINE>CurrencyPair currencyPair = adaptSymbol(order.symbol);<NEW_LINE>Order.Builder builder;<NEW_LINE>if (order.type.equals(org.knowm.xchange.binance.dto.trade.OrderType.MARKET)) {<NEW_LINE>builder = new MarketOrder.Builder(type, currencyPair);<NEW_LINE>} else if (order.type.equals(org.knowm.xchange.binance.dto.trade.OrderType.LIMIT) || order.type.equals(org.knowm.xchange.binance.dto.trade.OrderType.LIMIT_MAKER)) {<NEW_LINE>builder = new LimitOrder.Builder(type, currencyPair).limitPrice(order.price);<NEW_LINE>} else {<NEW_LINE>builder = new StopOrder.Builder(type, currencyPair).stopPrice(order.stopPrice);<NEW_LINE>}<NEW_LINE>builder.orderStatus(adaptOrderStatus(order.status)).originalAmount(order.origQty).id(Long.toString(order.orderId)).timestamp(order.getTime()<MASK><NEW_LINE>if (order.executedQty.signum() != 0 && order.cummulativeQuoteQty.signum() != 0) {<NEW_LINE>builder.averagePrice(order.cummulativeQuoteQty.divide(order.executedQty, MathContext.DECIMAL32));<NEW_LINE>}<NEW_LINE>if (order.clientOrderId != null) {<NEW_LINE>builder.flag(BinanceOrderFlags.withClientId(order.clientOrderId));<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | ).cumulativeAmount(order.executedQty); |
650,024 | public static void main(String[] args) throws ClassNotFoundException, IOException {<NEW_LINE>Properties props = StringUtils.argsToProperties(args);<NEW_LINE>String filePath = props.getProperty("file");<NEW_LINE>CoNLLUReader reader = new CoNLLUReader();<NEW_LINE>CoNLLUOutputter writer = new CoNLLUOutputter();<NEW_LINE>System.err.println("Reading in docs...");<NEW_LINE>List<Annotation> docs = reader.readCoNLLUFile(filePath);<NEW_LINE>System.err.println("Done.");<NEW_LINE>System.err.println("Tagging docs...");<NEW_LINE>String taggerPath = props.getProperty("tagger");<NEW_LINE>maxentTagger = new MaxentTagger(taggerPath);<NEW_LINE>for (Annotation doc : docs) {<NEW_LINE>CoreDocument coreDoc = new CoreDocument(doc);<NEW_LINE>for (CoreSentence sentence : coreDoc.sentences()) {<NEW_LINE>maxentTagger.tagCoreLabels(sentence.tokens());<NEW_LINE>}<NEW_LINE>String updatedCoNLLU = writer.print(doc);<NEW_LINE>System.out.println(updatedCoNLLU.trim() + "\n");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | System.err.println("Done."); |
250,283 | static ASelectableCondition load(final XMLElement element) {<NEW_LINE>final Object attr = AttributeConditionController.toAttributeObject(element<MASK><NEW_LINE>Object value = element.getAttribute(CompareConditionAdapter.VALUE, null);<NEW_LINE>if (value == null) {<NEW_LINE>final String spec = element.getAttribute(CompareConditionAdapter.OBJECT, null);<NEW_LINE>value = TypeReference.create(spec);<NEW_LINE>}<NEW_LINE>final boolean matchCase = TreeXmlReader.xmlToBoolean(element.getAttribute(CompareConditionAdapter.MATCH_CASE, null));<NEW_LINE>final int compResult = Integer.parseInt(element.getAttribute(COMPARATION_RESULT, null));<NEW_LINE>final boolean succeed = TreeXmlReader.xmlToBoolean(element.getAttribute(SUCCEED, null));<NEW_LINE>final boolean matchApproximately = TreeXmlReader.xmlToBoolean(element.getAttribute(MATCH_APPROXIMATELY, null));<NEW_LINE>return new AttributeCompareCondition(attr, value, matchCase, compResult, succeed, matchApproximately, Boolean.valueOf(element.getAttribute(IGNORE_DIACRITICS, null)));<NEW_LINE>} | .getAttribute(ATTRIBUTE, null)); |
1,091,248 | public MdmLink createOrUpdateLinkEntity(IBaseResource theGoldenResource, IBaseResource theSourceResource, MdmMatchOutcome theMatchOutcome, MdmLinkSourceEnum theLinkSource, @Nullable MdmTransactionContext theMdmTransactionContext) {<NEW_LINE>Long goldenResourcePid = myJpaIdHelperService.getPidOrNull(theGoldenResource);<NEW_LINE>Long sourceResourcePid = myJpaIdHelperService.getPidOrNull(theSourceResource);<NEW_LINE>MdmLink <MASK><NEW_LINE>mdmLink.setLinkSource(theLinkSource);<NEW_LINE>mdmLink.setMatchResult(theMatchOutcome.getMatchResultEnum());<NEW_LINE>// Preserve these flags for link updates<NEW_LINE>mdmLink.setEidMatch(theMatchOutcome.isEidMatch() | mdmLink.isEidMatchPresent());<NEW_LINE>mdmLink.setHadToCreateNewGoldenResource(theMatchOutcome.isCreatedNewResource() | mdmLink.getHadToCreateNewGoldenResource());<NEW_LINE>mdmLink.setMdmSourceType(myFhirContext.getResourceType(theSourceResource));<NEW_LINE>if (mdmLink.getScore() != null) {<NEW_LINE>mdmLink.setScore(Math.max(theMatchOutcome.score, mdmLink.getScore()));<NEW_LINE>} else {<NEW_LINE>mdmLink.setScore(theMatchOutcome.score);<NEW_LINE>}<NEW_LINE>String message = String.format("Creating MdmLink from %s to %s -> %s", theGoldenResource.getIdElement().toUnqualifiedVersionless(), theSourceResource.getIdElement().toUnqualifiedVersionless(), theMatchOutcome);<NEW_LINE>theMdmTransactionContext.addTransactionLogMessage(message);<NEW_LINE>ourLog.debug(message);<NEW_LINE>save(mdmLink);<NEW_LINE>return mdmLink;<NEW_LINE>} | mdmLink = getOrCreateMdmLinkByGoldenResourcePidAndSourceResourcePid(goldenResourcePid, sourceResourcePid); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.