idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,063,266 | public Mono<Void> writeTo(ClientHttpRequest request, ExchangeStrategies strategies) {<NEW_LINE>HttpHeaders requestHeaders = request.getHeaders();<NEW_LINE>if (!this.headers.isEmpty()) {<NEW_LINE>this.headers.entrySet().stream().filter(entry -> !requestHeaders.containsKey(entry.getKey())).forEach(entry -> requestHeaders.put(entry.getKey(), entry.getValue()));<NEW_LINE>}<NEW_LINE>MultiValueMap<String, HttpCookie> requestCookies = request.getCookies();<NEW_LINE>if (!this.cookies.isEmpty()) {<NEW_LINE>this.cookies.forEach((name, values) -> values.forEach(value -> {<NEW_LINE>HttpCookie cookie = new HttpCookie(name, value);<NEW_LINE>requestCookies.add(name, cookie);<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>if (this.httpRequestConsumer != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return this.body.insert(request, new BodyInserter.Context() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public List<HttpMessageWriter<?>> messageWriters() {<NEW_LINE>return strategies.messageWriters();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Optional<ServerHttpRequest> serverRequest() {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Map<String, Object> hints() {<NEW_LINE>return Hints.from(Hints.LOG_PREFIX_HINT, logPrefix());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | this.httpRequestConsumer.accept(request); |
1,423,221 | IKeyframes<Double, Vector3[]> parseNormalKeyframes(@NotNull String DEF) throws XPathExpressionException {<NEW_LINE>Node tag;<NEW_LINE>Node node;<NEW_LINE>NodeList nodes;<NEW_LINE>XPathExpression expr;<NEW_LINE>XPath xpath = xPathfactory.newXPath();<NEW_LINE>Element scene = (Element) mDoc.getDocumentElement().getElementsByTagName("Scene").item(0);<NEW_LINE>expr = xpath.compile("//NormalInterpolator[@DEF=\"" + DEF + "\"]");<NEW_LINE>nodes = (NodeList) expr.evaluate(scene, XPathConstants.NODESET);<NEW_LINE>node = nodes.item(0);<NEW_LINE>Keyframes3D keyframes = new Keyframes3D();<NEW_LINE>tag = node.getAttributes().getNamedItem("key");<NEW_LINE>String[] keys = tag.getNodeValue().split("\\s+");<NEW_LINE>tag = node.getAttributes().getNamedItem("keyValue");<NEW_LINE>String[] values = tag.getNodeValue().split("\\s+");<NEW_LINE>if (keys.length < 1)<NEW_LINE>return null;<NEW_LINE>if (values.length < keys.length)<NEW_LINE>return null;<NEW_LINE>for (int i = 0; i < keys.length; i++) {<NEW_LINE>int framelength = values.length / keys.length;<NEW_LINE>double k = Double.parseDouble(keys[i]);<NEW_LINE>Vector3[] v = new Vector3[framelength / 3];<NEW_LINE>for (int j = 0; j < v.length; j++) {<NEW_LINE>int offset <MASK><NEW_LINE>double x = Double.parseDouble(values[offset + 0]);<NEW_LINE>double y = Double.parseDouble(values[offset + 1]);<NEW_LINE>double z = Double.parseDouble(values[offset + 2]);<NEW_LINE>v[j] = new Vector3(x, y, z);<NEW_LINE>}<NEW_LINE>keyframes.addPoint(k, v);<NEW_LINE>}<NEW_LINE>return keyframes;<NEW_LINE>} | = i * framelength + j * 3; |
600,672 | public S3Location unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>S3Location s3Location = new S3Location();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Bucket", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>s3Location.setBucket(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Key", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>s3Location.setKey(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("BucketOwner", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>s3Location.setBucketOwner(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return s3Location;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,707,472 | public void handle(ResteasyReactiveRequestContext requestContext) throws Exception {<NEW_LINE>ServerHttpResponse response = requestContext.serverResponse();<NEW_LINE>String contentEncoding = response.getResponseHeader(HttpHeaders.CONTENT_ENCODING);<NEW_LINE>if (contentEncoding != null && io.vertx.core.http.HttpHeaders.IDENTITY.toString().equals(contentEncoding)) {<NEW_LINE>switch(compression) {<NEW_LINE>case ON:<NEW_LINE>response.removeResponseHeader(HttpHeaders.CONTENT_ENCODING);<NEW_LINE>break;<NEW_LINE>case UNDEFINED:<NEW_LINE>EncodedMediaType responseContentType = requestContext.getResponseContentType();<NEW_LINE>if ((responseContentType == null) && (produces != null)) {<NEW_LINE>if (encodedProduces == null) {<NEW_LINE>synchronized (this) {<NEW_LINE>if (encodedProduces == null) {<NEW_LINE>encodedProduces = new EncodedMediaType<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>responseContentType = encodedProduces;<NEW_LINE>}<NEW_LINE>if (responseContentType != null) {<NEW_LINE>MediaType contentType = responseContentType.getMediaType();<NEW_LINE>if (contentType != null && compressMediaTypes.contains(contentType.getType() + '/' + contentType.getSubtype())) {<NEW_LINE>response.removeResponseHeader(HttpHeaders.CONTENT_ENCODING);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// OFF - no action is needed because the "Content-Encoding: identity" header is set<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (MediaType.valueOf(produces)); |
1,618,263 | // internal async trace.<NEW_LINE>@Override<NEW_LINE>public Trace continueAsyncContextTraceObject(TraceRoot traceRoot, LocalAsyncId localAsyncId, boolean canSampled) {<NEW_LINE>if (canSampled) {<NEW_LINE>final SpanChunkFactory spanChunkFactory = new AsyncSpanChunkFactory(traceRoot, localAsyncId);<NEW_LINE>final Storage storage = storageFactory.createStorage(spanChunkFactory);<NEW_LINE>final CallStack<SpanEvent<MASK><NEW_LINE>final boolean samplingEnable = true;<NEW_LINE>final SpanRecorder spanRecorder = recorderFactory.newTraceRootSpanRecorder(traceRoot, samplingEnable);<NEW_LINE>final WrappedSpanEventRecorder wrappedSpanEventRecorder = recorderFactory.newWrappedSpanEventRecorder(traceRoot);<NEW_LINE>final Trace asyncTrace = new AsyncChildTrace(traceRoot, callStack, storage, samplingEnable, spanRecorder, wrappedSpanEventRecorder, localAsyncId);<NEW_LINE>return asyncTrace;<NEW_LINE>} else {<NEW_LINE>return new DisableAsyncChildTrace(traceRoot, localAsyncId);<NEW_LINE>}<NEW_LINE>} | > callStack = callStackFactory.newCallStack(); |
1,545,290 | public static QueryAuthResponse unmarshall(QueryAuthResponse queryAuthResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryAuthResponse.setRequestId<MASK><NEW_LINE>queryAuthResponse.setCode(_ctx.integerValue("QueryAuthResponse.Code"));<NEW_LINE>queryAuthResponse.setSuccess(_ctx.booleanValue("QueryAuthResponse.Success"));<NEW_LINE>queryAuthResponse.setMessage(_ctx.stringValue("QueryAuthResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setInstanceId(_ctx.stringValue("QueryAuthResponse.Data.InstanceId"));<NEW_LINE>data.setProductCode(_ctx.stringValue("QueryAuthResponse.Data.ProductCode"));<NEW_LINE>List<InfoDTOListItem> infoDTOList = new ArrayList<InfoDTOListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryAuthResponse.Data.InfoDTOList.Length"); i++) {<NEW_LINE>InfoDTOListItem infoDTOListItem = new InfoDTOListItem();<NEW_LINE>infoDTOListItem.setItemName(_ctx.stringValue("QueryAuthResponse.Data.InfoDTOList[" + i + "].ItemName"));<NEW_LINE>infoDTOListItem.setItemRecordVid(_ctx.stringValue("QueryAuthResponse.Data.InfoDTOList[" + i + "].ItemRecordVid"));<NEW_LINE>infoDTOListItem.setAuthOrderVid(_ctx.stringValue("QueryAuthResponse.Data.InfoDTOList[" + i + "].AuthOrderVid"));<NEW_LINE>infoDTOListItem.setOperateCode(_ctx.stringValue("QueryAuthResponse.Data.InfoDTOList[" + i + "].OperateCode"));<NEW_LINE>infoDTOList.add(infoDTOListItem);<NEW_LINE>}<NEW_LINE>data.setInfoDTOList(infoDTOList);<NEW_LINE>queryAuthResponse.setData(data);<NEW_LINE>return queryAuthResponse;<NEW_LINE>} | (_ctx.stringValue("QueryAuthResponse.RequestId")); |
87,980 | final DeleteWorkflowResult executeDeleteWorkflow(DeleteWorkflowRequest deleteWorkflowRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteWorkflowRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteWorkflowRequest> request = null;<NEW_LINE>Response<DeleteWorkflowResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteWorkflowRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteWorkflowRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Customer Profiles");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteWorkflow");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteWorkflowResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteWorkflowResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
550,240 | public void onCraftMatrixChanged() {<NEW_LINE>if (contentHolder.getBlueprintWorld().isClientSide)<NEW_LINE>return;<NEW_LINE>ServerPlayer serverplayerentity = (ServerPlayer) player;<NEW_LINE>CraftingContainer craftingInventory = new BlueprintCraftingInventory(this, ghostInventory);<NEW_LINE>Optional<CraftingRecipe> optional = player.getServer().getRecipeManager().getRecipeFor(RecipeType.CRAFTING, craftingInventory, player.getCommandSenderWorld());<NEW_LINE>if (!optional.isPresent()) {<NEW_LINE>if (ghostInventory.getStackInSlot(9).isEmpty())<NEW_LINE>return;<NEW_LINE>if (!contentHolder.inferredIcon)<NEW_LINE>return;<NEW_LINE>ghostInventory.setStackInSlot(9, ItemStack.EMPTY);<NEW_LINE>serverplayerentity.connection.send(new ClientboundContainerSetSlotPacket(containerId, incrementStateId(), 36 + 9, ItemStack.EMPTY));<NEW_LINE>contentHolder.inferredIcon = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CraftingRecipe icraftingrecipe = optional.get();<NEW_LINE>ItemStack itemstack = icraftingrecipe.assemble(craftingInventory);<NEW_LINE>ghostInventory.setStackInSlot(9, itemstack);<NEW_LINE>contentHolder.inferredIcon = true;<NEW_LINE><MASK><NEW_LINE>toSend.getOrCreateTag().putBoolean("InferredFromRecipe", true);<NEW_LINE>serverplayerentity.connection.send(new ClientboundContainerSetSlotPacket(containerId, incrementStateId(), 36 + 9, toSend));<NEW_LINE>} | ItemStack toSend = itemstack.copy(); |
364,382 | protected void executeParse(BpmnParse bpmnParse, StartEvent element) {<NEW_LINE>if (element.getSubProcess() != null && element.getSubProcess() instanceof EventSubProcess) {<NEW_LINE>if (CollectionUtil.isNotEmpty(element.getEventDefinitions())) {<NEW_LINE>EventDefinition eventDefinition = element.getEventDefinitions().get(0);<NEW_LINE>if (eventDefinition instanceof MessageEventDefinition) {<NEW_LINE>MessageEventDefinition messageDefinition = (MessageEventDefinition) eventDefinition;<NEW_LINE>BpmnModel bpmnModel = bpmnParse.getBpmnModel();<NEW_LINE>String messageRef = messageDefinition.getMessageRef();<NEW_LINE>if (bpmnModel.containsMessageId(messageRef)) {<NEW_LINE>Message message = bpmnModel.getMessage(messageRef);<NEW_LINE>messageDefinition.setMessageRef(message.getName());<NEW_LINE>messageDefinition.setExtensionElements(message.getExtensionElements());<NEW_LINE>}<NEW_LINE>element.setBehavior(bpmnParse.getActivityBehaviorFactory().createEventSubProcessMessageStartEventActivityBehavior(element, messageDefinition));<NEW_LINE>} else if (eventDefinition instanceof ErrorEventDefinition) {<NEW_LINE>element.setBehavior(bpmnParse.getActivityBehaviorFactory<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (CollectionUtil.isEmpty(element.getEventDefinitions())) {<NEW_LINE>element.setBehavior(bpmnParse.getActivityBehaviorFactory().createNoneStartEventActivityBehavior(element));<NEW_LINE>}<NEW_LINE>if (element.getSubProcess() == null && (CollectionUtil.isEmpty(element.getEventDefinitions()) || bpmnParse.getCurrentProcess().getInitialFlowElement() == null)) {<NEW_LINE>bpmnParse.getCurrentProcess().setInitialFlowElement(element);<NEW_LINE>}<NEW_LINE>checkStartFormKey(bpmnParse.getCurrentProcessDefinition(), element);<NEW_LINE>} | ().createEventSubProcessErrorStartEventActivityBehavior(element)); |
1,576,246 | protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {<NEW_LINE>// parse attributes (but replace the value assignment with references)<NEW_LINE>NamedNodeMap attributes = element.getAttributes();<NEW_LINE>for (int x = 0; x < attributes.getLength(); x++) {<NEW_LINE>Attr attribute = (<MASK><NEW_LINE>if (isEligibleAttribute(attribute, parserContext)) {<NEW_LINE>String propertyName = extractPropertyName(attribute.getLocalName());<NEW_LINE>Assert.state(StringUtils.hasText(propertyName), "Illegal property name returned from 'extractPropertyName(String)': cannot be null or empty.");<NEW_LINE>builder.addPropertyReference(propertyName, attribute.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String phase = element.getAttribute("phase");<NEW_LINE>if (StringUtils.hasText(phase)) {<NEW_LINE>builder.addPropertyValue("phase", phase);<NEW_LINE>}<NEW_LINE>postProcess(builder, element);<NEW_LINE>// parse nested listeners<NEW_LINE>List<Element> listDefs = DomUtils.getChildElementsByTagName(element, "listener");<NEW_LINE>if (!listDefs.isEmpty()) {<NEW_LINE>ManagedMap<BeanDefinition, Collection<? extends BeanDefinition>> listeners = new ManagedMap<>(listDefs.size());<NEW_LINE>for (Element listElement : listDefs) {<NEW_LINE>Object[] listenerDefinition = parseListener(listElement);<NEW_LINE>listeners.put((BeanDefinition) listenerDefinition[0], (Collection<? extends BeanDefinition>) listenerDefinition[1]);<NEW_LINE>}<NEW_LINE>builder.addPropertyValue("messageListeners", listeners);<NEW_LINE>}<NEW_LINE>} | Attr) attributes.item(x); |
1,145,101 | public void saveScreenshot() {<NEW_LINE>// Since ScreenGrabber is initialized before DisplayResolutionDependentFbo (because the latter contains a reference to the former)<NEW_LINE>// on first call on saveScreenshot() displayResolutionDependentFBOs will be null.<NEW_LINE>if (displayResolutionDependentFBOs == null) {<NEW_LINE>displayResolutionDependentFBOs = <MASK><NEW_LINE>}<NEW_LINE>FBO sceneFinalFbo = displayResolutionDependentFBOs.get(DisplayResolutionDependentFbo.FINAL_BUFFER);<NEW_LINE>final ByteBuffer buffer = sceneFinalFbo.getColorBufferRawData();<NEW_LINE>if (buffer == null) {<NEW_LINE>logger.error("No screenshot data available. No screenshot will be saved.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int width = sceneFinalFbo.width();<NEW_LINE>int height = sceneFinalFbo.height();<NEW_LINE>Runnable task;<NEW_LINE>if (savingGamePreview) {<NEW_LINE>task = () -> saveGamePreviewTask(buffer, width, height);<NEW_LINE>this.savingGamePreview = false;<NEW_LINE>} else {<NEW_LINE>task = () -> saveScreenshotTask(buffer, width, height);<NEW_LINE>}<NEW_LINE>GameScheduler.scheduleParallel("Write screenshot", task);<NEW_LINE>isTakingScreenshot = false;<NEW_LINE>} | CoreRegistry.get(DisplayResolutionDependentFbo.class); |
145,222 | private Iterable<CacheEntryEvent<? extends K, ? extends V>> createCacheEntryEvent(Collection<CacheEventData> keys) {<NEW_LINE>HashSet<CacheEntryEvent<? extends K, ? extends V>> evt = new HashSet<CacheEntryEvent<? extends K, ? extends V>>();<NEW_LINE>for (CacheEventData cacheEventData : keys) {<NEW_LINE>EventType eventType = CacheEventType.convertToEventType(cacheEventData.getCacheEventType());<NEW_LINE>K key = <MASK><NEW_LINE>boolean hasNewValue = !(eventType == EventType.REMOVED || eventType == EventType.EXPIRED);<NEW_LINE>final V newValue;<NEW_LINE>final V oldValue;<NEW_LINE>if (isOldValueRequired) {<NEW_LINE>if (hasNewValue) {<NEW_LINE>newValue = toObject(cacheEventData.getDataValue());<NEW_LINE>oldValue = toObject(cacheEventData.getDataOldValue());<NEW_LINE>} else {<NEW_LINE>// according to contract of CacheEntryEvent#getValue<NEW_LINE>oldValue = toObject(cacheEventData.getDataValue());<NEW_LINE>newValue = oldValue;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (hasNewValue) {<NEW_LINE>newValue = toObject(cacheEventData.getDataValue());<NEW_LINE>oldValue = null;<NEW_LINE>} else {<NEW_LINE>newValue = null;<NEW_LINE>oldValue = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final CacheEntryEventImpl<K, V> event = new CacheEntryEventImpl<K, V>(source, eventType, key, newValue, oldValue);<NEW_LINE>if (filter == null || filter.evaluate(event)) {<NEW_LINE>evt.add(event);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return evt;<NEW_LINE>} | toObject(cacheEventData.getDataKey()); |
1,843,368 | private void drawOneHexa(UGraphic ug, String colorName, int i, int j, UPolygon hexa) {<NEW_LINE>final HColorSimple color = (<MASK><NEW_LINE>ug = applyColor(ug, color);<NEW_LINE>ug = ug.apply(new UTranslate(centerHexa(i, j)));<NEW_LINE>ug.draw(hexa);<NEW_LINE>final UFont font = UFont.sansSerif(14).bold();<NEW_LINE>TextBlock tt = getTextName(font, colorName, color);<NEW_LINE>Dimension2D dimText = tt.calculateDimension(ug.getStringBounder());<NEW_LINE>if (dimText.getWidth() > getWidth()) {<NEW_LINE>tt = getTextName(font, findShortest(ug.getStringBounder(), font, colorName), color);<NEW_LINE>dimText = tt.calculateDimension(ug.getStringBounder());<NEW_LINE>}<NEW_LINE>tt.drawU(ug.apply(new UTranslate(-dimText.getWidth() / 2, -dimText.getHeight() / 2)));<NEW_LINE>} | HColorSimple) colors.getColorOrWhite(colorName); |
300,953 | public DateList transform(DateList dates) {<NEW_LINE>if (dayList.isEmpty()) {<NEW_LINE>return dates;<NEW_LINE>}<NEW_LINE>final DateList weekDayDates = Dates.getDateListInstance(dates);<NEW_LINE>Function<Date, List<Date>> transformer = null;<NEW_LINE>switch(getFrequency()) {<NEW_LINE>case WEEKLY:<NEW_LINE>transformer = new WeeklyExpansionFilter(dates.getType());<NEW_LINE>break;<NEW_LINE>case MONTHLY:<NEW_LINE>transformer = new <MASK><NEW_LINE>break;<NEW_LINE>case YEARLY:<NEW_LINE>transformer = new YearlyExpansionFilter(dates.getType());<NEW_LINE>break;<NEW_LINE>case DAILY:<NEW_LINE>default:<NEW_LINE>transformer = new LimitFilter();<NEW_LINE>}<NEW_LINE>for (final Date date : dates) {<NEW_LINE>List<Date> transformed = transformer.apply(date);<NEW_LINE>// filter by offset<NEW_LINE>List<Date> filtered = new ArrayList<>();<NEW_LINE>dayList.forEach(day -> filtered.addAll(getOffsetDates(transformed.stream().filter(d -> getCalendarInstance(d, true).get(Calendar.DAY_OF_WEEK) == WeekDay.getCalendarDay(day)).collect(Collectors.toCollection(() -> Dates.getDateListInstance(weekDayDates))), day.getOffset())));<NEW_LINE>weekDayDates.addAll(filtered);<NEW_LINE>}<NEW_LINE>return weekDayDates;<NEW_LINE>} | MonthlyExpansionFilter(dates.getType()); |
1,800,140 | protected void validateValue(FacesContext context, Object value) {<NEW_LINE><MASK><NEW_LINE>String match = getMatch();<NEW_LINE>Object submittedValue = getSubmittedValue();<NEW_LINE>if (isValid() && LangUtils.isNotBlank(match)) {<NEW_LINE>Password matchWith = (Password) SearchExpressionFacade.resolveComponent(context, this, match);<NEW_LINE>if (submittedValue != null && !submittedValue.equals(matchWith.getSubmittedValue())) {<NEW_LINE>setValid(false);<NEW_LINE>matchWith.setValid(false);<NEW_LINE>String validatorMessage = getValidatorMessage();<NEW_LINE>FacesMessage msg = null;<NEW_LINE>if (validatorMessage != null) {<NEW_LINE>msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, validatorMessage, validatorMessage);<NEW_LINE>} else {<NEW_LINE>Object[] params = new Object[2];<NEW_LINE>params[0] = ComponentUtils.getLabel(context, this);<NEW_LINE>params[1] = ComponentUtils.getLabel(context, matchWith);<NEW_LINE>msg = MessageFactory.getFacesMessage(Password.INVALID_MATCH_KEY, FacesMessage.SEVERITY_ERROR, params);<NEW_LINE>}<NEW_LINE>context.addMessage(getClientId(context), msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | super.validateValue(context, value); |
1,788,346 | public MethodDeclaration createGetter(TypeDeclaration parent, EclipseNode fieldNode, String name, int modifier, ASTNode source, boolean lazy, List<Annotation> onMethod) {<NEW_LINE>// Remember the type; lazy will change it;<NEW_LINE>TypeReference returnType = copyType(((FieldDeclaration) fieldNode.get<MASK><NEW_LINE>Statement[] statements;<NEW_LINE>boolean addSuppressWarningsUnchecked = false;<NEW_LINE>if (lazy) {<NEW_LINE>statements = createLazyGetterBody(source, fieldNode);<NEW_LINE>addSuppressWarningsUnchecked = true;<NEW_LINE>} else {<NEW_LINE>statements = createSimpleGetterBody(source, fieldNode);<NEW_LINE>}<NEW_LINE>AnnotationValues<Accessors> accessors = getAccessorsForField(fieldNode);<NEW_LINE>MethodDeclaration method = new MethodDeclaration(parent.compilationResult);<NEW_LINE>if (shouldMakeFinal(fieldNode, accessors))<NEW_LINE>modifier |= ClassFileConstants.AccFinal;<NEW_LINE>method.modifiers = modifier;<NEW_LINE>method.returnType = returnType;<NEW_LINE>method.annotations = null;<NEW_LINE>method.arguments = null;<NEW_LINE>method.selector = name.toCharArray();<NEW_LINE>method.binding = null;<NEW_LINE>method.thrownExceptions = null;<NEW_LINE>method.typeParameters = null;<NEW_LINE>method.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG;<NEW_LINE>method.bodyStart = method.declarationSourceStart = method.sourceStart = source.sourceStart;<NEW_LINE>method.bodyEnd = method.declarationSourceEnd = method.sourceEnd = source.sourceEnd;<NEW_LINE>method.statements = statements;<NEW_LINE>EclipseHandlerUtil.registerCreatedLazyGetter((FieldDeclaration) fieldNode.get(), method.selector, returnType); | ()).type, source); |
32,935 | // @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })<NEW_LINE>@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })<NEW_LINE>public Response update(@HeaderParam(Constants.SESSION_TOKEN_HEADER_NAME) String sessionToken, @PathParam("entityClass") String entityClassName, String input, @Context HttpHeaders headers) {<NEW_LINE>sessionToken = sessionToken.replaceAll("^\"|\"$", "");<NEW_LINE>input = input.replaceAll("^\"|\"$", "");<NEW_LINE>log.debug("PUT: sessionToken:" + sessionToken);<NEW_LINE>log.debug("PUT: entityClassName:" + entityClassName);<NEW_LINE>String mediaType = headers != null && headers.getRequestHeaders().containsKey("Content-type") ? headers.getRequestHeader("Content-type").get(0) : MediaType.APPLICATION_JSON;<NEW_LINE>mediaType = mediaType.equalsIgnoreCase(MediaType.APPLICATION_XML) ? MediaType.APPLICATION_XML : MediaType.APPLICATION_JSON;<NEW_LINE>log.debug("POST: Media Type:" + mediaType);<NEW_LINE>Object output;<NEW_LINE>Class<?> entityClass;<NEW_LINE>Object entity;<NEW_LINE>EntityMetadata entityMetadata = null;<NEW_LINE>try {<NEW_LINE>EntityManager em = EMRepository.INSTANCE.getEM(sessionToken);<NEW_LINE>entityClass = EntityUtils.getEntityClass(entityClassName, em);<NEW_LINE>log.debug("PUT: entityClass: " + entityClass);<NEW_LINE>entityMetadata = EntityUtils.getEntityMetaData(entityClass.getSimpleName(), em);<NEW_LINE>entity = JAXBUtils.<MASK><NEW_LINE>output = em.merge(entity);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error(e.getMessage());<NEW_LINE>return Response.serverError().build();<NEW_LINE>}<NEW_LINE>if (output == null) {<NEW_LINE>return Response.notModified().build();<NEW_LINE>}<NEW_LINE>output = JAXBUtils.toString(output, mediaType);<NEW_LINE>if (mediaType.equalsIgnoreCase(MediaType.APPLICATION_JSON)) {<NEW_LINE>return Response.ok(ResponseBuilder.buildOutput(entityClass, entityMetadata, output), mediaType).build();<NEW_LINE>} else {<NEW_LINE>return Response.ok(output.toString(), mediaType).build();<NEW_LINE>}<NEW_LINE>} | toObject(input, entityClass, mediaType); |
86,649 | public void handleEvent(Event event) {<NEW_LINE>Shell shell = (Shell) event.widget;<NEW_LINE>if (shell.getData(SHELL_METRICS_DISABLED_KEY) != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>currentState = calcState(shell);<NEW_LINE>if (event.type != SWT.Dispose && currentState == SWT.NONE) {<NEW_LINE>currentBounds = shell.getBounds();<NEW_LINE>if (currentBounds == null) {<NEW_LINE>currentBounds = new Rectangle(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean changed = false;<NEW_LINE>if (currentState != savedState) {<NEW_LINE>COConfigurationManager.setParameter(sConfigPrefix + ".maximized", currentState == SWT.MAX);<NEW_LINE>savedState = currentState;<NEW_LINE>changed = true;<NEW_LINE>}<NEW_LINE>if (!currentBounds.equals(savedBounds)) {<NEW_LINE>if (currentBounds.width > 0 && currentBounds.height > 0) {<NEW_LINE>COConfigurationManager.setParameter(sConfigPrefix + ".rectangle", currentBounds.x + "," + currentBounds.y + "," + currentBounds.width + "," + currentBounds.height);<NEW_LINE>savedBounds = currentBounds;<NEW_LINE>changed = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (changed) {<NEW_LINE>COConfigurationManager.setDirty();<NEW_LINE>}<NEW_LINE>} | 0, 0, 0, 0); |
721,987 | int[] prune(int[] idx) {<NEW_LINE>IntVector words = new IntVector();<NEW_LINE>IntVector ngrams = new IntVector();<NEW_LINE>for (int i : idx) {<NEW_LINE>if (i < nwords_) {<NEW_LINE>words.add(i);<NEW_LINE>} else {<NEW_LINE>ngrams.add(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>words.sort();<NEW_LINE>IntVector newIndexes = new <MASK><NEW_LINE>if (ngrams.size() > 0) {<NEW_LINE>int j = 0;<NEW_LINE>for (int k = 0; k < ngrams.size(); k++) {<NEW_LINE>int ngram = ngrams.get(k);<NEW_LINE>pruneidx_.put(ngram - nwords_, j);<NEW_LINE>j++;<NEW_LINE>}<NEW_LINE>newIndexes.addAll(ngrams);<NEW_LINE>}<NEW_LINE>pruneidx_size_ = pruneidx_.size();<NEW_LINE>Arrays.fill(word2int_, -1);<NEW_LINE>int j = 0;<NEW_LINE>for (int i = 0; i < words_.size(); i++) {<NEW_LINE>if (getType(i) == TYPE_LABEL || (j < words.size() && words.get(j) == i)) {<NEW_LINE>words_.set(j, words_.get(i));<NEW_LINE>word2int_[find(words_.get(j).word)] = j;<NEW_LINE>j++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>nwords_ = words.size();<NEW_LINE>size_ = nwords_ + nlabels_;<NEW_LINE>words_ = new ArrayList<>(words_.subList(0, size_));<NEW_LINE>initNgrams();<NEW_LINE>return newIndexes.copyOf();<NEW_LINE>} | IntVector(words.copyOf()); |
1,232,070 | protected Face[] quadToTriangle(Face f) {<NEW_LINE>assert f.verticies.length == 4;<NEW_LINE>Face[] t = new Face[] { new Face(), new Face() };<NEW_LINE>t[0].verticies = new Vertex[3];<NEW_LINE>t[1].verticies = new Vertex[3];<NEW_LINE>Vertex v0 = f.verticies[0];<NEW_LINE>Vertex v1 = f.verticies[1];<NEW_LINE>Vertex v2 = f.verticies[2];<NEW_LINE>Vertex v3 = f.verticies[3];<NEW_LINE>// find the pair of vertices that is closest to each over<NEW_LINE>// v0 and v2<NEW_LINE>// OR<NEW_LINE>// v1 and v3<NEW_LINE>float d1 = v0.v.distanceSquared(v2.v);<NEW_LINE>float d2 = v1.v.distanceSquared(v3.v);<NEW_LINE>if (d1 < d2) {<NEW_LINE>// put an edge in v0, v2<NEW_LINE>t[0].verticies[0] = v0;<NEW_LINE>t[0].verticies[1] = v1;<NEW_LINE>t[0].verticies[2] = v3;<NEW_LINE>t[1].verticies[0] = v1;<NEW_LINE>t[1].verticies[1] = v2;<NEW_LINE>t[1].verticies[2] = v3;<NEW_LINE>} else {<NEW_LINE>// put an edge in v1, v3<NEW_LINE>t[0].verticies[0] = v0;<NEW_LINE>t[0].verticies[1] = v1;<NEW_LINE>t[0<MASK><NEW_LINE>t[1].verticies[0] = v0;<NEW_LINE>t[1].verticies[1] = v2;<NEW_LINE>t[1].verticies[2] = v3;<NEW_LINE>}<NEW_LINE>return t;<NEW_LINE>} | ].verticies[2] = v2; |
1,710,791 | public static Triple<Double, Double, Double> printResults(Counter<String> entityTP, Counter<String> entityFP, Counter<String> entityFN) {<NEW_LINE>Set<String> entities = new TreeSet<>();<NEW_LINE>entities.addAll(entityTP.keySet());<NEW_LINE>entities.addAll(entityFP.keySet());<NEW_LINE>entities.addAll(entityFN.keySet());<NEW_LINE>log.info(" Entity\tP\tR\tF1\tTP\tFP\tFN");<NEW_LINE>for (String entity : entities) {<NEW_LINE>double tp = entityTP.getCount(entity);<NEW_LINE>double fp = entityFP.getCount(entity);<NEW_LINE>double fn = entityFN.getCount(entity);<NEW_LINE>printPRLine(entity, tp, fp, fn);<NEW_LINE>}<NEW_LINE>double tp = entityTP.totalCount();<NEW_LINE><MASK><NEW_LINE>double fn = entityFN.totalCount();<NEW_LINE>return printPRLine("Totals", tp, fp, fn);<NEW_LINE>} | double fp = entityFP.totalCount(); |
772,456 | public void project(double camX, double camY, double camZ, Point2D_F64 output) {<NEW_LINE>// angle between incoming ray and principle axis<NEW_LINE>// Principle Axis = (0,0,z)<NEW_LINE>// Incoming Ray = (x,y,z)<NEW_LINE>// uses dot product<NEW_LINE>double theta = Math.acos(camZ / UtilPoint3D_F64.norm(camX, camY, camZ));<NEW_LINE>// compute symmetric projection function<NEW_LINE>double r = polynomial(model.symmetric, theta);<NEW_LINE>// angle on the image plane of the incoming ray<NEW_LINE>double phi = Math.atan2(camY, camX);<NEW_LINE>// u_r[0] or u_phi[1]<NEW_LINE>double cosphi = Math.cos(phi);<NEW_LINE>// u_r[1] or -u_phi[0]<NEW_LINE>double sinphi = Math.sin(phi);<NEW_LINE>// distorted (normalized) coordinates<NEW_LINE>double distX, distY;<NEW_LINE>if (isAsymmetric) {<NEW_LINE>// distortion terms. radial and tangential<NEW_LINE>double disRad = polynomial(model.radial, theta) * polytrig(model.radialTrig, cosphi, sinphi);<NEW_LINE>double disTan = polynomial(model.tangent, theta) * polytrig(model.tangentTrig, cosphi, sinphi);<NEW_LINE>// put it all together to get normalized image coordinates<NEW_LINE>distX = (r + <MASK><NEW_LINE>distY = (r + disRad) * sinphi + disTan * cosphi;<NEW_LINE>} else {<NEW_LINE>distX = r * cosphi;<NEW_LINE>distY = r * sinphi;<NEW_LINE>}<NEW_LINE>// project into pixels<NEW_LINE>double skew = zeroSkew ? 0.0 : model.skew;<NEW_LINE>output.x = (model.fx * distX + skew * distY + model.cx);<NEW_LINE>output.y = (model.fy * distY + model.cy);<NEW_LINE>} | disRad) * cosphi - disTan * sinphi; |
1,364,838 | protected MultiGetResult<K, V> do_GET_ALL(Set<? extends K> keys) {<NEW_LINE>RedisConnection con = null;<NEW_LINE>try {<NEW_LINE>con = connectionFactory.getConnection();<NEW_LINE>ArrayList<K> keyList = new ArrayList<>(keys);<NEW_LINE>byte[][] newKeys = keyList.stream().map((k) -> buildKey(k)).toArray(byte[][]::new);<NEW_LINE>Map<K, CacheGetResult<V>> resultMap = new HashMap<>();<NEW_LINE>if (newKeys.length > 0) {<NEW_LINE>List mgetResults = con.mGet(newKeys);<NEW_LINE>for (int i = 0; i < mgetResults.size(); i++) {<NEW_LINE>Object value = mgetResults.get(i);<NEW_LINE>K key = keyList.get(i);<NEW_LINE>if (value != null) {<NEW_LINE>CacheValueHolder<V> holder = (CacheValueHolder<V>) valueDecoder.apply((byte[]) value);<NEW_LINE>if (System.currentTimeMillis() >= holder.getExpireTime()) {<NEW_LINE>resultMap.put(key, CacheGetResult.EXPIRED_WITHOUT_MSG);<NEW_LINE>} else {<NEW_LINE>CacheGetResult<V> r = new CacheGetResult<>(CacheResultCode.SUCCESS, null, holder);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>resultMap.put(key, CacheGetResult.NOT_EXISTS_WITHOUT_MSG);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new MultiGetResult<>(CacheResultCode.SUCCESS, null, resultMap);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logError("GET_ALL", "keys(" + keys.size() + ")", ex);<NEW_LINE>return new MultiGetResult<>(ex);<NEW_LINE>} finally {<NEW_LINE>closeConnection(con);<NEW_LINE>}<NEW_LINE>} | resultMap.put(key, r); |
396,019 | private boolean updateCircumcircle(List<double[]> points) {<NEW_LINE>double[] pa = points.get(a), pb = points.get(b), pc = points.get(c);<NEW_LINE>// Compute vectors from A: AB, AC:<NEW_LINE>final double abx = pb[0] - pa[0], aby = pb[1] - pa[1];<NEW_LINE>final double bcx = pc[0] - pb[0], bcy = pc[1] - pb[1];<NEW_LINE>// Degenerated:<NEW_LINE>final double D = abx * bcy - aby * bcx;<NEW_LINE>if (D == 0) {<NEW_LINE>m[0] = Double.NaN;<NEW_LINE>m[1] = Double.NaN;<NEW_LINE>r2 = Double.NaN;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Midpoints of AB and BC:<NEW_LINE>final double mabx = (pa[0] + pb[0]) * .5, maby = (pa[1] + pb[1]) * .5;<NEW_LINE>final double mbcx = (pb[0] + pc[0]) * .5, mbcy = (pb[1] + pc[1]) * .5;<NEW_LINE>final double beta = (abx * (mbcx - mabx) + aby * <MASK><NEW_LINE>m[0] = mbcx - bcy * beta;<NEW_LINE>m[1] = mbcy + bcx * beta;<NEW_LINE>final double rx = pa[0] - m[0], ry = pa[1] - m[1];<NEW_LINE>r2 = rx * rx + ry * ry;<NEW_LINE>return true;<NEW_LINE>} | (mbcy - maby)) / D; |
1,186,147 | public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE>org.apache.thrift.TSerializable msg;<NEW_LINE>getManagerStats_result result = new getManagerStats_result();<NEW_LINE>if (e instanceof org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException) {<NEW_LINE>result.sec = (org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException) e;<NEW_LINE>result.setSecIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException) {<NEW_LINE>result.tnase = (org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException) e;<NEW_LINE>result.setTnaseIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE>_LOGGER.error("TApplicationException inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>_LOGGER.error("Exception writing to internal frame buffer", ex);<NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>} | _LOGGER.error("Exception inside handler", e); |
973,228 | public BytecodeRecorderConstantDefinitionBuildItem pregenProxies(JpaModelBuildItem jpaModel, JpaModelIndexBuildItem indexBuildItem, TransformedClassesBuildItem transformedClassesBuildItem, List<PersistenceUnitDescriptorBuildItem> persistenceUnitDescriptorBuildItems, BuildProducer<GeneratedClassBuildItem> generatedClassBuildItemBuildProducer, LiveReloadBuildItem liveReloadBuildItem) {<NEW_LINE>Set<String> managedClassAndPackageNames = new HashSet<>(jpaModel.getEntityClassNames());<NEW_LINE>for (PersistenceUnitDescriptorBuildItem pud : persistenceUnitDescriptorBuildItems) {<NEW_LINE>// Note: getManagedClassNames() can also return *package* names<NEW_LINE>// See the source code of Hibernate ORM for proof:<NEW_LINE>// org.hibernate.boot.archive.scan.internal.ScanResultCollector.isListedOrDetectable<NEW_LINE>// is used for packages too, and it relies (indirectly) on getManagedClassNames().<NEW_LINE>managedClassAndPackageNames.addAll(pud.getManagedClassNames());<NEW_LINE>}<NEW_LINE>PreGeneratedProxies proxyDefinitions = generatedProxies(managedClassAndPackageNames, indexBuildItem.getIndex(), transformedClassesBuildItem, generatedClassBuildItemBuildProducer, liveReloadBuildItem);<NEW_LINE>// Make proxies available through a constant;<NEW_LINE>// this is a hack to avoid introducing circular dependencies between build steps.<NEW_LINE>//<NEW_LINE>// If we just passed the proxy definitions to #build as a normal build item,<NEW_LINE>// we would have the following dependencies:<NEW_LINE>//<NEW_LINE>// #pregenProxies => ProxyDefinitionsBuildItem => #build => BeanContainerListenerBuildItem<NEW_LINE>// => Arc container init => BeanContainerBuildItem<NEW_LINE>// => some RestEasy Reactive Method => BytecodeTransformerBuildItem<NEW_LINE>// => build step that transforms bytecode => TransformedClassesBuildItem<NEW_LINE>// => #pregenProxies<NEW_LINE>//<NEW_LINE>// Since the dependency from #preGenProxies to #build is only a static init thing<NEW_LINE>// (#build needs to pass the proxy definitions to the recorder),<NEW_LINE>// we get rid of the circular dependency by defining a constant<NEW_LINE>// to pass the proxy definitions to the recorder.<NEW_LINE>// That way, the dependency is only between #pregenProxies<NEW_LINE>// and the build step that generates the bytecode of bytecode recorders.<NEW_LINE>return new <MASK><NEW_LINE>} | BytecodeRecorderConstantDefinitionBuildItem(PreGeneratedProxies.class, proxyDefinitions); |
1,797,286 | protected Component createWindowButtons() {<NEW_LINE>vBox = Box.createVerticalBox();<NEW_LINE>vBox.setOpaque(true);<NEW_LINE>vBox.setBackground(ColorResource.getTitleColor());<NEW_LINE>Box hBox = Box.createHorizontalBox();<NEW_LINE>hBox.setBackground(ColorResource.getTitleColor());<NEW_LINE>// if (menuBox) {<NEW_LINE>// // JButton btn2 =<NEW_LINE>// createTransparentButton(ImageResource.get("exit.png"), new<NEW_LINE>// Dimension(30, 30), null);<NEW_LINE>// // btn2.setName("MENU_OPEN");<NEW_LINE>// // // btn.setRolloverIcon(ImageResource.get("min_btn_r.png"));<NEW_LINE>// // hBox.add(btn2);<NEW_LINE>// // JButton btn =<NEW_LINE>// createTransparentButton(ImageResource.get("drop.png"), new<NEW_LINE>// Dimension(30, 30), null);<NEW_LINE>// // btn.setName("MENU_OPEN");<NEW_LINE>// // // btn.setRolloverIcon(ImageResource.get("min_btn_r.png"));<NEW_LINE>// // hBox.add(btn);<NEW_LINE>// // hBox.add(Box.createRigidArea(new Dimension(10, 1)));<NEW_LINE>// // // hBox.add(Box.createHorizontalStrut(10));<NEW_LINE>//<NEW_LINE>// JLabel lbl = new JLabel();<NEW_LINE>// lbl.setMaximumSize(new Dimension(1, 12));<NEW_LINE>// lbl.setPreferredSize(new Dimension(1, 12));<NEW_LINE>// lbl.setBackground(new Color(65,65,65));<NEW_LINE>// lbl.setOpaque(true);<NEW_LINE>// hBox.add(lbl);<NEW_LINE>// hBox.add(Box.createRigidArea(new Dimension(10, 1)));<NEW_LINE>// //menuBtn = btn;<NEW_LINE>// // hBox.add(Box.createHorizontalStrut(10));<NEW_LINE>// }<NEW_LINE>if (showGitHubIcon) {<NEW_LINE>JButton btnG = createTransparentButton(ImageResource.getIcon("github.png", 16, 16), new Dimension(XDMUtils.getScaledInt(30), XDMUtils.getScaledInt(30)), actGitHub);<NEW_LINE>btnG.setToolTipText("GitHub");<NEW_LINE>// btn.setRolloverIcon(ImageResource.get("max_btn_r.png"));<NEW_LINE>hBox.add(btnG);<NEW_LINE>}<NEW_LINE>if (showTwitterIcon) {<NEW_LINE>JButton btnT = createTransparentButton(ImageResource.getIcon("twitter.png", 16, 16), new Dimension(XDMUtils.getScaledInt(30), XDMUtils.getScaledInt(30)), actTwitter);<NEW_LINE>btnT.setToolTipText(StringResource.get("LBL_TWITTER_PAGE"));<NEW_LINE>// btn.setRolloverIcon(ImageResource.get("max_btn_r.png"));<NEW_LINE>hBox.add(btnT);<NEW_LINE>}<NEW_LINE>if (showFBIcon) {<NEW_LINE>JButton btnF = createTransparentButton(ImageResource.getIcon("facebook.png", 16, 16), new Dimension(XDMUtils.getScaledInt(30), XDMUtils.getScaledInt(30)), actFb);<NEW_LINE>btnF.setToolTipText(StringResource.get("LBL_LIKE_ON_FB"));<NEW_LINE>// btn.setRolloverIcon(ImageResource.get("max_btn_r.png"));<NEW_LINE>hBox.add(btnF);<NEW_LINE>}<NEW_LINE>if (minimizeBox) {<NEW_LINE>JButton btn = createTransparentButton(ImageResource.getIcon("title_min.png", 20, 20), new Dimension(XDMUtils.getScaledInt(30), XDMUtils.getScaledInt(30)), actMin);<NEW_LINE>// btn.setRolloverIcon(ImageResource.get("min_btn_r.png"));<NEW_LINE>hBox.add(btn);<NEW_LINE>}<NEW_LINE>if (maximizeBox) {<NEW_LINE>JButton btn = createTransparentButton(ImageResource.getIcon("title_max.png", 20, 20), new Dimension(XDMUtils.getScaledInt(30), XDMUtils.getScaledInt(30)), actMax);<NEW_LINE>// btn.setRolloverIcon(ImageResource.get("max_btn_r.png"));<NEW_LINE>hBox.add(btn);<NEW_LINE>}<NEW_LINE>JButton btn = createTransparentButton(ImageResource.getIcon("title_close.png", 20, 20), new Dimension(XDMUtils.getScaledInt(30), XDMUtils.<MASK><NEW_LINE>// btn.setRolloverIcon(ImageResource.get("close_btn_r.png"));<NEW_LINE>hBox.add(btn);<NEW_LINE>return hBox;<NEW_LINE>} | getScaledInt(30)), actClose); |
890,893 | public void update(NQueensBoard board) {<NEW_LINE>int size = board.getSize();<NEW_LINE>if (queens.length != size * size) {<NEW_LINE>gridPane.getChildren().clear();<NEW_LINE>gridPane.getColumnConstraints().clear();<NEW_LINE>gridPane.getRowConstraints().clear();<NEW_LINE>queens = new Polygon[size * size];<NEW_LINE>RowConstraints c1 = new RowConstraints();<NEW_LINE>c1.setPercentHeight(100.0 / size);<NEW_LINE>ColumnConstraints c2 = new ColumnConstraints();<NEW_LINE>c2.setPercentWidth(100.0 / size);<NEW_LINE>for (int i = 0; i < board.getSize(); i++) {<NEW_LINE>gridPane.getRowConstraints().add(c1);<NEW_LINE>gridPane.getColumnConstraints().add(c2);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < queens.length; i++) {<NEW_LINE>StackPane field = new StackPane();<NEW_LINE>queens[i] = createQueen();<NEW_LINE>field.getChildren().add(queens[i]);<NEW_LINE>int col = i % size;<NEW_LINE>int row = i / size;<NEW_LINE>field.setBackground(new Background(new BackgroundFill((col % 2 == row % 2) ? Color.WHITE : Color.LIGHTGRAY, null, null)));<NEW_LINE>gridPane.add(field, col, row);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double scale = 0.2 * gridPane.getWidth() / gridPane.getColumnConstraints().size();<NEW_LINE>for (int i = 0; i < queens.length; i++) {<NEW_LINE>Polygon queen = queens[i];<NEW_LINE>queen.setScaleX(scale);<NEW_LINE>queen.setScaleY(scale);<NEW_LINE>XYLocation loc = new XYLocation(<MASK><NEW_LINE>if (board.queenExistsAt(loc)) {<NEW_LINE>queen.setVisible(true);<NEW_LINE>queen.setFill(board.isSquareUnderAttack(loc) ? Color.RED : Color.BLACK);<NEW_LINE>} else {<NEW_LINE>queen.setVisible(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | i % size, i / size); |
1,557,754 | public void run() {<NEW_LINE>String dn;<NEW_LINE>File f = new File((String) o);<NEW_LINE>if (f.exists()) {<NEW_LINE>FileObject fo = FileUtil.toFileObject(f);<NEW_LINE>Project p = FileOwnerQuery.getOwner(fo);<NEW_LINE>if (p != null) {<NEW_LINE>ProjectInformation pi = (ProjectInformation) ProjectUtils.getInformation(p);<NEW_LINE>if (pi != null) {<NEW_LINE>dn = NbBundle.getMessage(SourcesNodeModel.class, "CTL_SourcesModel_Column_Name_ProjectSources", f.getPath(), pi.getDisplayName());<NEW_LINE>} else {<NEW_LINE>dn = NbBundle.getMessage(SourcesNodeModel.class, <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dn = NbBundle.getMessage(SourcesNodeModel.class, "CTL_SourcesModel_Column_Name_LibrarySources", f.getPath());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dn = (String) o;<NEW_LINE>}<NEW_LINE>synchronized (pathWithProject) {<NEW_LINE>pathWithProject.put(o, dn);<NEW_LINE>}<NEW_LINE>fireNodeChanged(o);<NEW_LINE>} | "CTL_SourcesModel_Column_Name_LibrarySources", f.getPath()); |
525,818 | private int compareCRC(VirtualFileSyncPair item) throws CoreException {<NEW_LINE>InputStream clientStream = item.getSourceInputStream();<NEW_LINE><MASK><NEW_LINE>int result;<NEW_LINE>if (clientStream != null && serverStream != null) {<NEW_LINE>// get individual CRC's<NEW_LINE>long clientCRC = getCRC(clientStream);<NEW_LINE>long serverCRC = getCRC(serverStream);<NEW_LINE>// close streams<NEW_LINE>try {<NEW_LINE>clientStream.close();<NEW_LINE>serverStream.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>IdeLog.logError(SyncingPlugin.getDefault(), MessageFormat.format(Messages.Synchronizer_ErrorClosingStreams, item.getRelativePath()), e);<NEW_LINE>}<NEW_LINE>result = (clientCRC == serverCRC) ? SyncState.ItemsMatch : SyncState.CRCMismatch;<NEW_LINE>} else {<NEW_LINE>// NOTE: clientStream can only equal serverStream if both are null,<NEW_LINE>// so we assume the files match in that case<NEW_LINE>result = (clientStream == serverStream) ? SyncState.ItemsMatch : SyncState.CRCMismatch;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | InputStream serverStream = item.getDestinationInputStream(); |
922,398 | private void mouse_clicked(MouseEvent e, boolean rightClick) {<NEW_LINE>Point point = e.getPoint();<NEW_LINE>log.info("Right=" + rightClick + " - " + point.toString());<NEW_LINE>if (rightClick) {<NEW_LINE>m_ddQ = m_viewPanel.getDrillDown(point);<NEW_LINE>m_daQ = m_viewPanel.getDrillAcross(point);<NEW_LINE>m_ddM = null;<NEW_LINE>m_daM = null;<NEW_LINE>if (m_ddQ == null && m_daQ == null)<NEW_LINE>return;<NEW_LINE>// Create Menu<NEW_LINE>JPopupMenu pop = new JPopupMenu();<NEW_LINE>Icon wi = Env.getImageIcon("mWindow.gif");<NEW_LINE>if (m_ddQ != null) {<NEW_LINE>m_ddM = new CMenuItem(m_ddQ.getDisplayName(Env.getCtx()), wi);<NEW_LINE>m_ddM.setToolTipText(m_ddQ.toString());<NEW_LINE>m_ddM.addActionListener(this);<NEW_LINE>pop.add(m_ddM);<NEW_LINE>}<NEW_LINE>if (m_daQ != null) {<NEW_LINE>m_daM = new CMenuItem(m_daQ.getDisplayName(Env.getCtx()), wi);<NEW_LINE>m_daM.setToolTipText(m_daQ.toString());<NEW_LINE>m_daM.addActionListener(this);<NEW_LINE>pop.add(m_daM);<NEW_LINE>}<NEW_LINE>Point pp = e.getPoint();<NEW_LINE>pop.show((Component) e.getSource(), pp.x, pp.y);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));<NEW_LINE>if (m_drillDown) {<NEW_LINE>MQuery query = m_viewPanel.getDrillDown(point);<NEW_LINE>if (query != null) {<NEW_LINE>log.info("Drill Down: " <MASK><NEW_LINE>executeDrill(query);<NEW_LINE>}<NEW_LINE>} else if (comboDrill.getSelectedItem() != null && comboDrill.getSelectedIndex() > 0) {<NEW_LINE>MQuery query = m_viewPanel.getDrillAcross(point);<NEW_LINE>if (query != null) {<NEW_LINE>NamePair pp = (NamePair) comboDrill.getSelectedItem();<NEW_LINE>query.setTableName(pp.getID());<NEW_LINE>log.info("Drill Accross: " + query.getWhereClause(true));<NEW_LINE>executeDrill(query);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// setCursor<NEW_LINE>cmd_drill();<NEW_LINE>} | + query.getWhereClause(true)); |
1,847,690 | protected void addProfilesList(Profiles profiles, String text, String tableSummary, Content body) {<NEW_LINE>Content heading = HtmlTree.HEADING(HtmlConstants.PROFILE_HEADING, true, profilesLabel);<NEW_LINE>Content div = HtmlTree.DIV(HtmlStyle.indexContainer, heading);<NEW_LINE>HtmlTree ul = new HtmlTree(HtmlTag.UL);<NEW_LINE>ul.setTitle(profilesLabel);<NEW_LINE>String profileName;<NEW_LINE>for (int i = 1; i < profiles.getProfileCount(); i++) {<NEW_LINE>profileName = (Profile<MASK><NEW_LINE>// If the profile has valid packages to be documented, add it to the<NEW_LINE>// left-frame generated for profile index.<NEW_LINE>if (configuration.shouldDocumentProfile(profileName))<NEW_LINE>ul.addContent(getProfile(profileName));<NEW_LINE>}<NEW_LINE>div.addContent(ul);<NEW_LINE>body.addContent(div);<NEW_LINE>} | .lookup(i)).name; |
1,693,635 | // validate the path, path must be an absolute path<NEW_LINE>public static List<String> buildSourceTargets(List<String> directories) {<NEW_LINE>Map<String, Boolean> isRegexPath = new HashMap<>();<NEW_LINE>Map<String, Pattern> patterns = new HashMap<>();<NEW_LINE>// for each path<NEW_LINE>Set<String> toBeReadFiles = new HashSet<>();<NEW_LINE>for (String eachPath : directories) {<NEW_LINE>int endMark;<NEW_LINE>for (endMark = 0; endMark < eachPath.length(); endMark++) {<NEW_LINE>if ('*' == eachPath.charAt(endMark) || '?' == eachPath.charAt(endMark)) {<NEW_LINE>isRegexPath.put(eachPath, true);<NEW_LINE>patterns.put(eachPath, generatePattern(eachPath));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String parentDirectory;<NEW_LINE>if (!isRegexPath.isEmpty() && isRegexPath.get(eachPath)) {<NEW_LINE>int lastDirSeparator = eachPath.substring(0, endMark).lastIndexOf(IOUtils.DIR_SEPARATOR);<NEW_LINE>parentDirectory = eachPath.substring(0, lastDirSeparator + 1);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>parentDirectory = eachPath;<NEW_LINE>}<NEW_LINE>buildSourceTargetsEachPath(eachPath, parentDirectory, toBeReadFiles, patterns, isRegexPath);<NEW_LINE>}<NEW_LINE>return Arrays.asList(toBeReadFiles.toArray(new String[0]));<NEW_LINE>} | isRegexPath.put(eachPath, false); |
1,168,943 | public void refresh(final ShardingSphereMetaData schemaMetaData, final FederationDatabaseMetaData database, final Map<String, OptimizerPlannerContext> optimizerPlanners, final Collection<String> logicDataSourceNames, final RenameTableStatement sqlStatement, final ConfigurationProperties props) throws SQLException {<NEW_LINE>SchemaAlteredEvent event = new SchemaAlteredEvent(schemaMetaData.getName());<NEW_LINE>for (RenameTableDefinitionSegment each : sqlStatement.getRenameTables()) {<NEW_LINE>String tableName = each.getTable().getTableName().getIdentifier().getValue();<NEW_LINE>String renameTable = each.getRenameTable().getTableName().getIdentifier().getValue();<NEW_LINE>putTableMetaData(schemaMetaData, database, optimizerPlanners, logicDataSourceNames, renameTable, props);<NEW_LINE>removeTableMetaData(schemaMetaData, database, optimizerPlanners, tableName);<NEW_LINE>event.getAlteredTables().add(schemaMetaData.getDefaultSchema<MASK><NEW_LINE>event.getDroppedTables().add(tableName);<NEW_LINE>}<NEW_LINE>ShardingSphereEventBus.getInstance().post(event);<NEW_LINE>} | ().get(renameTable)); |
1,424,110 | public void run() {<NEW_LINE>if (command == null || command.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String[] cmd = split(command);<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>Process p = rt.exec(cmd);<NEW_LINE>this.process = p;<NEW_LINE>LOGGER.info(String.format("[%s] Process %s started. [%s][%s]", label, id(), command, StringUtil.join(cmd)));<NEW_LINE>listener.processStarted(this);<NEW_LINE>// Read both output streams (output of the process, so input), so<NEW_LINE>// the process keeps running and to output it's output<NEW_LINE>InputStreamHelper errorStream = new InputStreamHelper(p.getErrorStream());<NEW_LINE>InputStreamHelper inputStream = new InputStreamHelper(p.getInputStream());<NEW_LINE>errorStream.start();<NEW_LINE>inputStream.start();<NEW_LINE>int exitValue = p.waitFor();<NEW_LINE>errorStream.join(1000);<NEW_LINE>inputStream.join(1000);<NEW_LINE>listener.processFinished(this, exitValue);<NEW_LINE>LOGGER.info(String.format("[%s] Process %s finished.", label, id()));<NEW_LINE>} catch (IOException ex) {<NEW_LINE>listener.message(this, "Error: " + ex);<NEW_LINE>LOGGER.warning(String.format("[%s] Error starting process / %s [%s][%s]", label, ex, command, StringUtil.join(cmd)));<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>listener.message(this, "Error: " + ex);<NEW_LINE>LOGGER.warning(String.format("[%s] %s", label, ex));<NEW_LINE>}<NEW_LINE>} | Runtime rt = Runtime.getRuntime(); |
409,925 | public static ListNamespacesResponse unmarshall(ListNamespacesResponse listNamespacesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listNamespacesResponse.setRequestId(_ctx.stringValue("ListNamespacesResponse.RequestId"));<NEW_LINE>List<Namespace> namespaces = new ArrayList<Namespace>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListNamespacesResponse.Namespaces.Length"); i++) {<NEW_LINE>Namespace namespace = new Namespace();<NEW_LINE>namespace.setNamespace(_ctx.stringValue("ListNamespacesResponse.Namespaces[" + i + "].Namespace"));<NEW_LINE>namespace.setName(_ctx.stringValue("ListNamespacesResponse.Namespaces[" + i + "].Name"));<NEW_LINE>namespace.setUserId(_ctx.stringValue("ListNamespacesResponse.Namespaces[" + i + "].UserId"));<NEW_LINE>namespace.setProjectId(_ctx.stringValue("ListNamespacesResponse.Namespaces[" + i + "].ProjectId"));<NEW_LINE>namespace.setDescription(_ctx.stringValue("ListNamespacesResponse.Namespaces[" + i + "].Description"));<NEW_LINE>namespace.setGmtCreate(_ctx.longValue("ListNamespacesResponse.Namespaces[" + i + "].GmtCreate"));<NEW_LINE>namespace.setGmtModified(_ctx.longValue("ListNamespacesResponse.Namespaces[" + i + "].GmtModified"));<NEW_LINE>namespace.setAuthType(_ctx.integerValue<MASK><NEW_LINE>namespaces.add(namespace);<NEW_LINE>}<NEW_LINE>listNamespacesResponse.setNamespaces(namespaces);<NEW_LINE>return listNamespacesResponse;<NEW_LINE>} | ("ListNamespacesResponse.Namespaces[" + i + "].AuthType")); |
882,146 | public static void log(Object... args) {<NEW_LINE>// --Argument Check<NEW_LINE>if (args.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isClosed) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// --Create Record<NEW_LINE>final Object content = args[args.length - 1];<NEW_LINE>final Object[] tags = new Object[args.length - 1];<NEW_LINE>System.arraycopy(args, 0, tags, 0, args.length - 1);<NEW_LINE>final long timestamp = System.currentTimeMillis();<NEW_LINE>// --Handle Record<NEW_LINE>if (isThreaded) {<NEW_LINE>// (case: multithreaded)<NEW_LINE>final Runnable log = () -> {<NEW_LINE>assert <MASK><NEW_LINE>Record toPass = new Record(content, tags, depth, timestamp);<NEW_LINE>handlers.process(toPass, MessageType.SIMPLE, depth, toPass.timesstamp);<NEW_LINE>assert !isThreaded || control.isHeldByCurrentThread();<NEW_LINE>};<NEW_LINE>long threadId = Thread.currentThread().getId();<NEW_LINE>attemptThreadControl(threadId, log);<NEW_LINE>} else {<NEW_LINE>// (case: no threading)<NEW_LINE>Record toPass = new Record(content, tags, depth, timestamp);<NEW_LINE>handlers.process(toPass, MessageType.SIMPLE, depth, toPass.timesstamp);<NEW_LINE>}<NEW_LINE>} | !isThreaded || control.isHeldByCurrentThread(); |
1,176,129 | public static String[][] parseFromLines(String[] lines, int minimumItemsInOneLine, int startLine, int endLine) {<NEW_LINE>String[][] labels = null;<NEW_LINE>String[][] labelsRet = null;<NEW_LINE>if (startLine <= endLine) {<NEW_LINE>int i, j;<NEW_LINE>int count = 0;<NEW_LINE>for (i = startLine; i <= endLine; i++) {<NEW_LINE>String[] labelInfos = null;<NEW_LINE>if (minimumItemsInOneLine > 1) {<NEW_LINE>labelInfos = lines[i].split(" ");<NEW_LINE>} else {<NEW_LINE>labelInfos = new String[1];<NEW_LINE>labelInfos[0] = lines[i];<NEW_LINE>}<NEW_LINE>boolean isNotEmpty = false;<NEW_LINE>for (j = 0; j < labelInfos.length; j++) {<NEW_LINE>labelInfos[j] = labelInfos[j].trim();<NEW_LINE>if (labelInfos[j].length() != 0)<NEW_LINE>isNotEmpty = true;<NEW_LINE>}<NEW_LINE>if (labelInfos.length > 0 && isNotEmpty)<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>int tmpCount = 0;<NEW_LINE>if (count > 0) {<NEW_LINE>labels = new String[count][];<NEW_LINE>for (i = startLine; i <= endLine; i++) {<NEW_LINE>if (tmpCount > count - 1)<NEW_LINE>break;<NEW_LINE>String[] labelInfos = null;<NEW_LINE>if (minimumItemsInOneLine > 1) {<NEW_LINE>labelInfos = lines[i].split(" ");<NEW_LINE>} else {<NEW_LINE>labelInfos = new String[1];<NEW_LINE>labelInfos[0] = lines[i];<NEW_LINE>}<NEW_LINE>boolean isNotEmpty = false;<NEW_LINE>for (j = 0; j < labelInfos.length; j++) {<NEW_LINE>labelInfos[j] = labelInfos[j].trim();<NEW_LINE>if (labelInfos[j].length() != 0)<NEW_LINE>isNotEmpty = true;<NEW_LINE>}<NEW_LINE>if (labelInfos.length > 0 && isNotEmpty) {<NEW_LINE>labels[<MASK><NEW_LINE>for (j = 0; j < Math.min(labelInfos.length, minimumItemsInOneLine); j++) labels[tmpCount][j] = labelInfos[j].trim();<NEW_LINE>tmpCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>labelsRet = new String[tmpCount][];<NEW_LINE>for (i = 0; i < tmpCount; i++) {<NEW_LINE>labelsRet[i] = new String[minimumItemsInOneLine];<NEW_LINE>for (j = 0; j < minimumItemsInOneLine; j++) labelsRet[i][j] = labels[i][j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return labelsRet;<NEW_LINE>} | tmpCount] = new String[minimumItemsInOneLine]; |
501,510 | public boolean isReachable(boolean chatty) {<NEW_LINE>WebTarget webTarget = getTarget("");<NEW_LINE>try (Response response = webTarget.request().get()) {<NEW_LINE>_logger.info(response.getStatus() + " " + response.getStatusInfo() + " " + response + "\n");<NEW_LINE>if (response.getStatusInfo().getFamily() != Status.Family.SUCCESSFUL) {<NEW_LINE>_logger.errorf("GetObject: Did not get an OK response\n");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (ProcessingException e) {<NEW_LINE>if (e.getMessage().contains("ConnectException")) {<NEW_LINE>if (chatty) {<NEW_LINE>_logger.errorf("BF-Client: unable to connect to coordinator at %s\n", webTarget.getUri());<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (e.getMessage().contains("SSLHandshakeException")) {<NEW_LINE>if (chatty) {<NEW_LINE>_logger.errorf("SSL handshake exception while connecting to coordinator (Is the coordinator using " + <MASK><NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (e.getMessage().contains("SocketException: Unexpected end of file")) {<NEW_LINE>if (chatty) {<NEW_LINE>_logger.errorf("SocketException while connecting to coordinator. (Are you using SSL?)\n");<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | "SSL and using keys that you trust?): %s\n", e.getMessage()); |
320,268 | // 3 9hm902ya6q6bq246ewuh67h38<NEW_LINE>// void reverse_edge(edge_t * e)<NEW_LINE>@Unused<NEW_LINE>@Original(version = "2.38.0", path = "lib/dotgen/acyclic.c", name = "reverse_edge", key = "9hm902ya6q6bq246ewuh67h38", definition = "void reverse_edge(edge_t * e)")<NEW_LINE>public static void reverse_edge(ST_Agedge_s e) {<NEW_LINE>ENTERING("9hm902ya6q6bq246ewuh67h38", "reverse_edge");<NEW_LINE>try {<NEW_LINE>ST_Agedge_s f;<NEW_LINE>delete_fast_edge(e);<NEW_LINE>if ((f = find_fast_edge(aghead(e), agtail(e))) != null)<NEW_LINE>merge_oneway(e, f);<NEW_LINE>else<NEW_LINE>virtual_edge(aghead(e)<MASK><NEW_LINE>} finally {<NEW_LINE>LEAVING("9hm902ya6q6bq246ewuh67h38", "reverse_edge");<NEW_LINE>}<NEW_LINE>} | , agtail(e), e); |
313,347 | public static ListStrategiesResponse unmarshall(ListStrategiesResponse listStrategiesResponse, UnmarshallerContext context) {<NEW_LINE>listStrategiesResponse.setRequestId(context.stringValue("ListStrategiesResponse.RequestId"));<NEW_LINE>listStrategiesResponse.setSuccess(context.booleanValue("ListStrategiesResponse.Success"));<NEW_LINE>listStrategiesResponse.setCode(context.stringValue("ListStrategiesResponse.Code"));<NEW_LINE>listStrategiesResponse.setMessage(context.stringValue("ListStrategiesResponse.Message"));<NEW_LINE>listStrategiesResponse.setHttpStatusCode(context.integerValue("ListStrategiesResponse.HttpStatusCode"));<NEW_LINE>List<Strategy> strategies = new ArrayList<Strategy>();<NEW_LINE>for (int i = 0; i < context.lengthValue("ListStrategiesResponse.Strategies.Length"); i++) {<NEW_LINE>Strategy strategy = new Strategy();<NEW_LINE>strategy.setStrategyId(context.stringValue("ListStrategiesResponse.Strategies[" + i + "].StrategyId"));<NEW_LINE>strategy.setStrategyName(context.stringValue("ListStrategiesResponse.Strategies[" + i + "].StrategyName"));<NEW_LINE>strategy.setStrategyDescription(context.stringValue("ListStrategiesResponse.Strategies[" + i + "].StrategyDescription"));<NEW_LINE>strategy.setType(context.stringValue("ListStrategiesResponse.Strategies[" + i + "].Type"));<NEW_LINE>strategy.setStartTime(context.longValue("ListStrategiesResponse.Strategies[" + i + "].StartTime"));<NEW_LINE>strategy.setEndTime(context.longValue("ListStrategiesResponse.Strategies[" + i + "].EndTime"));<NEW_LINE>strategy.setRepeatBy(context.stringValue("ListStrategiesResponse.Strategies[" + i + "].RepeatBy"));<NEW_LINE>strategy.setMaxAttemptsPerDay(context.integerValue("ListStrategiesResponse.Strategies[" + i + "].MaxAttemptsPerDay"));<NEW_LINE>strategy.setMinAttemptInterval(context.integerValue("ListStrategiesResponse.Strategies[" + i + "].MinAttemptInterval"));<NEW_LINE>strategy.setCustomized(context.stringValue("ListStrategiesResponse.Strategies[" + i + "].Customized"));<NEW_LINE>strategy.setRoutingStrategy(context.stringValue("ListStrategiesResponse.Strategies[" + i + "].RoutingStrategy"));<NEW_LINE>strategy.setFollowUpStrategy(context.stringValue<MASK><NEW_LINE>strategy.setIsTemplate(context.booleanValue("ListStrategiesResponse.Strategies[" + i + "].IsTemplate"));<NEW_LINE>List<String> repeatDays = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < context.lengthValue("ListStrategiesResponse.Strategies[" + i + "].RepeatDays.Length"); j++) {<NEW_LINE>repeatDays.add(context.stringValue("ListStrategiesResponse.Strategies[" + i + "].RepeatDays[" + j + "]"));<NEW_LINE>}<NEW_LINE>strategy.setRepeatDays(repeatDays);<NEW_LINE>List<TimeFrame> workingTime = new ArrayList<TimeFrame>();<NEW_LINE>for (int j = 0; j < context.lengthValue("ListStrategiesResponse.Strategies[" + i + "].WorkingTime.Length"); j++) {<NEW_LINE>TimeFrame timeFrame = new TimeFrame();<NEW_LINE>timeFrame.setBeginTime(context.stringValue("ListStrategiesResponse.Strategies[" + i + "].WorkingTime[" + j + "].BeginTime"));<NEW_LINE>timeFrame.setEndTime(context.stringValue("ListStrategiesResponse.Strategies[" + i + "].WorkingTime[" + j + "].EndTime"));<NEW_LINE>workingTime.add(timeFrame);<NEW_LINE>}<NEW_LINE>strategy.setWorkingTime(workingTime);<NEW_LINE>strategies.add(strategy);<NEW_LINE>}<NEW_LINE>listStrategiesResponse.setStrategies(strategies);<NEW_LINE>return listStrategiesResponse;<NEW_LINE>} | ("ListStrategiesResponse.Strategies[" + i + "].FollowUpStrategy")); |
1,027,065 | private void updateCustomWidthSlider() {<NEW_LINE>if (selectedMode == WidthMode.CUSTOM) {<NEW_LINE>Slider slider = view.findViewById(R.id.width_slider);<NEW_LINE>final TextView tvCustomWidth = view.findViewById(R.id.width_value_tv);<NEW_LINE>slider.setValueTo(CUSTOM_WIDTH_MAX);<NEW_LINE>slider.setValueFrom(CUSTOM_WIDTH_MIN);<NEW_LINE>((TextView) view.findViewById(R.id.width_value_min)).setText(String.valueOf(CUSTOM_WIDTH_MIN));<NEW_LINE>((TextView) view.findViewById(R.id.width_value_max)).setText(String.valueOf(CUSTOM_WIDTH_MAX));<NEW_LINE>String widthKey = getRouteLineWidth();<NEW_LINE>int width = Algorithms.parseIntSilently(widthKey, 1);<NEW_LINE>widthKey = String.valueOf(width);<NEW_LINE>setRouteLineWidth(widthKey);<NEW_LINE>tvCustomWidth.setText(widthKey);<NEW_LINE>slider.setValue(width);<NEW_LINE>slider.addOnChangeListener(new Slider.OnChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onValueChange(@NonNull Slider slider, float value, boolean fromUser) {<NEW_LINE>if (fromUser) {<NEW_LINE>String newWidth = String.valueOf((int) value);<NEW_LINE>setRouteLineWidth(newWidth);<NEW_LINE>tvCustomWidth.setText(newWidth);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>UiUtilities.setupSlider(slider, nightMode, null, true);<NEW_LINE>ScrollUtils.addOnGlobalLayoutListener(sliderContainer, new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>if (sliderContainer.getVisibility() == View.VISIBLE) {<NEW_LINE>onNeedScrollListener.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>AndroidUiHelper.updateVisibility(sliderContainer, true);<NEW_LINE>} else {<NEW_LINE>AndroidUiHelper.updateVisibility(sliderContainer, false);<NEW_LINE>}<NEW_LINE>} | onVerticalScrollNeeded(sliderContainer.getBottom()); |
641,299 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Permanent permanent = game.getPermanent(source.getSourceId());<NEW_LINE>// If the permanent leaves the battlefield before the ability resolves, artifacts won't be exiled.<NEW_LINE>if (permanent == null || controller == null)<NEW_LINE>return false;<NEW_LINE>Set<Card> toExile = new LinkedHashSet<>();<NEW_LINE>for (Permanent artifact : game.getBattlefield().getActivePermanents(filter, controller.getId(), game)) {<NEW_LINE>toExile.add(artifact);<NEW_LINE>}<NEW_LINE>if (!toExile.isEmpty()) {<NEW_LINE>controller.moveCardsToExile(toExile, source, game, true, CardUtil.getCardExileZoneId(game, source<MASK><NEW_LINE>new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()).apply(game, source);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | ), permanent.getIdName()); |
217,727 | private void loadNode97() {<NEW_LINE>UaObjectTypeNode node = new UaObjectTypeNode(this.context, Identifiers.LimitAlarmType, new QualifiedName(0, "LimitAlarmType"), new LocalizedText("en", "LimitAlarmType"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), false);<NEW_LINE>node.addReference(new Reference(Identifiers.LimitAlarmType, Identifiers.HasProperty, Identifiers.LimitAlarmType_HighHighLimit.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.LimitAlarmType, Identifiers.HasProperty, Identifiers.LimitAlarmType_HighLimit.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.LimitAlarmType, Identifiers.HasProperty, Identifiers.LimitAlarmType_LowLimit<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.LimitAlarmType, Identifiers.HasProperty, Identifiers.LimitAlarmType_LowLowLimit.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.LimitAlarmType, Identifiers.HasSubtype, Identifiers.AlarmConditionType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), true)); |
1,154,285 | public boolean onTouch(View v, MotionEvent event) {<NEW_LINE>postAction();<NEW_LINE>if (event.getAction() == MotionEvent.ACTION_DOWN && popupView.getLayoutParams() != null) {<NEW_LINE>x = event.getRawX();<NEW_LINE>y = event.getRawY();<NEW_LINE>w = popupView.getLayoutParams().width;<NEW_LINE>h = popupView.getLayoutParams().height;<NEW_LINE>x2 = AnchorHelper.getX(anchor);<NEW_LINE>y2 = AnchorHelper.getY(anchor);<NEW_LINE>} else if (event.getAction() == MotionEvent.ACTION_MOVE && popupView.getLayoutParams() != null) {<NEW_LINE>int nWidth = (int) (w + (x - event.getRawX()));<NEW_LINE>if (nWidth > MIN_WH) {<NEW_LINE>popupView.getLayoutParams().width = nWidth;<NEW_LINE>AnchorHelper.setX(anchor, event.getRawX() + (x2 - x));<NEW_LINE>}<NEW_LINE>int nHeight = (int) (h + (event.getRawY() - y));<NEW_LINE>if (nHeight > MIN_WH) {<NEW_LINE>popupView<MASK><NEW_LINE>}<NEW_LINE>AnchorHelper.setY(anchor, y2);<NEW_LINE>popupView.requestLayout();<NEW_LINE>LOG.d("Anchor WxH", Dips.pxToDp(anchor.getWidth()), Dips.pxToDp(anchor.getHeight()));<NEW_LINE>} else if (event.getAction() == MotionEvent.ACTION_UP) {<NEW_LINE>saveLayout();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | .getLayoutParams().height = nHeight; |
293,863 | public void marshall(DiskSnapshot diskSnapshot, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (diskSnapshot == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getSupportCode(), SUPPORTCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getResourceType(), RESOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getSizeInGb(), SIZEINGB_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getState(), STATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getProgress(), PROGRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getFromDiskName(), FROMDISKNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getFromDiskArn(), FROMDISKARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getFromInstanceName(), FROMINSTANCENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getFromInstanceArn(), FROMINSTANCEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getIsFromAutoSnapshot(), ISFROMAUTOSNAPSHOT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | diskSnapshot.getLocation(), LOCATION_BINDING); |
630,239 | public static LZ4FFrameInfo LZ4F_INIT_FRAMEINFO(LZ4FFrameInfo info) {<NEW_LINE>info.blockSizeID(org.bytedeco.lz4.global.lz4.LZ4F_default);<NEW_LINE>info.blockMode(org.bytedeco.lz4.global.lz4.LZ4F_blockLinked);<NEW_LINE>info.blockMode(org.bytedeco.lz4.global.lz4.LZ4F_blockLinked);<NEW_LINE>info.contentChecksumFlag(org.bytedeco.lz4.global.lz4.LZ4F_noContentChecksum);<NEW_LINE>info.frameType(org.bytedeco.<MASK><NEW_LINE>info.contentSize(0);<NEW_LINE>info.dictID(0);<NEW_LINE>info.blockChecksumFlag(org.bytedeco.lz4.global.lz4.LZ4F_noBlockChecksum);<NEW_LINE>return info;<NEW_LINE>} | lz4.global.lz4.LZ4F_frame); |
375,488 | private String classToInventoryPythonClass(Class<?> clazz) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>boolean hasParent = (clazz.getSuperclass() != Object.class);<NEW_LINE>if (hasParent && !isPythonClassGenerated(clazz.getSuperclass())) {<NEW_LINE>sb.append(classToInventoryPythonClass(clazz.getSuperclass()));<NEW_LINE>}<NEW_LINE>if (hasParent) {<NEW_LINE>sb.append(String.format("\nclass %s(%s):", clazz.getSimpleName(), clazz.getSuperclass().getSimpleName()));<NEW_LINE>sb.append(String.format("\n%sdef __init__(self):", whiteSpace(4)));<NEW_LINE>sb.append(String.format("\n%ssuper(%s, self).__init__()", whiteSpace(8), clazz.getSimpleName()));<NEW_LINE>} else {<NEW_LINE>sb.append(String.format("\nclass %s(object):", clazz.getSimpleName()));<NEW_LINE>sb.append(String.format("\n%sdef __init__(self):", whiteSpace(4)));<NEW_LINE>}<NEW_LINE>Field[] fs = clazz.getDeclaredFields();<NEW_LINE>for (Field f : fs) {<NEW_LINE>sb.append(String.format("\n%sself.%s = None", whiteSpace(8), f.getName()));<NEW_LINE>}<NEW_LINE>sb.append(String.format("\n\n%sdef evaluate(self, inv):", whiteSpace(4)));<NEW_LINE>if (hasParent) {<NEW_LINE>sb.append(String.format("\n%ssuper(%s, self).evaluate(inv)", whiteSpace(8)<MASK><NEW_LINE>}<NEW_LINE>for (Field f : fs) {<NEW_LINE>sb.append(String.format("\n%sif hasattr(inv, '%s'):", whiteSpace(8), f.getName()));<NEW_LINE>sb.append(String.format("\n%sself.%s = inv.%s", whiteSpace(12), f.getName(), f.getName()));<NEW_LINE>sb.append(String.format("\n%selse:", whiteSpace(8)));<NEW_LINE>sb.append(String.format("\n%sself.%s = None\n", whiteSpace(12), f.getName()));<NEW_LINE>}<NEW_LINE>sb.append("\n\n");<NEW_LINE>markPythonClassAsGenerated(clazz);<NEW_LINE>return sb.toString();<NEW_LINE>} | , clazz.getSimpleName())); |
610,771 | private void checkNullSafety(HashMap<String, ColumnState.EventField> eventFields, PrimaryKey pk, Schema.Field field, String databaseFieldName, ReplicationBitSetterStaticConfig replicationBitConfig) throws DatabusException {<NEW_LINE>if (eventFields.get(databaseFieldName) == null) {<NEW_LINE>LOG.error(<MASK><NEW_LINE>if (// Are we ok to accept null fields ?<NEW_LINE>!_errorOnMissingFields) {<NEW_LINE>// We cannot tolerate empty primary key fields, so we'll throw exception if key is null<NEW_LINE>if (pk.isPartOfPrimaryKey(field))<NEW_LINE>throw new DatabusException("Skip errors on missing DB Fields is true, but cannot proceed because primary key not found: " + field.name());<NEW_LINE>// We also need the replication field, it's not optional if MissingValueBehavior == STOP_WITH_ERROR<NEW_LINE>if (replicationBitConfig.getSourceType() == ReplicationBitSetterStaticConfig.SourceType.COLUMN && isReplicationField(databaseFieldName, replicationBitConfig) && replicationBitConfig.getMissingValueBehavior() == MissingValueBehavior.STOP_WITH_ERROR) {<NEW_LINE>throw new DatabusException("Skip errors on missing DB Fields is true, but the replication field is missing, this is mandatory, cannot proceed with " + field.name() + " field missing");<NEW_LINE>}<NEW_LINE>setSeenMissingFields(true);<NEW_LINE>// If not primary key, we create fake hash entry with a null eventfield entry<NEW_LINE>ColumnState.EventField emptyEventField = new ColumnState.EventField(false, null, true);<NEW_LINE>eventFields.put(databaseFieldName, emptyEventField);<NEW_LINE>} else<NEW_LINE>throw new DatabusException("Unable to find a required field " + databaseFieldName + " in the xml trail file");<NEW_LINE>}<NEW_LINE>} | "Missing field " + databaseFieldName + " in event from the xml trail for table " + _currentTable); |
1,370,065 | public List<Article> mergeResults(List<Article> fuzzyResult, List<Article> cwResult, Logger logger) {<NEW_LINE>if (fuzzyResult.isEmpty())<NEW_LINE>return cwResult;<NEW_LINE>if (cwResult.isEmpty())<NEW_LINE>return fuzzyResult;<NEW_LINE>Map<String, Article> cwArticles = new HashMap<>();<NEW_LINE>for (Article a : cwResult) {<NEW_LINE>cwArticles.put(a.getName(), a);<NEW_LINE>}<NEW_LINE>for (Article a : fuzzyResult) {<NEW_LINE>Article cwA = cwArticles.get(a.getName());<NEW_LINE>if (cwA == null) {<NEW_LINE>logger.debug("merge: fuzzyResult {}", a.getName());<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>logger.debug(<MASK><NEW_LINE>}<NEW_LINE>cwArticles.remove(a.getName());<NEW_LINE>a.prob = cwA.getProb();<NEW_LINE>a.getByCWLookup = true;<NEW_LINE>}<NEW_LINE>for (Article a : cwArticles.values()) {<NEW_LINE>logger.debug("merge: cwResult {}", a.getName());<NEW_LINE>fuzzyResult.add(a);<NEW_LINE>}<NEW_LINE>return fuzzyResult;<NEW_LINE>} | "merge: fuzzyResult+cwResult {}", a.getName()); |
516,801 | protected Map<ServerFormDetails, FormDownloadException> doInBackground(ArrayList<ServerFormDetails>... values) {<NEW_LINE>HashMap<ServerFormDetails, FormDownloadException> results = new HashMap<>();<NEW_LINE>int index = 1;<NEW_LINE>for (ServerFormDetails serverFormDetails : values[0]) {<NEW_LINE>try {<NEW_LINE>String currentFormNumber = String.valueOf(index);<NEW_LINE>String totalForms = String.valueOf(values[0].size());<NEW_LINE>publishProgress(serverFormDetails.getFormName(), currentFormNumber, totalForms);<NEW_LINE>formDownloader.downloadForm(serverFormDetails, count -> {<NEW_LINE>String message = getLocalizedString(Collect.getInstance(), R.string.form_download_progress, serverFormDetails.getFormName(), String.valueOf(count), String.valueOf(serverFormDetails.getManifest().getMediaFiles<MASK><NEW_LINE>publishProgress(message, currentFormNumber, totalForms);<NEW_LINE>}, this::isCancelled);<NEW_LINE>results.put(serverFormDetails, null);<NEW_LINE>} catch (FormDownloadException.DownloadingInterrupted e) {<NEW_LINE>return emptyMap();<NEW_LINE>} catch (FormDownloadException e) {<NEW_LINE>results.put(serverFormDetails, e);<NEW_LINE>}<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | ().size())); |
1,685,827 | public void onCreateOptionsMenu(Menu onCreate, MenuInflater inflater) {<NEW_LINE>OsmandApplication app = (OsmandApplication) getActivity().getApplication();<NEW_LINE>boolean light = app.getSettings().isLightActionBar();<NEW_LINE>Menu menu = onCreate;<NEW_LINE>if (getActivity() instanceof SearchActivity) {<NEW_LINE>((SearchActivity) getActivity<MASK><NEW_LINE>light = false;<NEW_LINE>}<NEW_LINE>MenuItem menuItem = menu.add(0, SHOW_ON_MAP, 0, R.string.shared_string_show_on_map);<NEW_LINE>menuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);<NEW_LINE>menuItem = menuItem.setIcon(app.getUIUtilities().getIcon(R.drawable.ic_action_marker_dark, light));<NEW_LINE>menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onMenuItemClick(MenuItem item) {<NEW_LINE>select(SHOW_ON_MAP);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ()).getClearToolbar(false); |
1,071,902 | private ResponseSpec createUserRequestCreation(User user) throws WebClientResponseException {<NEW_LINE>Object postBody = user;<NEW_LINE>// verify the required parameter 'user' is set<NEW_LINE>if (user == null) {<NEW_LINE>throw new WebClientResponseException("Missing the required parameter 'user' when calling createUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>final Map<String, Object> pathParams = new HashMap<String, Object>();<NEW_LINE>final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final HttpHeaders headerParams = new HttpHeaders();<NEW_LINE>final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap<String, Object> formParams = new <MASK><NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("/user", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | LinkedMultiValueMap<String, Object>(); |
1,671,952 | private smile.data.vector.BaseVector readByteArrayField(FieldVector fieldVector) {<NEW_LINE>int count = fieldVector.getValueCount();<NEW_LINE>byte[][] a = new byte[count][];<NEW_LINE>if (fieldVector instanceof VarBinaryVector) {<NEW_LINE>VarBinaryVector vector = (VarBinaryVector) fieldVector;<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>if (vector.isNull(i))<NEW_LINE>a[i] = null;<NEW_LINE>else<NEW_LINE>a[i] = vector.get(i);<NEW_LINE>}<NEW_LINE>} else if (fieldVector instanceof FixedSizeBinaryVector) {<NEW_LINE>FixedSizeBinaryVector vector = (FixedSizeBinaryVector) fieldVector;<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>if (vector.isNull(i))<NEW_LINE>a[i] = null;<NEW_LINE>else<NEW_LINE>a[i<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("Unsupported binary vector: " + fieldVector);<NEW_LINE>}<NEW_LINE>return smile.data.vector.Vector.of(fieldVector.getField().getName(), DataTypes.ByteArrayType, a);<NEW_LINE>} | ] = vector.get(i); |
424,302 | public NdbOpenJPAResult lookup(OpenJPAStateManager sm, NdbOpenJPADomainTypeHandlerImpl<?> domainTypeHandler, List<NdbOpenJPADomainFieldHandlerImpl> fieldHandlers) {<NEW_LINE>com.mysql.clusterj.core.store.Table storeTable = domainTypeHandler.getStoreTable();<NEW_LINE>session.startAutoTransaction();<NEW_LINE>try {<NEW_LINE>Operation op = session.getSelectOperation(storeTable);<NEW_LINE>int[<MASK><NEW_LINE>BitSet fieldsInResult = new BitSet();<NEW_LINE>for (int i : keyFields) {<NEW_LINE>fieldsInResult.set(i);<NEW_LINE>}<NEW_LINE>ValueHandler handler = domainTypeHandler.getValueHandler(sm, this);<NEW_LINE>domainTypeHandler.operationSetKeys(handler, op);<NEW_LINE>// include the key columns in the results<NEW_LINE>domainTypeHandler.operationGetKeys(op);<NEW_LINE>for (NdbOpenJPADomainFieldHandlerImpl fieldHandler : fieldHandlers) {<NEW_LINE>fieldHandler.operationGetValue(op);<NEW_LINE>fieldsInResult.set(fieldHandler.getFieldNumber());<NEW_LINE>}<NEW_LINE>ResultData resultData = op.resultData();<NEW_LINE>NdbOpenJPAResult result = new NdbOpenJPAResult(resultData, domainTypeHandler, fieldsInResult);<NEW_LINE>session.endAutoTransaction();<NEW_LINE>return result;<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>session.failAutoTransaction();<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>} | ] keyFields = domainTypeHandler.getKeyFieldNumbers(); |
412,218 | protected void doTransactionScan(final DB db, Object threadstate) {<NEW_LINE>final ThreadState state = (ThreadState) threadstate;<NEW_LINE>final Random random = ThreadLocalRandom.current();<NEW_LINE>final String keyname = keys[random<MASK><NEW_LINE>// choose a random scan length<NEW_LINE>int len = scanlength.nextValue().intValue();<NEW_LINE>int offsets = random.nextInt(maxOffsets - 1);<NEW_LINE>final long startTimestamp;<NEW_LINE>if (offsets > 0) {<NEW_LINE>startTimestamp = state.startTimestamp + state.timestampGenerator.getOffset(offsets);<NEW_LINE>} else {<NEW_LINE>startTimestamp = state.startTimestamp;<NEW_LINE>}<NEW_LINE>// rando tags<NEW_LINE>Set<String> fields = new HashSet<String>();<NEW_LINE>for (int i = 0; i < tagPairs; ++i) {<NEW_LINE>if (groupBy && groupBys[i]) {<NEW_LINE>fields.add(tagKeys[i]);<NEW_LINE>} else {<NEW_LINE>fields.add(tagKeys[i] + tagPairDelimiter + tagValues[random.nextInt(tagCardinality[i])]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (queryTimeSpan > 0) {<NEW_LINE>final long endTimestamp;<NEW_LINE>if (queryRandomTimeSpan) {<NEW_LINE>endTimestamp = startTimestamp + (timestampInterval * random.nextInt(queryTimeSpan / timestampInterval));<NEW_LINE>} else {<NEW_LINE>endTimestamp = startTimestamp + queryTimeSpan;<NEW_LINE>}<NEW_LINE>fields.add(timestampKey + tagPairDelimiter + startTimestamp + queryTimeSpanDelimiter + endTimestamp);<NEW_LINE>} else {<NEW_LINE>fields.add(timestampKey + tagPairDelimiter + startTimestamp);<NEW_LINE>}<NEW_LINE>if (groupBy) {<NEW_LINE>fields.add(groupByKey + tagPairDelimiter + groupByFunction);<NEW_LINE>}<NEW_LINE>if (downsample) {<NEW_LINE>fields.add(downsampleKey + tagPairDelimiter + downsampleFunction + tagPairDelimiter + downsampleInterval);<NEW_LINE>}<NEW_LINE>final Vector<HashMap<String, ByteIterator>> results = new Vector<HashMap<String, ByteIterator>>();<NEW_LINE>db.scan(table, keyname, len, fields, results);<NEW_LINE>} | .nextInt(keys.length)]; |
156,470 | public boolean onCreateOptionsMenu(Menu menu) {<NEW_LINE>getMenuInflater().inflate(R.menu.main, menu);<NEW_LINE>popularItemDispay(menu.findItem(R.id.by_popular));<NEW_LINE>showLanguageIcon(menu.findItem(R.id.only_language));<NEW_LINE>menu.findItem(R.id.only_language).<MASK><NEW_LINE>menu.findItem(R.id.random_favorite).setVisible(modeType == ModeType.FAVORITE);<NEW_LINE>initializeSearchItem(menu.findItem(R.id.search));<NEW_LINE>if (modeType == ModeType.TAG) {<NEW_LINE>MenuItem item = menu.findItem(R.id.tag_manager);<NEW_LINE>item.setVisible(inspector.getTag().getId() > 0);<NEW_LINE>TagStatus ts = inspector.getTag().getStatus();<NEW_LINE>updateTagStatus(item, ts);<NEW_LINE>}<NEW_LINE>Utility.tintMenu(menu);<NEW_LINE>return true;<NEW_LINE>} | setVisible(modeType == ModeType.NORMAL); |
1,791,716 | public void configure(Context context) {<NEW_LINE>logger.info("configure from context: {}", context);<NEW_LINE>configManager = ConfigManager.getInstance();<NEW_LINE>topicProperties = configManager.getTopicProperties();<NEW_LINE>masterHostAndPortLists = configManager.getMqClusterUrl2Token().keySet();<NEW_LINE>tubeConfig = configManager.getMqClusterConfig();<NEW_LINE>configManager.getTopicConfig().addUpdateCallback(new ConfigUpdateCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void update() {<NEW_LINE>diffSetPublish(new HashSet<>(topicProperties.values()), new HashSet<>(configManager.getTopicProperties().values()));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>configManager.getMqClusterHolder().addUpdateCallback(new ConfigUpdateCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void update() {<NEW_LINE>diffUpdateTubeClient(masterHostAndPortLists, configManager.getMqClusterUrl2Token().keySet());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>producerInfoMap = new ConcurrentHashMap<>();<NEW_LINE>masterUrl2producers = new ConcurrentHashMap<>();<NEW_LINE>clientIdCache = tubeConfig.getClientIdCache();<NEW_LINE>if (clientIdCache) {<NEW_LINE>int survivedTime = tubeConfig.getMaxSurvivedTime();<NEW_LINE>if (survivedTime > 0) {<NEW_LINE>maxSurvivedTime = survivedTime;<NEW_LINE>} else {<NEW_LINE>logger.warn("invalid {}", survivedTime);<NEW_LINE>}<NEW_LINE>int survivedSize = tubeConfig.getMaxSurvivedSize();<NEW_LINE>if (survivedSize > 0) {<NEW_LINE>maxSurvivedSize = survivedSize;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>int badEventQueueSize = tubeConfig.getBadEventQueueSize();<NEW_LINE>Preconditions.checkArgument(badEventQueueSize > 0, "badEventQueueSize must be > 0");<NEW_LINE>resendQueue = new LinkedBlockingQueue<>(badEventQueueSize);<NEW_LINE>int threadNum = tubeConfig.getThreadNum();<NEW_LINE>Preconditions.checkArgument(threadNum > 0, "threadNum must be > 0");<NEW_LINE>sinkThreadPool = new Thread[threadNum];<NEW_LINE>int eventQueueSize = tubeConfig.getEventQueueSize();<NEW_LINE>Preconditions.checkArgument(eventQueueSize > 0, "eventQueueSize must be > 0");<NEW_LINE>eventQueue = new LinkedBlockingQueue<>(eventQueueSize);<NEW_LINE>if (tubeConfig.getDiskIoRatePerSec() != 0) {<NEW_LINE>diskRateLimiter = RateLimiter.create(tubeConfig.getDiskIoRatePerSec());<NEW_LINE>}<NEW_LINE>} | logger.warn("invalid {}", survivedSize); |
1,433,879 | public void verifyLock(long curTimeInMicros) throws Exception, BusyLockException, StaleLockException {<NEW_LINE>if (getLockColumn() == null)<NEW_LINE>throw new IllegalStateException("verifyLock() called without attempting to take the lock");<NEW_LINE>// Read back all columns. There should be only 1 if we got the lock<NEW_LINE>Map<C, <MASK><NEW_LINE>// Cleanup and check that we really got the lock<NEW_LINE>for (Entry<C, Long> entry : lockResult.entrySet()) {<NEW_LINE>// This is a stale lock that was never cleaned up<NEW_LINE>if (entry.getValue() != 0 && curTimeInMicros > entry.getValue()) {<NEW_LINE>if (failOnStaleLock) {<NEW_LINE>throw new StaleLockException("Stale lock on row '" + key + "'. Manual cleanup requried.");<NEW_LINE>}<NEW_LINE>locksToDelete.add(entry.getKey());<NEW_LINE>} else // Lock already taken, and not by us<NEW_LINE>if (!entry.getKey().equals(getLockColumn())) {<NEW_LINE>throw new BusyLockException("Lock already acquired for row '" + key + "' with lock column " + entry.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Long> lockResult = readLockColumns(readDataColumns); |
1,809,821 | protected void exportGenericElement(JRGenericPrintElement element) throws IOException {<NEW_LINE>GenericElementXmlHandler handler = (GenericElementXmlHandler) GenericElementHandlerEnviroment.getInstance(jasperReportsContext).getElementHandler(element.getGenericType(), getExporterKey());<NEW_LINE>if (handler != null) {<NEW_LINE>handler.exportElement(exporterContext, element);<NEW_LINE>} else {<NEW_LINE>xmlWriter.startElement(JRXmlConstants.ELEMENT_genericElement);<NEW_LINE>exportReportElement(element);<NEW_LINE>JRGenericElementType genericType = element.getGenericType();<NEW_LINE>xmlWriter.startElement(JRXmlConstants.ELEMENT_genericElementType);<NEW_LINE>xmlWriter.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_namespace, genericType.getNamespace());<NEW_LINE>xmlWriter.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_name, genericType.getName());<NEW_LINE>// genericElementType<NEW_LINE>xmlWriter.closeElement();<NEW_LINE>Set<String> names = element.getParameterNames();<NEW_LINE>for (Iterator<String> it = names.iterator(); it.hasNext(); ) {<NEW_LINE>String name = it.next();<NEW_LINE>Object value = element.getParameterValue(name);<NEW_LINE>xmlWriter.startElement(JRXmlConstants.ELEMENT_genericElementParameter);<NEW_LINE>xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_name, name);<NEW_LINE>if (value != null) {<NEW_LINE>String valueClass = value.getClass().getName();<NEW_LINE>// check if there's a builtin serializer for the value<NEW_LINE>boolean <MASK><NEW_LINE>if (!builtinSerialization) {<NEW_LINE>// try XML handlers, if none works then default back to the builtin serialization<NEW_LINE>builtinSerialization = !XmlValueHandlerUtils.instance().writeToXml(value, this);<NEW_LINE>}<NEW_LINE>if (builtinSerialization) {<NEW_LINE>String data = JRValueStringUtils.serialize(valueClass, value);<NEW_LINE>xmlWriter.startElement(JRXmlConstants.ELEMENT_genericElementParameterValue);<NEW_LINE>xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_class, valueClass);<NEW_LINE>xmlWriter.writeCDATA(data);<NEW_LINE>// genericElementParameterValue<NEW_LINE>xmlWriter.closeElement();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// genericElementParameter<NEW_LINE>xmlWriter.closeElement();<NEW_LINE>}<NEW_LINE>// genericElement<NEW_LINE>xmlWriter.closeElement();<NEW_LINE>}<NEW_LINE>} | builtinSerialization = JRValueStringUtils.hasSerializer(valueClass); |
163,748 | protected void updateSelection(Mode mode, int begin, int end) {<NEW_LINE>DoubleDBIDList[] values = silhouette.getSilhouetteValues();<NEW_LINE>if (begin < 0 || begin > end || end >= plotSize) {<NEW_LINE>LOG.warning("Invalid range in updateSelection: " + begin + " .. " + end);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>//<NEW_LINE>HashSetModifiableDBIDs //<NEW_LINE>selection = //<NEW_LINE>(selContext == null || mode == Mode.REPLACE) ? DBIDUtil.newHashSet() : DBIDUtil.newHashSet(selContext.getSelectedIds());<NEW_LINE>int clusbegin = 0;<NEW_LINE>for (int i = 0; i < values.length; i++) {<NEW_LINE>DoubleDBIDList cluster = values[i];<NEW_LINE>int tbegin = begin, tend = end;<NEW_LINE>if (begin < clusbegin) {<NEW_LINE>tbegin = 0;<NEW_LINE>} else {<NEW_LINE>tbegin = begin - clusbegin;<NEW_LINE>}<NEW_LINE>if (end >= clusbegin + cluster.size()) {<NEW_LINE>tend = cluster.size() - 1;<NEW_LINE>} else {<NEW_LINE>tend = end - clusbegin;<NEW_LINE>}<NEW_LINE>for (DBIDArrayIter it = cluster.iter().seek(tbegin); it.getOffset() <= tend; it.advance()) {<NEW_LINE>if (mode == Mode.INVERT) {<NEW_LINE>if (!selection.add(it)) {<NEW_LINE>selection.remove(it);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// In REPLACE and ADD, add objects.<NEW_LINE>// The difference was done before by not re-using the selection.<NEW_LINE>// Since we are using a set, we can just add in any case.<NEW_LINE>selection.add(it);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>clusbegin += cluster.size() + 3;<NEW_LINE>}<NEW_LINE>context.setSelection(new DBIDSelection(selection));<NEW_LINE>} | DBIDSelection selContext = context.getSelection(); |
698,364 | @Override<NEW_LINE>public Component createUIComponentImpl(@Nonnull Disposable parentUIDisposable) {<NEW_LINE>ModuleCompilerPathsManager moduleCompilerPathsManager = ModuleCompilerPathsManager.getInstance(getModule());<NEW_LINE>myInheritCompilerOutput = RadioButton.create(ProjectLocalize.projectInheritCompileOutputPath());<NEW_LINE>myPerModuleCompilerOutput = RadioButton.create(ProjectLocalize.projectModuleCompileOutputPath());<NEW_LINE>ValueGroups.boolGroup().add(myInheritCompilerOutput).add(myPerModuleCompilerOutput);<NEW_LINE>final ValueComponent.ValueListener<Boolean> listener = e -> enableCompilerSettings(!myInheritCompilerOutput.getValueOrError());<NEW_LINE>myInheritCompilerOutput.addValueListener(listener);<NEW_LINE>myPerModuleCompilerOutput.addValueListener(listener);<NEW_LINE>for (ContentFolderTypeProvider provider : ContentFolderTypeProvider.filter(myFilter)) {<NEW_LINE>CommitableFieldPanel panel = createOutputPathPanel("Select " + provider.getName() + " Output", provider, parentUIDisposable, url -> {<NEW_LINE>if (moduleCompilerPathsManager.isInheritedCompilerOutput()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>moduleCompilerPathsManager.setCompilerOutputUrl(provider, url);<NEW_LINE>});<NEW_LINE>myOutputFields.put(provider, panel);<NEW_LINE>}<NEW_LINE>myCbExcludeOutput = CheckBox.create(ProjectBundle.message("module.paths.exclude.output.checkbox"), moduleCompilerPathsManager.isExcludeOutput());<NEW_LINE>myCbExcludeOutput.addValueListener(e -> moduleCompilerPathsManager.setExcludeOutput(myCbExcludeOutput.getValueOrError()));<NEW_LINE>VerticalLayout panel = VerticalLayout.create();<NEW_LINE>panel.add(myInheritCompilerOutput);<NEW_LINE>panel.add(myPerModuleCompilerOutput);<NEW_LINE>FormBuilder formBuilder = FormBuilder.create();<NEW_LINE>for (Map.Entry<ContentFolderTypeProvider, CommitableFieldPanel> entry : myOutputFields.entrySet()) {<NEW_LINE>CommitableFieldPanel value = entry.getValue();<NEW_LINE>formBuilder.addLabeled(value.getLabelComponent(), value.getComponent());<NEW_LINE>}<NEW_LINE>formBuilder.addBottom(myCbExcludeOutput);<NEW_LINE>Component bottom = formBuilder.build();<NEW_LINE>bottom.addBorder(BorderPosition.LEFT, BorderStyle.EMPTY, Image.DEFAULT_ICON_SIZE);<NEW_LINE>panel.add(bottom);<NEW_LINE>// // fill with data<NEW_LINE>updateOutputPathPresentation();<NEW_LINE>//<NEW_LINE>// //compiler settings<NEW_LINE>final <MASK><NEW_LINE>myInheritCompilerOutput.setValue(outputPathInherited);<NEW_LINE>myPerModuleCompilerOutput.setValue(!outputPathInherited);<NEW_LINE>enableCompilerSettings(!outputPathInherited);<NEW_LINE>panel.addBorders(BorderStyle.EMPTY, null, 5);<NEW_LINE>return panel;<NEW_LINE>} | boolean outputPathInherited = moduleCompilerPathsManager.isInheritedCompilerOutput(); |
1,373,381 | public void applyChanges() {<NEW_LINE>boolean fire;<NEW_LINE>synchronized (this) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.fine("applyChanges");<NEW_LINE>pf.applyChanges();<NEW_LINE>// Make sure that completions settings that are only accessible for<NEW_LINE>// 'all languages' are not overriden by particular languages (mime types)<NEW_LINE>for (String mimeType : EditorSettings.getDefault().getAllMimeTypes()) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.fine("Cleaning up '" + mimeType + "' preferences");<NEW_LINE>Preferences prefs = MimeLookup.getLookup(mimeType<MASK><NEW_LINE>// NOI18N<NEW_LINE>prefs.remove(SimpleValueNames.COMPLETION_PAIR_CHARACTERS);<NEW_LINE>prefs.remove(SimpleValueNames.COMPLETION_AUTO_POPUP);<NEW_LINE>prefs.remove(SimpleValueNames.JAVADOC_AUTO_POPUP);<NEW_LINE>prefs.remove(SimpleValueNames.JAVADOC_POPUP_NEXT_TO_CC);<NEW_LINE>prefs.remove(SimpleValueNames.SHOW_DEPRECATED_MEMBERS);<NEW_LINE>prefs.remove(SimpleValueNames.COMPLETION_INSTANT_SUBSTITUTION);<NEW_LINE>prefs.remove(SimpleValueNames.COMPLETION_CASE_SENSITIVE);<NEW_LINE>}<NEW_LINE>pf.destroy();<NEW_LINE>pf = null;<NEW_LINE>panel.setSelector(null);<NEW_LINE>selector = null;<NEW_LINE>fire = changed;<NEW_LINE>changed = false;<NEW_LINE>}<NEW_LINE>if (fire) {<NEW_LINE>pcs.firePropertyChange(PROP_CHANGED, true, false);<NEW_LINE>}<NEW_LINE>} | ).lookup(Preferences.class); |
1,678,564 | protected void componentShowing() {<NEW_LINE>// NOI18N<NEW_LINE>Log.getLogger().entering("QueryBuilder", "componentShowing");<NEW_LINE>String command = getSqlCommand();<NEW_LINE>if (_queryModel == null)<NEW_LINE>_queryModel = new QueryModel(quoter);<NEW_LINE>Log.getLogger().finest(" * command=" + command);<NEW_LINE>// Parse the current query, in case it has changed<NEW_LINE>// Special case for handling null queries -- prompt for an initial table<NEW_LINE>// We should probably allow this, since the user can delete the last table in the<NEW_LINE>// editor anyway, so we need to be able to deal with empty queries as a special case.<NEW_LINE>if ((command == null) || (command.trim().length() == 0)) {<NEW_LINE>Log.getLogger().finest("QBShowing command is null");<NEW_LINE>setVisible(true);<NEW_LINE>this.repaint();<NEW_LINE>String msg = NbBundle.<MASK><NEW_LINE>// NOI18N<NEW_LINE>NotifyDescriptor // NOI18N<NEW_LINE>d = new NotifyDescriptor.Message(msg + "\n\n", NotifyDescriptor.ERROR_MESSAGE);<NEW_LINE>DialogDisplayer.getDefault().notify(d);<NEW_LINE>_queryBuilderPane.getQueryBuilderGraphFrame().addTable();<NEW_LINE>} else {<NEW_LINE>String queryText = getSqlText();<NEW_LINE>// parse and populate only if the query has changed.<NEW_LINE>if (queryText == null || (!command.trim().equalsIgnoreCase(queryText.trim()))) {<NEW_LINE>this.populate(command, false);<NEW_LINE>setVisible(true);<NEW_LINE>this.repaint();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>activateActions();<NEW_LINE>_queryBuilderPane.getQueryBuilderSqlTextArea().requestFocus();<NEW_LINE>if (DEBUG)<NEW_LINE>// NOI18N<NEW_LINE>System.out.println(" _queryBuilderPane.getQueryBuilderSqlTextArea().requestFocus () called. ");<NEW_LINE>} | getMessage(QueryBuilder.class, "EMPTY_QUERY_ADD_TABLE"); |
1,096,690 | public static DescribeVsStorageTrafficUsageDataResponse unmarshall(DescribeVsStorageTrafficUsageDataResponse describeVsStorageTrafficUsageDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeVsStorageTrafficUsageDataResponse.setRequestId(_ctx.stringValue("DescribeVsStorageTrafficUsageDataResponse.RequestId"));<NEW_LINE>List<TrafficUsageDataModule> trafficUsage = new ArrayList<TrafficUsageDataModule>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeVsStorageTrafficUsageDataResponse.TrafficUsage.Length"); i++) {<NEW_LINE>TrafficUsageDataModule trafficUsageDataModule = new TrafficUsageDataModule();<NEW_LINE>trafficUsageDataModule.setTimeStamp(_ctx.stringValue("DescribeVsStorageTrafficUsageDataResponse.TrafficUsage[" + i + "].TimeStamp"));<NEW_LINE>trafficUsageDataModule.setBucket(_ctx.stringValue("DescribeVsStorageTrafficUsageDataResponse.TrafficUsage[" + i + "].Bucket"));<NEW_LINE>trafficUsageDataModule.setLanTrafficInDataValue(_ctx.longValue("DescribeVsStorageTrafficUsageDataResponse.TrafficUsage[" + i + "].LanTrafficInDataValue"));<NEW_LINE>trafficUsageDataModule.setLanTrafficOutDataValue(_ctx.longValue("DescribeVsStorageTrafficUsageDataResponse.TrafficUsage[" + i + "].LanTrafficOutDataValue"));<NEW_LINE>trafficUsageDataModule.setWanTrafficInDataValue(_ctx.longValue("DescribeVsStorageTrafficUsageDataResponse.TrafficUsage[" + i + "].WanTrafficInDataValue"));<NEW_LINE>trafficUsageDataModule.setWanTrafficOutDataValue(_ctx.longValue("DescribeVsStorageTrafficUsageDataResponse.TrafficUsage[" + i + "].WanTrafficOutDataValue"));<NEW_LINE>trafficUsageDataModule.setLanBandwidthInDataValue(_ctx.floatValue("DescribeVsStorageTrafficUsageDataResponse.TrafficUsage[" + i + "].LanBandwidthInDataValue"));<NEW_LINE>trafficUsageDataModule.setLanBandwidthOutDataValue(_ctx.floatValue("DescribeVsStorageTrafficUsageDataResponse.TrafficUsage[" + i + "].LanBandwidthOutDataValue"));<NEW_LINE>trafficUsageDataModule.setWanBandwidthInDataValue(_ctx.floatValue("DescribeVsStorageTrafficUsageDataResponse.TrafficUsage[" + i + "].WanBandwidthInDataValue"));<NEW_LINE>trafficUsageDataModule.setWanBandwidthOutDataValue(_ctx.floatValue<MASK><NEW_LINE>trafficUsage.add(trafficUsageDataModule);<NEW_LINE>}<NEW_LINE>describeVsStorageTrafficUsageDataResponse.setTrafficUsage(trafficUsage);<NEW_LINE>return describeVsStorageTrafficUsageDataResponse;<NEW_LINE>} | ("DescribeVsStorageTrafficUsageDataResponse.TrafficUsage[" + i + "].WanBandwidthOutDataValue")); |
249,808 | private OHashTable.BucketPath nextLevelUp(final OHashTable.BucketPath bucketPath, final OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>if (bucketPath.parent == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final int nodeLocalDepth = bucketPath.nodeLocalDepth;<NEW_LINE>assert directory.getNodeLocalDepth(bucketPath.nodeIndex, atomicOperation) == bucketPath.nodeLocalDepth;<NEW_LINE>final int pointersSize = 1 << (MAX_LEVEL_DEPTH - nodeLocalDepth);<NEW_LINE>final OHashTable.BucketPath parent = bucketPath.parent;<NEW_LINE>if (parent.itemIndex < MAX_LEVEL_SIZE / 2) {<NEW_LINE>final int nextParentIndex = (parent.itemIndex / pointersSize + 1) * pointersSize;<NEW_LINE>return new OHashTable.BucketPath(parent.parent, 0, nextParentIndex, parent.nodeIndex, <MASK><NEW_LINE>}<NEW_LINE>final int nextParentIndex = ((parent.itemIndex - MAX_LEVEL_SIZE / 2) / pointersSize + 1) * pointersSize + MAX_LEVEL_SIZE / 2;<NEW_LINE>if (nextParentIndex < MAX_LEVEL_SIZE) {<NEW_LINE>return new BucketPath(parent.parent, 0, nextParentIndex, parent.nodeIndex, parent.nodeLocalDepth, parent.nodeGlobalDepth);<NEW_LINE>}<NEW_LINE>return nextLevelUp(new OHashTable.BucketPath(parent.parent, 0, MAX_LEVEL_SIZE - 1, parent.nodeIndex, parent.nodeLocalDepth, parent.nodeGlobalDepth), atomicOperation);<NEW_LINE>} | parent.nodeLocalDepth, parent.nodeGlobalDepth); |
1,455,190 | private Predicate toFilterPredicate(EffectivePerson effectivePerson, Business business, Wi wi) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Draft.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Draft> cq = cb.createQuery(Draft.class);<NEW_LINE>Root<Draft> root = cq.from(Draft.class);<NEW_LINE>Predicate p = cb.equal(root.get(Draft_.person), effectivePerson.getDistinguishedName());<NEW_LINE>if (ListTools.isNotEmpty(wi.getApplicationList())) {<NEW_LINE>p = cb.and(p, root.get(Draft_.application).in<MASK><NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(wi.getProcessList())) {<NEW_LINE>if (BooleanUtils.isFalse(wi.getRelateEditionProcess())) {<NEW_LINE>p = cb.and(p, root.get(Draft_.process).in(wi.getProcessList()));<NEW_LINE>} else {<NEW_LINE>p = cb.and(p, root.get(Draft_.process).in(business.process().listEditionProcess(wi.getProcessList())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (DateTools.isDateTimeOrDate(wi.getStartTime())) {<NEW_LINE>p = cb.and(p, cb.greaterThan(root.get(Draft_.createTime), DateTools.parse(wi.getStartTime())));<NEW_LINE>}<NEW_LINE>if (DateTools.isDateTimeOrDate(wi.getEndTime())) {<NEW_LINE>p = cb.and(p, cb.lessThan(root.get(Draft_.createTime), DateTools.parse(wi.getEndTime())));<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(wi.getCreatorUnitList())) {<NEW_LINE>p = cb.and(p, root.get(Draft_.unit).in(wi.getCreatorUnitList()));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNoneBlank(wi.getTitle())) {<NEW_LINE>String key = StringTools.escapeSqlLikeKey(wi.getTitle());<NEW_LINE>p = cb.and(p, cb.like(root.get(Draft_.title), "%" + key + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>}<NEW_LINE>return p;<NEW_LINE>} | (wi.getApplicationList())); |
415,013 | public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.history);<NEW_LINE>ListView listView = findViewById(R.id.history_list);<NEW_LINE>fab = findViewById(R.id.history_add);<NEW_LINE>fab.setOnClickListener(v -> {<NEW_LINE>Intent i = new Intent(HistoryActivity.this, ManualActivity.class);<NEW_LINE>startActivityForResult(i, 0);<NEW_LINE>});<NEW_LINE>mDB = DBHelper.getReadableDatabase(this);<NEW_LINE>formatter = new Formatter(this);<NEW_LINE>listView.setDividerHeight(2);<NEW_LINE>listView.setOnItemClickListener(this);<NEW_LINE>cursorAdapter = new HistoryListAdapter(this, null);<NEW_LINE>listView.setAdapter(cursorAdapter);<NEW_LINE>this.getSupportLoaderManager().initLoader(0, null, this);<NEW_LINE>AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);<NEW_LINE>new <MASK><NEW_LINE>} | ActivityCleaner().conditionalRecompute(mDB); |
932,535 | private Object copyingObjects(Object object, boolean copyCacheFields) {<NEW_LINE>if (object instanceof Number) {<NEW_LINE>return (Number) object;<NEW_LINE>} else if (object instanceof String) {<NEW_LINE>return (String) object;<NEW_LINE>} else if (object instanceof Boolean) {<NEW_LINE>return (Boolean) object;<NEW_LINE>} else if (object instanceof List) {<NEW_LINE>List<Object> <MASK><NEW_LINE>List<Object> list = (List<Object>) object;<NEW_LINE>for (Object o : list) {<NEW_LINE>copy.add(copyingObjects(o, copyCacheFields));<NEW_LINE>}<NEW_LINE>return copy;<NEW_LINE>} else if (object instanceof Map) {<NEW_LINE>Map<Object, Object> copy = new LinkedHashMap<>();<NEW_LINE>Map<Object, Object> map = (Map<Object, Object>) object;<NEW_LINE>for (Object o : map.keySet()) {<NEW_LINE>copy.put(o, copyingObjects(map.get(o), copyCacheFields));<NEW_LINE>}<NEW_LINE>return copy;<NEW_LINE>} else // OSMAND ANDROID CHANGE BEGIN:<NEW_LINE>// removed instanceOf OpExprEvaluator<NEW_LINE>// OSMAND ANDROID CHANGE END:<NEW_LINE>if (object instanceof OpObject) {<NEW_LINE>return new OpObject((OpObject) object);<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("Type of object is not supported");<NEW_LINE>}<NEW_LINE>} | copy = new ArrayList<>(); |
768,717 | private EntityDef addExecutionPointDefinitionEntity() {<NEW_LINE>final String guid = "d7f8d1d2-8cec-4fd2-b9fd-c8307cad750d";<NEW_LINE>final String name = "ExecutionPointDefinition";<NEW_LINE>final String description = "A description of an activity that supports the implementation of a governance requirement.";<NEW_LINE>final String descriptionGUID = null;<NEW_LINE>final String superTypeName = "Referenceable";<NEW_LINE>EntityDef entityDef = archiveHelper.getDefaultEntityDef(guid, name, this.archiveBuilder.getEntityDef<MASK><NEW_LINE>List<TypeDefAttribute> properties = new ArrayList<>();<NEW_LINE>TypeDefAttribute property;<NEW_LINE>final String attribute1Name = "displayName";<NEW_LINE>final String attribute1Description = "Short name for display and reports.";<NEW_LINE>final String attribute1DescriptionGUID = null;<NEW_LINE>final String attribute2Name = "description";<NEW_LINE>final String attribute2Description = "Description of the execution point.";<NEW_LINE>final String attribute2DescriptionGUID = null;<NEW_LINE>property = archiveHelper.getStringTypeDefAttribute(attribute1Name, attribute1Description, attribute1DescriptionGUID);<NEW_LINE>properties.add(property);<NEW_LINE>property = archiveHelper.getStringTypeDefAttribute(attribute2Name, attribute2Description, attribute2DescriptionGUID);<NEW_LINE>properties.add(property);<NEW_LINE>entityDef.setPropertiesDefinition(properties);<NEW_LINE>return entityDef;<NEW_LINE>} | (superTypeName), description, descriptionGUID); |
1,792,302 | public static DescribeFlowJobResponse unmarshall(DescribeFlowJobResponse describeFlowJobResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeFlowJobResponse.setRequestId(_ctx.stringValue("DescribeFlowJobResponse.RequestId"));<NEW_LINE>describeFlowJobResponse.setAdhoc(_ctx.stringValue("DescribeFlowJobResponse.Adhoc"));<NEW_LINE>describeFlowJobResponse.setAlertConf(_ctx.stringValue("DescribeFlowJobResponse.AlertConf"));<NEW_LINE>describeFlowJobResponse.setCategoryId(_ctx.stringValue("DescribeFlowJobResponse.CategoryId"));<NEW_LINE>describeFlowJobResponse.setCustomVariables(_ctx.stringValue("DescribeFlowJobResponse.CustomVariables"));<NEW_LINE>describeFlowJobResponse.setDescription(_ctx.stringValue("DescribeFlowJobResponse.Description"));<NEW_LINE>describeFlowJobResponse.setEditLockDetail(_ctx.stringValue("DescribeFlowJobResponse.EditLockDetail"));<NEW_LINE>describeFlowJobResponse.setEnvConf(_ctx.stringValue("DescribeFlowJobResponse.EnvConf"));<NEW_LINE>describeFlowJobResponse.setFailAct(_ctx.stringValue("DescribeFlowJobResponse.FailAct"));<NEW_LINE>describeFlowJobResponse.setGmtCreate(_ctx.longValue("DescribeFlowJobResponse.GmtCreate"));<NEW_LINE>describeFlowJobResponse.setGmtModified(_ctx.longValue("DescribeFlowJobResponse.GmtModified"));<NEW_LINE>describeFlowJobResponse.setId(_ctx.stringValue("DescribeFlowJobResponse.Id"));<NEW_LINE>describeFlowJobResponse.setLastInstanceId(_ctx.stringValue("DescribeFlowJobResponse.LastInstanceId"));<NEW_LINE>describeFlowJobResponse.setMaxRetry<MASK><NEW_LINE>describeFlowJobResponse.setMaxRunningTimeSec(_ctx.longValue("DescribeFlowJobResponse.MaxRunningTimeSec"));<NEW_LINE>describeFlowJobResponse.setMonitorConf(_ctx.stringValue("DescribeFlowJobResponse.MonitorConf"));<NEW_LINE>describeFlowJobResponse.setName(_ctx.stringValue("DescribeFlowJobResponse.Name"));<NEW_LINE>describeFlowJobResponse.setParamConf(_ctx.stringValue("DescribeFlowJobResponse.ParamConf"));<NEW_LINE>describeFlowJobResponse.setParams(_ctx.stringValue("DescribeFlowJobResponse.Params"));<NEW_LINE>describeFlowJobResponse.setRetryInterval(_ctx.longValue("DescribeFlowJobResponse.RetryInterval"));<NEW_LINE>describeFlowJobResponse.setRetryPolicy(_ctx.stringValue("DescribeFlowJobResponse.RetryPolicy"));<NEW_LINE>describeFlowJobResponse.setRunConf(_ctx.stringValue("DescribeFlowJobResponse.RunConf"));<NEW_LINE>describeFlowJobResponse.setType(_ctx.stringValue("DescribeFlowJobResponse.Type"));<NEW_LINE>describeFlowJobResponse.setMode(_ctx.stringValue("DescribeFlowJobResponse.mode"));<NEW_LINE>List<Resource> resourceList = new ArrayList<Resource>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeFlowJobResponse.ResourceList.Length"); i++) {<NEW_LINE>Resource resource = new Resource();<NEW_LINE>resource.setAlias(_ctx.stringValue("DescribeFlowJobResponse.ResourceList[" + i + "].Alias"));<NEW_LINE>resource.setPath(_ctx.stringValue("DescribeFlowJobResponse.ResourceList[" + i + "].Path"));<NEW_LINE>resourceList.add(resource);<NEW_LINE>}<NEW_LINE>describeFlowJobResponse.setResourceList(resourceList);<NEW_LINE>return describeFlowJobResponse;<NEW_LINE>} | (_ctx.integerValue("DescribeFlowJobResponse.MaxRetry")); |
1,037,689 | private void initSuperUsersAndGroupMapping(String authorizerName, Map<String, BasicAuthorizerUser> userMap, Map<String, BasicAuthorizerRole> roleMap, Map<String, BasicAuthorizerGroupMapping> groupMappingMap, String initialAdminUser, String initialAdminRole, String initialAdminGroupMapping) {<NEW_LINE>if (!roleMap.containsKey(BasicAuthUtils.ADMIN_NAME)) {<NEW_LINE>createRoleInternal(authorizerName, BasicAuthUtils.ADMIN_NAME);<NEW_LINE>setPermissionsInternal(authorizerName, BasicAuthUtils.ADMIN_NAME, SUPERUSER_PERMISSIONS);<NEW_LINE>}<NEW_LINE>if (!roleMap.containsKey(BasicAuthUtils.INTERNAL_USER_NAME)) {<NEW_LINE>createRoleInternal(authorizerName, BasicAuthUtils.INTERNAL_USER_NAME);<NEW_LINE>setPermissionsInternal(authorizerName, BasicAuthUtils.INTERNAL_USER_NAME, SUPERUSER_PERMISSIONS);<NEW_LINE>}<NEW_LINE>if (!userMap.containsKey(BasicAuthUtils.ADMIN_NAME)) {<NEW_LINE><MASK><NEW_LINE>assignUserRoleInternal(authorizerName, BasicAuthUtils.ADMIN_NAME, BasicAuthUtils.ADMIN_NAME);<NEW_LINE>}<NEW_LINE>if (!userMap.containsKey(BasicAuthUtils.INTERNAL_USER_NAME)) {<NEW_LINE>createUserInternal(authorizerName, BasicAuthUtils.INTERNAL_USER_NAME);<NEW_LINE>assignUserRoleInternal(authorizerName, BasicAuthUtils.INTERNAL_USER_NAME, BasicAuthUtils.INTERNAL_USER_NAME);<NEW_LINE>}<NEW_LINE>if (initialAdminRole != null && !(initialAdminRole.equals(BasicAuthUtils.ADMIN_NAME) || initialAdminRole.equals(BasicAuthUtils.INTERNAL_USER_NAME)) && !roleMap.containsKey(initialAdminRole)) {<NEW_LINE>createRoleInternal(authorizerName, initialAdminRole);<NEW_LINE>setPermissionsInternal(authorizerName, initialAdminRole, SUPERUSER_PERMISSIONS);<NEW_LINE>}<NEW_LINE>if (initialAdminUser != null && !(initialAdminUser.equals(BasicAuthUtils.ADMIN_NAME) || initialAdminUser.equals(BasicAuthUtils.INTERNAL_USER_NAME)) && !userMap.containsKey(initialAdminUser)) {<NEW_LINE>createUserInternal(authorizerName, initialAdminUser);<NEW_LINE>assignUserRoleInternal(authorizerName, initialAdminUser, initialAdminRole == null ? BasicAuthUtils.ADMIN_NAME : initialAdminRole);<NEW_LINE>}<NEW_LINE>if (initialAdminGroupMapping != null && !groupMappingMap.containsKey(BasicAuthUtils.ADMIN_GROUP_MAPPING_NAME)) {<NEW_LINE>BasicAuthorizerGroupMapping groupMapping = new BasicAuthorizerGroupMapping(BasicAuthUtils.ADMIN_GROUP_MAPPING_NAME, initialAdminGroupMapping, new HashSet<>(Collections.singletonList(initialAdminRole == null ? BasicAuthUtils.ADMIN_NAME : initialAdminRole)));<NEW_LINE>createGroupMappingInternal(authorizerName, groupMapping);<NEW_LINE>}<NEW_LINE>} | createUserInternal(authorizerName, BasicAuthUtils.ADMIN_NAME); |
764,930 | private static XMSSMTPrivateKey xmssmtCreateKeyStructure(XMSSMTPrivateKeyParameters keyParams) throws IOException {<NEW_LINE>byte[<MASK><NEW_LINE>int n = keyParams.getParameters().getTreeDigestSize();<NEW_LINE>int totalHeight = keyParams.getParameters().getHeight();<NEW_LINE>int indexSize = (totalHeight + 7) / 8;<NEW_LINE>int secretKeySize = n;<NEW_LINE>int secretKeyPRFSize = n;<NEW_LINE>int publicSeedSize = n;<NEW_LINE>int rootSize = n;<NEW_LINE>int position = 0;<NEW_LINE>int index = (int) XMSSUtil.bytesToXBigEndian(keyData, position, indexSize);<NEW_LINE>if (!XMSSUtil.isIndexValid(totalHeight, index)) {<NEW_LINE>throw new IllegalArgumentException("index out of bounds");<NEW_LINE>}<NEW_LINE>position += indexSize;<NEW_LINE>byte[] secretKeySeed = XMSSUtil.extractBytesAtOffset(keyData, position, secretKeySize);<NEW_LINE>position += secretKeySize;<NEW_LINE>byte[] secretKeyPRF = XMSSUtil.extractBytesAtOffset(keyData, position, secretKeyPRFSize);<NEW_LINE>position += secretKeyPRFSize;<NEW_LINE>byte[] publicSeed = XMSSUtil.extractBytesAtOffset(keyData, position, publicSeedSize);<NEW_LINE>position += publicSeedSize;<NEW_LINE>byte[] root = XMSSUtil.extractBytesAtOffset(keyData, position, rootSize);<NEW_LINE>position += rootSize; | ] keyData = keyParams.getEncoded(); |
801,450 | private boolean onPaste(boolean isPastedAsPlainText) {<NEW_LINE>ClipboardManager clipboardManager = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);<NEW_LINE>StringBuilder text = new StringBuilder();<NEW_LINE>StringBuilder html = new StringBuilder();<NEW_LINE>if (clipboardManager != null && clipboardManager.hasPrimaryClip()) {<NEW_LINE>ClipData clipData = clipboardManager.getPrimaryClip();<NEW_LINE>int itemCount = clipData.getItemCount();<NEW_LINE>for (int i = 0; i < itemCount; i++) {<NEW_LINE>Item item = clipData.getItemAt(i);<NEW_LINE>text.append(item<MASK><NEW_LINE>if (!isPastedAsPlainText) {<NEW_LINE>html.append(item.coerceToHtmlText(getContext()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// temporarily disable listener during call to toHtml()<NEW_LINE>disableTextChangedListener();<NEW_LINE>String content = toHtml(getText(), false);<NEW_LINE>int cursorPositionStart = getSelectionStart();<NEW_LINE>int cursorPositionEnd = getSelectionEnd();<NEW_LINE>enableTextChangedListener();<NEW_LINE>ReactContext reactContext = (ReactContext) getContext();<NEW_LINE>EventDispatcher eventDispatcher = reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();<NEW_LINE>eventDispatcher.dispatchEvent(new ReactAztecPasteEvent(getId(), content, cursorPositionStart, cursorPositionEnd, text.toString(), html.toString()));<NEW_LINE>return true;<NEW_LINE>} | .coerceToText(getContext())); |
1,101,541 | public Object visit(ASTJoinClause node, Object data) {<NEW_LINE>// first child is the table reference<NEW_LINE>Node tableReference = node.getChild(0);<NEW_LINE>// remaining children are joins<NEW_LINE>int lineNumber = tableReference.getBeginLine();<NEW_LINE>for (int i = 1; i < node.getNumChildren(); i++) {<NEW_LINE>lineNumber++;<NEW_LINE>Node child = node.getChild(i);<NEW_LINE>if (child.getBeginLine() != lineNumber) {<NEW_LINE>addViolationWithMessage(data, child, child.getXPathNodeName() + " should be on line " + lineNumber);<NEW_LINE>}<NEW_LINE>List<ASTEqualityExpression> conditions = child.findDescendantsOfType(ASTEqualityExpression.class);<NEW_LINE>if (conditions.size() == 1) {<NEW_LINE>// one condition should be on the same line<NEW_LINE>ASTEqualityExpression singleCondition = conditions.get(0);<NEW_LINE>if (singleCondition.getBeginLine() != lineNumber) {<NEW_LINE>addViolationWithMessage(data, child, "Join condition \"" + singleCondition.getImage() + "\" should be on line " + lineNumber);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// each condition on a separate line<NEW_LINE>for (ASTEqualityExpression singleCondition : conditions) {<NEW_LINE>lineNumber++;<NEW_LINE>if (singleCondition.getBeginLine() != lineNumber) {<NEW_LINE>addViolationWithMessage(data, child, "Join condition \"" + singleCondition.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.visit(node, data);<NEW_LINE>} | getImage() + "\" should be on line " + lineNumber); |
1,790,814 | public Object call(Object who, Method method, Object... args) throws Throwable {<NEW_LINE>IInterface appThread = (IInterface) args[0];<NEW_LINE>Intent service = (Intent) args[1];<NEW_LINE>String resolvedType = (String) args[2];<NEW_LINE>if (service.getComponent() != null && getHostPkg().equals(service.getComponent().getPackageName())) {<NEW_LINE>// for server process<NEW_LINE>return method.invoke(who, args);<NEW_LINE>}<NEW_LINE>int userId = VUserHandle.myUserId();<NEW_LINE>if (service.getBooleanExtra("_VA_|_from_inner_", false)) {<NEW_LINE>userId = service.getIntExtra("_VA_|_user_id_", userId);<NEW_LINE>service = service.getParcelableExtra("_VA_|_intent_");<NEW_LINE>} else {<NEW_LINE>if (isServerProcess()) {<NEW_LINE>userId = service.getIntExtra("_VA_|_user_id_", VUserHandle.USER_NULL);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>service.setDataAndType(service.getData(), resolvedType);<NEW_LINE>ServiceInfo serviceInfo = VirtualCore.get().resolveServiceInfo(service, VUserHandle.myUserId());<NEW_LINE>if (serviceInfo != null) {<NEW_LINE>if (isFiltered(service)) {<NEW_LINE>return service.getComponent();<NEW_LINE>}<NEW_LINE>return VActivityManager.get().startService(<MASK><NEW_LINE>}<NEW_LINE>return method.invoke(who, args);<NEW_LINE>} | appThread, service, resolvedType, userId); |
163,755 | private void init(Context context, AttributeSet attrs) {<NEW_LINE>TypedArray ta = getContext().obtainStyledAttributes(attrs, R.styleable.SmoothCheckBox);<NEW_LINE>int tickColor = ThemeStore.accentColor(context);<NEW_LINE>mCheckedColor = context.getResources().getColor(R.color.background_card);<NEW_LINE>mUnCheckedColor = context.getResources().getColor(R.color.background_menu);<NEW_LINE>mFloorColor = context.getResources().getColor(R.color.transparent30);<NEW_LINE>tickColor = ta.getColor(R.styleable.SmoothCheckBox_color_tick, tickColor);<NEW_LINE>mAnimDuration = ta.getInt(R.styleable.SmoothCheckBox_duration, DEF_ANIM_DURATION);<NEW_LINE>mFloorColor = ta.getColor(R.styleable.SmoothCheckBox_color_unchecked_stroke, mFloorColor);<NEW_LINE>mCheckedColor = ta.getColor(R.styleable.SmoothCheckBox_color_checked, mCheckedColor);<NEW_LINE>mUnCheckedColor = ta.getColor(R.styleable.SmoothCheckBox_color_unchecked, mUnCheckedColor);<NEW_LINE>mStrokeWidth = ta.getDimensionPixelSize(R.styleable.SmoothCheckBox_stroke_width, DensityUtil.dp2px(getContext(), 0));<NEW_LINE>ta.recycle();<NEW_LINE>mFloorUnCheckedColor = mFloorColor;<NEW_LINE>mTickPaint = new Paint(Paint.ANTI_ALIAS_FLAG);<NEW_LINE>mTickPaint.setStyle(Paint.Style.STROKE);<NEW_LINE>mTickPaint.setStrokeCap(Paint.Cap.ROUND);<NEW_LINE>mTickPaint.setColor(tickColor);<NEW_LINE>mFloorPaint <MASK><NEW_LINE>mFloorPaint.setStyle(Paint.Style.FILL);<NEW_LINE>mFloorPaint.setColor(mFloorColor);<NEW_LINE>mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);<NEW_LINE>mPaint.setStyle(Paint.Style.FILL);<NEW_LINE>mPaint.setColor(mCheckedColor);<NEW_LINE>mTickPath = new Path();<NEW_LINE>mCenterPoint = new Point();<NEW_LINE>mTickPoints = new Point[3];<NEW_LINE>mTickPoints[0] = new Point();<NEW_LINE>mTickPoints[1] = new Point();<NEW_LINE>mTickPoints[2] = new Point();<NEW_LINE>setOnClickListener(v -> {<NEW_LINE>toggle();<NEW_LINE>mTickDrawing = false;<NEW_LINE>mDrewDistance = 0;<NEW_LINE>if (isChecked()) {<NEW_LINE>startCheckedAnimation();<NEW_LINE>} else {<NEW_LINE>startUnCheckedAnimation();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | = new Paint(Paint.ANTI_ALIAS_FLAG); |
1,112,737 | final UpdateGroupResult executeUpdateGroup(UpdateGroupRequest updateGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UpdateGroupRequest> request = null;<NEW_LINE>Response<UpdateGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateGroupRequest));<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, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,692,011 | private TargetWindowT loadIfNeeded(BoundedWindow mainWindow) {<NEW_LINE>try {<NEW_LINE>String processRequestInstructionId = idGenerator.getId();<NEW_LINE>InstructionRequest processRequest = InstructionRequest.newBuilder().setInstructionId(processRequestInstructionId).setProcessBundle(ProcessBundleRequest.newBuilder().setProcessBundleDescriptorId(registerIfRequired())).build();<NEW_LINE>ConcurrentLinkedQueue<WindowedValue<KV<byte[], TargetWindowT>>> outputValue = new ConcurrentLinkedQueue<>();<NEW_LINE>// Open the inbound consumer<NEW_LINE>InboundDataClient waitForInboundTermination = beamFnDataService.receive(LogicalEndpoint.data(processRequestInstructionId, "write"), inboundCoder, outputValue::add);<NEW_LINE>CompletionStage<InstructionResponse> <MASK><NEW_LINE>// Open the outbound consumer<NEW_LINE>try (CloseableFnDataReceiver<WindowedValue<KV<byte[], BoundedWindow>>> outboundConsumer = beamFnDataService.send(LogicalEndpoint.data(processRequestInstructionId, "read"), outboundCoder)) {<NEW_LINE>outboundConsumer.accept(WindowedValue.valueInGlobalWindow(KV.of(EMPTY_ARRAY, mainWindow)));<NEW_LINE>}<NEW_LINE>// Check to see if processing the request failed.<NEW_LINE>MoreFutures.get(processResponse);<NEW_LINE>waitForInboundTermination.awaitCompletion();<NEW_LINE>WindowedValue<KV<byte[], TargetWindowT>> sideInputWindow = outputValue.poll();<NEW_LINE>checkState(sideInputWindow != null, "Expected side input window to have been emitted by SDK harness.");<NEW_LINE>checkState(sideInputWindow.getValue() != null, "Side input window emitted by SDK harness was a WindowedValue with no value in it.");<NEW_LINE>checkState(sideInputWindow.getValue().getValue() != null, "Side input window emitted by SDK harness was a WindowedValue<KV<...>> with a null V.");<NEW_LINE>checkState(outputValue.isEmpty(), "Expected only a single side input window to have been emitted by " + "the SDK harness but also received %s", outputValue);<NEW_LINE>return sideInputWindow.getValue().getValue();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOG.error("Unable to map main input window {} to side input window.", mainWindow, e);<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>} | processResponse = instructionRequestHandler.handle(processRequest); |
1,138,641 | static Pair<Map<String, Set<String>>, Set<Project>> computeModulesAndPackages(final CompilationInfo info, Result tags) {<NEW_LINE>Map<String, Set<String>> module2UsedUnexportedPackages = new HashMap<>();<NEW_LINE>Set<TypeElement> seenClasses = new HashSet<>();<NEW_LINE>Set<Project> seenProjects = new HashSet<>();<NEW_LINE>Set<CompilationUnitTree> seen = new HashSet<>();<NEW_LINE>computeModulesAndPackages(info, info.getCompilationUnit(), module2UsedUnexportedPackages, seenClasses, seenProjects, seen);<NEW_LINE>List<Tag> buildTags = tags.<MASK><NEW_LINE>if (buildTags != null) {<NEW_LINE>for (Tag buildTag : buildTags) {<NEW_LINE>String[] classNames = buildTag.getValue().split("\\s+");<NEW_LINE>for (String className : classNames) {<NEW_LINE>TypeElement built = info.getElements().getTypeElement(className);<NEW_LINE>if (built == null)<NEW_LINE>continue;<NEW_LINE>TreePath builtPath = info.getTrees().getPath(built);<NEW_LINE>if (// XXX: can do something?<NEW_LINE>builtPath == null)<NEW_LINE>continue;<NEW_LINE>computeModulesAndPackages(info, builtPath.getCompilationUnit(), module2UsedUnexportedPackages, seenClasses, seenProjects, seen);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Pair.of(module2UsedUnexportedPackages, seenProjects);<NEW_LINE>} | getName2Tag().get("build"); |
1,632,570 | public void read(org.apache.thrift.protocol.TProtocol prot, startGetSummaries_result struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(3);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct.success = new org.apache.accumulo.core.dataImpl.thrift.TSummaries();<NEW_LINE><MASK><NEW_LINE>struct.setSuccessIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException();<NEW_LINE>struct.sec.read(iprot);<NEW_LINE>struct.setSecIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct.tope = new org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException();<NEW_LINE>struct.tope.read(iprot);<NEW_LINE>struct.setTopeIsSet(true);<NEW_LINE>}<NEW_LINE>} | struct.success.read(iprot); |
26,984 | private BInvokableSymbol createReturnTrueStatement(Location pos, BLangFunction function, BLangBlockFunctionBody functionBlock) {<NEW_LINE>BLangReturn trueReturnStmt = ASTBuilderUtil.createReturnStmt(pos, functionBlock);<NEW_LINE>trueReturnStmt.expr = ASTBuilderUtil.createLiteral(pos, symTable.booleanType, true);<NEW_LINE>// Create function symbol before visiting desugar phase for the function<NEW_LINE>BInvokableSymbol functionSymbol = Symbols.createFunctionSymbol(Flags.asMask(function.flagSet), new Name(function.name.value), new Name(function.name.originalValue), env.enclPkg.packageID, function.getBType(), env.enclEnv.enclVarSym, true, function.pos, VIRTUAL);<NEW_LINE>functionSymbol.originalName = new Name(function.name.originalValue);<NEW_LINE>functionSymbol.retType = function.returnTypeNode.getBType();<NEW_LINE>functionSymbol.params = function.requiredParams.stream().map(param -> param.symbol).collect(Collectors.toList());<NEW_LINE>functionSymbol.scope = env.scope;<NEW_LINE>functionSymbol.type = new BInvokableType(Collections.singletonList(getStringAnyTupleType()), getRestType(functionSymbol), symTable.booleanType, null);<NEW_LINE>function.symbol = functionSymbol;<NEW_LINE>rewrite(function, env);<NEW_LINE><MASK><NEW_LINE>return functionSymbol;<NEW_LINE>} | env.enclPkg.addFunction(function); |
940,016 | final SynthesizeSpeechResult executeSynthesizeSpeech(SynthesizeSpeechRequest synthesizeSpeechRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(synthesizeSpeechRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SynthesizeSpeechRequest> request = null;<NEW_LINE>Response<SynthesizeSpeechResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SynthesizeSpeechRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(synthesizeSpeechRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SynthesizeSpeech");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SynthesizeSpeechResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(false).withHasStreamingSuccessResponse(true), new SynthesizeSpeechResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>request.addHandlerContext(HandlerContextKey.HAS_STREAMING_OUTPUT, Boolean.TRUE);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "Polly"); |
1,231,593 | public static Builder newBuilder(WorkflowSettings copy) {<NEW_LINE>Builder builder = newBuilder();<NEW_LINE>builder.inputSpec = copy.getInputSpec();<NEW_LINE>builder.outputDir = copy.getOutputDir();<NEW_LINE>builder<MASK><NEW_LINE>builder.skipOverwrite = copy.isSkipOverwrite();<NEW_LINE>builder.removeOperationIdPrefix = copy.isRemoveOperationIdPrefix();<NEW_LINE>builder.skipOperationExample = copy.isSkipOperationExample();<NEW_LINE>builder.logToStderr = copy.isLogToStderr();<NEW_LINE>builder.validateSpec = copy.isValidateSpec();<NEW_LINE>builder.enablePostProcessFile = copy.isEnablePostProcessFile();<NEW_LINE>builder.enableMinimalUpdate = copy.isEnableMinimalUpdate();<NEW_LINE>builder.generateAliasAsModel = copy.isGenerateAliasAsModel();<NEW_LINE>builder.strictSpecBehavior = copy.isStrictSpecBehavior();<NEW_LINE>builder.templatingEngineName = copy.getTemplatingEngineName();<NEW_LINE>builder.ignoreFileOverride = copy.getIgnoreFileOverride();<NEW_LINE>// this, and any other collections, must be mutable in the builder.<NEW_LINE>builder.globalProperties = new HashMap<>(copy.getGlobalProperties());<NEW_LINE>// force builder "with" methods to invoke side effects<NEW_LINE>builder.withTemplateDir(copy.getTemplateDir());<NEW_LINE>return builder;<NEW_LINE>} | .verbose = copy.isVerbose(); |
538,174 | public Callable<ResponseEntity<String>> elidePatch(@RequestHeader HttpHeaders requestHeaders, @RequestParam MultiValueMap<String, String> allRequestParams, @RequestBody String body, HttpServletRequest request, Authentication authentication) {<NEW_LINE>final String apiVersion = HeaderUtils.resolveApiVersion(requestHeaders);<NEW_LINE>final Map<String, List<String>> requestHeadersCleaned = HeaderUtils.lowercaseAndRemoveAuthHeaders(requestHeaders);<NEW_LINE>final String pathname = getJsonApiPath(request, settings.<MASK><NEW_LINE>final User user = new AuthenticationUser(authentication);<NEW_LINE>final String baseUrl = getBaseUrlEndpoint();<NEW_LINE>return new Callable<ResponseEntity<String>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ResponseEntity<String> call() throws Exception {<NEW_LINE>ElideResponse response = elide.patch(baseUrl, request.getContentType(), request.getContentType(), pathname, body, convert(allRequestParams), requestHeadersCleaned, user, apiVersion, UUID.randomUUID());<NEW_LINE>return ResponseEntity.status(response.getResponseCode()).body(response.getBody());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | getJsonApi().getPath()); |
1,478,448 | public int remove(final int key) {<NEW_LINE>if (key == FREE_KEY) {<NEW_LINE>if (!m_hasFreeKey)<NEW_LINE>return m_noValueMarker;<NEW_LINE>m_hasFreeKey = false;<NEW_LINE>--m_size;<NEW_LINE>// value is not cleaned<NEW_LINE>return m_freeValue;<NEW_LINE>}<NEW_LINE>int ptr = (Tools.phiMix(key) & m_mask) << 1;<NEW_LINE>int k = m_data[ptr];<NEW_LINE>if (// we check FREE prior to this call<NEW_LINE>k == key) {<NEW_LINE>final int res = m_data[ptr + 1];<NEW_LINE>shiftKeys(ptr);<NEW_LINE>--m_size;<NEW_LINE>return res;<NEW_LINE>} else // end of chain already<NEW_LINE>if (k == FREE_KEY)<NEW_LINE>return m_noValueMarker;<NEW_LINE>while (true) {<NEW_LINE>// that's next index calculation<NEW_LINE>ptr <MASK><NEW_LINE>k = m_data[ptr];<NEW_LINE>if (k == key) {<NEW_LINE>final int res = m_data[ptr + 1];<NEW_LINE>shiftKeys(ptr);<NEW_LINE>--m_size;<NEW_LINE>return res;<NEW_LINE>} else if (k == FREE_KEY)<NEW_LINE>return m_noValueMarker;<NEW_LINE>}<NEW_LINE>} | = (ptr + 2) & m_mask2; |
1,678,483 | private void handleSingleResultsetEndPacket(int serverStatusFlags, long affectedRows, long lastInsertId) {<NEW_LINE>this.result = (serverStatusFlags & ServerStatusFlags.SERVER_STATUS_LAST_ROW_SENT) == 0;<NEW_LINE>T result;<NEW_LINE>Throwable failure;<NEW_LINE>int size;<NEW_LINE>RowDesc rowDesc;<NEW_LINE>if (decoder != null) {<NEW_LINE>failure = decoder.complete();<NEW_LINE>result = decoder.result();<NEW_LINE>rowDesc = decoder.rowDesc;<NEW_LINE>size = decoder.size();<NEW_LINE>decoder.reset();<NEW_LINE>} else {<NEW_LINE>result = emptyResult(cmd.collector());<NEW_LINE>failure = null;<NEW_LINE>size = 0;<NEW_LINE>rowDesc = null;<NEW_LINE>}<NEW_LINE>cmd.resultHandler().handleResult((int) affectedRows, <MASK><NEW_LINE>cmd.resultHandler().addProperty(MySQLClient.LAST_INSERTED_ID, lastInsertId);<NEW_LINE>} | size, rowDesc, result, failure); |
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.<MASK><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.addParam(cvInfo.isDeleted());<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.getLockedOn()); |
160,973 | public Cache consistentHashForCoverageZone(final String ip, final String deliveryServiceId, final HTTPRequest request, final boolean useDeep) {<NEW_LINE>final DeliveryService deliveryService = cacheRegister.getDeliveryService(deliveryServiceId);<NEW_LINE>if (deliveryService == null) {<NEW_LINE>LOGGER.error("Failed getting delivery service from cache register for id '" + deliveryServiceId + "'");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final IPVersions requestVersion = ip.contains(":") ? IPVersions.IPV6ONLY : IPVersions.IPV4ONLY;<NEW_LINE>final CacheLocation coverageZoneCacheLocation = getCoverageZoneCacheLocation(ip, deliveryService, useDeep, null, requestVersion);<NEW_LINE>final List<Cache> caches = selectCachesByCZ(deliveryService, coverageZoneCacheLocation, requestVersion);<NEW_LINE>if (caches == null || caches.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final String <MASK><NEW_LINE>return consistentHasher.selectHashable(caches, deliveryService.getDispersion(), pathToHash);<NEW_LINE>} | pathToHash = buildPatternBasedHashString(deliveryService, request); |
1,238,859 | public Map<String, INDArray> init(NeuralNetConfiguration conf, INDArray paramsView, boolean initializeParams) {<NEW_LINE>Map<String, INDArray> params = super.init(conf, paramsView, initializeParams);<NEW_LINE>FeedForwardLayer layerConf = (FeedForwardLayer) conf.getLayer();<NEW_LINE>int nIn = layerConf.getNIn();<NEW_LINE>int nOut = layerConf.getNOut();<NEW_LINE>int nWeightParams = nIn * nOut;<NEW_LINE>int nUserWeightParams = numUsers * nOut;<NEW_LINE>INDArray userWeightView = paramsView.get(NDArrayIndex.point(0), NDArrayIndex.interval(nWeightParams + nOut<MASK><NEW_LINE>params.put(USER_WEIGHT_KEY, this.createUserWeightMatrix(conf, userWeightView, initializeParams));<NEW_LINE>conf.addVariable(USER_WEIGHT_KEY);<NEW_LINE>return params;<NEW_LINE>} | , nWeightParams + nOut + nUserWeightParams)); |
1,717,552 | private DWARFDataType makeDataTypeForEnum(DIEAggregate diea) {<NEW_LINE>DWARFNameInfo dni = prog.getName(diea);<NEW_LINE>int enumSize = (int) diea.getUnsignedLong(DWARFAttribute.DW_AT_byte_size, -1);<NEW_LINE>if (enumSize == 0) {<NEW_LINE>Msg.warn(this, "Enum " + dni.getNamespacePath() + "[DWARF DIE " + diea.getHexOffset() + "] has a size of 0, forcing to 1");<NEW_LINE>enumSize = 1;<NEW_LINE>}<NEW_LINE>if (enumSize == -1) {<NEW_LINE>Msg.warn(this, "Enum " + dni.getNamespacePath() + "[DWARF DIE " + <MASK><NEW_LINE>enumSize = 1;<NEW_LINE>}<NEW_LINE>Enum enumDT = new EnumDataType(dni.getParentCP(), dni.getName(), enumSize, dataTypeManager);<NEW_LINE>populateStubEnum(enumDT, diea);<NEW_LINE>// Merge enums with the same name / category path if possible<NEW_LINE>for (DataType prevDT : dwarfDTM.forAllConflicts(dni.asDataTypePath())) {<NEW_LINE>if (prevDT instanceof Enum && ((Enum) prevDT).getLength() == enumDT.getLength()) {<NEW_LINE>Enum prevEnum = (Enum) prevDT;<NEW_LINE>if (isCompatEnumValues(enumDT, prevEnum)) {<NEW_LINE>mergeEnumValues(prevEnum, enumDT);<NEW_LINE>return new DWARFDataType(prevEnum, dni, diea.getOffset());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DataType result = dataTypeManager.addDataType(enumDT, DWARFDataTypeConflictHandler.INSTANCE);<NEW_LINE>return new DWARFDataType(result, dni, diea.getOffset());<NEW_LINE>} | diea.getHexOffset() + "] does not have a size specified, forcing to 1"); |
1,019,876 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String path0, String path1, String path2, String path3, String path4, String path5, String path6, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> <MASK><NEW_LINE>Business business = new Business(emc);<NEW_LINE>Document document = emc.find(id, Document.class);<NEW_LINE>if (null == document) {<NEW_LINE>throw new ExceptionDocumentNotExists(id);<NEW_LINE>}<NEW_LINE>this.createData(business, document, jsonElement, path0, path1, path2, path3, path4, path5, path6);<NEW_LINE>emc.commit();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(document.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>CacheManager.notify(Document.class);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | result = new ActionResult<>(); |
1,321,331 | protected void scoreCensus(int disparityRange, final boolean leftToRight) {<NEW_LINE>final int[<MASK><NEW_LINE>final long[] dataLeft = censusLeft.data;<NEW_LINE>final long[] dataRight = censusRight.data;<NEW_LINE>for (int d = 0; d < disparityRange; d++) {<NEW_LINE>int total = 0;<NEW_LINE>for (int y = 0; y < blockHeight; y++) {<NEW_LINE>int idxLeft = (y + sampleRadiusY) * censusLeft.stride + sampleRadiusX;<NEW_LINE>int idxRight = (y + sampleRadiusY) * censusRight.stride + sampleRadiusX + d;<NEW_LINE>for (int x = 0; x < blockWidth; x++) {<NEW_LINE>final long a = dataLeft[idxLeft++];<NEW_LINE>final long b = dataRight[idxRight++];<NEW_LINE>total += DescriptorDistance.hamming(a ^ b);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int index = leftToRight ? disparityRange - d - 1 : d;<NEW_LINE>scores[index] = total;<NEW_LINE>}<NEW_LINE>} | ] scores = leftToRight ? scoreLtoR : scoreRtoL; |
1,741,283 | public static DescribeDcdnDomainUvDataResponse unmarshall(DescribeDcdnDomainUvDataResponse describeDcdnDomainUvDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDcdnDomainUvDataResponse.setRequestId(_ctx.stringValue("DescribeDcdnDomainUvDataResponse.RequestId"));<NEW_LINE>describeDcdnDomainUvDataResponse.setDomainName<MASK><NEW_LINE>describeDcdnDomainUvDataResponse.setStartTime(_ctx.stringValue("DescribeDcdnDomainUvDataResponse.StartTime"));<NEW_LINE>describeDcdnDomainUvDataResponse.setEndTime(_ctx.stringValue("DescribeDcdnDomainUvDataResponse.EndTime"));<NEW_LINE>describeDcdnDomainUvDataResponse.setDataInterval(_ctx.stringValue("DescribeDcdnDomainUvDataResponse.DataInterval"));<NEW_LINE>List<UsageData> uvDataInterval = new ArrayList<UsageData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDcdnDomainUvDataResponse.UvDataInterval.Length"); i++) {<NEW_LINE>UsageData usageData = new UsageData();<NEW_LINE>usageData.setValue(_ctx.stringValue("DescribeDcdnDomainUvDataResponse.UvDataInterval[" + i + "].Value"));<NEW_LINE>usageData.setTimeStamp(_ctx.stringValue("DescribeDcdnDomainUvDataResponse.UvDataInterval[" + i + "].TimeStamp"));<NEW_LINE>uvDataInterval.add(usageData);<NEW_LINE>}<NEW_LINE>describeDcdnDomainUvDataResponse.setUvDataInterval(uvDataInterval);<NEW_LINE>return describeDcdnDomainUvDataResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeDcdnDomainUvDataResponse.DomainName")); |
963,252 | final CreateBusinessReportScheduleResult executeCreateBusinessReportSchedule(CreateBusinessReportScheduleRequest createBusinessReportScheduleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createBusinessReportScheduleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<CreateBusinessReportScheduleRequest> request = null;<NEW_LINE>Response<CreateBusinessReportScheduleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateBusinessReportScheduleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createBusinessReportScheduleRequest));<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, "Alexa For Business");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateBusinessReportSchedule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateBusinessReportScheduleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateBusinessReportScheduleResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,133,501 | private void layoutStackedChildrenAt(Point linePoint, ConnectionWidgetLayoutAlignment adjustedAlignment, ConnectionWidget connectionWidget, ArrayList<Widget> children) {<NEW_LINE>int areaWidth = 0, areaHeight = 0;<NEW_LINE>if (adjustedAlignment != ConnectionWidgetLayoutAlignment.NONE) {<NEW_LINE>for (Widget childWidget : children) {<NEW_LINE>Rectangle bounds = childWidget.getPreferredBounds();<NEW_LINE>areaWidth = Math.max(areaWidth, bounds.width);<NEW_LINE>areaHeight += bounds.height;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Point referencePoint = getReferencePointForAdjustedAlignment(adjustedAlignment, new Rectangle(areaWidth, areaHeight));<NEW_LINE>int areaX = linePoint.x - referencePoint.x;<NEW_LINE>int areaY = linePoint.y - referencePoint.y;<NEW_LINE>int yCursor = 0;<NEW_LINE>for (Widget childWidget : children) {<NEW_LINE>Rectangle preferredBounds = childWidget.getPreferredBounds();<NEW_LINE>Point location = childWidget.getPreferredLocation();<NEW_LINE>int x = areaX - preferredBounds.x;<NEW_LINE>int y = areaY + yCursor - preferredBounds.y;<NEW_LINE>if (location != null) {<NEW_LINE>x += location.x;<NEW_LINE>y += location.y;<NEW_LINE>}<NEW_LINE>switch(adjustedAlignment) {<NEW_LINE>case CENTER_LEFT:<NEW_LINE>break;<NEW_LINE>case CENTER_RIGHT:<NEW_LINE>x += areaWidth - preferredBounds.width;<NEW_LINE>break;<NEW_LINE>case CENTER:<NEW_LINE>x += (<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>yCursor += preferredBounds.height;<NEW_LINE>childWidget.resolveBounds(new Point(x, y), preferredBounds);<NEW_LINE>}<NEW_LINE>} | areaWidth - preferredBounds.width) / 2; |
1,255,752 | public static void validate(List<Symbol> outputSymbols, List<Symbol> groupBy) throws IllegalArgumentException {<NEW_LINE>boolean containsAggregations = SymbolVisitors.any(x -> x instanceof Function && ((Function) x).type() == FunctionType.AGGREGATE, outputSymbols);<NEW_LINE>if (!containsAggregations && groupBy.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < outputSymbols.size(); i++) {<NEW_LINE>Symbol output = outputSymbols.get(i);<NEW_LINE>Symbol offender = output.accept(FindOffendingSymbol.INSTANCE, groupBy);<NEW_LINE>if (offender == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("'" + offender + "' must appear in the GROUP BY clause or be used in an aggregation function. " + "Perhaps you grouped by an alias that clashes with a column in the relations");<NEW_LINE>}<NEW_LINE>} | groupBy.forEach(GroupAndAggregateSemantics::ensureTypedGroupKey); |
509,057 | public static void main(final String[] a) {<NEW_LINE>final long n = Long.parseLong(a[0]);<NEW_LINE>final long incr = Long.MAX_VALUE / (n / 2);<NEW_LINE>long start, elapsed;<NEW_LINE>for (int k = 10; k-- != 0; ) {<NEW_LINE>System.out.print("Broadword msb: ");<NEW_LINE>start = System.currentTimeMillis();<NEW_LINE>for (long i = n, v = 0; i-- != 0; ) mostSignificantBit(v += incr);<NEW_LINE>elapsed = System.currentTimeMillis() - start;<NEW_LINE>System.out.println("elapsed " + elapsed + ", " + (1000000.0 * elapsed / n) + " ns/call");<NEW_LINE>System.out.print("java.lang msb: ");<NEW_LINE>start = System.currentTimeMillis();<NEW_LINE>for (long i = n, v = 0; i-- != 0; ) Long.numberOfLeadingZeros(v += incr);<NEW_LINE>elapsed = System.currentTimeMillis() - start;<NEW_LINE>System.out.println("elapsed " + elapsed + ", " + (1000000.0 <MASK><NEW_LINE>System.out.print("MSB-based lsb: ");<NEW_LINE>start = System.currentTimeMillis();<NEW_LINE>for (long i = n, v = 0; i-- != 0; ) msbBasedLeastSignificantBit(v += incr);<NEW_LINE>elapsed = System.currentTimeMillis() - start;<NEW_LINE>System.out.println("elapsed " + elapsed + ", " + (1000000.0 * elapsed / n) + " ns/call");<NEW_LINE>System.out.print("Multiplication/lookup lsb: ");<NEW_LINE>start = System.currentTimeMillis();<NEW_LINE>for (long i = n, v = 0; i-- != 0; ) multLookupLeastSignificantBit(v += incr);<NEW_LINE>elapsed = System.currentTimeMillis() - start;<NEW_LINE>System.out.println("elapsed " + elapsed + ", " + (1000000.0 * elapsed / n) + " ns/call");<NEW_LINE>System.out.print("Byte-by-byte lsb: ");<NEW_LINE>start = System.currentTimeMillis();<NEW_LINE>for (long i = n, v = 0; i-- != 0; ) leastSignificantBit(v += incr);<NEW_LINE>elapsed = System.currentTimeMillis() - start;<NEW_LINE>System.out.println("elapsed " + elapsed + ", " + (1000000.0 * elapsed / n) + " ns/call");<NEW_LINE>System.out.print("java.lang lsb: ");<NEW_LINE>start = System.currentTimeMillis();<NEW_LINE>for (long i = n, v = 0; i-- != 0; ) Long.numberOfTrailingZeros(v += incr);<NEW_LINE>elapsed = System.currentTimeMillis() - start;<NEW_LINE>System.out.println("elapsed " + elapsed + ", " + (1000000.0 * elapsed / n) + " ns/call");<NEW_LINE>}<NEW_LINE>} | * elapsed / n) + " ns/call"); |
344,725 | public static String forXmlTag(String intag) {<NEW_LINE>if (XMLChar.isValidName(intag) || LangUtils.isEmpty(intag)) {<NEW_LINE>return intag;<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder(intag.length());<NEW_LINE>sb.append(intag);<NEW_LINE>char c;<NEW_LINE>for (int i = sb.length() - 1; i >= 0; i--) {<NEW_LINE>c = intag.charAt(i);<NEW_LINE>if (!XMLChar.isName(c)) {<NEW_LINE>switch(c) {<NEW_LINE>case ' ':<NEW_LINE>sb.setCharAt(i, '_');<NEW_LINE>break;<NEW_LINE>case '<':<NEW_LINE>sb.setCharAt(i, '.');<NEW_LINE>sb.insert(i + 1, "lt.");<NEW_LINE>break;<NEW_LINE>case '>':<NEW_LINE>sb.setCharAt(i, '.');<NEW_LINE>sb.insert(i + 1, "gt.");<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>sb.setCharAt(i, '.');<NEW_LINE>sb.<MASK><NEW_LINE>sb.insert(i + 1, Integer.toHexString(c));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Make sure the first character is an allowed one<NEW_LINE>if (!XMLChar.isNameStart(sb.charAt(0))) {<NEW_LINE>sb.insert(0, '_');<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | insert(i + 1, '.'); |
1,823,688 | public void onFocusOutMinAmountTextField(boolean oldValue, boolean newValue) {<NEW_LINE>if (oldValue && !newValue) {<NEW_LINE>InputValidator.ValidationResult result = isBtcInputValid(minAmount.get());<NEW_LINE>minAmountValidationResult.set(result);<NEW_LINE>if (result.isValid) {<NEW_LINE>Coin minAmountAsCoin = dataModel.getMinAmount().get();<NEW_LINE>syncMinAmountWithAmount = minAmountAsCoin != null && minAmountAsCoin.equals(dataModel.getAmount().get());<NEW_LINE>setMinAmountToModel();<NEW_LINE>dataModel.calculateMinVolume();<NEW_LINE>if (dataModel.getMinVolume().get() != null) {<NEW_LINE>InputValidator.ValidationResult minVolumeResult = isVolumeInputValid(VolumeUtil.formatVolume(dataModel.getMinVolume<MASK><NEW_LINE>volumeValidationResult.set(minVolumeResult);<NEW_LINE>updateButtonDisableState();<NEW_LINE>}<NEW_LINE>this.minAmount.set(btcFormatter.formatCoin(minAmountAsCoin));<NEW_LINE>if (!dataModel.isMinAmountLessOrEqualAmount()) {<NEW_LINE>this.amount.set(this.minAmount.get());<NEW_LINE>} else {<NEW_LINE>minAmountValidationResult.set(result);<NEW_LINE>if (this.amount.get() != null)<NEW_LINE>amountValidationResult.set(isBtcInputValid(this.amount.get()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>syncMinAmountWithAmount = true;<NEW_LINE>}<NEW_LINE>maybeShowMakeOfferToUnsignedAccountWarning();<NEW_LINE>}<NEW_LINE>} | ().get())); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.