idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,849,650 | public void run(RegressionEnvironment env) {<NEW_LINE>SubscriberInterface subscriber = new SubscriberInterface();<NEW_LINE>EPCompiled compiled = env.compile("@name('s0') select * from SupportMarkerInterface");<NEW_LINE>EPStatement stmt = env.deploy(compiled).statement("s0");<NEW_LINE>stmt.setSubscriber(subscriber);<NEW_LINE><MASK><NEW_LINE>env.sendEventBean(a1);<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(new Object[] { a1 }, subscriber.getAndResetIndicate().toArray());<NEW_LINE>SupportBean_B b1 = new SupportBean_B("B1");<NEW_LINE>env.sendEventBean(b1);<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(new Object[] { b1 }, subscriber.getAndResetIndicate().toArray());<NEW_LINE>env.undeployAll();<NEW_LINE>SupportBean_C c1 = new SupportBean_C("C1");<NEW_LINE>env.sendEventBean(c1);<NEW_LINE>assertEquals(0, subscriber.getAndResetIndicate().size());<NEW_LINE>env.deploy(compiled).statement("s0").setSubscriber(subscriber);<NEW_LINE>SupportBean_D d1 = new SupportBean_D("D1");<NEW_LINE>env.sendEventBean(d1);<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(new Object[] { d1 }, subscriber.getAndResetIndicate().toArray());<NEW_LINE>env.undeployAll();<NEW_LINE>} | SupportBean_A a1 = new SupportBean_A("A1"); |
846,804 | public ClasspathEntry combineWith(ClasspathEntry referringEntry) {<NEW_LINE>if (referringEntry == null)<NEW_LINE>return this;<NEW_LINE>IClasspathAttribute[] referringExtraAttributes = referringEntry.getExtraAttributes();<NEW_LINE>if (referringEntry.isExported() || referringEntry.getAccessRuleSet() != null || referringExtraAttributes.length > 0) {<NEW_LINE>boolean combine = this.entryKind == CPE_SOURCE || referringEntry.combineAccessRules();<NEW_LINE>IClasspathAttribute[] combinedAttributes = this.extraAttributes;<NEW_LINE>int lenRefer = referringExtraAttributes.length;<NEW_LINE>if (lenRefer > 0) {<NEW_LINE>int lenEntry = combinedAttributes.length;<NEW_LINE>if (referringEntry.path.isPrefixOf(this.path)) {<NEW_LINE>// consider prefix location as less specific, put to back (e.g.: referring to a library via a project):<NEW_LINE>System.arraycopy(combinedAttributes, 0, combinedAttributes = new IClasspathAttribute[lenEntry + lenRefer], 0, lenEntry);<NEW_LINE>System.arraycopy(referringExtraAttributes, 0, combinedAttributes, lenEntry, lenRefer);<NEW_LINE>} else {<NEW_LINE>// otherwise consider the referring entry as more specific than the referee:<NEW_LINE>System.arraycopy(combinedAttributes, 0, combinedAttributes = new IClasspathAttribute[lenEntry + lenRefer], lenRefer, lenEntry);<NEW_LINE>System.arraycopy(referringExtraAttributes, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new // duplicate container entry for tagging it as exported<NEW_LINE>ClasspathEntry(// duplicate container entry for tagging it as exported<NEW_LINE>getContentKind(), // duplicate container entry for tagging it as exported<NEW_LINE>getEntryKind(), // duplicate container entry for tagging it as exported<NEW_LINE>getPath(), // duplicate container entry for tagging it as exported<NEW_LINE>this.inclusionPatterns, // duplicate container entry for tagging it as exported<NEW_LINE>this.exclusionPatterns, // duplicate container entry for tagging it as exported<NEW_LINE>getSourceAttachmentPath(), // duplicate container entry for tagging it as exported<NEW_LINE>getSourceAttachmentRootPath(), // duplicate container entry for tagging it as exported<NEW_LINE>getOutputLocation(), referringEntry.isExported() || this.isExported, combine(referringEntry.getAccessRules(), getAccessRules(), combine), this.combineAccessRules, combinedAttributes);<NEW_LINE>}<NEW_LINE>// no need to clone<NEW_LINE>return this;<NEW_LINE>} | 0, combinedAttributes, 0, lenRefer); |
123,961 | public HBaseScanSpec visitFunctionCall(FunctionCall call, Void value) throws RuntimeException {<NEW_LINE>HBaseScanSpec nodeScanSpec = null;<NEW_LINE>String functionName = call.getName();<NEW_LINE>List<LogicalExpression> args = call.args();<NEW_LINE>if (CompareFunctionsProcessor.isCompareFunction(functionName)) {<NEW_LINE>if (nullComparatorSupported == null) {<NEW_LINE>nullComparatorSupported = groupScan.getHBaseConf().getBoolean("drill.hbase.supports.null.comparator", false);<NEW_LINE>}<NEW_LINE>CompareFunctionsProcessor processor = CompareFunctionsProcessor.createFunctionsProcessorInstance(call, nullComparatorSupported);<NEW_LINE>if (processor.isSuccess()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>switch(functionName) {<NEW_LINE>case FunctionNames.AND:<NEW_LINE>case FunctionNames.OR:<NEW_LINE>HBaseScanSpec firstScanSpec = args.get(0).accept(this, null);<NEW_LINE>for (int i = 1; i < args.size(); ++i) {<NEW_LINE>HBaseScanSpec nextScanSpec = args.get(i).accept(this, null);<NEW_LINE>if (firstScanSpec != null && nextScanSpec != null) {<NEW_LINE>nodeScanSpec = mergeScanSpecs(functionName, firstScanSpec, nextScanSpec);<NEW_LINE>} else {<NEW_LINE>allExpressionsConverted = false;<NEW_LINE>if (FunctionNames.AND.equals(functionName)) {<NEW_LINE>nodeScanSpec = firstScanSpec == null ? nextScanSpec : firstScanSpec;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>firstScanSpec = nodeScanSpec;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (nodeScanSpec == null) {<NEW_LINE>allExpressionsConverted = false;<NEW_LINE>}<NEW_LINE>return nodeScanSpec;<NEW_LINE>} | nodeScanSpec = createHBaseScanSpec(call, processor); |
1,390,327 | public void actionPerform(Component component) {<NEW_LINE><MASK><NEW_LINE>if (selected.size() != 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Entity editItem = (Entity) selected.toArray()[0];<NEW_LINE>Map<String, Object> editorParams = new HashMap<>();<NEW_LINE>editorParams.put("metaClass", editItem.getMetaClass());<NEW_LINE>editorParams.put("item", editItem);<NEW_LINE>editorParams.put("parent", item);<NEW_LINE>editorParams.put("autocommit", Boolean.FALSE);<NEW_LINE>MetaProperty inverseProperty = metaProperty.getInverse();<NEW_LINE>if (inverseProperty != null) {<NEW_LINE>editorParams.put("parentProperty", inverseProperty.getName());<NEW_LINE>}<NEW_LINE>if (metaProperty.getType() == MetaProperty.Type.COMPOSITION) {<NEW_LINE>editorParams.put("parentDs", entitiesDs);<NEW_LINE>}<NEW_LINE>Window window = openWindow("entityInspector.edit", OPEN_TYPE, editorParams);<NEW_LINE>window.addCloseListener(actionId -> entitiesDs.refresh());<NEW_LINE>} | Set selected = entitiesTable.getSelected(); |
532,717 | private void superPreDestroy(InvocationContext inv) {<NEW_LINE>try {<NEW_LINE>ResultsLocal results = ResultsLocalBean.getSFBean();<NEW_LINE>results.addPreDestroy(CLASS_NAME, "superPreDestroy");<NEW_LINE>// Validate and update context data.<NEW_LINE>Map<String, Object> map = inv.getContextData();<NEW_LINE>String data;<NEW_LINE>if (map.containsKey("PreDestroy")) {<NEW_LINE>data = (String) map.get("PreDestroy");<NEW_LINE>data = data + ":" + CLASS_NAME;<NEW_LINE>} else {<NEW_LINE>data = CLASS_NAME;<NEW_LINE>}<NEW_LINE>map.put("PreDestroy", data);<NEW_LINE>results.setPreDestroyContextData(data);<NEW_LINE>// Verify around invoke does not see any context data from lifecycle<NEW_LINE>// callback events.<NEW_LINE>if (map.containsKey("PostActivate")) {<NEW_LINE>throw new IllegalStateException("PostActivate context data shared with PreDestroy interceptor");<NEW_LINE>} else if (map.containsKey("AroundInvoke")) {<NEW_LINE>throw new IllegalStateException("AroundInvoke context data shared with PreDestroy interceptor");<NEW_LINE>} else if (map.containsKey("PrePassivate")) {<NEW_LINE>throw new IllegalStateException("PrePassivate context data shared with PreDestroy interceptor");<NEW_LINE>} else if (map.containsKey("PostConstruct")) {<NEW_LINE>throw new IllegalStateException("PostConstruct context data shared with PreDestroy interceptor");<NEW_LINE>}<NEW_LINE>// Verify same InvocationContext passed to each PreDestroy<NEW_LINE>// interceptor method.<NEW_LINE>InvocationContext ctxData;<NEW_LINE>if (map.containsKey("InvocationContext")) {<NEW_LINE>ctxData = (<MASK><NEW_LINE>if (inv != ctxData) {<NEW_LINE>throw new IllegalStateException("Same InvocationContext not passed to each PreDestroy interceptor");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>map.put("InvocationContext", inv);<NEW_LINE>}<NEW_LINE>inv.proceed();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new EJBException("unexpected Throwable", e);<NEW_LINE>}<NEW_LINE>} | InvocationContext) map.get("InvocationContext"); |
1,474,198 | ReadResult read(long startOffset, int maxLength, Duration timeout) {<NEW_LINE>Exceptions.checkNotClosed(this.closed, this);<NEW_LINE>Preconditions.checkState<MASK><NEW_LINE>Exceptions.checkArgument(startOffset >= 0, "startOffset", "startOffset must be a non-negative number.");<NEW_LINE>Exceptions.checkArgument(maxLength >= 0, "maxLength", "maxLength must be a non-negative number.");<NEW_LINE>// We only check if we exceeded the last offset of a Sealed Segment. If we attempted to read from a truncated offset<NEW_LINE>// that will be handled by returning a Truncated ReadResultEntryType.<NEW_LINE>Exceptions.checkArgument(checkReadAvailability(startOffset, true) != ReadAvailability.BeyondLastOffset, "startOffset", "StreamSegment is sealed and startOffset is beyond the last offset of the StreamSegment.");<NEW_LINE>log.debug("{}: Read (Offset = {}, MaxLength = {}).", this.traceObjectId, startOffset, maxLength);<NEW_LINE>return new StreamSegmentReadResult(startOffset, maxLength, this::getMultiReadResultEntry, this.traceObjectId);<NEW_LINE>} | (!this.recoveryMode, "StreamSegmentReadIndex is in Recovery Mode."); |
1,059,950 | public void marshall(UpdateWebACLRequest updateWebACLRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateWebACLRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateWebACLRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateWebACLRequest.getScope(), SCOPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateWebACLRequest.getDefaultAction(), DEFAULTACTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateWebACLRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateWebACLRequest.getRules(), RULES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateWebACLRequest.getVisibilityConfig(), VISIBILITYCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateWebACLRequest.getLockToken(), LOCKTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateWebACLRequest.getCustomResponseBodies(), CUSTOMRESPONSEBODIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateWebACLRequest.getCaptchaConfig(), CAPTCHACONFIG_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | updateWebACLRequest.getId(), ID_BINDING); |
1,255,774 | public PCollection<KV<BigQueryTablePartition, String>> expand(PBegin begin) {<NEW_LINE>Schema targetFileSchema = table.getSchema();<NEW_LINE>if (table.isPartitioned() && enforceSamePartitionKey) {<NEW_LINE>// Apart from renaming the field in the schema we don't need to anything else (e.g. replace<NEW_LINE>// the field in the actual GenericRecord being processed) because writers write fields<NEW_LINE>// to the file based on their numeric position, not their name.<NEW_LINE>targetFileSchema = Schemas.renameAvroField(targetFileSchema, table.getPartitioningColumn(), table.getPartitioningColumn() + PARTITION_COLUMN_RENAME_SUFFIX);<NEW_LINE>}<NEW_LINE>Sink<GenericRecord> sink;<NEW_LINE>switch(outputFileFormat) {<NEW_LINE>case PARQUET:<NEW_LINE>sink = ParquetIO.sink(targetFileSchema).withCompressionCodec(outputFileCompression.getParquetCodec());<NEW_LINE>break;<NEW_LINE>case AVRO:<NEW_LINE>sink = AvroIO.<GenericRecord>sink(targetFileSchema).withCodec(outputFileCompression.getAvroCodec());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>BigQueryToGcsDirectoryNaming dn = new BigQueryToGcsDirectoryNaming(enforceSamePartitionKey);<NEW_LINE>if (!table.isPartitioned()) {<NEW_LINE>return transformTable(begin, sink, dn);<NEW_LINE>}<NEW_LINE>if (table.getPartitions() == null || table.getPartitions().isEmpty()) {<NEW_LINE>throw new IllegalStateException(String.format("Expected at least 1 partition for a partitioned table %s, but got none.", table.getTableName()));<NEW_LINE>}<NEW_LINE>List<PCollection<KV<BigQueryTablePartition, String>>> collections = new ArrayList<>();<NEW_LINE>table.getPartitions().forEach(p -> collections.add(transformPartition(begin, sink, p, dn)));<NEW_LINE>return PCollectionList.of(collections).apply(tableNodeName("FlattenPartitionResults"), Flatten.pCollections());<NEW_LINE>} | throw new UnsupportedOperationException("Output format is not implemented: " + outputFileFormat); |
1,102,025 | protected AuthChallenge challengeResponse(HttpFacade facade, final OIDCAuthenticationError.Reason reason, final String error, final String description) {<NEW_LINE>StringBuilder header = new StringBuilder("Bearer realm=\"");<NEW_LINE>header.append(deployment.getRealm()).append("\"");<NEW_LINE>if (error != null) {<NEW_LINE>header.append(", error=\"").append<MASK><NEW_LINE>}<NEW_LINE>if (description != null) {<NEW_LINE>header.append(", error_description=\"").append(description).append("\"");<NEW_LINE>}<NEW_LINE>final String challenge = header.toString();<NEW_LINE>return new AuthChallenge() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int getResponseCode() {<NEW_LINE>return 401;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean challenge(HttpFacade facade) {<NEW_LINE>if (deployment.getPolicyEnforcer() != null) {<NEW_LINE>deployment.getPolicyEnforcer().enforce(OIDCHttpFacade.class.cast(facade));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>OIDCAuthenticationError error = new OIDCAuthenticationError(reason, description);<NEW_LINE>facade.getRequest().setError(error);<NEW_LINE>facade.getResponse().addHeader("WWW-Authenticate", challenge);<NEW_LINE>if (deployment.isDelegateBearerErrorResponseSending()) {<NEW_LINE>facade.getResponse().setStatus(401);<NEW_LINE>} else {<NEW_LINE>facade.getResponse().sendError(401);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | (error).append("\""); |
1,505,415 | public Request<CreateInstanceProfileRequest> marshall(CreateInstanceProfileRequest createInstanceProfileRequest) {<NEW_LINE>if (createInstanceProfileRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<CreateInstanceProfileRequest> request = new DefaultRequest<CreateInstanceProfileRequest>(createInstanceProfileRequest, "AmazonIdentityManagement");<NEW_LINE>request.addParameter("Action", "CreateInstanceProfile");<NEW_LINE>request.addParameter("Version", "2010-05-08");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (createInstanceProfileRequest.getInstanceProfileName() != null) {<NEW_LINE>request.addParameter("InstanceProfileName", StringUtils.fromString(createInstanceProfileRequest.getInstanceProfileName()));<NEW_LINE>}<NEW_LINE>if (createInstanceProfileRequest.getPath() != null) {<NEW_LINE>request.addParameter("Path", StringUtils.fromString(createInstanceProfileRequest.getPath()));<NEW_LINE>}<NEW_LINE>if (!createInstanceProfileRequest.getTags().isEmpty() || !((com.amazonaws.internal.SdkInternalList<Tag>) createInstanceProfileRequest.getTags()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<Tag> tagsList = (com.amazonaws.internal.SdkInternalList<<MASK><NEW_LINE>int tagsListIndex = 1;<NEW_LINE>for (Tag tagsListValue : tagsList) {<NEW_LINE>if (tagsListValue != null) {<NEW_LINE>if (tagsListValue.getKey() != null) {<NEW_LINE>request.addParameter("Tags.member." + tagsListIndex + ".Key", StringUtils.fromString(tagsListValue.getKey()));<NEW_LINE>}<NEW_LINE>if (tagsListValue.getValue() != null) {<NEW_LINE>request.addParameter("Tags.member." + tagsListIndex + ".Value", StringUtils.fromString(tagsListValue.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tagsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | Tag>) createInstanceProfileRequest.getTags(); |
1,176,540 | public void paint(Graphics gr, JComponent c) {<NEW_LINE>final OnOffButton button = (OnOffButton) c;<NEW_LINE>final Dimension size = button.getSize();<NEW_LINE>int w = size.width - 8;<NEW_LINE>int h = size.height - 6;<NEW_LINE>if (h % 2 == 1) {<NEW_LINE>h--;<NEW_LINE>}<NEW_LINE>int ovalSize = h - JBUI.scale(4);<NEW_LINE>Graphics2D g = ((Graphics2D) gr);<NEW_LINE>GraphicsUtil.setupAAPainting(g);<NEW_LINE>g.translate(1, 1);<NEW_LINE>if (button.isSelected()) {<NEW_LINE>Color color = UIManager.getColor("Hyperlink.linkColor");<NEW_LINE>if (color == null) {<NEW_LINE>color = new JBColor(new Color(57, 113, 238), new Color(13, 41, 62));<NEW_LINE>}<NEW_LINE>g.setColor(color);<NEW_LINE>g.fillRoundRect(0, 0, w, h, h, h);<NEW_LINE>g.setColor(UIUtil.getBorderColor());<NEW_LINE>g.drawRoundRect(0, 0, <MASK><NEW_LINE>g.setColor(UIUtil.getListForeground(true));<NEW_LINE>g.drawString(button.getOnText(), h / 2, h - 4);<NEW_LINE>g.setColor(UIUtil.getBorderColor());<NEW_LINE>g.fillOval(w - h + JBUI.scale(1), JBUI.scale(2), ovalSize, ovalSize);<NEW_LINE>} else {<NEW_LINE>g.setColor(UIUtil.getPanelBackground());<NEW_LINE>g.fillRoundRect(0, 0, w, h, h, h);<NEW_LINE>g.setColor(UIUtil.getBorderColor());<NEW_LINE>g.drawRoundRect(0, 0, w, h, h, h);<NEW_LINE>g.setColor(UIUtil.getLabelDisabledForeground());<NEW_LINE>g.drawString(button.getOffText(), h + 4, h - 4);<NEW_LINE>g.setColor(UIUtil.getBorderColor());<NEW_LINE>g.fillOval(JBUI.scale(2), JBUI.scale(2), ovalSize, ovalSize);<NEW_LINE>}<NEW_LINE>g.translate(-1, -1);<NEW_LINE>} | w, h, h, h); |
565,979 | public Observable<ServiceResponseWithHeaders<Page<CloudJob>, JobListFromJobScheduleHeaders>> listFromJobScheduleWithServiceResponseAsync(final String jobScheduleId, final JobListFromJobScheduleOptions jobListFromJobScheduleOptions) {<NEW_LINE>return listFromJobScheduleSinglePageAsync(jobScheduleId, jobListFromJobScheduleOptions).concatMap(new Func1<ServiceResponseWithHeaders<Page<CloudJob>, JobListFromJobScheduleHeaders>, Observable<ServiceResponseWithHeaders<Page<CloudJob>, JobListFromJobScheduleHeaders>>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Observable<ServiceResponseWithHeaders<Page<CloudJob>, JobListFromJobScheduleHeaders>> call(ServiceResponseWithHeaders<Page<CloudJob>, JobListFromJobScheduleHeaders> page) {<NEW_LINE>String nextPageLink = page.body().nextPageLink();<NEW_LINE>if (nextPageLink == null) {<NEW_LINE>return Observable.just(page);<NEW_LINE>}<NEW_LINE>JobListFromJobScheduleNextOptions jobListFromJobScheduleNextOptions = null;<NEW_LINE>if (jobListFromJobScheduleOptions != null) {<NEW_LINE>jobListFromJobScheduleNextOptions = new JobListFromJobScheduleNextOptions();<NEW_LINE>jobListFromJobScheduleNextOptions.withClientRequestId(jobListFromJobScheduleOptions.clientRequestId());<NEW_LINE>jobListFromJobScheduleNextOptions.<MASK><NEW_LINE>jobListFromJobScheduleNextOptions.withOcpDate(jobListFromJobScheduleOptions.ocpDate());<NEW_LINE>}<NEW_LINE>return Observable.just(page).concatWith(listFromJobScheduleNextWithServiceResponseAsync(nextPageLink, jobListFromJobScheduleNextOptions));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | withReturnClientRequestId(jobListFromJobScheduleOptions.returnClientRequestId()); |
1,361,819 | private BinaryOperationExpression createPatternMatchingOperationSegment(final AExprContext ctx) {<NEW_LINE>String operator = ctx.patternMatchingOperator().getText();<NEW_LINE>ExpressionSegment left = (ExpressionSegment) visit(ctx.aExpr(0));<NEW_LINE>ListExpression right = new ListExpression(ctx.aExpr(1).start.getStartIndex(), ctx.aExpr().get(ctx.aExpr().size() - 1<MASK><NEW_LINE>for (int i = 1; i < ctx.aExpr().size(); i++) {<NEW_LINE>right.getItems().add((ExpressionSegment) visit(ctx.aExpr().get(i)));<NEW_LINE>}<NEW_LINE>String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));<NEW_LINE>return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);<NEW_LINE>} | ).stop.getStopIndex()); |
891,376 | public TargetCapacitySpecification unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>TargetCapacitySpecification targetCapacitySpecification = new TargetCapacitySpecification();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return targetCapacitySpecification;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("totalTargetCapacity", targetDepth)) {<NEW_LINE>targetCapacitySpecification.setTotalTargetCapacity(IntegerStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("onDemandTargetCapacity", targetDepth)) {<NEW_LINE>targetCapacitySpecification.setOnDemandTargetCapacity(IntegerStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("spotTargetCapacity", targetDepth)) {<NEW_LINE>targetCapacitySpecification.setSpotTargetCapacity(IntegerStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("defaultTargetCapacityType", targetDepth)) {<NEW_LINE>targetCapacitySpecification.setDefaultTargetCapacityType(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("targetCapacityUnitType", targetDepth)) {<NEW_LINE>targetCapacitySpecification.setTargetCapacityUnitType(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return targetCapacitySpecification;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | XMLEvent xmlEvent = context.nextEvent(); |
1,633,984 | final DescribeDataSourcesResult executeDescribeDataSources(DescribeDataSourcesRequest describeDataSourcesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDataSourcesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeDataSourcesRequest> request = null;<NEW_LINE>Response<DescribeDataSourcesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDataSourcesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDataSourcesRequest));<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, "Machine Learning");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDataSources");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDataSourcesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDataSourcesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
641,068 | private void drawTransforms(Canvas canvas) {<NEW_LINE>canvas.save();<NEW_LINE>try (var path = new Path();<NEW_LINE>var paint = new Paint().setColor(0xFF437AA0).setMode(PaintMode.STROKE).setStrokeWidth(1f);<NEW_LINE>var secondaryPaint = new Paint().setColor(0xFFFAA6B2).setMode(PaintMode.STROKE).setStrokeWidth(1f)) {<NEW_LINE>// offsets<NEW_LINE>path.reset().addRRect(RRect.makeLTRB(0, 0, 20, 20, 5));<NEW_LINE>canvas.drawPath(path, secondaryPaint);<NEW_LINE>path.offset(5, 5);<NEW_LINE>canvas.drawPath(path, paint);<NEW_LINE>canvas.translate(50, 0);<NEW_LINE>try (Path subpath = new Path().addRRect(RRect.makeLTRB(0, 0, 20, 20, 5))) {<NEW_LINE>canvas.drawPath(subpath, secondaryPaint);<NEW_LINE>subpath.offset(5, 5, path);<NEW_LINE>canvas.drawPath(path, paint);<NEW_LINE>canvas.translate(50, 0);<NEW_LINE>}<NEW_LINE>// transform<NEW_LINE>path.reset().addRRect(RRect.makeLTRB(0, 0, 20, 20, 5));<NEW_LINE>canvas.drawPath(path, secondaryPaint);<NEW_LINE>path.transform(Matrix33.makeRotate(-15));<NEW_LINE>canvas.drawPath(path, paint);<NEW_LINE>canvas.translate(50, 0);<NEW_LINE>try (Path subpath = new Path().addRRect(RRect.makeLTRB(0, 0, 20, 20, 5))) {<NEW_LINE>canvas.drawPath(subpath, secondaryPaint);<NEW_LINE>subpath.transform(Matrix33.makeRotate(-15), path);<NEW_LINE><MASK><NEW_LINE>canvas.translate(50, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>canvas.restore();<NEW_LINE>canvas.translate(0, 50);<NEW_LINE>} | canvas.drawPath(path, paint); |
241,601 | public void onLinkRemoteOpen(Event event) {<NEW_LINE>Link link = event.getLink();<NEW_LINE>if (link instanceof Sender) {<NEW_LINE>if (link.getRemoteTarget() != null) {<NEW_LINE>if (TRACE_LOGGER.isInfoEnabled()) {<NEW_LINE>TRACE_LOGGER.info(String.format(Locale.US, "onLinkRemoteOpen senderName[%s], linkName[%s], remoteTarget[%s]", this.senderName, link.getName(), link.getRemoteTarget()));<NEW_LINE>}<NEW_LINE>if (this.isFirstFlow.compareAndSet(true, false)) {<NEW_LINE>this.msgSender.onOpenComplete(null);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (TRACE_LOGGER.isInfoEnabled()) {<NEW_LINE>TRACE_LOGGER.info(String.format(Locale.US, "onLinkRemoteOpen senderName[%s], linkName[%s], remoteTarget[null], remoteSource[null], action[waitingForError]", this.senderName<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , link.getName())); |
1,683,494 | private static Observable<Set<Endpoint>> staticEndpoints(final int[] ports, final int stageNum, final int workerIndex, final int numPartitions) {<NEW_LINE>return Observable.create(new OnSubscribe<Set<Endpoint>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void call(Subscriber<? super Set<Endpoint>> subscriber) {<NEW_LINE>Set<Endpoint> endpoints <MASK><NEW_LINE>for (int i = 0; i < ports.length; i++) {<NEW_LINE>int port = ports[i];<NEW_LINE>for (int j = 1; j <= numPartitions; j++) {<NEW_LINE>Endpoint endpoint = new Endpoint("localhost", port, "stage_" + stageNum + "_index_" + workerIndex + "_partition_" + j);<NEW_LINE>logger.info("adding static endpoint:" + endpoint);<NEW_LINE>endpoints.add(endpoint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>subscriber.onNext(endpoints);<NEW_LINE>subscriber.onCompleted();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | = new HashSet<Endpoint>(); |
1,658,959 | public void handle(Request request, HttpResponder httpResponder) {<NEW_LINE>Stopwatch stopwatch = Stopwatch.createStarted();<NEW_LINE>ServeEvent serveEvent;<NEW_LINE>Request processedRequest = request;<NEW_LINE>if (!requestFilters.isEmpty()) {<NEW_LINE>RequestFilterAction requestFilterAction = processFilters(request, requestFilters, RequestFilterAction.continueWith(request));<NEW_LINE>if (requestFilterAction instanceof ContinueAction) {<NEW_LINE>processedRequest = ((ContinueAction) requestFilterAction).getRequest();<NEW_LINE>serveEvent = handleRequest(processedRequest);<NEW_LINE>} else {<NEW_LINE>serveEvent = ServeEvent.of(LoggedRequest.createFrom(request), ((StopAction) requestFilterAction).getResponseDefinition());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>serveEvent = handleRequest(request);<NEW_LINE>}<NEW_LINE>ResponseDefinition responseDefinition = serveEvent.getResponseDefinition();<NEW_LINE>responseDefinition.setOriginalRequest(processedRequest);<NEW_LINE>Response response = responseRenderer.render(serveEvent);<NEW_LINE>ServeEvent completedServeEvent = serveEvent.complete(response, (int<MASK><NEW_LINE>if (logRequests()) {<NEW_LINE>notifier().info("Request received:\n" + formatRequest(processedRequest) + "\n\nMatched response definition:\n" + responseDefinition + "\n\nResponse:\n" + response);<NEW_LINE>}<NEW_LINE>for (RequestListener listener : listeners) {<NEW_LINE>listener.requestReceived(processedRequest, response);<NEW_LINE>}<NEW_LINE>beforeResponseSent(completedServeEvent, response);<NEW_LINE>stopwatch.reset();<NEW_LINE>stopwatch.start();<NEW_LINE>httpResponder.respond(processedRequest, response);<NEW_LINE>completedServeEvent.afterSend((int) stopwatch.elapsed(MILLISECONDS));<NEW_LINE>afterResponseSent(completedServeEvent, response);<NEW_LINE>stopwatch.stop();<NEW_LINE>} | ) stopwatch.elapsed(MILLISECONDS)); |
1,453,707 | public static String literalToRawString(LiteralArg arg) {<NEW_LINE>ArgType type = arg.getType();<NEW_LINE>if (type == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>long lit = arg.getLiteral();<NEW_LINE>switch(type.getPrimitiveType()) {<NEW_LINE>case BOOLEAN:<NEW_LINE>return lit == 0 ? "false" : "true";<NEW_LINE>case CHAR:<NEW_LINE>return String.valueOf((char) lit);<NEW_LINE>case BYTE:<NEW_LINE>case SHORT:<NEW_LINE>case INT:<NEW_LINE>case LONG:<NEW_LINE>return Long.toString(lit);<NEW_LINE>case FLOAT:<NEW_LINE>return Float.toString(Float.intBitsToFloat((int) lit));<NEW_LINE>case DOUBLE:<NEW_LINE>return Double.toString<MASK><NEW_LINE>case OBJECT:<NEW_LINE>case ARRAY:<NEW_LINE>if (lit != 0) {<NEW_LINE>LOG.warn("Wrong object literal: {} for type: {}", lit, type);<NEW_LINE>return Long.toString(lit);<NEW_LINE>}<NEW_LINE>return "null";<NEW_LINE>default:<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | (Double.longBitsToDouble(lit)); |
739,000 | private void indeterminateChanged() {<NEW_LINE>boolean show = indeterminateButton.isSelected();<NEW_LINE>// show/hide indeterminate checkboxes<NEW_LINE>for (Component c : getComponents()) {<NEW_LINE>if ((c instanceof TestStateCheckBox && ((TestStateCheckBox) c).isStateIndeterminate()) || c instanceof FlatTriStateCheckBox || (c instanceof JLabel && ((JLabel) c).getText().startsWith("ind")))<NEW_LINE>c.setVisible(show);<NEW_LINE>}<NEW_LINE>// update layout<NEW_LINE>MigLayout layout = (MigLayout) getLayout();<NEW_LINE>Object columnCons = layout.getColumnConstraints();<NEW_LINE>AC ac = (columnCons instanceof String) ? ConstraintParser.parseColumnConstraints((String) columnCons) : (AC) columnCons;<NEW_LINE>DimConstraint[] constaints = ac.getConstaints();<NEW_LINE>constaints[3].setSizeGroup(show ? "1" : null);<NEW_LINE>constaints[6].<MASK><NEW_LINE>BoundSize gap = show ? null : ConstraintParser.parseBoundSize("0", true, true);<NEW_LINE>constaints[3].setGapBefore(gap);<NEW_LINE>constaints[6].setGapBefore(gap);<NEW_LINE>layout.setColumnConstraints(ac);<NEW_LINE>preview.revalidate();<NEW_LINE>revalidate();<NEW_LINE>repaint();<NEW_LINE>FlatThemeFileEditor.putPrefsBoolean(preview.state, KEY_SHOW_INDETERMINATE, show, true);<NEW_LINE>} | setSizeGroup(show ? "2" : null); |
362,015 | public static void expandNativeLibraryDirectories(ClassLoader classLoader, List<File> libPaths) {<NEW_LINE>if (sPathListField == null)<NEW_LINE>return;<NEW_LINE>Object pathList = getValue(sPathListField, classLoader);<NEW_LINE>if (pathList == null)<NEW_LINE>return;<NEW_LINE>if (sDexPathList_nativeLibraryDirectories_field == null) {<NEW_LINE>sDexPathList_nativeLibraryDirectories_field = getDeclaredField(<MASK><NEW_LINE>if (sDexPathList_nativeLibraryDirectories_field == null)<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// List<File> nativeLibraryDirectories<NEW_LINE>List<File> paths = getValue(sDexPathList_nativeLibraryDirectories_field, pathList);<NEW_LINE>if (paths == null)<NEW_LINE>return;<NEW_LINE>paths.addAll(libPaths);<NEW_LINE>// NativeLibraryElement[] nativeLibraryPathElements<NEW_LINE>if (sDexPathList_nativeLibraryPathElements_field == null) {<NEW_LINE>sDexPathList_nativeLibraryPathElements_field = getDeclaredField(pathList.getClass(), "nativeLibraryPathElements");<NEW_LINE>}<NEW_LINE>if (sDexPathList_nativeLibraryPathElements_field == null)<NEW_LINE>return;<NEW_LINE>int N = libPaths.size();<NEW_LINE>Object[] elements = new Object[N];<NEW_LINE>for (int i = 0; i < N; i++) {<NEW_LINE>Object dexElement = makeNativeLibraryElement(libPaths.get(i));<NEW_LINE>elements[i] = dexElement;<NEW_LINE>}<NEW_LINE>expandArray(pathList, sDexPathList_nativeLibraryPathElements_field, elements, false);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | pathList.getClass(), "nativeLibraryDirectories"); |
174,107 | public static void main(String[] args) {<NEW_LINE>Map<String, Object> kafkaConsumerConfig = new HashMap<>();<NEW_LINE>kafkaConsumerConfig.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");<NEW_LINE>kafkaConsumerConfig.put(ConsumerConfig.GROUP_ID_CONFIG, "sample-kafka-spout");<NEW_LINE>kafkaConsumerConfig.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");<NEW_LINE>kafkaConsumerConfig.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");<NEW_LINE>LOG.info("Kafka Consumer Config: {}", kafkaConsumerConfig);<NEW_LINE>KafkaConsumerFactory<String, String> kafkaConsumerFactory = new DefaultKafkaConsumerFactory<>(kafkaConsumerConfig);<NEW_LINE>TopologyBuilder topologyBuilder = new TopologyBuilder();<NEW_LINE>topologyBuilder.setSpout(KAFKA_SPOUT_NAME, new KafkaSpout<>(kafkaConsumerFactory, Collections.singletonList("test-topic")));<NEW_LINE>topologyBuilder.setBolt(LOGGING_BOLT_NAME, new LoggingBolt()).shuffleGrouping(KAFKA_SPOUT_NAME);<NEW_LINE>Config config = new Config();<NEW_LINE>config.setNumStmgrs(1);<NEW_LINE>config.setContainerCpuRequested(1);<NEW_LINE>config.setContainerRamRequested(ByteAmount.fromGigabytes(1));<NEW_LINE>config.setContainerDiskRequested(ByteAmount.fromGigabytes(1));<NEW_LINE>config.setComponentCpu(KAFKA_SPOUT_NAME, 0.25);<NEW_LINE>config.setComponentRam(KAFKA_SPOUT_NAME, ByteAmount.fromMegabytes(256));<NEW_LINE>config.setComponentDisk(KAFKA_SPOUT_NAME, ByteAmount.fromMegabytes(512));<NEW_LINE>config.setComponentCpu(LOGGING_BOLT_NAME, 0.25);<NEW_LINE>config.setComponentRam(LOGGING_BOLT_NAME<MASK><NEW_LINE>config.setComponentDisk(LOGGING_BOLT_NAME, ByteAmount.fromMegabytes(256));<NEW_LINE>Simulator simulator = new Simulator();<NEW_LINE>simulator.submitTopology("heron-kafka-spout-sample-topology", config, topologyBuilder.createTopology());<NEW_LINE>} | , ByteAmount.fromMegabytes(256)); |
94,948 | public Translation readTranslation(TranslatedEntity entityType, String entityId, String fieldName, String localeCode, String localeCountryCode, ResultType stage) {<NEW_LINE>CriteriaBuilder builder = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Translation> criteria = builder.createQuery(Translation.class);<NEW_LINE>Root<TranslationImpl> root = criteria.from(TranslationImpl.class);<NEW_LINE>criteria.select(root);<NEW_LINE>List<Predicate> restrictions = new ArrayList<Predicate>();<NEW_LINE>restrictions.add(builder.equal(root.get("entityType"), entityType.getFriendlyType()));<NEW_LINE>restrictions.add(builder.equal(root.get("entityId"), entityId));<NEW_LINE>restrictions.add(builder.equal(root.get("fieldName"), fieldName));<NEW_LINE>restrictions.add(builder.like(root.get("localeCode").as(String.class), localeCode + "%"));<NEW_LINE>try {<NEW_LINE>Class<?> aClass = entityConfiguration.createEntityInstance(entityType.<MASK><NEW_LINE>if (extensionManager != null) {<NEW_LINE>extensionManager.getProxy().setup(aClass, stage);<NEW_LINE>extensionManager.getProxy().refineParameterRetrieve(aClass, stage, builder, criteria, root, restrictions);<NEW_LINE>}<NEW_LINE>criteria.where(restrictions.toArray(new Predicate[restrictions.size()]));<NEW_LINE>TypedQuery<Translation> query = em.createQuery(criteria);<NEW_LINE>if (extensionManager != null) {<NEW_LINE>extensionManager.getProxy().refineQuery(aClass, stage, query);<NEW_LINE>}<NEW_LINE>query.setHint(QueryHints.HINT_CACHEABLE, true);<NEW_LINE>List<Translation> translations = query.getResultList();<NEW_LINE>if (!translations.isEmpty()) {<NEW_LINE>if (!localeCode.equals(localeCountryCode)) {<NEW_LINE>return findBestTranslation(localeCountryCode, translations);<NEW_LINE>} else {<NEW_LINE>return findSpecificTranslation(localeCountryCode, translations);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (extensionManager != null) {<NEW_LINE>extensionManager.getProxy().breakdown(TranslationImpl.class, stage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getType()).getClass(); |
1,708,346 | public void exitMethod(String methodName, String returnValue) {<NEW_LINE>if (!shouldLog(methodName))<NEW_LINE>return;<NEW_LINE>LogicalSide side = (forcedSideForTesting != null) ? forcedSideForTesting : EffectiveSide.get();<NEW_LINE>HashMap<String, Boolean> reentryFlagsSide = (side == <MASK><NEW_LINE>final int indentLevel = (side == LogicalSide.CLIENT) ? indentLevelClient : indentLevelServer;<NEW_LINE>if (!reentryFlagsSide.containsKey(methodName) || !reentryFlagsSide.get(methodName)) {<NEW_LINE>// never entered: ignore call<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>reentryFlagsSide.put(methodName, false);<NEW_LINE>if (side == LogicalSide.CLIENT) {<NEW_LINE>--indentLevelClient;<NEW_LINE>// should never happen.<NEW_LINE>if (indentLevelClient < 0)<NEW_LINE>indentLevelClient = 0;<NEW_LINE>} else {<NEW_LINE>--indentLevelServer;<NEW_LINE>// should never happen.<NEW_LINE>if (indentLevelServer < 0)<NEW_LINE>indentLevelServer = 0;<NEW_LINE>}<NEW_LINE>addIndentedOutputLine(side, indentLevel - 1, "} " + methodName + " return=" + returnValue, indentLevel <= 1 || immediateOutput);<NEW_LINE>} | LogicalSide.CLIENT) ? reentryFlagsClient : reentryFlagsServer; |
19,956 | private CaseAnalysis analyzeCaseOne() throws ExprValidationException {<NEW_LINE>// Case 1 expression example:<NEW_LINE>// case when a=b then x [when c=d then y...] [else y]<NEW_LINE>//<NEW_LINE>ExprNode[] children = this.getChildNodes();<NEW_LINE>if (children.length < 2) {<NEW_LINE>throw new ExprValidationException("Case node must have at least 2 parameters");<NEW_LINE>}<NEW_LINE>List<UniformPair<ExprNode>> whenThenNodeList = new LinkedList<>();<NEW_LINE>int numWhenThen = children.length >> 1;<NEW_LINE>for (int i = 0; i < numWhenThen; i++) {<NEW_LINE>ExprNode whenExpr = children[i << 1];<NEW_LINE>ExprNode thenExpr = children[(i << 1) + 1];<NEW_LINE>whenThenNodeList.add(new UniformPair<>(whenExpr, thenExpr));<NEW_LINE>}<NEW_LINE>ExprNode optionalElseExprNode = null;<NEW_LINE>if (children.length % 2 != 0) {<NEW_LINE>optionalElseExprNode = children[children.length - 1];<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>} | CaseAnalysis(whenThenNodeList, null, optionalElseExprNode); |
1,792,819 | private int updateSelectedKeys() {<NEW_LINE>int entries = pollWrapper.updated;<NEW_LINE>int numKeysUpdated = 0;<NEW_LINE>for (int i = 0; i < entries; i++) {<NEW_LINE>int nextFD = pollWrapper.getDescriptor(i);<NEW_LINE>SelectionKeyImpl ski = fdToKey.get(Integer.valueOf(nextFD));<NEW_LINE>// ski is null in the case of an interrupt<NEW_LINE>if (ski != null) {<NEW_LINE>int <MASK><NEW_LINE>if (selectedKeys.contains(ski)) {<NEW_LINE>if (ski.channel.translateAndSetReadyOps(rOps, ski)) {<NEW_LINE>numKeysUpdated++;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ski.channel.translateAndSetReadyOps(rOps, ski);<NEW_LINE>if ((ski.nioReadyOps() & ski.nioInterestOps()) != 0) {<NEW_LINE>selectedKeys.add(ski);<NEW_LINE>numKeysUpdated++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return numKeysUpdated;<NEW_LINE>} | rOps = pollWrapper.getEventOps(i); |
1,404,120 | public GlmEvaluationBatchOp linkFrom(BatchOperator<?>... inputs) {<NEW_LINE>checkOpSize(2, inputs);<NEW_LINE>BatchOperator<?> model = inputs[0];<NEW_LINE>BatchOperator<?> in = inputs[1];<NEW_LINE>String[] featureColNames = getFeatureCols();<NEW_LINE>String labelColName = getLabelCol();<NEW_LINE>String weightColName = getWeightCol();<NEW_LINE>String offsetColName = getOffsetCol();<NEW_LINE>Family familyName = getFamily();<NEW_LINE>Link linkName = getLink();<NEW_LINE>double variancePower = getVariancePower();<NEW_LINE>double linkPower = getLinkPower();<NEW_LINE>int numIter = getMaxIter();<NEW_LINE>double epsilon = getEpsilon();<NEW_LINE>boolean fitIntercept = getFitIntercept();<NEW_LINE>double regParam = getRegParam();<NEW_LINE>FamilyLink familyLink = new FamilyLink(<MASK><NEW_LINE>int numFeature = featureColNames.length;<NEW_LINE>DataSet<Row> data = GlmUtil.preProc(in, featureColNames, offsetColName, weightColName, labelColName);<NEW_LINE>DataSet<GlmUtil.WeightedLeastSquaresModel> wlsModel = model.getDataSet().mapPartition(new GlmUtil.GlmModelToWlsModel());<NEW_LINE>DataSet<Row> residual = GlmUtil.residual(wlsModel, data, numFeature, familyLink);<NEW_LINE>DataSet<GlmModelSummary> aggSummay = GlmUtil.aggSummary(residual, wlsModel, numFeature, familyLink, regParam, numIter, epsilon, fitIntercept);<NEW_LINE>// residual<NEW_LINE>String[] residualColNames = new String[numFeature + 4 + 4];<NEW_LINE>TypeInformation[] residualColTypes = new TypeInformation[numFeature + 4 + 4];<NEW_LINE>for (int i = 0; i < numFeature; i++) {<NEW_LINE>residualColNames[i] = featureColNames[i];<NEW_LINE>residualColTypes[i] = Types.DOUBLE;<NEW_LINE>}<NEW_LINE>residualColNames[numFeature] = "label";<NEW_LINE>residualColTypes[numFeature] = Types.DOUBLE;<NEW_LINE>residualColNames[numFeature + 1] = "weight";<NEW_LINE>residualColTypes[numFeature + 1] = Types.DOUBLE;<NEW_LINE>residualColNames[numFeature + 2] = "offset";<NEW_LINE>residualColTypes[numFeature + 2] = Types.DOUBLE;<NEW_LINE>residualColNames[numFeature + 3] = "pred";<NEW_LINE>residualColTypes[numFeature + 3] = Types.DOUBLE;<NEW_LINE>residualColNames[numFeature + 4] = "residualdevianceResiduals";<NEW_LINE>residualColTypes[numFeature + 4] = Types.DOUBLE;<NEW_LINE>residualColNames[numFeature + 5] = "pearsonResiduals";<NEW_LINE>residualColTypes[numFeature + 5] = Types.DOUBLE;<NEW_LINE>residualColNames[numFeature + 6] = "workingResiduals";<NEW_LINE>residualColTypes[numFeature + 6] = Types.DOUBLE;<NEW_LINE>residualColNames[numFeature + 7] = "responseResiduals";<NEW_LINE>residualColTypes[numFeature + 7] = Types.DOUBLE;<NEW_LINE>this.setSideOutputTables(new Table[] { DataSetConversionUtil.toTable(getMLEnvironmentId(), residual, residualColNames, residualColTypes) });<NEW_LINE>// summary<NEW_LINE>String[] summaryColNames = new String[1];<NEW_LINE>TypeInformation[] summaryColTypes = new TypeInformation[1];<NEW_LINE>summaryColNames[0] = "summary";<NEW_LINE>summaryColTypes[0] = Types.STRING;<NEW_LINE>this.setOutput(aggSummay.map(new MapFunction<GlmModelSummary, Row>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Row map(GlmModelSummary value) throws Exception {<NEW_LINE>return Row.of(JsonConverter.toJson(value));<NEW_LINE>}<NEW_LINE>}), summaryColNames, summaryColTypes);<NEW_LINE>return this;<NEW_LINE>} | familyName, variancePower, linkName, linkPower); |
1,030,560 | private Set<MyFormat> findProperAudio(TrackGroupArray groupArray) {<NEW_LINE>String trackCodecs = mPrefs.getSelectedAudioTrackCodecs();<NEW_LINE>int bitrate = mPrefs.getSelectedAudioTrackBitrate();<NEW_LINE>Set<MyFormat> result = new HashSet<>();<NEW_LINE>// search the same tracks<NEW_LINE>for (int j = 0; j < groupArray.length; j++) {<NEW_LINE>TrackGroup trackGroup = groupArray.get(j);<NEW_LINE>for (int i = 0; i < trackGroup.length; i++) {<NEW_LINE>Format <MASK><NEW_LINE>MyFormat myFormat = new MyFormat(format, new Pair<>(j, i));<NEW_LINE>if (bitrate != 0 && myFormat.bitrate > bitrate + 10_000) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (codecEquals(myFormat.codecs, trackCodecs)) {<NEW_LINE>result.add(myFormat);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | format = trackGroup.getFormat(i); |
1,015,080 | private void initComponents() {<NEW_LINE>Font labelEstimatedFont = new Font(Font.SANS_SERIF, Font.PLAIN, 12);<NEW_LINE>navigationButtons = new NavigationButtons(getBackend(), 1.0, (int) getBackend().getSettings().getJogFeedRate());<NEW_LINE>buttonUpdateSettingsX = new JButton(Localization.getString("platform.plugin.setupwizard.update"));<NEW_LINE>labelEstimatedStepsX = new JLabel("0 steps/mm");<NEW_LINE>labelEstimatedStepsX.setFont(labelEstimatedFont);<NEW_LINE>labelPositionX = new JLabel(" 0.0 mm", JLabel.RIGHT);<NEW_LINE>textFieldMeasuredX = new JTextField("0.0");<NEW_LINE>textFieldMeasuredX.addKeyListener(createKeyListener(Axis.X, labelEstimatedStepsX));<NEW_LINE>textFieldSettingStepsX = new JTextField("0.0");<NEW_LINE>textFieldSettingStepsX.addKeyListener(createKeyListenerChangeSetting());<NEW_LINE>buttonUpdateSettingsX.setEnabled(false);<NEW_LINE>buttonUpdateSettingsX.addActionListener(createListenerUpdateSetting(Axis.X, textFieldSettingStepsX));<NEW_LINE>buttonUpdateSettingsY = new JButton(Localization.getString("platform.plugin.setupwizard.update"));<NEW_LINE>labelEstimatedStepsY = new JLabel<MASK><NEW_LINE>labelEstimatedStepsY.setFont(labelEstimatedFont);<NEW_LINE>labelPositionY = new JLabel(" 0.0 mm", JLabel.RIGHT);<NEW_LINE>textFieldMeasuredY = new JTextField("0.0");<NEW_LINE>textFieldMeasuredY.addKeyListener(createKeyListener(Axis.Y, labelEstimatedStepsY));<NEW_LINE>textFieldSettingStepsY = new JTextField("0.0");<NEW_LINE>textFieldSettingStepsY.addKeyListener(createKeyListenerChangeSetting());<NEW_LINE>buttonUpdateSettingsY.setEnabled(false);<NEW_LINE>buttonUpdateSettingsY.addActionListener(createListenerUpdateSetting(Axis.Y, textFieldSettingStepsY));<NEW_LINE>buttonUpdateSettingsZ = new JButton(Localization.getString("platform.plugin.setupwizard.update"));<NEW_LINE>labelEstimatedStepsZ = new JLabel("0 steps/mm");<NEW_LINE>labelEstimatedStepsZ.setFont(labelEstimatedFont);<NEW_LINE>labelPositionZ = new JLabel(" 0.0 mm", JLabel.RIGHT);<NEW_LINE>textFieldMeasuredZ = new JTextField("0.0");<NEW_LINE>textFieldMeasuredZ.addKeyListener(createKeyListener(Axis.Z, labelEstimatedStepsZ));<NEW_LINE>textFieldSettingStepsZ = new JTextField("0.0");<NEW_LINE>textFieldSettingStepsZ.addKeyListener(createKeyListenerChangeSetting());<NEW_LINE>buttonUpdateSettingsZ.setEnabled(false);<NEW_LINE>buttonUpdateSettingsZ.addActionListener(createListenerUpdateSetting(Axis.Z, textFieldSettingStepsZ));<NEW_LINE>} | (Localization.getString("platform.plugin.setupwizard.calibration.setting")); |
89,669 | static IsNewStrategy basedOn(Neo4jPersistentEntity<?> entityMetaData) {<NEW_LINE>Assert.notNull(entityMetaData, "Entity meta data must not be null.");<NEW_LINE>IdDescription idDescription = entityMetaData.getIdDescription();<NEW_LINE>Class<?> valueType = entityMetaData.getRequiredIdProperty().getType();<NEW_LINE>if (idDescription.isExternallyGeneratedId() && valueType.isPrimitive()) {<NEW_LINE>throw new IllegalArgumentException(String.format("Cannot use %s with externally generated, primitive ids.", DefaultNeo4jIsNewStrategy<MASK><NEW_LINE>}<NEW_LINE>Function<Object, Object> valueLookup;<NEW_LINE>Neo4jPersistentProperty versionProperty = entityMetaData.getVersionProperty();<NEW_LINE>if (idDescription.isAssignedId()) {<NEW_LINE>if (versionProperty == null) {<NEW_LINE>log.warn(() -> "Instances of " + entityMetaData.getType() + " with an assigned id will always be treated as new without version property!");<NEW_LINE>valueType = Void.class;<NEW_LINE>valueLookup = source -> null;<NEW_LINE>} else {<NEW_LINE>valueType = versionProperty.getType();<NEW_LINE>valueLookup = source -> entityMetaData.getPropertyAccessor(source).getProperty(versionProperty);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>valueLookup = source -> entityMetaData.getIdentifierAccessor(source).getIdentifier();<NEW_LINE>}<NEW_LINE>return new DefaultNeo4jIsNewStrategy(idDescription, valueType, valueLookup);<NEW_LINE>} | .class.getName())); |
1,374,180 | public ManagedList parseInterceptors(Element element, ParserContext parserContext) {<NEW_LINE>ManagedList interceptors = new ManagedList();<NEW_LINE>NodeList childNodes = element.getChildNodes();<NEW_LINE>for (int i = 0; i < childNodes.getLength(); i++) {<NEW_LINE>Node child = childNodes.item(i);<NEW_LINE>if (child.getNodeType() == Node.ELEMENT_NODE) {<NEW_LINE>Element childElement = (Element) child;<NEW_LINE>String localName = child.getLocalName();<NEW_LINE>if ("bean".equals(localName)) {<NEW_LINE>BeanDefinitionParserDelegate delegate = parserContext.getDelegate();<NEW_LINE>BeanDefinitionHolder holder = delegate.parseBeanDefinitionElement(childElement);<NEW_LINE>// NOSONAR never null<NEW_LINE>holder = delegate.decorateBeanDefinitionIfRequired(childElement, holder);<NEW_LINE>parserContext.registerBeanComponent(new BeanComponentDefinition(holder));<NEW_LINE>interceptors.add(new RuntimeBeanReference<MASK><NEW_LINE>} else if ("ref".equals(localName)) {<NEW_LINE>String ref = childElement.getAttribute("bean");<NEW_LINE>interceptors.add(new RuntimeBeanReference(ref));<NEW_LINE>} else {<NEW_LINE>BeanDefinitionRegisteringParser parser = this.parsers.get(localName);<NEW_LINE>if (parser == null) {<NEW_LINE>parserContext.getReaderContext().error("unsupported interceptor element '" + localName + "'", childElement);<NEW_LINE>}<NEW_LINE>String interceptorBeanName = parser.parse(childElement, parserContext);<NEW_LINE>interceptors.add(new RuntimeBeanReference(interceptorBeanName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return interceptors;<NEW_LINE>} | (holder.getBeanName())); |
928,717 | private static ImmutableList<IFlowgraphView> loadModuleFlowgraphs(final AbstractSQLProvider provider, final CModule module, final CTagManager viewTagManager, final CTagManager nodeTagManager, final ViewType viewType) throws CouldntLoadDataException {<NEW_LINE>checkArguments(provider, module, viewTagManager);<NEW_LINE>final String query = " SELECT * FROM load_module_flow_graphs(?, ?) ";<NEW_LINE>final CConnection connection = provider.getConnection();<NEW_LINE>try {<NEW_LINE>final PreparedStatement statement = connection.getConnection().prepareStatement(query);<NEW_LINE>statement.setInt(1, module.getConfiguration().getId());<NEW_LINE>statement.setObject(2, viewType == ViewType.Native ? <MASK><NEW_LINE>final ResultSet resultSet = statement.executeQuery();<NEW_LINE>final Map<Integer, Set<CTag>> tags = loadTags(connection, module, viewTagManager);<NEW_LINE>return new ImmutableList.Builder<IFlowgraphView>().addAll(processQueryResults(resultSet, module, tags, nodeTagManager, provider, new ArrayList<CView>(), viewType, GraphType.FLOWGRAPH)).build();<NEW_LINE>} catch (final SQLException exception) {<NEW_LINE>throw new CouldntLoadDataException(exception);<NEW_LINE>}<NEW_LINE>} | "native" : "non-native", Types.OTHER); |
947,829 | protected String doIt() throws Exception {<NEW_LINE>List<Object> parameters = new ArrayList<>();<NEW_LINE>StringBuffer whereClause = new StringBuffer(I_HR_LeaveType.COLUMNNAME_IsLeaveRepeated).append<MASK><NEW_LINE>parameters.add(true);<NEW_LINE>if (getLeaveTypeId() > 0) {<NEW_LINE>parameters.add(getLeaveTypeId());<NEW_LINE>whereClause.append(" AND ").append(I_HR_LeaveType.COLUMNNAME_HR_LeaveType_ID).append(" = ").append(" ?");<NEW_LINE>}<NEW_LINE>if (getLeaveReasonId() == 0) {<NEW_LINE>MHRLeaveReason leaveReason = new Query(getCtx(), I_HR_LeaveReason.Table_Name, null, get_TrxName()).setClient_ID().setOnlyActiveRecords(true).first();<NEW_LINE>if (leaveReason == null) {<NEW_LINE>throw new AdempiereException("@HR_LeaveReason_ID@ @NotFound@");<NEW_LINE>}<NEW_LINE>setLeaveReasonId(leaveReason.getHR_LeaveReason_ID());<NEW_LINE>}<NEW_LINE>//<NEW_LINE>new Query(getCtx(), I_HR_LeaveType.Table_Name, whereClause.toString(), get_TrxName()).setParameters(parameters).setClient_ID().setOnlyActiveRecords(true).<MHRLeaveType>list().forEach(leaveType -> {<NEW_LINE>processLeaveType(leaveType);<NEW_LINE>});<NEW_LINE>return "@Created@: " + created;<NEW_LINE>} | (" = ").append(" ?"); |
510,642 | private boolean handleRequestor(final Expression node, final ClassNode primaryType, final TypeLookupResult result) {<NEW_LINE>// TODO: Why does result.scope.getEnclosingAssignment() exist?<NEW_LINE>result.enclosingAssignment = enclosingAssignment;<NEW_LINE>result.receiverType = primaryType != null ? primaryType : result.scope.getDelegateOrThis();<NEW_LINE>VisitStatus status = requestor.acceptASTNode(node, result, enclosingElement);<NEW_LINE>VariableScope scope = scopes.getLast();<NEW_LINE>scope.setMethodCallArgumentTypes(null);<NEW_LINE>scope.setMethodCallGenericsTypes(null);<NEW_LINE>// when there is a category method, we don't want to store it<NEW_LINE>// as the declaring type since this will mess things up inside closures<NEW_LINE>ClassNode rememberedDeclaringType = result.declaringType;<NEW_LINE>if (scope.getCategoryNames().contains(rememberedDeclaringType)) {<NEW_LINE>rememberedDeclaringType = (primaryType != null ? primaryType : scope.getDelegateOrThis());<NEW_LINE>}<NEW_LINE>if (rememberedDeclaringType == null) {<NEW_LINE>rememberedDeclaringType = VariableScope.OBJECT_CLASS_NODE;<NEW_LINE>}<NEW_LINE>switch(status) {<NEW_LINE>case CONTINUE:<NEW_LINE>// TODO: (node instanceof MethodCall && !(node instanceof MethodCallExpression))<NEW_LINE>if (node instanceof ConstructorCallExpression || node instanceof StaticMethodCallExpression) {<NEW_LINE>dependentDeclarationStack.add(new Tuple(result.declaringType, result.declaration));<NEW_LINE>}<NEW_LINE>// fall through<NEW_LINE>case CANCEL_BRANCH:<NEW_LINE>postVisit(node, result.<MASK><NEW_LINE>return (status == VisitStatus.CONTINUE);<NEW_LINE>case STOP_VISIT:<NEW_LINE>case CANCEL_MEMBER:<NEW_LINE>throw new VisitCompleted(status);<NEW_LINE>}<NEW_LINE>// won't get here<NEW_LINE>return false;<NEW_LINE>} | type, rememberedDeclaringType, result.declaration); |
443,541 | public void generate(GeneratorContext context, MethodReference method) {<NEW_LINE>String array = context.parameterName(1);<NEW_LINE>String index = context.parameterName(2);<NEW_LINE>String componentTypeField = context.names().forMemberField(new FieldReference(RuntimeClass.class<MASK><NEW_LINE>String flagsField = context.names().forMemberField(new FieldReference(RuntimeClass.class.getName(), "flags"));<NEW_LINE>context.writer().println("TeaVM_Class* componentType = (TeaVM_Class*) TEAVM_CLASS_OF(" + array + ")" + "->" + componentTypeField + ";");<NEW_LINE>context.writer().println("int32_t flags = componentType->" + flagsField + ";");<NEW_LINE>context.writer().println("if (flags & " + RuntimeClass.PRIMITIVE + ") {").indent();<NEW_LINE>context.writer().println("switch ((flags >> " + RuntimeClass.PRIMITIVE_SHIFT + ") & " + RuntimeClass.PRIMITIVE_MASK + ") {").indent();<NEW_LINE>MethodDependencyInfo dependency = context.dependencies().getMethod(new MethodReference(Array.class, "getImpl", Object.class, int.class, Object.class));<NEW_LINE>ValueDependencyInfo arrayDependency = dependency.getVariable(1);<NEW_LINE>Set<String> types = new HashSet<>(Arrays.asList(arrayDependency.getTypes()));<NEW_LINE>for (int i = 0; i < primitiveWrappers.length; ++i) {<NEW_LINE>String typeName = ValueType.arrayOf(primitiveTypes[i]).toString();<NEW_LINE>if (!types.contains(typeName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String wrapper = "java.lang." + primitiveWrappers[i];<NEW_LINE>MethodReference methodRef = new MethodReference(wrapper, "valueOf", primitiveTypes[i], ValueType.object(wrapper));<NEW_LINE>String type = CodeWriter.strictTypeAsString(primitiveTypes[i]);<NEW_LINE>context.writer().println("case " + primitives[i] + ":").indent();<NEW_LINE>context.importMethod(methodRef, true);<NEW_LINE>context.writer().println("return " + context.names().forMethod(methodRef) + "(TEAVM_ARRAY_AT(" + array + ", " + type + ", " + index + "));");<NEW_LINE>context.writer().outdent();<NEW_LINE>}<NEW_LINE>context.writer().outdent().println("}").outdent().println("}");<NEW_LINE>context.writer().println("return TEAVM_ARRAY_AT(" + array + ", void*, " + index + ");");<NEW_LINE>} | .getName(), "itemType")); |
1,677,547 | public static AnnotationMirror fromName(Elements elements, @FullyQualifiedName CharSequence name, Map<String, AnnotationValue> elementNamesValues) {<NEW_LINE>final TypeElement annoElt = elements.getTypeElement(name);<NEW_LINE>if (annoElt == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (annoElt.getKind() != ElementKind.ANNOTATION_TYPE) {<NEW_LINE>throw new BugInCF(annoElt + " is not an annotation");<NEW_LINE>}<NEW_LINE>final DeclaredType annoType = <MASK><NEW_LINE>if (annoType == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<ExecutableElement> methods = ElementFilter.methodsIn(annoElt.getEnclosedElements());<NEW_LINE>Map<ExecutableElement, AnnotationValue> elementValues = new LinkedHashMap<>(methods.size());<NEW_LINE>for (ExecutableElement annoElement : methods) {<NEW_LINE>AnnotationValue elementValue = elementNamesValues.get(annoElement.getSimpleName().toString());<NEW_LINE>if (elementValue == null) {<NEW_LINE>AnnotationValue defaultValue = annoElement.getDefaultValue();<NEW_LINE>if (defaultValue == null) {<NEW_LINE>throw new BugInCF("AnnotationBuilder.fromName: no value for element %s of %s", annoElement, name);<NEW_LINE>} else {<NEW_LINE>elementValue = defaultValue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>elementValues.put(annoElement, elementValue);<NEW_LINE>}<NEW_LINE>AnnotationMirror result = new CheckerFrameworkAnnotationMirror(annoType, elementValues);<NEW_LINE>return result;<NEW_LINE>} | (DeclaredType) annoElt.asType(); |
347,457 | public static Story from(Cursor cursor) {<NEW_LINE>Long internalId = cursor.getLong(HNewsContract.StoryEntry.COLUMN_ID);<NEW_LINE>Long id = cursor.getLong(HNewsContract.StoryEntry.COLUMN_ITEM_ID);<NEW_LINE>String type = cursor.getString(HNewsContract.StoryEntry.COLUMN_TYPE);<NEW_LINE>String by = cursor.getString(HNewsContract.StoryEntry.COLUMN_BY);<NEW_LINE>int comments = cursor.getInt(HNewsContract.StoryEntry.COLUMN_COMMENTS);<NEW_LINE>String url = cursor.getString(HNewsContract.StoryEntry.COLUMN_URL);<NEW_LINE>int score = cursor.getInt(HNewsContract.StoryEntry.COLUMN_SCORE);<NEW_LINE>String title = cursor.getString(HNewsContract.StoryEntry.COLUMN_TITLE);<NEW_LINE>Long time = cursor.getLong(HNewsContract.StoryEntry.COLUMN_TIME_AGO);<NEW_LINE>Long timestamp = cursor.getLong(HNewsContract.StoryEntry.COLUMN_TIMESTAMP);<NEW_LINE>int rank = cursor.getInt(HNewsContract.StoryEntry.COLUMN_RANK);<NEW_LINE>int bookmark = cursor.getInt(HNewsContract.StoryEntry.COLUMN_BOOKMARK);<NEW_LINE>int read = cursor.getInt(HNewsContract.StoryEntry.COLUMN_READ);<NEW_LINE>int voted = cursor.getInt(HNewsContract.StoryEntry.COLUMN_VOTED);<NEW_LINE>String filter = cursor.<MASK><NEW_LINE>return new Story(internalId, by, id, type, time, score, title, url, comments, timestamp, rank, bookmark, read, voted, filter);<NEW_LINE>} | getString(HNewsContract.StoryEntry.COLUMN_FILTER); |
262,296 | private void loadNode362() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.CertificateGroupType_TrustList_Close_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupType_TrustList_Close_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupType_TrustList_Close_InputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupType_TrustList_Close_InputArguments, Identifiers.HasProperty, Identifiers.CertificateGroupType_TrustList_Close.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>FileHandle</Name><DataType><Identifier>i=7</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | (1), 0.0, false); |
743,400 | public HttpMethodBase createMethod(final URL neutronUrl, final String uri) throws NeutronRestApiException {<NEW_LINE>String url;<NEW_LINE>try {<NEW_LINE>String formattedUrl = neutronUrl.toString() + uri;<NEW_LINE>url = new URL(formattedUrl).toString();<NEW_LINE>Constructor<? extends HttpMethodBase> httpMethodConstructor = httpClazz.getConstructor(String.class);<NEW_LINE>HttpMethodBase httpMethod = httpMethodConstructor.newInstance(url);<NEW_LINE>return httpMethod;<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>String error = "Unable to build Neutron API URL";<NEW_LINE>s_logger.error(error, e);<NEW_LINE>throw new NeutronRestApiException(error, e);<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>String error = "Unable to build Neutron API URL due to reflection error";<NEW_LINE>s_logger.error(error, e);<NEW_LINE><MASK><NEW_LINE>} catch (SecurityException e) {<NEW_LINE>String error = "Unable to build Neutron API URL due to security violation";<NEW_LINE>s_logger.error(error, e);<NEW_LINE>throw new NeutronRestApiException(error, e);<NEW_LINE>} catch (InstantiationException e) {<NEW_LINE>String error = "Unable to build Neutron API due to instantiation error";<NEW_LINE>s_logger.error(error, e);<NEW_LINE>throw new NeutronRestApiException(error, e);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>String error = "Unable to build Neutron API URL due to absence of access modifier";<NEW_LINE>s_logger.error(error, e);<NEW_LINE>throw new NeutronRestApiException(error, e);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>String error = "Unable to build Neutron API URL due to wrong argument in constructor";<NEW_LINE>s_logger.error(error, e);<NEW_LINE>throw new NeutronRestApiException(error, e);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>String error = "Unable to build Neutron API URL due to target error";<NEW_LINE>s_logger.error(error, e);<NEW_LINE>throw new NeutronRestApiException(error, e);<NEW_LINE>}<NEW_LINE>} | throw new NeutronRestApiException(error, e); |
1,118,052 | private void addContent() {<NEW_LINE>gridPane.getColumnConstraints().get(0).setHalignment(HPos.LEFT);<NEW_LINE>gridPane.getColumnConstraints().get(0<MASK><NEW_LINE>gridPane.getColumnConstraints().get(1).setHgrow(Priority.SOMETIMES);<NEW_LINE>Tuple2<Label, TextArea> labelTextAreaTuple2 = addTopLabelTextArea(gridPane, ++rowIndex, Res.get("showWalletDataWindow.walletData"), "");<NEW_LINE>TextArea textArea = labelTextAreaTuple2.second;<NEW_LINE>Label label = labelTextAreaTuple2.first;<NEW_LINE>label.setMinWidth(150);<NEW_LINE>textArea.setPrefHeight(500);<NEW_LINE>textArea.getStyleClass().add("small-text");<NEW_LINE>CheckBox isUpdateCheckBox = addLabelCheckBox(gridPane, ++rowIndex, Res.get("showWalletDataWindow.includePrivKeys"));<NEW_LINE>isUpdateCheckBox.setSelected(false);<NEW_LINE>isUpdateCheckBox.selectedProperty().addListener((observable, oldValue, newValue) -> {<NEW_LINE>showWallet(textArea, isUpdateCheckBox);<NEW_LINE>});<NEW_LINE>showWallet(textArea, isUpdateCheckBox);<NEW_LINE>actionButtonText(Res.get("shared.copyToClipboard"));<NEW_LINE>onAction(() -> Utilities.copyToClipboard(textArea.getText()));<NEW_LINE>} | ).setHgrow(Priority.ALWAYS); |
81,910 | Statement generateJumpStatement(Decompiler.Block sourceBlock, BasicBlock target) {<NEW_LINE>Decompiler.Block targetBlock = getTargetBlock(sourceBlock, target);<NEW_LINE>if (targetBlock == null) {<NEW_LINE>int targetIndex = indexer.<MASK><NEW_LINE>if (targetIndex >= sourceBlock.end) {<NEW_LINE>throw new IllegalStateException("Could not find block for basic block $" + target.getIndex());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (target.getIndex() == indexer.nodeAt(targetBlock.end)) {<NEW_LINE>BreakStatement breakStmt = new BreakStatement();<NEW_LINE>breakStmt.setLocation(currentLocation);<NEW_LINE>breakStmt.setTarget(targetBlock.statement);<NEW_LINE>return breakStmt;<NEW_LINE>} else {<NEW_LINE>ContinueStatement contStmt = new ContinueStatement();<NEW_LINE>contStmt.setLocation(currentLocation);<NEW_LINE>contStmt.setTarget(targetBlock.statement);<NEW_LINE>return contStmt;<NEW_LINE>}<NEW_LINE>} | indexOf(target.getIndex()); |
1,478,845 | private CompletableFuture<TableWriterFlushResult> flushOnce(DirectSegmentAccess segment, TimeoutTimer timer) {<NEW_LINE>// Index all the keys in the segment range pointed to by the aggregator.<NEW_LINE>long lastOffset = this.aggregator.getLastIndexToProcessAtOnce(this.connector.getMaxFlushSize());<NEW_LINE>assert lastOffset - this.aggregator.getFirstOffset() <= this.connector.getMaxFlushSize();<NEW_LINE>if (lastOffset < this.aggregator.getLastOffset()) {<NEW_LINE>log.info("{}: Partial flush initiated up to offset {}. State: {}.", this.traceObjectId, lastOffset, this.aggregator);<NEW_LINE>}<NEW_LINE>KeyUpdateCollection keyUpdates = readKeysFromSegment(segment, this.aggregator.<MASK><NEW_LINE>log.debug("{}: Flush.ReadFromSegment KeyCount={}, UpdateCount={}, HighestCopiedOffset={}, LastIndexedOffset={}.", this.traceObjectId, keyUpdates.getUpdates().size(), keyUpdates.getTotalUpdateCount(), keyUpdates.getHighestCopiedOffset(), keyUpdates.getLastIndexedOffset());<NEW_LINE>// Group keys by their assigned TableBucket (whether existing or not), then fetch all existing keys<NEW_LINE>// for each such bucket and finally (reindex) update the bucket.<NEW_LINE>return this.indexWriter.groupByBucket(segment, keyUpdates.getUpdates(), timer).thenComposeAsync(builders -> fetchExistingKeys(builders, segment, timer).thenComposeAsync(v -> {<NEW_LINE>val bucketUpdates = builders.stream().map(BucketUpdate.Builder::build).collect(Collectors.toList());<NEW_LINE>logBucketUpdates(bucketUpdates);<NEW_LINE>return this.indexWriter.updateBuckets(segment, bucketUpdates, this.aggregator.getLastIndexedOffset(), keyUpdates.getLastIndexedOffset(), keyUpdates.getTotalUpdateCount(), timer.getRemaining());<NEW_LINE>}, this.executor), this.executor).thenApply(updateCount -> new TableWriterFlushResult(keyUpdates, updateCount));<NEW_LINE>} | getFirstOffset(), lastOffset, timer); |
1,500,668 | protected InitialLdapContext openContext(String userDn, String password) {<NEW_LINE>Hashtable<String, String> env = new Hashtable<>();<NEW_LINE>env.put(Context.INITIAL_CONTEXT_FACTORY, ldapConfiguration.getInitialContextFactory());<NEW_LINE>env.put(Context.<MASK><NEW_LINE>env.put(Context.PROVIDER_URL, ldapConfiguration.getServerUrl());<NEW_LINE>env.put(Context.SECURITY_PRINCIPAL, userDn);<NEW_LINE>env.put(Context.SECURITY_CREDENTIALS, password);<NEW_LINE>// for anonymous login<NEW_LINE>if (ldapConfiguration.isAllowAnonymousLogin() && password.isEmpty()) {<NEW_LINE>env.put(Context.SECURITY_AUTHENTICATION, "none");<NEW_LINE>}<NEW_LINE>if (ldapConfiguration.isUseSsl()) {<NEW_LINE>env.put(Context.SECURITY_PROTOCOL, "ssl");<NEW_LINE>}<NEW_LINE>// add additional properties<NEW_LINE>Map<String, String> contextProperties = ldapConfiguration.getContextProperties();<NEW_LINE>if (contextProperties != null) {<NEW_LINE>env.putAll(contextProperties);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return new InitialLdapContext(env, null);<NEW_LINE>} catch (AuthenticationException e) {<NEW_LINE>throw new LdapAuthenticationException("Could not authenticate with LDAP server", e);<NEW_LINE>} catch (NamingException e) {<NEW_LINE>throw new IdentityProviderException("Could not connect to LDAP server", e);<NEW_LINE>}<NEW_LINE>} | SECURITY_AUTHENTICATION, ldapConfiguration.getSecurityAuthentication()); |
590,108 | private List<String> generateDropStatementsForRoutines() throws SQLException {<NEW_LINE>// #2193: PostgreSQL 11 removed the 'proisagg' column and replaced it with 'prokind'.<NEW_LINE>String isAggregate = database.getVersion().isAtLeast("11") ? "pg_proc.prokind = 'a'" : "pg_proc.proisagg";<NEW_LINE>// PROCEDURE is only available from PostgreSQL 11<NEW_LINE>String isProcedure = database.getVersion().<MASK><NEW_LINE>List<Map<String, String>> rows = // Search for all functions<NEW_LINE>jdbcTemplate.// Search for all functions<NEW_LINE>queryForList(// that don't depend on an extension<NEW_LINE>"SELECT proname, oidvectortypes(proargtypes) AS args, " + isAggregate + " as agg, " + isProcedure + " as proc " + "FROM pg_proc INNER JOIN pg_namespace ns ON (pg_proc.pronamespace = ns.oid) " + "LEFT JOIN pg_depend dep ON dep.objid = pg_proc.oid AND dep.deptype = 'e' " + "WHERE ns.nspname = ? AND dep.objid IS NULL", name);<NEW_LINE>List<String> statements = new ArrayList<>();<NEW_LINE>for (Map<String, String> row : rows) {<NEW_LINE>String type = "FUNCTION";<NEW_LINE>if (isTrue(row.get("agg"))) {<NEW_LINE>type = "AGGREGATE";<NEW_LINE>} else if (isTrue(row.get("proc"))) {<NEW_LINE>type = "PROCEDURE";<NEW_LINE>}<NEW_LINE>statements.add("DROP " + type + " IF EXISTS " + database.quote(name, row.get("proname")) + "(" + row.get("args") + ") CASCADE");<NEW_LINE>}<NEW_LINE>return statements;<NEW_LINE>} | isAtLeast("11") ? "pg_proc.prokind = 'p'" : "FALSE"; |
423,363 | public void processMessage(String[] tokens, Map<String, Pattern> unstartedApps, Map<String, List<String>> failedApps) {<NEW_LINE>String appName;<NEW_LINE>switch(action) {<NEW_LINE>case REMOVE_APP_NAME_FROM_UNSTARTED_APPS:<NEW_LINE>appName = findAppNameInTokens(unstartedApps, tokens);<NEW_LINE>if (appName != null) {<NEW_LINE>unstartedApps.remove(appName);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case ADD_FAILURE_FOR_APP_NAME_TO_FAILED_APPS:<NEW_LINE>appName = findAppNameInTokens(unstartedApps, tokens);<NEW_LINE>if (appName != null) {<NEW_LINE>List<String> failures = failedApps.get(appName);<NEW_LINE>if (failures == null) {<NEW_LINE>failures <MASK><NEW_LINE>failedApps.put(appName, failures);<NEW_LINE>}<NEW_LINE>failures.add(tokensToString(tokens));<NEW_LINE>unstartedApps.remove(appName);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case ADD_FAILURE_FOR_ALL_FAILED_APPS:<NEW_LINE>addFailureToAllFailedApps(tokens, failedApps);<NEW_LINE>break;<NEW_LINE>case IGNORE:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | = new ArrayList<String>(); |
290,079 | protected void parseCreateField(ParseContext context) throws IOException {<NEW_LINE>if (stored == false && hasDocValues == false) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>byte[] value = context.parseExternalValue(byte[].class);<NEW_LINE>if (value == null) {<NEW_LINE>if (context.parser().currentToken() == XContentParser.Token.VALUE_NULL) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>value = context<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (value == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (stored) {<NEW_LINE>context.doc().add(new StoredField(fieldType().name(), value));<NEW_LINE>}<NEW_LINE>if (hasDocValues) {<NEW_LINE>CustomBinaryDocValuesField field = (CustomBinaryDocValuesField) context.doc().getByKey(fieldType().name());<NEW_LINE>if (field == null) {<NEW_LINE>field = new CustomBinaryDocValuesField(fieldType().name(), value);<NEW_LINE>context.doc().addWithKey(fieldType().name(), field);<NEW_LINE>} else {<NEW_LINE>field.add(value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Only add an entry to the field names field if the field is stored<NEW_LINE>// but has no doc values so exists query will work on a field with<NEW_LINE>// no doc values<NEW_LINE>createFieldNamesField(context);<NEW_LINE>}<NEW_LINE>} | .parser().binaryValue(); |
827,677 | public static void runMap(String mapURL, int iterations) {<NEW_LINE>getExecutor().startAsync(() -> {<NEW_LINE>long totalTime = 0L;<NEW_LINE>for (int i = 0; i < iterations; i++) {<NEW_LINE>var time = TimingKt.measureNanoTime(() -> {<NEW_LINE>var level = getAssetLoader().loadLevel(mapURL, new TMXLevelLoader());<NEW_LINE>return Unit.INSTANCE;<NEW_LINE>});<NEW_LINE>totalTime += time;<NEW_LINE>System.out.printf("Iteration " + (i + 1) + " : %.2f seconds\n", time / 1_000_000_000.0);<NEW_LINE>}<NEW_LINE>String results = "Map: " + currentMapSelection + "\nIterations: " + iterations + "\nAverage: " <MASK><NEW_LINE>status.setText(results);<NEW_LINE>System.out.println(results);<NEW_LINE>});<NEW_LINE>} | + (totalTime / iterations) / 1_000_000_000.0; |
1,557,412 | static <T> T referenceForTempleSet(final List<TemplateSetReference<T>> templateSetReferences, final PwmSettingTemplateSet pwmSettingTemplateSet) {<NEW_LINE>final PwmSettingTemplateSet effectiveTemplateSet = pwmSettingTemplateSet == null ? PwmSettingTemplateSet.getDefault() : pwmSettingTemplateSet;<NEW_LINE>if (templateSetReferences == null || templateSetReferences.isEmpty()) {<NEW_LINE>throw new IllegalStateException("templateSetReferences can not be null");<NEW_LINE>}<NEW_LINE>if (templateSetReferences.size() == 1) {<NEW_LINE>return templateSetReferences.get(0).getReference();<NEW_LINE>}<NEW_LINE>for (int matchCountExamSize = templateSetReferences.size(); matchCountExamSize > 0; matchCountExamSize--) {<NEW_LINE>for (final TemplateSetReference<T> templateSetReference : templateSetReferences) {<NEW_LINE>final Set<PwmSettingTemplate> temporarySet = CollectionUtil.copyToEnumSet(templateSetReference.getSettingTemplates(), PwmSettingTemplate.class);<NEW_LINE>temporarySet.<MASK><NEW_LINE>final int matchCount = temporarySet.size();<NEW_LINE>if (matchCount == matchCountExamSize) {<NEW_LINE>return templateSetReference.getReference();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return templateSetReferences.get(0).getReference();<NEW_LINE>} | retainAll(effectiveTemplateSet.getTemplates()); |
1,064,118 | public static void write(ModuleDetails moduleDetails) throws TransformerException, ParserConfigurationException {<NEW_LINE>final DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();<NEW_LINE>dbFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");<NEW_LINE>dbFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");<NEW_LINE>final DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();<NEW_LINE>final Document doc = dBuilder.newDocument();<NEW_LINE>final Element <MASK><NEW_LINE>final Element rootChild = doc.createElement("module");<NEW_LINE>rootElement.appendChild(rootChild);<NEW_LINE>doc.appendChild(rootElement);<NEW_LINE>final Element checkModule = doc.createElement(moduleDetails.getModuleType().getLabel());<NEW_LINE>rootChild.appendChild(checkModule);<NEW_LINE>checkModule.setAttribute(XML_TAG_NAME, moduleDetails.getName());<NEW_LINE>checkModule.setAttribute("fully-qualified-name", moduleDetails.getFullQualifiedName());<NEW_LINE>checkModule.setAttribute("parent", moduleDetails.getParent());<NEW_LINE>final Element desc = doc.createElement(XML_TAG_DESCRIPTION);<NEW_LINE>final Node cdataDesc = doc.createCDATASection(moduleDetails.getDescription());<NEW_LINE>desc.appendChild(cdataDesc);<NEW_LINE>checkModule.appendChild(desc);<NEW_LINE>createPropertySection(moduleDetails, checkModule, doc);<NEW_LINE>if (!moduleDetails.getViolationMessageKeys().isEmpty()) {<NEW_LINE>final Element messageKeys = doc.createElement("message-keys");<NEW_LINE>for (String msg : moduleDetails.getViolationMessageKeys()) {<NEW_LINE>final Element messageKey = doc.createElement("message-key");<NEW_LINE>messageKey.setAttribute("key", msg);<NEW_LINE>messageKeys.appendChild(messageKey);<NEW_LINE>}<NEW_LINE>checkModule.appendChild(messageKeys);<NEW_LINE>}<NEW_LINE>writeToFile(doc, moduleDetails);<NEW_LINE>} | rootElement = doc.createElement("checkstyle-metadata"); |
854,996 | /*<NEW_LINE>* Validate the classpaths of the projects affected by the given delta.<NEW_LINE>* Create markers if necessary.<NEW_LINE>* Returns whether cycle markers should be recomputed.<NEW_LINE>*/<NEW_LINE>private boolean validateClasspaths(IResourceDelta delta) {<NEW_LINE>Set<IPath> affectedProjects = new HashSet<>(5);<NEW_LINE>validateClasspaths(delta, affectedProjects);<NEW_LINE>boolean needCycleValidation = false;<NEW_LINE>// validate classpaths of affected projects (dependent projects<NEW_LINE>// or projects that reference a library in one of the projects that have changed)<NEW_LINE>if (!affectedProjects.isEmpty()) {<NEW_LINE>IWorkspaceRoot workspaceRoot = ResourcesPlugin<MASK><NEW_LINE>IProject[] projects = workspaceRoot.getProjects();<NEW_LINE>int length = projects.length;<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>IProject project = projects[i];<NEW_LINE>JavaProject javaProject = (JavaProject) JavaCore.create(project);<NEW_LINE>try {<NEW_LINE>IPath projectPath = project.getFullPath();<NEW_LINE>// allowed to reuse model cache<NEW_LINE>IClasspathEntry[] classpath = javaProject.getResolvedClasspath();<NEW_LINE>for (int j = 0, cpLength = classpath.length; j < cpLength; j++) {<NEW_LINE>IClasspathEntry entry = classpath[j];<NEW_LINE>switch(entry.getEntryKind()) {<NEW_LINE>case IClasspathEntry.CPE_PROJECT:<NEW_LINE>if (affectedProjects.contains(entry.getPath())) {<NEW_LINE>this.state.addClasspathValidation(javaProject);<NEW_LINE>needCycleValidation = true;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case IClasspathEntry.CPE_LIBRARY:<NEW_LINE>IPath entryPath = entry.getPath();<NEW_LINE>IPath libProjectPath = entryPath.removeLastSegments(entryPath.segmentCount() - 1);<NEW_LINE>if (// if library contained in another project<NEW_LINE>!libProjectPath.equals(projectPath) && affectedProjects.contains(libProjectPath)) {<NEW_LINE>this.state.addClasspathValidation(javaProject);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>// project no longer exists<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return needCycleValidation;<NEW_LINE>} | .getWorkspace().getRoot(); |
1,088,319 | public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {<NEW_LINE>if (args.length == 0) {<NEW_LINE>throw new NotEnoughArgumentsException(tl("mobsAvailable", StringUtil.joinList(Mob.getMobList())));<NEW_LINE>}<NEW_LINE>final List<String> mobParts = SpawnMob<MASK><NEW_LINE>final List<String> mobData = SpawnMob.mobData(args[0]);<NEW_LINE>int mobCount = 1;<NEW_LINE>if (args.length >= 2) {<NEW_LINE>mobCount = Integer.parseInt(args[1]);<NEW_LINE>}<NEW_LINE>if (mobParts.size() > 1 && !user.isAuthorized("essentials.spawnmob.stack")) {<NEW_LINE>throw new Exception(tl("cannotStackMob"));<NEW_LINE>}<NEW_LINE>if (args.length >= 3) {<NEW_LINE>SpawnMob.spawnmob(ess, server, user.getSource(), getPlayer(ess.getServer(), user, args, 2), mobParts, mobData, mobCount);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SpawnMob.spawnmob(ess, server, user, mobParts, mobData, mobCount);<NEW_LINE>} | .mobParts(args[0]); |
1,826,954 | public void layout(Layer layer) {<NEW_LINE>Style style = layer.container.getStyle();<NEW_LINE>if (layer.visible) {<NEW_LINE>style.clearDisplay();<NEW_LINE>} else {<NEW_LINE>style.setDisplay(Display.NONE);<NEW_LINE>}<NEW_LINE>style.setProperty("left", layer.setLeft ? (layer.left + layer.leftUnit.getType()) : "");<NEW_LINE>style.setProperty("top", layer.setTop ? (layer.top + layer.topUnit.getType()) : "");<NEW_LINE>style.setProperty("right", layer.setRight ? (layer.right + layer.rightUnit.getType()) : "");<NEW_LINE>style.setProperty("bottom", layer.setBottom ? (layer.bottom + layer.bottomUnit.getType()) : "");<NEW_LINE>style.setProperty("width", layer.setWidth ? (layer.width + layer.widthUnit.getType()) : "");<NEW_LINE>style.setProperty("height", layer.setHeight ? (layer.height + layer.heightUnit.getType()) : "");<NEW_LINE>style = layer.child.getStyle();<NEW_LINE>switch(layer.hPos) {<NEW_LINE>case BEGIN:<NEW_LINE>style.<MASK><NEW_LINE>style.clearRight();<NEW_LINE>break;<NEW_LINE>case END:<NEW_LINE>style.clearLeft();<NEW_LINE>style.setRight(0, Unit.PX);<NEW_LINE>break;<NEW_LINE>case STRETCH:<NEW_LINE>style.setLeft(0, Unit.PX);<NEW_LINE>style.setRight(0, Unit.PX);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(layer.vPos) {<NEW_LINE>case BEGIN:<NEW_LINE>style.setTop(0, Unit.PX);<NEW_LINE>style.clearBottom();<NEW_LINE>break;<NEW_LINE>case END:<NEW_LINE>style.clearTop();<NEW_LINE>style.setBottom(0, Unit.PX);<NEW_LINE>break;<NEW_LINE>case STRETCH:<NEW_LINE>style.setTop(0, Unit.PX);<NEW_LINE>style.setBottom(0, Unit.PX);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | setLeft(0, Unit.PX); |
1,548,285 | protected RubyArray regexpNames(RubyRegexp regexp) {<NEW_LINE>final int size = regexp.regex.numberOfNames();<NEW_LINE>if (size == 0) {<NEW_LINE>return createEmptyArray();<NEW_LINE>}<NEW_LINE>final Object[] names = new Object[size];<NEW_LINE>int i = 0;<NEW_LINE>for (Iterator<NameEntry> iter = regexp.regex.namedBackrefIterator(); iter.hasNext(); ) {<NEW_LINE>final NameEntry e = iter.next();<NEW_LINE>final byte[] bytes = Arrays.copyOfRange(e.name, e.nameP, e.nameEnd);<NEW_LINE>final Rope rope = RopeOperations.create(bytes, UTF8Encoding.INSTANCE, CodeRange.CR_UNKNOWN);<NEW_LINE>final RubySymbol name = getSymbol(rope, Encodings.UTF_8);<NEW_LINE>final int[] backrefs = e.getBackRefs();<NEW_LINE>final RubyArray backrefsRubyArray = createArray(backrefs);<NEW_LINE>names[i++] = createArray(new Object<MASK><NEW_LINE>}<NEW_LINE>return createArray(names);<NEW_LINE>} | [] { name, backrefsRubyArray }); |
1,463,824 | public List<LayoutToken> fromText(final String text) {<NEW_LINE>List<String> toks = null;<NEW_LINE>try {<NEW_LINE>toks = GrobidAnalyzer.getInstance().tokenize(text);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Fail tokenization for " + text, e);<NEW_LINE>}<NEW_LINE>tokenizations = toks.stream().map(LayoutToken::new).collect(Collectors.toList());<NEW_LINE>blocks = new ArrayList<>();<NEW_LINE>Block b = new Block();<NEW_LINE>for (LayoutToken lt : tokenizations) {<NEW_LINE>b.addToken(lt);<NEW_LINE>}<NEW_LINE>Page p = new Page(1);<NEW_LINE>b.setPage(p);<NEW_LINE>b.setText(text);<NEW_LINE>pages = new ArrayList<>();<NEW_LINE>pages.add(p);<NEW_LINE>blocks.add(b);<NEW_LINE>p.addBlock(b);<NEW_LINE>b.setStartToken(0);<NEW_LINE>b.setEndToken(toks.size() - 1);<NEW_LINE><MASK><NEW_LINE>return tokenizations;<NEW_LINE>} | images = new ArrayList<>(); |
1,825,413 | private static Map<String, Object> list2map_string(List<Object> valueList, String key, Udf convert, Hints hints) throws Throwable {<NEW_LINE>return list2map_udf(valueList, (readOnly, params) -> {<NEW_LINE>int rowNumber <MASK><NEW_LINE>if (params[1] == null) {<NEW_LINE>throw new NullPointerException("element " + rowNumber + " data is null");<NEW_LINE>}<NEW_LINE>DataModel rowData = DomainHelper.convertTo(params[1]);<NEW_LINE>if (!rowData.isObject()) {<NEW_LINE>throw new NullPointerException("element " + rowNumber + " type is not Object");<NEW_LINE>}<NEW_LINE>DataModel keyValue = ((ObjectModel) rowData).get(key);<NEW_LINE>if (keyValue == null) {<NEW_LINE>throw new NullPointerException("element " + rowNumber + " key '" + key + "' is not exist");<NEW_LINE>}<NEW_LINE>if (!keyValue.isValue()) {<NEW_LINE>throw new NullPointerException("element " + rowNumber + " key '" + key + "' type must primary");<NEW_LINE>}<NEW_LINE>return String.valueOf(keyValue.unwrap());<NEW_LINE>}, convert, hints);<NEW_LINE>} | = (int) params[0]; |
328,877 | public Builder mergeFrom(io.kubernetes.client.proto.V1.TopologySelectorTerm other) {<NEW_LINE>if (other == io.kubernetes.client.proto.V1.TopologySelectorTerm.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (matchLabelExpressionsBuilder_ == null) {<NEW_LINE>if (!other.matchLabelExpressions_.isEmpty()) {<NEW_LINE>if (matchLabelExpressions_.isEmpty()) {<NEW_LINE>matchLabelExpressions_ = other.matchLabelExpressions_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>} else {<NEW_LINE>ensureMatchLabelExpressionsIsMutable();<NEW_LINE>matchLabelExpressions_.addAll(other.matchLabelExpressions_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.matchLabelExpressions_.isEmpty()) {<NEW_LINE>if (matchLabelExpressionsBuilder_.isEmpty()) {<NEW_LINE>matchLabelExpressionsBuilder_.dispose();<NEW_LINE>matchLabelExpressionsBuilder_ = null;<NEW_LINE>matchLabelExpressions_ = other.matchLabelExpressions_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>matchLabelExpressionsBuilder_ = com.google.protobuf.GeneratedMessageV3<MASK><NEW_LINE>} else {<NEW_LINE>matchLabelExpressionsBuilder_.addAllMessages(other.matchLabelExpressions_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>} | .alwaysUseFieldBuilders ? getMatchLabelExpressionsFieldBuilder() : null; |
596,921 | public float[] filter(float[] data) {<NEW_LINE>if (mNewCoefficientsAvailable) {<NEW_LINE>mCoefficients = mNewCoefficients;<NEW_LINE>mNewCoefficientsAvailable = false;<NEW_LINE>}<NEW_LINE>int middle = mCoefficients.length / 2;<NEW_LINE>float[] filtered = new float[data.length];<NEW_LINE>int toCopy = middle;<NEW_LINE>System.arraycopy(data, 0, filtered, 0, toCopy);<NEW_LINE>System.arraycopy(data, data.length - toCopy, filtered, <MASK><NEW_LINE>float accumulator;<NEW_LINE>for (int x = 0; x < data.length - mCoefficients.length + 1; x++) {<NEW_LINE>accumulator = 0.0f;<NEW_LINE>for (int y = 0; y < mCoefficients.length; y++) {<NEW_LINE>accumulator += data[x + y] * mCoefficients[y];<NEW_LINE>}<NEW_LINE>filtered[x + middle] = accumulator;<NEW_LINE>}<NEW_LINE>return filtered;<NEW_LINE>} | filtered.length - toCopy, toCopy); |
1,075,521 | public Builder mergeFrom(org.mlflow.api.proto.ModelRegistry.SearchRegisteredModels.Response other) {<NEW_LINE>if (other == org.mlflow.api.proto.ModelRegistry.SearchRegisteredModels.Response.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (registeredModelsBuilder_ == null) {<NEW_LINE>if (!other.registeredModels_.isEmpty()) {<NEW_LINE>if (registeredModels_.isEmpty()) {<NEW_LINE>registeredModels_ = other.registeredModels_;<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>ensureRegisteredModelsIsMutable();<NEW_LINE>registeredModels_.addAll(other.registeredModels_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.registeredModels_.isEmpty()) {<NEW_LINE>if (registeredModelsBuilder_.isEmpty()) {<NEW_LINE>registeredModelsBuilder_.dispose();<NEW_LINE>registeredModelsBuilder_ = null;<NEW_LINE>registeredModels_ = other.registeredModels_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>registeredModelsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getRegisteredModelsFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE>registeredModelsBuilder_.addAllMessages(other.registeredModels_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (other.hasNextPageToken()) {<NEW_LINE>bitField0_ |= 0x00000002;<NEW_LINE>nextPageToken_ = other.nextPageToken_;<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>} | bitField0_ = (bitField0_ & ~0x00000001); |
617,048 | private // loaded container (don't call repeatedly)<NEW_LINE>void loadLayout(String containerId, NodeList layoutNodeList) throws java.io.IOException {<NEW_LINE>layoutContainer = layoutModel.getLayoutComponent(containerId);<NEW_LINE>if (layoutContainer == null) {<NEW_LINE>layoutContainer = new LayoutComponent(containerId, true);<NEW_LINE>layoutModel.addRootComponent(layoutContainer);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < layoutNodeList.getLength(); i++) {<NEW_LINE>Node dimLayoutNode = layoutNodeList.item(i);<NEW_LINE>if (!(dimLayoutNode instanceof Element) || !dimLayoutNode.getNodeName().equals(XML_DIMENSION_LAYOUT)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Node dimAttrNode = dimLayoutNode.getAttributes().getNamedItem(ATTR_DIMENSION_DIM);<NEW_LINE>dimension = integerFromNode(dimAttrNode);<NEW_LINE>rootIndex = 0;<NEW_LINE>LayoutInterval layoutRoot = layoutContainer.getLayoutRoot(0, dimension);<NEW_LINE><MASK><NEW_LINE>for (int j = 0; j < subNodes.getLength(); j++) {<NEW_LINE>Node node = subNodes.item(j);<NEW_LINE>if (node instanceof Element) {<NEW_LINE>loadGroup(layoutRoot, node);<NEW_LINE>// just one root is loaded<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// recover from missing component name if needed<NEW_LINE>correctMissingName();<NEW_LINE>// check if the container layout is valid - all components having intervals in both dimensions<NEW_LINE>checkMissingComponentsInDimension();<NEW_LINE>} | NodeList subNodes = dimLayoutNode.getChildNodes(); |
1,209,347 | public Result doMerge() {<NEW_LINE>com.feth.play.module.pa.controllers.Authenticate.noCache(response());<NEW_LINE>// this is the currently logged in user<NEW_LINE>final AuthUser aUser = this.auth.getUser(session());<NEW_LINE>// this is the user that was selected for a login<NEW_LINE>final AuthUser bUser = this.auth.getMergeUser(session());<NEW_LINE>if (bUser == null) {<NEW_LINE>// user to merge with could not be found, silently redirect to login<NEW_LINE>return redirect(routes.Application.index());<NEW_LINE>}<NEW_LINE>final Form<Accept> filledForm = ACCEPT_FORM.bindFromRequest();<NEW_LINE>if (filledForm.hasErrors()) {<NEW_LINE>// User did not select whether to merge or not merge<NEW_LINE>return badRequest(ask_merge.render(this.userProvider, filledForm, aUser, bUser));<NEW_LINE>} else {<NEW_LINE>// User made a choice :)<NEW_LINE>final boolean merge <MASK><NEW_LINE>if (merge) {<NEW_LINE>flash(Application.FLASH_MESSAGE_KEY, this.msg.preferred(request()).at("playauthenticate.accounts.merge.success"));<NEW_LINE>}<NEW_LINE>return this.auth.merge(ctx(), merge);<NEW_LINE>}<NEW_LINE>} | = filledForm.get().accept; |
1,584,801 | public static DescribePropertyCronDetailResponse unmarshall(DescribePropertyCronDetailResponse describePropertyCronDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePropertyCronDetailResponse.setRequestId(_ctx.stringValue("DescribePropertyCronDetailResponse.RequestId"));<NEW_LINE>PageInfo pageInfo = new PageInfo();<NEW_LINE>pageInfo.setCount(_ctx.integerValue("DescribePropertyCronDetailResponse.PageInfo.Count"));<NEW_LINE>pageInfo.setPageSize(_ctx.integerValue("DescribePropertyCronDetailResponse.PageInfo.PageSize"));<NEW_LINE>pageInfo.setTotalCount(_ctx.integerValue("DescribePropertyCronDetailResponse.PageInfo.TotalCount"));<NEW_LINE>pageInfo.setCurrentPage(_ctx.integerValue("DescribePropertyCronDetailResponse.PageInfo.CurrentPage"));<NEW_LINE>describePropertyCronDetailResponse.setPageInfo(pageInfo);<NEW_LINE>List<PropertyCron> propertys = new ArrayList<PropertyCron>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePropertyCronDetailResponse.Propertys.Length"); i++) {<NEW_LINE>PropertyCron propertyCron = new PropertyCron();<NEW_LINE>propertyCron.setInstanceName(_ctx.stringValue<MASK><NEW_LINE>propertyCron.setIp(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].Ip"));<NEW_LINE>propertyCron.setCreate(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].Create"));<NEW_LINE>propertyCron.setCreateTimestamp(_ctx.longValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].CreateTimestamp"));<NEW_LINE>propertyCron.setUuid(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].Uuid"));<NEW_LINE>propertyCron.setInstanceId(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].InstanceId"));<NEW_LINE>propertyCron.setIntranetIp(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].IntranetIp"));<NEW_LINE>propertyCron.setInternetIp(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].InternetIp"));<NEW_LINE>propertyCron.setPeriod(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].Period"));<NEW_LINE>propertyCron.setSource(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].Source"));<NEW_LINE>propertyCron.setCmd(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].Cmd"));<NEW_LINE>propertyCron.setUser(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].User"));<NEW_LINE>propertyCron.setMd5(_ctx.stringValue("DescribePropertyCronDetailResponse.Propertys[" + i + "].Md5"));<NEW_LINE>propertys.add(propertyCron);<NEW_LINE>}<NEW_LINE>describePropertyCronDetailResponse.setPropertys(propertys);<NEW_LINE>return describePropertyCronDetailResponse;<NEW_LINE>} | ("DescribePropertyCronDetailResponse.Propertys[" + i + "].InstanceName")); |
1,430,910 | private void handleSnappy(BuildProducer<ReflectiveClassBuildItem> reflectiveClass, BuildProducer<NativeImageResourceBuildItem> nativeLibs, NativeConfig nativeConfig) {<NEW_LINE>reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, true, "org.xerial.snappy.SnappyInputStream", "org.xerial.snappy.SnappyOutputStream"));<NEW_LINE>String root = "org/xerial/snappy/native/";<NEW_LINE>// add linux64 native lib when targeting containers<NEW_LINE>if (nativeConfig.isContainerBuild()) {<NEW_LINE>String dir = "Linux/x86_64";<NEW_LINE>String snappyNativeLibraryName = "libsnappyjava.so";<NEW_LINE>String path = root + dir + "/" + snappyNativeLibraryName;<NEW_LINE>nativeLibs.produce(new NativeImageResourceBuildItem(path));<NEW_LINE>} else {<NEW_LINE>// otherwise the native lib of the platform this build runs on<NEW_LINE>String dir = OSInfo.getNativeLibFolderPathForCurrentOS();<NEW_LINE>String snappyNativeLibraryName = System.mapLibraryName("snappyjava");<NEW_LINE>String path <MASK><NEW_LINE>nativeLibs.produce(new NativeImageResourceBuildItem(path));<NEW_LINE>}<NEW_LINE>} | = root + dir + "/" + snappyNativeLibraryName; |
1,221,278 | public void onConnectionError(MySQLResponseService service, int errNo) {<NEW_LINE>if (errNo == ErrorCode.ER_XAER_NOTA) {<NEW_LINE>RouteResultsetNode rrn = (RouteResultsetNode) service.getAttachment();<NEW_LINE>String xid = service.getConnXID(session.getSessionXaID(), rrn);<NEW_LINE>XAAnalysisHandler xaAnalysisHandler = new XAAnalysisHandler(((PhysicalDbInstance) service.getConnection().getPoolRelated().getInstance()).getDbGroup().getWriteDbInstance());<NEW_LINE>// if mysql connection holding xa transaction wasn't released, may result in ER_XAER_NOTA.<NEW_LINE>// so we need check xid here<NEW_LINE>boolean isExistXid = xaAnalysisHandler.isExistXid(xid);<NEW_LINE>boolean isSuccess = xaAnalysisHandler.isSuccess();<NEW_LINE>if (isSuccess && !isExistXid) {<NEW_LINE>// ERROR 1397 (XAE04): XAER_NOTA: Unknown XID, not prepared<NEW_LINE>xaOldThreadIds.remove(rrn);<NEW_LINE>service.setXaStatus(TxState.TX_ROLLBACKED_STATE);<NEW_LINE>XAStateLog.saveXARecoveryLog(session.getSessionXaID(), service);<NEW_LINE>service.setXaStatus(TxState.TX_INITIALIZE_STATE);<NEW_LINE>}<NEW_LINE>} else if (lastStageIsXAEnd) {<NEW_LINE>service.<MASK><NEW_LINE>service.setXaStatus(TxState.TX_ROLLBACKED_STATE);<NEW_LINE>XAStateLog.saveXARecoveryLog(session.getSessionXaID(), service);<NEW_LINE>} else {<NEW_LINE>service.setXaStatus(TxState.TX_ROLLBACK_FAILED_STATE);<NEW_LINE>XAStateLog.saveXARecoveryLog(session.getSessionXaID(), service);<NEW_LINE>}<NEW_LINE>} | getConnection().businessClose("rollback error"); |
126,603 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see com.aptana.filesystem.ftp.BaseFTPConnectionFileManager#deleteDirectory(org.eclipse.core.runtime.IPath,<NEW_LINE>* org.eclipse.core.runtime.IProgressMonitor)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected void deleteDirectory(IPath path, IProgressMonitor monitor) throws CoreException, FileNotFoundException {<NEW_LINE>MultiStatus status = new MultiStatus(SecureFTPPlugin.PLUGIN_ID, 0, null, null);<NEW_LINE>try {<NEW_LINE>IPath <MASK><NEW_LINE>changeCurrentDir(dirPath);<NEW_LINE>Policy.checkCanceled(monitor);<NEW_LINE>recursiveDeleteTree(path, monitor, status);<NEW_LINE>changeCurrentDir(dirPath);<NEW_LINE>ftpClient.rmdir(path.lastSegment());<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (OperationCanceledException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (!status.isOK()) {<NEW_LINE>MultiStatus multiStatus = new MultiStatus(SecureFTPPlugin.PLUGIN_ID, 0, Messages.SFTPConnectionFileManager_FailedDeleteDirectory, e);<NEW_LINE>multiStatus.addAll(status);<NEW_LINE>} else {<NEW_LINE>throw new CoreException(new Status(Status.ERROR, SecureFTPPlugin.PLUGIN_ID, Messages.SFTPConnectionFileManager_FailedDeleteDirectory, e));<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>monitor.done();<NEW_LINE>}<NEW_LINE>} | dirPath = path.removeLastSegments(1); |
1,196,947 | private String uploadFile(String sourceFile, String destinationUrl) throws IOException, URISyntaxException {<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_DEBUG, "Start"));<NEW_LINE>String result = ERROR;<NEW_LINE>httpClient = new DefaultHttpClient();<NEW_LINE>HttpParams params = httpClient.getParams();<NEW_LINE>if (isUrlDirect(destinationUrl) == false) {<NEW_LINE>setProxy();<NEW_LINE>String proxyHost = System.getProperty("http.proxyHost");<NEW_LINE>String proxyPort = System.getProperty("http.proxyPort");<NEW_LINE>if ((proxyHost != null) && (proxyPort != null)) {<NEW_LINE>try {<NEW_LINE>HttpHost proxy = new HttpHost(proxyHost, Integer.parseInt(proxyPort));<NEW_LINE>httpClient.getParams().<MASK><NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, e.getMessage()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);<NEW_LINE>HttpConnectionParams.setConnectionTimeout(params, HTTP_TIMEOUT);<NEW_LINE>HttpConnectionParams.setSoTimeout(params, HTTP_TIMEOUT);<NEW_LINE>URL url = new URL(fixUrl(destinationUrl));<NEW_LINE>HttpPost httpPost = new HttpPost(url.toURI());<NEW_LINE>File sourceFileObject = new File(sourceFile);<NEW_LINE>if (sourceFileObject.exists() == false)<NEW_LINE>throw (new IOException("source file not found"));<NEW_LINE>FileBody fileContent = new FileBody(new File(sourceFile));<NEW_LINE>MultipartEntity reqEntity = new MultipartEntity();<NEW_LINE>// Insert Authorization header if required<NEW_LINE>if (m_username.length() > 0) {<NEW_LINE>byte[] encodedPasswordBuffer = (m_username + ":" + m_password).getBytes();<NEW_LINE>Base64 encoder = new Base64();<NEW_LINE>String encodedPassword = encoder.encodeToString(encodedPasswordBuffer);<NEW_LINE>encodedPassword = encodedPassword.substring(0, encodedPassword.length() - 2);<NEW_LINE>httpPost.setHeader("Authorization", "Basic " + encodedPassword);<NEW_LINE>}<NEW_LINE>reqEntity.addPart("SpbImagerFile", fileContent);<NEW_LINE>httpPost.setHeader("Cache-Control", "no-cache");<NEW_LINE>httpPost.setHeader("User-Agent", "Symbol RhoElements");<NEW_LINE>httpPost.getParams().setBooleanParameter("http.protocol.expect-continue", false);<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_INFO, "executing request " + httpPost.getRequestLine()));<NEW_LINE>httpPost.setEntity(reqEntity);<NEW_LINE>try {<NEW_LINE>result = httpClient.execute(httpPost, new CustomHttpResponse());<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_DEBUG, "End"));<NEW_LINE>return result;<NEW_LINE>} | setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); |
1,476,629 | public static ListTagResourcesResponse unmarshall(ListTagResourcesResponse listTagResourcesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listTagResourcesResponse.setRequestId(_ctx.stringValue("ListTagResourcesResponse.RequestId"));<NEW_LINE>listTagResourcesResponse.setSuccess(_ctx.booleanValue("ListTagResourcesResponse.Success"));<NEW_LINE>listTagResourcesResponse.setNextToken<MASK><NEW_LINE>List<TagResource> tagResources = new ArrayList<TagResource>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListTagResourcesResponse.TagResources.Length"); i++) {<NEW_LINE>TagResource tagResource = new TagResource();<NEW_LINE>tagResource.setTagKey(_ctx.stringValue("ListTagResourcesResponse.TagResources[" + i + "].TagKey"));<NEW_LINE>tagResource.setTagValue(_ctx.stringValue("ListTagResourcesResponse.TagResources[" + i + "].TagValue"));<NEW_LINE>tagResource.setResourceId(_ctx.stringValue("ListTagResourcesResponse.TagResources[" + i + "].ResourceId"));<NEW_LINE>tagResource.setResourceType(_ctx.stringValue("ListTagResourcesResponse.TagResources[" + i + "].ResourceType"));<NEW_LINE>tagResources.add(tagResource);<NEW_LINE>}<NEW_LINE>listTagResourcesResponse.setTagResources(tagResources);<NEW_LINE>return listTagResourcesResponse;<NEW_LINE>} | (_ctx.stringValue("ListTagResourcesResponse.NextToken")); |
909,827 | protected Pair<RegisterSetLatticeElement, RegisterSetLatticeElement> transformMul(final ReilInstruction ins, final RegisterSetLatticeElement state) {<NEW_LINE>if ((ins.getFirstOperand().getType() == OperandType.INTEGER_LITERAL) && ins.getFirstOperand().getValue().equalsIgnoreCase("0")) {<NEW_LINE>final RegisterSetLatticeElement newState = state.copy();<NEW_LINE>newState.untaint(ins.getThirdOperand().getValue());<NEW_LINE>return new Pair<RegisterSetLatticeElement, RegisterSetLatticeElement>(newState, null);<NEW_LINE>} else if ((ins.getSecondOperand().getType() == OperandType.INTEGER_LITERAL) && ins.getSecondOperand().getValue().equalsIgnoreCase("0")) {<NEW_LINE>final RegisterSetLatticeElement newState = state.copy();<NEW_LINE>newState.untaint(ins.getThirdOperand().getValue());<NEW_LINE>return new Pair<RegisterSetLatticeElement<MASK><NEW_LINE>}<NEW_LINE>return transformNormalInstruction(ins, state);<NEW_LINE>} | , RegisterSetLatticeElement>(newState, null); |
370,463 | protected void updateCheckboxesEnabledByWildcards() {<NEW_LINE>if (rolesPolicyVersion == 1)<NEW_LINE>return;<NEW_LINE>Permission globalWildcardPermission = getWildcardPermission();<NEW_LINE>boolean globalWildcardModify = globalWildcardPermission != null && EntityAttrAccess.MODIFY.getId().equals(globalWildcardPermission.getValue());<NEW_LINE>boolean globalWildcardView = globalWildcardPermission != null && EntityAttrAccess.VIEW.getId().equals(globalWildcardPermission.getValue());<NEW_LINE>MultiplePermissionTarget item = propertyPermissionsTable.getSingleSelected();<NEW_LINE>if (item != null) {<NEW_LINE>Permission entityWildcardPermission = <MASK><NEW_LINE>boolean entityWildcardModify = entityWildcardPermission != null && EntityAttrAccess.MODIFY.getId().equals(entityWildcardPermission.getValue());<NEW_LINE>boolean entityWildcardView = entityWildcardPermission != null && EntityAttrAccess.VIEW.getId().equals(entityWildcardPermission.getValue());<NEW_LINE>for (AttributePermissionControl control : permissionControls) {<NEW_LINE>boolean modifyEnabled = "*".equals(control.getAttributeName()) ? !globalWildcardModify : !globalWildcardModify && !entityWildcardModify;<NEW_LINE>boolean viewEnabled = "*".equals(control.getAttributeName()) ? !globalWildcardView : !globalWildcardView && !entityWildcardView;<NEW_LINE>control.getModifyCheckBox().setEnabled(modifyEnabled);<NEW_LINE>control.getReadOnlyCheckBox().setEnabled(viewEnabled);<NEW_LINE>}<NEW_LINE>allModifyCheck.setEnabled(!globalWildcardModify && !entityWildcardModify);<NEW_LINE>allReadOnlyCheck.setEnabled(!globalWildcardView && !entityWildcardView);<NEW_LINE>}<NEW_LINE>} | getWildcardPermission(item.getEntityMetaClassName()); |
955,445 | static final PyObject array_new(PyNewWrapper new_, boolean init, PyType subtype, PyObject[] args, String[] keywords) {<NEW_LINE>if (new_.for_type != subtype && keywords.length > 0) {<NEW_LINE>int argc = args.length - keywords.length;<NEW_LINE>PyObject[] justArgs = new PyObject[argc];<NEW_LINE>System.arraycopy(args, 0, justArgs, 0, argc);<NEW_LINE>args = justArgs;<NEW_LINE>}<NEW_LINE>// Create a 'blank canvas' of the appropriate concrete class.<NEW_LINE>PyArray self = new_.for_type == subtype ? new PyArray(subtype) : new PyArrayDerived(subtype);<NEW_LINE>// Build the argument parser for this call<NEW_LINE>ArgParser ap = new ArgParser("array", args, Py.NoKeywords, new String[] { "typecode", "initializer" }, 1);<NEW_LINE>ap.noKeywords();<NEW_LINE>// Retrieve the mandatory type code that determines the element itemClass<NEW_LINE>PyObject obj = ap.getPyObject(0);<NEW_LINE>if (obj instanceof PyString && !(obj instanceof PyUnicode)) {<NEW_LINE>if (obj.__len__() != 1) {<NEW_LINE>throw Py.TypeError("array() argument 1 must be char, not str");<NEW_LINE>}<NEW_LINE>char typecode = obj.toString().charAt(0);<NEW_LINE>self.setElementType(ItemType.fromTypecode(typecode), null);<NEW_LINE>} else if (obj instanceof PyJavaType) {<NEW_LINE>Class<?> itemClass = ((PyJavaType) obj).getProxyType();<NEW_LINE>self.setElementType(ItemType.OBJECT, itemClass);<NEW_LINE>} else {<NEW_LINE>throw Py.TypeError("array() argument 1 must be char, not " + obj.getType().fastGetName());<NEW_LINE>}<NEW_LINE>// Fill the array from the second argument (if there is one)<NEW_LINE>self.useInitial(ap<MASK><NEW_LINE>return self;<NEW_LINE>} | .getPyObject(1, null)); |
400,565 | ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String workId) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<List<Wo>> <MASK><NEW_LINE>Business business = new Business(emc);<NEW_LINE>Work work = emc.fetch(workId, Work.class, ListTools.toList(Work.job_FIELDNAME));<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(workId, Work.class);<NEW_LINE>}<NEW_LINE>if (!business.readableWithJob(effectivePerson, work.getJob())) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson);<NEW_LINE>}<NEW_LINE>List<Wo> wos = Wo.copier.copy(emc.listEqual(Task.class, Task.work_FIELDNAME, workId));<NEW_LINE>wos = wos.stream().sorted(Comparator.comparing(Wo::getStartTime, Comparator.nullsLast(Date::compareTo))).collect(Collectors.toList());<NEW_LINE>result.setData(wos);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | result = new ActionResult<>(); |
1,738,109 | public void noticePlayerUnlink(Player player) {<NEW_LINE>if (!isEnabled())<NEW_LINE>return;<NEW_LINE>if (getBypassNames().contains(player.getName()))<NEW_LINE>return;<NEW_LINE>if (checkWhitelist()) {<NEW_LINE>boolean whitelisted = Bukkit.getServer().getWhitelistedPlayers().stream().map(OfflinePlayer::getUniqueId).anyMatch(u -> u.equals(player.getUniqueId()));<NEW_LINE>if (whitelisted) {<NEW_LINE>DiscordSRV.debug(Debug.REQUIRE_LINK, "Player " + player.getName() + " is bypassing link requirement, player is whitelisted");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String ip = player.getAddress().getAddress().getHostAddress();<NEW_LINE>if (onlyCheckBannedPlayers() && !Bukkit.getServer().getBannedPlayers().stream().anyMatch(p -> p.getUniqueId().equals(player.getUniqueId())) && !Bukkit.getServer().getIPBans().stream().anyMatch(ip::equals)) {<NEW_LINE>DiscordSRV.debug(Debug.REQUIRE_LINK, "Player " + player.getName() + " is bypassing link requirement because \"Only check banned players\" is enabled");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DiscordSRV.info("Kicking player " + <MASK><NEW_LINE>Bukkit.getScheduler().runTask(DiscordSRV.getPlugin(), () -> player.kickPlayer(MessageUtil.translateLegacy(getUnlinkedKickMessage())));<NEW_LINE>} | player.getName() + " for unlinking their accounts"); |
227,710 | public CompletableFuture<Void> startTruncation(final Map<Long, Long> streamCut, OperationContext context) {<NEW_LINE>Preconditions.checkNotNull(context, "operation context cannot be null");<NEW_LINE>return getTruncationRecord(context).thenCompose(existing -> {<NEW_LINE>Preconditions.checkNotNull(existing);<NEW_LINE>Preconditions.checkArgument(!existing.getObject().isUpdating());<NEW_LINE>long mostRecent = getMostRecent(streamCut);<NEW_LINE>long oldest = getOldest(streamCut);<NEW_LINE>int epochLow = NameUtils.getEpoch(oldest);<NEW_LINE>int <MASK><NEW_LINE>return fetchEpochs(epochLow, epochHigh, true, context).thenCompose(epochs -> {<NEW_LINE>boolean isValid = isStreamCutValidInternal(streamCut, epochLow, epochs);<NEW_LINE>Exceptions.checkArgument(isValid, "streamCut", "invalid stream cut");<NEW_LINE>ImmutableMap<StreamSegmentRecord, Integer> span = computeStreamCutSpanInternal(streamCut, epochLow, epochHigh, epochs);<NEW_LINE>StreamTruncationRecord previous = existing.getObject();<NEW_LINE>// check greater than<NEW_LINE>Exceptions.checkArgument(streamCutEqualOrAfter(streamCut, span, previous.getStreamCut(), previous.getSpan()), "StreamCut", "Supplied streamcut is behind previous truncation point");<NEW_LINE>return computeTruncationRecord(previous, streamCut, span, context).thenCompose(prop -> Futures.toVoid(setTruncationData(new VersionedMetadata<>(prop, existing.getVersion()), context)));<NEW_LINE>});<NEW_LINE>});<NEW_LINE>} | epochHigh = NameUtils.getEpoch(mostRecent); |
1,671,009 | public AssemblyInstruction parseInstruction(String input, long address, String comment, String annotation, AssemblyLabels labels) {<NEW_LINE>input = input.replaceAll("\\s+", S_SPACE).trim();<NEW_LINE>int length = input.length();<NEW_LINE>boolean inBrackets = false;<NEW_LINE>String mnemonic = null;<NEW_LINE>List<String> prefixes = new ArrayList<>();<NEW_LINE>List<String> operands = new ArrayList<>();<NEW_LINE>StringBuilder partBuilder = new StringBuilder();<NEW_LINE>for (int pos = 0; pos < length; pos++) {<NEW_LINE>char c = input.charAt(pos);<NEW_LINE>if (c == C_OPEN_PARENTHESES || c == C_OPEN_SQUARE_BRACKET) {<NEW_LINE>inBrackets = true;<NEW_LINE>} else if (c == C_CLOSE_PARENTHESES || c == C_CLOSE_SQUARE_BRACKET) {<NEW_LINE>inBrackets = false;<NEW_LINE>}<NEW_LINE>if (c == C_SPACE && mnemonic == null) {<NEW_LINE>// end of part<NEW_LINE>String part = partBuilder.toString();<NEW_LINE>partBuilder.delete(0, partBuilder.length());<NEW_LINE>if (DEBUG_LOGGING_ASSEMBLY) {<NEW_LINE>logger.debug("part: '{}'", part);<NEW_LINE>}<NEW_LINE>if (mnemonic == null) {<NEW_LINE>if ("data64".equals(part) || "data32".equals(part) || "data16".equals(part) || "data8".equals(part) || "lock".equals(part)) {<NEW_LINE>prefixes.add(part);<NEW_LINE>} else {<NEW_LINE>mnemonic = part;<NEW_LINE>if (DEBUG_LOGGING_ASSEMBLY) {<NEW_LINE>logger.debug("mnemonic: '{}'", mnemonic);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (c == C_COMMA && !inBrackets) {<NEW_LINE><MASK><NEW_LINE>partBuilder.delete(0, partBuilder.length());<NEW_LINE>operands.add(operand);<NEW_LINE>if (DEBUG_LOGGING_ASSEMBLY) {<NEW_LINE>logger.debug("operand1: '{}'", operand);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>partBuilder.append(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (partBuilder.length() > 0) {<NEW_LINE>String part = partBuilder.toString();<NEW_LINE>partBuilder.delete(0, partBuilder.length() - 1);<NEW_LINE>if (mnemonic == null) {<NEW_LINE>mnemonic = part;<NEW_LINE>if (DEBUG_LOGGING_ASSEMBLY) {<NEW_LINE>logger.debug("mnemonic: '{}'", part);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>operands.add(part);<NEW_LINE>if (DEBUG_LOGGING_ASSEMBLY) {<NEW_LINE>logger.debug("operand2: '{}'", part);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new AssemblyInstruction(annotation, address, prefixes, mnemonic, operands, comment, labels);<NEW_LINE>} | String operand = partBuilder.toString(); |
1,606,167 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_file_list);<NEW_LINE>getSupportActionBar().setDisplayHomeAsUpEnabled(true);<NEW_LINE>mRootFolder = getRootFolder();<NEW_LINE>mCurrentDir = mRootFolder;<NEW_LINE>mFileList = (ListView) findViewById(R.id.fileList);<NEW_LINE>mCurrentPathView = (TextView) findViewById(R.id.currentPath);<NEW_LINE>mCurrentPathView.<MASK><NEW_LINE>mUpDirIcon = (ImageView) findViewById(R.id.upDirIcon);<NEW_LINE>mUpDirIcon.setImageResource(Profile.getStyledResource(this, R.attr.ic_folder_fl));<NEW_LINE>mUpDir = (TextView) findViewById(R.id.upDir);<NEW_LINE>mUpDir.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>File parent = mCurrentDir.getParentFile();<NEW_LINE>if (parent != null) {<NEW_LINE>setCurrentDir(parent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mFilesListAdapter = new FilesListAdapter(this, getExplorerFileFilter());<NEW_LINE>mFileList.setAdapter(mFilesListAdapter);<NEW_LINE>mFilesListAdapter.setDir(mRootFolder);<NEW_LINE>mFileList.setOnItemClickListener(getOnListItemClickListener());<NEW_LINE>mFileList.setOnItemLongClickListener(getOnListItemLongClickListener());<NEW_LINE>} | setText(mCurrentDir.getPath()); |
83,908 | private void tradeAtFortHochelagaMontreal() {<NEW_LINE>savings -= 160.0;<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("SUPPLIES AT FORT HOCHELAGA COST $150.00.");<NEW_LINE>System.out.println("YOUR TRAVEL EXPENSES TO HOCHELAGA WERE $10.00.");<NEW_LINE>minkPrice = ((.2 * Math.random() + .7) * (Math.pow(10, 2) + .5)) / <MASK><NEW_LINE>erminePrice = ((.2 * Math.random() + .65) * (Math.pow(10, 2) + .5)) / Math.pow(10, 2);<NEW_LINE>beaverPrice = ((.2 * Math.random() + .75) * (Math.pow(10, 2) + .5)) / Math.pow(10, 2);<NEW_LINE>foxPrice = ((.2 * Math.random() + .8) * (Math.pow(10, 2) + .5)) / Math.pow(10, 2);<NEW_LINE>} | Math.pow(10, 2); |
1,170,915 | public static PCode createCode(PythonContext context, int flags, byte[] codedata, String filename, int firstlineno, byte[] lnotab) {<NEW_LINE>boolean isNotAModule = (flags & PCode.FLAG_MODULE) == 0;<NEW_LINE>PythonLanguage language = context.getLanguage();<NEW_LINE>Supplier<CallTarget> createCode = () -> {<NEW_LINE>ByteSequence bytes = ByteSequence.create(codedata);<NEW_LINE>Source source = Source.newBuilder(PythonLanguage.ID, bytes, filename).mimeType(PythonLanguage.MIME_TYPE_BYTECODE).cached(!language.isSingleContext()).build();<NEW_LINE>return context.getEnv().parsePublic(source);<NEW_LINE>};<NEW_LINE>PythonObjectFactory factory = context.factory();<NEW_LINE>if (context.isCoreInitialized() || isNotAModule) {<NEW_LINE>return factory.createCode(createCode, flags, firstlineno, lnotab, filename);<NEW_LINE>} else {<NEW_LINE>RootCallTarget ct = (RootCallTarget) language.cacheCode(filename, createCode);<NEW_LINE>return factory.createCode(ct, <MASK><NEW_LINE>}<NEW_LINE>} | flags, firstlineno, lnotab, filename); |
1,395,992 | protected void renderShapes(Graphics2D g2, double scale) {<NEW_LINE>List<Polygon2D_F64> squares = getFoundPolygons();<NEW_LINE>for (int i = 0; i < squares.size(); i++) {<NEW_LINE>Polygon2D_F64 p = squares.get(i);<NEW_LINE>// if (isInGrids(p)) TODO fix broken method isInGrids<NEW_LINE>// continue;<NEW_LINE>g2.setColor(Color.cyan);<NEW_LINE>g2.setStroke(new BasicStroke(4));<NEW_LINE>drawPolygon(p, g2, scale);<NEW_LINE>g2.setColor(Color.blue);<NEW_LINE>g2.setStroke(new BasicStroke(2));<NEW_LINE>drawPolygon(p, g2, scale);<NEW_LINE>drawCornersInside(g2, scale, p);<NEW_LINE>}<NEW_LINE>List<EllipseRotated_F64> ellipses = getFoundEllipses();<NEW_LINE>AffineTransform rotate = new AffineTransform();<NEW_LINE>for (int i = 0; i < ellipses.size(); i++) {<NEW_LINE>EllipseRotated_F64 ellipse = ellipses.get(i);<NEW_LINE>rotate.setToIdentity();<NEW_LINE>rotate.rotate(ellipse.phi);<NEW_LINE>double w = scale * ellipse.a * 2;<NEW_LINE>double h = scale * ellipse.b * 2;<NEW_LINE>Shape shape = rotate.createTransformedShape(new Ellipse2D.Double(-w / 2, -h / 2, w, h));<NEW_LINE>shape = AffineTransform.getTranslateInstance(scale * ellipse.center.x, scale * ellipse.center.y).createTransformedShape(shape);<NEW_LINE>g2.setColor(Color.cyan);<NEW_LINE>g2.<MASK><NEW_LINE>g2.draw(shape);<NEW_LINE>g2.setColor(Color.blue);<NEW_LINE>g2.setStroke(new BasicStroke(2));<NEW_LINE>g2.draw(shape);<NEW_LINE>}<NEW_LINE>} | setStroke(new BasicStroke(4)); |
1,210,008 | private JPanel buildPluginPathsPanel() {<NEW_LINE>// create the UP and DOWN arrows panel<NEW_LINE>upButton = ButtonPanelFactory.createButton(ButtonPanelFactory.ARROW_UP_TYPE);<NEW_LINE>upButton.setName("UpArrow");<NEW_LINE>upButton.addActionListener(e -> handleSelection(UP));<NEW_LINE>downButton = ButtonPanelFactory.createButton(ButtonPanelFactory.ARROW_DOWN_TYPE);<NEW_LINE>downButton.setName("DownArrow");<NEW_LINE>downButton.addActionListener(e -> handleSelection(DOWN));<NEW_LINE>JPanel arrowButtonsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 10));<NEW_LINE>arrowButtonsPanel.add(upButton);<NEW_LINE>arrowButtonsPanel.add(downButton);<NEW_LINE>// create the Add and Remove panel<NEW_LINE>JButton addJarButton = ButtonPanelFactory.createButton(ADD_JAR_BUTTON_TEXT);<NEW_LINE>addJarButton.addActionListener(e -> addJarCallback());<NEW_LINE>JButton <MASK><NEW_LINE>addDirButton.addActionListener(e -> addDirCallback());<NEW_LINE>removeButton = ButtonPanelFactory.createButton("Remove");<NEW_LINE>removeButton.addActionListener(e -> handleSelection(REMOVE));<NEW_LINE>Dimension d = addJarButton.getPreferredSize();<NEW_LINE>addDirButton.setPreferredSize(d);<NEW_LINE>removeButton.setPreferredSize(d);<NEW_LINE>JPanel otherButtonsPanel = ButtonPanelFactory.createButtonPanel(new JButton[] { addJarButton, addDirButton, removeButton }, SIDE_MARGIN);<NEW_LINE>// put the right-side buttons panel together<NEW_LINE>JPanel listButtonPanel = new JPanel(new BorderLayout(0, 0));<NEW_LINE>listButtonPanel.add(arrowButtonsPanel, BorderLayout.NORTH);<NEW_LINE>listButtonPanel.add(otherButtonsPanel, BorderLayout.CENTER);<NEW_LINE>//<NEW_LINE>// construct the plugin paths list<NEW_LINE>//<NEW_LINE>JPanel scrollListPanel = new JPanel(new BorderLayout(10, 15));<NEW_LINE>pluginPathsList = new JList<>();<NEW_LINE>pluginPathsList.addListSelectionListener(new PathListSelectionListener());<NEW_LINE>pluginPathsList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);<NEW_LINE>// give the list a custom cell renderer that shows invalid paths<NEW_LINE>// in red (may be preference paths set previously that are no longer<NEW_LINE>// available<NEW_LINE>pluginPathsList.setCellRenderer(new PluginPathRenderer());<NEW_LINE>// component used for sizing all the text fields on the main panel<NEW_LINE>scrollPane = new JScrollPane(pluginPathsList);<NEW_LINE>scrollPane.setPreferredSize(new Dimension(250, 150));<NEW_LINE>scrollListPanel.add(scrollPane, BorderLayout.CENTER);<NEW_LINE>//<NEW_LINE>// construct the plugin text panel<NEW_LINE>//<NEW_LINE>JPanel pluginPathListPanel = new JPanel(new BorderLayout(0, 0));<NEW_LINE>pluginPathListPanel.add(scrollListPanel, BorderLayout.CENTER);<NEW_LINE>pluginPathListPanel.add(listButtonPanel, BorderLayout.EAST);<NEW_LINE>pluginPathListPanel.setBorder(new TitledBorder("User Plugin Paths"));<NEW_LINE>// set tooltips after adding all components to get around swing<NEW_LINE>// tooltip text problem where the text is obscured by a component<NEW_LINE>// added after tooltip has been added<NEW_LINE>//<NEW_LINE>upButton.setToolTipText("Changes the order of search for plugins");<NEW_LINE>downButton.setToolTipText("Changes the order of search for plugins");<NEW_LINE>pluginPathListPanel.validate();<NEW_LINE>return pluginPathListPanel;<NEW_LINE>} | addDirButton = ButtonPanelFactory.createButton(ADD_DIR_BUTTON_TEXT); |
1,126,747 | public void openTag(String elementName, List<String> attrs) {<NEW_LINE>if (DEBUG) {<NEW_LINE>dumpState("open " + elementName);<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>int elIndex = METADATA.indexForName(canonElementName);<NEW_LINE>// Treat unrecognized tags as void, but emit closing tags in closeTag().<NEW_LINE>if (elIndex == UNRECOGNIZED_TAG) {<NEW_LINE>if (openElements.size() < nestingLimit) {<NEW_LINE>underlying.openTag(elementName, attrs);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>prepareForContent(elIndex);<NEW_LINE>if (openElements.size() < nestingLimit) {<NEW_LINE>underlying.openTag(METADATA.canonNameForIndex(elIndex), attrs);<NEW_LINE>}<NEW_LINE>if (!HtmlTextEscapingMode.isVoidElement(canonElementName)) {<NEW_LINE>openElements.add(elIndex);<NEW_LINE>}<NEW_LINE>} | canonElementName = HtmlLexer.canonicalElementName(elementName); |
1,336,637 | final AddTagsToVaultResult executeAddTagsToVault(AddTagsToVaultRequest addTagsToVaultRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(addTagsToVaultRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AddTagsToVaultRequest> request = null;<NEW_LINE>Response<AddTagsToVaultResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AddTagsToVaultRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(addTagsToVaultRequest));<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, "Glacier");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AddTagsToVault");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AddTagsToVaultResult>> 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 AddTagsToVaultResultJsonUnmarshaller()); |
504,052 | protected JettyForker newJettyForker() throws Exception {<NEW_LINE>JettyForker jetty = new JettyForker();<NEW_LINE>jetty.setServer(server);<NEW_LINE>jetty.<MASK><NEW_LINE>jetty.setStopKey(stopKey);<NEW_LINE>jetty.setStopPort(stopPort);<NEW_LINE>jetty.setEnv(env);<NEW_LINE>jetty.setJvmArgs(jvmArgs);<NEW_LINE>jetty.setSystemProperties(mergedSystemProperties);<NEW_LINE>jetty.setContainerClassPath(getContainerClassPath());<NEW_LINE>jetty.setJettyXmlFiles(jettyXmls);<NEW_LINE>jetty.setJettyProperties(jettyProperties);<NEW_LINE>jetty.setForkWebXml(forkWebXml);<NEW_LINE>jetty.setContextXml(contextXml);<NEW_LINE>jetty.setWebAppPropsFile(new File(target, "webApp.props"));<NEW_LINE>Random random = new Random();<NEW_LINE>String token = Long.toString(random.nextLong() ^ System.currentTimeMillis(), 36).toUpperCase(Locale.ENGLISH);<NEW_LINE>jetty.setTokenFile(target.toPath().resolve(token + ".txt").toFile());<NEW_LINE>jetty.setWebApp(webApp);<NEW_LINE>return jetty;<NEW_LINE>} | setWorkDir(project.getBasedir()); |
1,444,557 | public void deleteUserAdditionalSpecializationByUserSpecialization(@NonNull final Integer userSpecializationId, @NonNull final Integer userId) {<NEW_LINE>final IQuery<I_CRM_Occupation> occupationList = queryBL.createQueryBuilder(I_CRM_Occupation.class).addEqualsFilter(I_CRM_Occupation.<MASK><NEW_LINE>queryBL.createQueryBuilder(I_AD_User_Occupation_AdditionalSpecialization.class).addEqualsFilter(I_AD_User_Occupation_AdditionalSpecialization.COLUMNNAME_AD_User_ID, userId).addInSubQueryFilter(I_AD_User_Occupation_AdditionalSpecialization.COLUMN_CRM_Occupation_ID, I_CRM_Occupation.COLUMN_CRM_Occupation_ID, occupationList).create().delete();<NEW_LINE>} | COLUMN_CRM_Occupation_Parent_ID, userSpecializationId).create(); |
1,741,664 | private void updateInstanceConfigAndBrokerResourceIfNeeded() {<NEW_LINE>InstanceConfig instanceConfig = HelixHelper.getInstanceConfig(_participantHelixManager, _instanceId);<NEW_LINE>boolean instanceConfigUpdated = HelixHelper.updateHostnamePort(instanceConfig, _hostname, _port);<NEW_LINE>if (_tlsPort > 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>boolean shouldUpdateBrokerResource = false;<NEW_LINE>String brokerTag = null;<NEW_LINE>List<String> instanceTags = instanceConfig.getTags();<NEW_LINE>if (instanceTags.isEmpty()) {<NEW_LINE>// This is a new broker (first time joining the cluster)<NEW_LINE>if (ZKMetadataProvider.getClusterTenantIsolationEnabled(_propertyStore)) {<NEW_LINE>brokerTag = TagNameUtils.getBrokerTagForTenant(null);<NEW_LINE>shouldUpdateBrokerResource = true;<NEW_LINE>} else {<NEW_LINE>brokerTag = Helix.UNTAGGED_BROKER_INSTANCE;<NEW_LINE>}<NEW_LINE>instanceConfig.addTag(brokerTag);<NEW_LINE>instanceConfigUpdated = true;<NEW_LINE>}<NEW_LINE>if (instanceConfigUpdated) {<NEW_LINE>HelixHelper.updateInstanceConfig(_participantHelixManager, instanceConfig);<NEW_LINE>}<NEW_LINE>if (shouldUpdateBrokerResource) {<NEW_LINE>// Update broker resource to include the new broker<NEW_LINE>long startTimeMs = System.currentTimeMillis();<NEW_LINE>List<String> tablesAdded = new ArrayList<>();<NEW_LINE>HelixHelper.updateBrokerResource(_participantHelixManager, _instanceId, Collections.singletonList(brokerTag), tablesAdded, null);<NEW_LINE>LOGGER.info("Updated broker resource for new joining broker: {} in {}ms, tables added: {}", _instanceId, System.currentTimeMillis() - startTimeMs, tablesAdded);<NEW_LINE>}<NEW_LINE>} | HelixHelper.updateTlsPort(instanceConfig, _tlsPort); |
337,539 | final UpdateVocabularyFilterResult executeUpdateVocabularyFilter(UpdateVocabularyFilterRequest updateVocabularyFilterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateVocabularyFilterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateVocabularyFilterRequest> request = null;<NEW_LINE>Response<UpdateVocabularyFilterResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UpdateVocabularyFilterRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateVocabularyFilterRequest));<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, "Transcribe");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateVocabularyFilter");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateVocabularyFilterResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateVocabularyFilterResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,464,187 | public ConfidencePredictingClassifier train(InstanceList trainList) {<NEW_LINE>FeatureSelection selectedFeatures = trainList.getFeatureSelection();<NEW_LINE>logger.fine("Training underlying classifier");<NEW_LINE>Classifier c = underlyingClassifierTrainer.train(trainList);<NEW_LINE>confusionMatrix = new ConfusionMatrix(new Trial(c, trainList));<NEW_LINE>assert (validationSet != null) : "This ClassifierTrainer requires a validation set.";<NEW_LINE>Trial t = new Trial(c, validationSet);<NEW_LINE><MASK><NEW_LINE>InstanceList confidencePredictionTraining = new InstanceList(confidencePredictingPipe);<NEW_LINE>logger.fine("Creating confidence prediction instance list");<NEW_LINE>double weight;<NEW_LINE>for (int i = 0; i < t.size(); i++) {<NEW_LINE>Classification classification = t.get(i);<NEW_LINE>confidencePredictionTraining.add(classification, null, classification.getInstance().getName(), classification.getInstance().getSource());<NEW_LINE>}<NEW_LINE>logger.info("Begin training ConfidencePredictingClassifier . . . ");<NEW_LINE>Classifier cpc = confidencePredictingClassifierTrainer.train(confidencePredictionTraining);<NEW_LINE>logger.info("Accuracy at predicting correct/incorrect in training = " + cpc.getAccuracy(confidencePredictionTraining));<NEW_LINE>// get most informative features per class, then combine to make<NEW_LINE>// new feature conjunctions<NEW_LINE>PerLabelInfoGain perLabelInfoGain = new PerLabelInfoGain(trainList);<NEW_LINE>// print out most informative features<NEW_LINE>this.classifier = new ConfidencePredictingClassifier(c, cpc);<NEW_LINE>return classifier;<NEW_LINE>// return new ConfidencePredictingClassifier (c, ada);<NEW_LINE>} | double accuracy = t.getAccuracy(); |
307,246 | private void updateSearch() {<NEW_LINE><MASK><NEW_LINE>if (search.trim().isEmpty()) {<NEW_LINE>suggestionList.visible = false;<NEW_LINE>this.fullInit();<NEW_LINE>} else {<NEW_LINE>search = search.toLowerCase(Locale.ENGLISH);<NEW_LINE>ArrayList<AbstractNode<ResourceLocation, ManualEntry>> lHeaders = new ArrayList<>();<NEW_LINE>Set<AbstractNode<ResourceLocation, ManualEntry>> lSpellcheck = new HashSet<>();<NEW_LINE>final String searchFinal = search;<NEW_LINE>manual.getAllEntriesAndCategories().forEach((node) -> {<NEW_LINE>if (manual.showNodeInList(node)) {<NEW_LINE>String title = ManualUtils.getTitleForNode(node, manual).toLowerCase(Locale.ENGLISH);<NEW_LINE>if (title.contains(searchFinal))<NEW_LINE>lHeaders.add(node);<NEW_LINE>else<NEW_LINE>lSpellcheck.add(node);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>List<AbstractNode<ResourceLocation, ManualEntry>> lCorrections = ManualUtils.getPrimitiveSpellingCorrections(search, lSpellcheck, 4, (e) -> ManualUtils.getTitleForNode(e, manual));<NEW_LINE>for (AbstractNode<ResourceLocation, ManualEntry> node : lSpellcheck) if (!lCorrections.contains(node)) {<NEW_LINE>if (node.isLeaf() && node.getLeafData().listForSearch(search)) {<NEW_LINE>lHeaders.add(node);<NEW_LINE>lCorrections.add(node);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>entryList.setEntries(lHeaders);<NEW_LINE>if (!lCorrections.isEmpty())<NEW_LINE>suggestionList.setEntries(lCorrections);<NEW_LINE>suggestionList.visible = !lCorrections.isEmpty();<NEW_LINE>}<NEW_LINE>} | String search = searchField.getValue(); |
1,761,611 | protected void saveContentletVersionInfo(ContentletVersionInfo cvInfo, boolean updateVersionTS) throws DotDataException, DotStateException {<NEW_LINE>boolean isNew = true;<NEW_LINE>if (UtilMethods.isSet(cvInfo.getIdentifier())) {<NEW_LINE>try {<NEW_LINE>final Optional<ContentletVersionInfo> fromDB = findContentletVersionInfoInDB(cvInfo.getIdentifier(), cvInfo.getLang());<NEW_LINE>if (fromDB.isPresent()) {<NEW_LINE>isNew = false;<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>Logger.debug(this.getClass(), e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>cvInfo.setIdentifier(UUIDGenerator.generateUuid());<NEW_LINE>}<NEW_LINE>if (updateVersionTS) {<NEW_LINE>cvInfo.setVersionTs(new Date());<NEW_LINE>}<NEW_LINE>final DotConnect dotConnect = new DotConnect();<NEW_LINE>if (isNew) {<NEW_LINE>dotConnect.setSQL(INSERT_CONTENTLET_VERSION_INFO_SQL);<NEW_LINE>dotConnect.addParam(cvInfo.getIdentifier());<NEW_LINE>dotConnect.addParam(cvInfo.getLang());<NEW_LINE>dotConnect.addParam(cvInfo.getWorkingInode());<NEW_LINE>dotConnect.addParam(cvInfo.getLiveInode());<NEW_LINE>dotConnect.addParam(cvInfo.isDeleted());<NEW_LINE>dotConnect.addParam(cvInfo.getLockedBy());<NEW_LINE>dotConnect.addParam(cvInfo.getLockedOn());<NEW_LINE>dotConnect.addParam(cvInfo.getVersionTs());<NEW_LINE>dotConnect.loadResult();<NEW_LINE>} else {<NEW_LINE>dotConnect.setSQL(UPDATE_CONTENTLET_VERSION_INFO_SQL);<NEW_LINE>dotConnect.addParam(cvInfo.getWorkingInode());<NEW_LINE>dotConnect.addParam(cvInfo.getLiveInode());<NEW_LINE>dotConnect.<MASK><NEW_LINE>dotConnect.addParam(cvInfo.getLockedBy());<NEW_LINE>dotConnect.addParam(cvInfo.getLockedOn());<NEW_LINE>dotConnect.addParam(cvInfo.getVersionTs());<NEW_LINE>dotConnect.addParam(cvInfo.getIdentifier());<NEW_LINE>dotConnect.addParam(cvInfo.getLang());<NEW_LINE>dotConnect.loadResult();<NEW_LINE>}<NEW_LINE>this.icache.removeContentletVersionInfoToCache(cvInfo.getIdentifier(), cvInfo.getLang());<NEW_LINE>} | addParam(cvInfo.isDeleted()); |
1,300,232 | public static void main(String[] args) throws IOException {<NEW_LINE>if (args.length < 4 || args.length > 5) {<NEW_LINE>System.err.println("Usage: " + ProhibitedCompoundRuleEvaluator.class.getSimpleName() + " <tokens> <langCode> <languageModelTopDir> <wikipediaXml|tatoebaFile|plainTextFile|dir>...");<NEW_LINE>System.err.println(" <tokens> is confusion set file with token/homophone pairs");<NEW_LINE>System.err.println(" <languageModelTopDir> is a directory with sub-directories like 'en' which then again contain '1grams',");<NEW_LINE>System.err.println(" '2grams', and '3grams' sub directories with Lucene indexes");<NEW_LINE>System.err.println(" See https://dev.languagetool.org/finding-errors-using-n-gram-data");<NEW_LINE>System.err.println(" <wikipediaXml|tatoebaFile|plainTextFile|dir> either a Wikipedia XML dump, or a Tatoeba file, or");<NEW_LINE>System.err.println(" a plain text file with one sentence per line, or a directory with");<NEW_LINE>System.err.println(" example sentences (where <word>.txt contains only the sentences for <word>).");<NEW_LINE>System.err.println(" You can specify both a Wikipedia file and a Tatoeba file.");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>String confusionSetFile = args[0];<NEW_LINE>String langCode = args[1];<NEW_LINE>Language lang = Languages.getLanguageForShortCode(langCode);<NEW_LINE>ConfusionSetLoader loader = new ConfusionSetLoader(lang);<NEW_LINE>Map<String, List<ConfusionPair>> confusionSet = loader.loadConfusionPairs(new FileInputStream(confusionSetFile));<NEW_LINE>LanguageModel languageModel = new LuceneLanguageModel(new File(args[2], lang.getShortCode()));<NEW_LINE>// LanguageModel languageModel = new BerkeleyRawLanguageModel(new File("/media/Data/berkeleylm/google_books_binaries/ger.blm.gz"));<NEW_LINE>// LanguageModel languageModel = new BerkeleyLanguageModel(new File("/media/Data/berkeleylm/google_books_binaries/ger.blm.gz"));<NEW_LINE>List<String> inputsFiles = new ArrayList<>();<NEW_LINE>inputsFiles<MASK><NEW_LINE>if (args.length >= 5) {<NEW_LINE>inputsFiles.add(args[4]);<NEW_LINE>}<NEW_LINE>ProhibitedCompoundRuleEvaluator generator = new ProhibitedCompoundRuleEvaluator(lang, languageModel);<NEW_LINE>for (List<ConfusionPair> entries : confusionSet.values()) {<NEW_LINE>for (ConfusionPair pair : entries) {<NEW_LINE>ConfusionString[] words = pair.getTerms().toArray(new ConfusionString[0]);<NEW_LINE>if (words.length < 2) {<NEW_LINE>throw new RuntimeException("Invalid confusion set entry: " + pair);<NEW_LINE>}<NEW_LINE>generator.run(inputsFiles, words[0].getString(), words[1].getString(), MAX_SENTENCES, EVAL_FACTORS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long endTime = System.currentTimeMillis();<NEW_LINE>System.out.println("\nTime: " + (endTime - startTime) + "ms");<NEW_LINE>} | .add(args[3]); |
242,519 | final GetEventStreamResult executeGetEventStream(GetEventStreamRequest getEventStreamRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getEventStreamRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetEventStreamRequest> request = null;<NEW_LINE>Response<GetEventStreamResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetEventStreamRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getEventStreamRequest));<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, "Pinpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetEventStream");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetEventStreamResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetEventStreamResultJsonUnmarshaller());<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); |
223,106 | public List<TableId> tables() {<NEW_LINE>awaitTablesReady(startupMs);<NEW_LINE>List<TableId> tablesSnapshot = tables.get();<NEW_LINE>if (tablesSnapshot == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Map<String, List<TableId>> duplicates = tablesSnapshot.stream().collect(Collectors.groupingBy(TableId::tableName)).entrySet().stream().filter(entry -> entry.getValue().size() > 1).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));<NEW_LINE>if (tablesSnapshot.isEmpty()) {<NEW_LINE>log.debug("Based on the supplied filtering rules, there are no matching tables to read from");<NEW_LINE>} else {<NEW_LINE>log.debug("Based on the supplied filtering rules, the tables available to read from include: {}", dialect.expressionBuilder().appendList().delimitedBy(",").of(tablesSnapshot));<NEW_LINE>}<NEW_LINE>if (!duplicates.isEmpty()) {<NEW_LINE>String configText;<NEW_LINE>if (whitelist != null) {<NEW_LINE>configText <MASK><NEW_LINE>} else if (blacklist != null) {<NEW_LINE>configText = "'" + JdbcSourceConnectorConfig.TABLE_BLACKLIST_CONFIG + "'";<NEW_LINE>} else {<NEW_LINE>configText = "'" + JdbcSourceConnectorConfig.TABLE_WHITELIST_CONFIG + "' or '" + JdbcSourceConnectorConfig.TABLE_BLACKLIST_CONFIG + "'";<NEW_LINE>}<NEW_LINE>String msg = "The connector uses the unqualified table name as the topic name and has " + "detected duplicate unqualified table names. This could lead to mixed data types in " + "the topic and downstream processing errors. To prevent such processing errors, the " + "JDBC Source connector fails to start when it detects duplicate table name " + "configurations. Update the connector's " + configText + " config to include exactly " + "one table in each of the tables listed below.\n\t";<NEW_LINE>RuntimeException exception = new ConnectException(msg + duplicates.values());<NEW_LINE>throw fail(exception);<NEW_LINE>}<NEW_LINE>return tablesSnapshot;<NEW_LINE>} | = "'" + JdbcSourceConnectorConfig.TABLE_WHITELIST_CONFIG + "'"; |
1,729,262 | final ListJobExecutionsForThingResult executeListJobExecutionsForThing(ListJobExecutionsForThingRequest listJobExecutionsForThingRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listJobExecutionsForThingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListJobExecutionsForThingRequest> request = null;<NEW_LINE>Response<ListJobExecutionsForThingResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListJobExecutionsForThingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listJobExecutionsForThingRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListJobExecutionsForThing");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListJobExecutionsForThingResult>> 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 ListJobExecutionsForThingResultJsonUnmarshaller()); |
666,968 | final ListShardsResult executeListShards(ListShardsRequest listShardsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listShardsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListShardsRequest> request = null;<NEW_LINE>Response<ListShardsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListShardsRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "Kinesis");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListShards");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListShardsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListShardsResultJsonUnmarshaller());<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>} | (super.beforeMarshalling(listShardsRequest)); |
864,229 | private void overrideHotkeySettings() {<NEW_LINE>for (DefaultHotkey hotkey : defaultHotkeys) {<NEW_LINE>// Check version of when the default hotkey was added<NEW_LINE>if (switchedFromVersionBefore(hotkey.version)) {<NEW_LINE>// Setting<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<List> setting = settings.getList("hotkeys");<NEW_LINE>Iterator<List> it = setting.iterator();<NEW_LINE>// Remove hotkey if already in setting<NEW_LINE>while (it.hasNext()) {<NEW_LINE>// Compare hotkey ids<NEW_LINE>if (it.next().get(0).equals(hotkey.data.get(0))) {<NEW_LINE>it.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add hotkey with default settings<NEW_LINE><MASK><NEW_LINE>LOGGER.info("Overriding hotkey setting: " + hotkey.data);<NEW_LINE>settings.putList("hotkeys", setting);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setting.add(hotkey.data); |
1,548,053 | public List<Contentlet> dbRelatedContentByParent(final String parentIdentifier, final String relationType, final boolean live, final String orderBy, final int limit, final int offset) throws DotDataException {<NEW_LINE>final StringBuilder query = new StringBuilder("select cont1.inode from contentlet cont1, inode ci1, tree tree1, " + "contentlet_version_info vi1 where tree1.parent = ? and tree1.relation_type = ? ").append("and tree1.child = cont1.identifier and cont1.inode = ci1.inode and vi1.identifier = cont1.identifier and " + (live ? "vi1.live_inode" : "vi1.working_inode")).append(" = cont1.inode");<NEW_LINE>if (UtilMethods.isSet(orderBy) && !(orderBy.trim().equals("sort_order") || orderBy.trim().equals("tree_order"))) {<NEW_LINE>query.append(" order by cont1.").append(orderBy);<NEW_LINE>} else {<NEW_LINE>query.append(" order by tree1.tree_order");<NEW_LINE>}<NEW_LINE>final DotConnect dc = new DotConnect();<NEW_LINE>dc.<MASK><NEW_LINE>dc.addParam(parentIdentifier);<NEW_LINE>dc.addParam(relationType);<NEW_LINE>if (limit > -1) {<NEW_LINE>dc.setMaxRows(limit);<NEW_LINE>}<NEW_LINE>if (offset > -1) {<NEW_LINE>dc.setStartRow(offset);<NEW_LINE>}<NEW_LINE>final List<Map<String, Object>> results = dc.loadObjectResults();<NEW_LINE>final List<Contentlet> contentlets = new ArrayList<Contentlet>();<NEW_LINE>for (final Map<String, Object> map : results) {<NEW_LINE>try {<NEW_LINE>contentlets.add(APILocator.getContentletAPI().find((String) map.get("inode"), APILocator.systemUser(), false));<NEW_LINE>} catch (DotSecurityException e) {<NEW_LINE>// Never Should throw DotSecurityException since is using systemUser but just in case<NEW_LINE>Logger.error(this, e.getMessage() + "inode: " + map.get("inode"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return contentlets;<NEW_LINE>} | setSQL(query.toString()); |
719,186 | static void saveSonicData(String sessionId, String eTag, String templateTag, String htmlSha1, long htmlSize, Map<String, List<String>> headers) {<NEW_LINE>if (SonicUtils.shouldLog(Log.INFO)) {<NEW_LINE>SonicUtils.log(TAG, Log.INFO, "saveSonicData sessionId = " + sessionId + ", eTag = " + eTag + ", templateTag = " + templateTag + ",htmlSha1 = " + htmlSha1 + ", htmlSize = " + htmlSize);<NEW_LINE>}<NEW_LINE>SonicDataHelper.SessionData sessionData = new SonicDataHelper.SessionData();<NEW_LINE>sessionData.sessionId = sessionId;<NEW_LINE>handleCacheControl(headers, sessionData);<NEW_LINE>sessionData.eTag = eTag;<NEW_LINE>sessionData.templateTag = templateTag;<NEW_LINE>sessionData.htmlSha1 = htmlSha1;<NEW_LINE>sessionData.htmlSize = htmlSize;<NEW_LINE>sessionData.templateUpdateTime = System.currentTimeMillis();<NEW_LINE><MASK><NEW_LINE>} | SonicDataHelper.saveSessionData(sessionId, sessionData); |
1,265,795 | public void render(PoseStack poseStack, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) {<NEW_LINE>// Draw dividing line<NEW_LINE>fill(poseStack, x - 3, (y + entryHeight) - 2, x + entryWidth, (y + entryHeight) - 1, 0x66BEBEBE);<NEW_LINE>Font font = Minecraft.getInstance().font;<NEW_LINE>// Draw header text<NEW_LINE>drawCenteredString(poseStack, font, text, x + (int) (entryWidth * 0.5), y + 5, 0xFFFFFF);<NEW_LINE>GuiUtil.bindIrisWidgetsTexture();<NEW_LINE>// Draw back button if present<NEW_LINE>if (this.backButton != null) {<NEW_LINE>backButton.render(poseStack, x, y, BUTTON_HEIGHT, mouseX, mouseY, tickDelta, hovered);<NEW_LINE>}<NEW_LINE>boolean shiftDown = Screen.hasShiftDown();<NEW_LINE>// Set the appearance of the reset button<NEW_LINE><MASK><NEW_LINE>this.resetButton.text = shiftDown ? RESET_BUTTON_TEXT_ACTIVE : RESET_BUTTON_TEXT_INACTIVE;<NEW_LINE>// Draw the utility buttons<NEW_LINE>this.utilityButtons.renderRightAligned(poseStack, (x + entryWidth) - 3, y, BUTTON_HEIGHT, mouseX, mouseY, tickDelta, hovered);<NEW_LINE>// Draw the reset button's tooltip<NEW_LINE>if (this.resetButton.isHovered()) {<NEW_LINE>Component tooltip = shiftDown ? RESET_TOOLTIP : RESET_HOLD_SHIFT_TOOLTIP;<NEW_LINE>queueBottomRightAnchoredTooltip(poseStack, mouseX, mouseY, font, tooltip);<NEW_LINE>}<NEW_LINE>// Draw the import/export button tooltips<NEW_LINE>if (this.importButton.isHovered()) {<NEW_LINE>queueBottomRightAnchoredTooltip(poseStack, mouseX, mouseY, font, IMPORT_TOOLTIP);<NEW_LINE>}<NEW_LINE>if (this.exportButton.isHovered()) {<NEW_LINE>queueBottomRightAnchoredTooltip(poseStack, mouseX, mouseY, font, EXPORT_TOOLTIP);<NEW_LINE>}<NEW_LINE>} | this.resetButton.disabled = !shiftDown; |
1,682,295 | public void onWorkerEvent(LifecycleEventsProto.WorkerStatusEvent workerEvent) {<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("onWorkerEvent " + workerEvent + " is error state " + WorkerState.isErrorState(workerEvent.getWorkerState()));<NEW_LINE>}<NEW_LINE>if (workerEvent.getHostName().isPresent() && WorkerState.isErrorState(workerEvent.getWorkerState())) {<NEW_LINE>String hostName = workerEvent.getHostName().get();<NEW_LINE>logger.info("Registering worker error on host {}", hostName);<NEW_LINE>HostErrors hostErrors = hostErrorMap.computeIfAbsent(hostName, (hName) -> new HostErrors(hName, slaveEnabler, this.error_check_window_millis, this.error_check_window_count));<NEW_LINE>if (hostErrors.addAndGetIsTooManyErrors(workerEvent)) {<NEW_LINE>logger.warn("Host {} has too many errors in a short duration, disabling..", hostName);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | this.slaveDisabler.call(hostName); |
878,896 | private JPanel initAsCross() {<NEW_LINE>setSize(side, side);<NEW_LINE>frameX = locx - (int) halfSide;<NEW_LINE>frameY = locy - (int) halfSide;<NEW_LINE>JPanel panel = new JPanel() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void paintComponent(Graphics g) {<NEW_LINE>if (g instanceof Graphics2D) {<NEW_LINE>int side = getWidth();<NEW_LINE>Point2D.Float center = new Point2D.Float(halfSide, halfSide);<NEW_LINE>Color redFull = new Color(255, 0, 0, 150);<NEW_LINE>Color redTrans = new Color(255, 0, 0, 0);<NEW_LINE>float radius = halfSide;<NEW_LINE>float[] dist = { 0.0f, 1.0f };<NEW_LINE>Color[] colorsRed = { redFull, redTrans };<NEW_LINE>Color[] colorsBlack = { Color.BLACK, Color.WHITE };<NEW_LINE>Graphics2D g2d = (Graphics2D) g;<NEW_LINE>g2d.setPaint(new RadialGradientPaint(center<MASK><NEW_LINE>g2d.fillRect(0, 0, side, side);<NEW_LINE>g2d.setPaint(new RadialGradientPaint(center, radius, dist, colorsBlack));<NEW_LINE>g2d.fillRect((int) halfSide - 1, 0, 2, side);<NEW_LINE>g2d.fillRect(0, (int) halfSide - 1, side, 2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return panel;<NEW_LINE>} | , radius, dist, colorsRed)); |
1,704,804 | public void marshall(PhoneNumberInformation phoneNumberInformation, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (phoneNumberInformation == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getPhoneNumberArn(), PHONENUMBERARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getPhoneNumberId(), PHONENUMBERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getPhoneNumber(), PHONENUMBER_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getIsoCountryCode(), ISOCOUNTRYCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getMessageType(), MESSAGETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getNumberCapabilities(), NUMBERCAPABILITIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getNumberType(), NUMBERTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getMonthlyLeasingPrice(), MONTHLYLEASINGPRICE_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getTwoWayEnabled(), TWOWAYENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getSelfManagedOptOutsEnabled(), SELFMANAGEDOPTOUTSENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getOptOutListName(), OPTOUTLISTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getDeletionProtectionEnabled(), DELETIONPROTECTIONENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getPoolId(), POOLID_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getCreatedTimestamp(), CREATEDTIMESTAMP_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | phoneNumberInformation.getTwoWayChannelArn(), TWOWAYCHANNELARN_BINDING); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.