idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
921,896
private static final long fibonacciSequenceUsingRecursion(long[] array, int n) {<NEW_LINE>if (n == 0 || n == 1)<NEW_LINE>return n;<NEW_LINE>// If array already has a value then it has previously been computed<NEW_LINE>if (array[n] != 0)<NEW_LINE>return array[n];<NEW_LINE>final String exception = "Run out of bits in long, n=" + n;<NEW_LINE>final long r1 = fibonacciSequenceUsingRecursion(array, (n - 1));<NEW_LINE>// memoization<NEW_LINE>array[n - 1] = r1;<NEW_LINE>// If r1 goes below zero then we have run out of bits in the long<NEW_LINE>if (r1 < 0)<NEW_LINE>throw new IllegalArgumentException(exception);<NEW_LINE>final long r2 = fibonacciSequenceUsingRecursion(<MASK><NEW_LINE>// memoization<NEW_LINE>array[n - 2] = r2;<NEW_LINE>// If r2 goes below zero then we have run out of bits in the long<NEW_LINE>if (r2 < 0)<NEW_LINE>throw new IllegalArgumentException(exception);<NEW_LINE>final long r = r1 + r2;<NEW_LINE>// If r goes below zero then we have run out of bits in the long<NEW_LINE>if (r < 0)<NEW_LINE>throw new IllegalArgumentException("Run out of bits in long, n=" + n);<NEW_LINE>// memoization<NEW_LINE>array[n] = r;<NEW_LINE>return r;<NEW_LINE>}
array, (n - 2));
1,472,765
// Override the reallocate method to provide for reallocating the contents when a field<NEW_LINE>// changes size. This method is only called in a top-level JMFMessage (one with no<NEW_LINE>// parent).<NEW_LINE>// Locking: We rely on something up the calling stack to protect us from<NEW_LINE>// concurrency issues.<NEW_LINE>int reallocate(int index, int offset, int oldLen, int newLen) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.entry(this, tc, "reallocate", new Object[] { Integer.valueOf(index), Integer.valueOf(offset), Integer.valueOf(oldLen), Integer.valueOf(newLen) });<NEW_LINE>// Get oTable index for the next field after this one, if any. We can be<NEW_LINE>// guaranteed that its offsetIndex is one greater than ours, since this is a<NEW_LINE>// varying length field.<NEW_LINE>int oInx = map.fields[index].offsetIndex + 1;<NEW_LINE>// Update the oTable in place<NEW_LINE>while (oInx < oTable.length) {<NEW_LINE>oTable[oInx++] += (newLen - oldLen);<NEW_LINE>}<NEW_LINE>// Compute the length of the balance, after the varying length field<NEW_LINE>int balance = (messageOffset + length) - offset - 4 - oldLen;<NEW_LINE>// Create new contents entry, and update related offsets and lengths<NEW_LINE>byte[] oldcontents = contents;<NEW_LINE>int oldMessageOffset = messageOffset;<NEW_LINE>int oldDataOffset = dataOffset;<NEW_LINE>int oldTableOffset = tableOffset;<NEW_LINE>length += (newLen - oldLen);<NEW_LINE>contents = new byte[length];<NEW_LINE>messageOffset = 0;<NEW_LINE>tableOffset = dataOffset = oldTableOffset - oldMessageOffset;<NEW_LINE>// Copy the schemata ids<NEW_LINE>System.arraycopy(oldcontents, <MASK><NEW_LINE>// Write the offset table into the new array<NEW_LINE>for (int i = 0; i < oTable.length; i++) {<NEW_LINE>ArrayUtil.writeInt(contents, dataOffset, oTable[i]);<NEW_LINE>dataOffset += 4;<NEW_LINE>}<NEW_LINE>// Copy up to the point where the length is changing<NEW_LINE>System.arraycopy(oldcontents, oldDataOffset, contents, dataOffset, offset - oldDataOffset);<NEW_LINE>// Copy balance of data after varying length field<NEW_LINE>if (balance > 0) {<NEW_LINE>System.arraycopy(oldcontents, offset + 4 + oldLen, contents, length - balance, balance);<NEW_LINE>}<NEW_LINE>reallocated = true;<NEW_LINE>// We have a new contents buffer, so it can't be shared<NEW_LINE>sharedContents = false;<NEW_LINE>// Ensure any dependent JSMessageData parts in the cache are updated.<NEW_LINE>reallocated(contents, -1);<NEW_LINE>int result = offset - oldMessageOffset;<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.exit(this, tc, "reallocate", Integer.valueOf(result));<NEW_LINE>return result;<NEW_LINE>}
oldMessageOffset, contents, 0, tableOffset);
770,523
final void localTransactionRolledBack() {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {<NEW_LINE>SibTr.<MASK><NEW_LINE>}<NEW_LINE>final ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK);<NEW_LINE>// Copy list to protect against concurrent modification by listener<NEW_LINE>final List<ConnectionEventListener> copy;<NEW_LINE>synchronized (_connectionListeners) {<NEW_LINE>copy = new ArrayList<ConnectionEventListener>(_connectionListeners);<NEW_LINE>}<NEW_LINE>for (final Iterator iterator = copy.iterator(); iterator.hasNext(); ) {<NEW_LINE>final Object object = iterator.next();<NEW_LINE>if (object instanceof ConnectionEventListener) {<NEW_LINE>((ConnectionEventListener) object).localTransactionRolledback(event);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {<NEW_LINE>SibTr.exit(this, TRACE, "localTransactionRolledBack");<NEW_LINE>}<NEW_LINE>}
entry(this, TRACE, "localTransactionRolledBack");
1,114,026
// suppressing warnings because I expect headers and query strings to be checked by the underlying<NEW_LINE>// servlet implementation<NEW_LINE>@SuppressFBWarnings({ "SERVLET_HEADER", "SERVLET_QUERY_STRING" })<NEW_LINE>private ContainerRequest servletRequestToContainerRequest(ServletRequest request) {<NEW_LINE>Timer.start("JERSEY_SERVLET_REQUEST_TO_CONTAINER");<NEW_LINE>HttpServletRequest servletRequest = (HttpServletRequest) request;<NEW_LINE>if (baseUri == null) {<NEW_LINE>baseUri = getBaseUri(request, "/");<NEW_LINE>}<NEW_LINE>String requestFullPath = servletRequest.getRequestURI();<NEW_LINE>if (LambdaContainerHandler.getContainerConfig().getServiceBasePath() != null && LambdaContainerHandler.getContainerConfig().isStripBasePath()) {<NEW_LINE>if (requestFullPath.startsWith(LambdaContainerHandler.getContainerConfig().getServiceBasePath())) {<NEW_LINE>requestFullPath = requestFullPath.replaceFirst(LambdaContainerHandler.getContainerConfig().getServiceBasePath(), "");<NEW_LINE>if (!requestFullPath.startsWith("/")) {<NEW_LINE>requestFullPath = "/" + requestFullPath;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>UriBuilder uriBuilder = UriBuilder.fromUri(baseUri).path(requestFullPath);<NEW_LINE>uriBuilder.replaceQuery(servletRequest.getQueryString());<NEW_LINE>PropertiesDelegate apiGatewayProperties = new MapPropertiesDelegate();<NEW_LINE>apiGatewayProperties.setProperty(API_GATEWAY_CONTEXT_PROPERTY, servletRequest.getAttribute(API_GATEWAY_CONTEXT_PROPERTY));<NEW_LINE>apiGatewayProperties.setProperty(API_GATEWAY_STAGE_VARS_PROPERTY, servletRequest.getAttribute(API_GATEWAY_STAGE_VARS_PROPERTY));<NEW_LINE>apiGatewayProperties.setProperty(LAMBDA_CONTEXT_PROPERTY, servletRequest.getAttribute(LAMBDA_CONTEXT_PROPERTY));<NEW_LINE>apiGatewayProperties.setProperty(JERSEY_SERVLET_REQUEST_PROPERTY, servletRequest);<NEW_LINE>ContainerRequest requestContext = new // jersey uses "/" by default<NEW_LINE>ContainerRequest(null, uriBuilder.build(), servletRequest.getMethod().toUpperCase(Locale.ENGLISH), (SecurityContext) servletRequest.getAttribute(JAX_SECURITY_CONTEXT_PROPERTY), apiGatewayProperties);<NEW_LINE>InputStream requestInputStream;<NEW_LINE>try {<NEW_LINE>requestInputStream = servletRequest.getInputStream();<NEW_LINE>if (requestInputStream != null) {<NEW_LINE>requestContext.setEntityStream(requestInputStream);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("Could not read input stream from request", e);<NEW_LINE>throw new RuntimeException("Could not read request input stream", e);<NEW_LINE>}<NEW_LINE>Enumeration<String> headerNames = servletRequest.getHeaderNames();<NEW_LINE>while (headerNames.hasMoreElements()) {<NEW_LINE><MASK><NEW_LINE>requestContext.getHeaders().addAll(headerKey, Collections.list(servletRequest.getHeaders(headerKey)));<NEW_LINE>}<NEW_LINE>Timer.stop("JERSEY_SERVLET_REQUEST_TO_CONTAINER");<NEW_LINE>return requestContext;<NEW_LINE>}
String headerKey = headerNames.nextElement();
639,045
public GeckoResult<SlowScriptResponse> onSlowScript(@NonNull GeckoSession aSession, @NonNull String aScriptFileName) {<NEW_LINE>final GeckoResult<SlowScriptResponse> result = new GeckoResult<>();<NEW_LINE>if (mSlowScriptPrompt == null) {<NEW_LINE>mSlowScriptPrompt = new ConfirmPromptWidget(mContext);<NEW_LINE>mSlowScriptPrompt.getPlacement().parentHandle = mAttachedWindow.getHandle();<NEW_LINE>mSlowScriptPrompt<MASK><NEW_LINE>mSlowScriptPrompt.getPlacement().translationY = WidgetPlacement.unitFromMeters(mContext, R.dimen.js_prompt_y_distance);<NEW_LINE>mSlowScriptPrompt.setTitle(mContext.getResources().getString(R.string.slow_script_dialog_title));<NEW_LINE>mSlowScriptPrompt.setMessage(mContext.getResources().getString(R.string.slow_script_dialog_description, aScriptFileName));<NEW_LINE>mSlowScriptPrompt.setButtons(new String[] { mContext.getResources().getString(R.string.slow_script_dialog_action_wait), mContext.getResources().getString(R.string.slow_script_dialog_action_stop) });<NEW_LINE>mSlowScriptPrompt.setPromptDelegate(new ConfirmPromptWidget.ConfirmPromptDelegate() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void confirm(int index) {<NEW_LINE>result.complete(index == 0 ? SlowScriptResponse.CONTINUE : SlowScriptResponse.STOP);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void dismiss() {<NEW_LINE>result.complete(SlowScriptResponse.CONTINUE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mSlowScriptPrompt.show(UIWidget.REQUEST_FOCUS, true);<NEW_LINE>}<NEW_LINE>return result.then(value -> {<NEW_LINE>if (mSlowScriptPrompt != null && !mSlowScriptPrompt.isReleased()) {<NEW_LINE>mSlowScriptPrompt.releaseWidget();<NEW_LINE>}<NEW_LINE>mSlowScriptPrompt = null;<NEW_LINE>return GeckoResult.fromValue(value);<NEW_LINE>});<NEW_LINE>}
.getPlacement().parentAnchorY = 0.0f;
1,222,899
final GetDomainPermissionsPolicyResult executeGetDomainPermissionsPolicy(GetDomainPermissionsPolicyRequest getDomainPermissionsPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDomainPermissionsPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDomainPermissionsPolicyRequest> request = null;<NEW_LINE>Response<GetDomainPermissionsPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDomainPermissionsPolicyRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "codeartifact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDomainPermissionsPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDomainPermissionsPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDomainPermissionsPolicyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(getDomainPermissionsPolicyRequest));
514,379
public void write(Object object, Properties properties) {<NEW_LINE>if (object instanceof LineBreakpoint) {<NEW_LINE>LineBreakpoint breakpoint = (LineBreakpoint) object;<NEW_LINE>FileObject fileObject = breakpoint.getLine().getLookup().lookup(FileObject.class);<NEW_LINE>properties.setString(LineBreakpoint.PROP_URL, fileObject.toURL().toString());<NEW_LINE>properties.setInt(LineBreakpoint.PROP_LINE_NUMBER, breakpoint.<MASK><NEW_LINE>properties.setBoolean(ENABED, breakpoint.isEnabled());<NEW_LINE>properties.setString(GROUP_NAME, breakpoint.getGroupName());<NEW_LINE>properties.setString(LineBreakpoint.PROP_CONDITION, breakpoint.getCondition());<NEW_LINE>} else if (object instanceof FunctionBreakpoint) {<NEW_LINE>FunctionBreakpoint breakpoint = (FunctionBreakpoint) object;<NEW_LINE>String func = breakpoint.getFunction();<NEW_LINE>properties.setString(FUNC_NAME, func);<NEW_LINE>properties.setString(TYPE, breakpoint.getType().toString());<NEW_LINE>properties.setBoolean(ENABED, breakpoint.isEnabled());<NEW_LINE>properties.setString(GROUP_NAME, breakpoint.getGroupName());<NEW_LINE>}<NEW_LINE>}
getLine().getLineNumber());
542,262
private void removeService(final EndpointDefinition endpointDefinition) {<NEW_LINE>logger.info(sputs("ClusteredStatReplicator::removeService()", serviceName, endpointDefinition, " replicator count ", replicatorsMap.size()));<NEW_LINE>final Pair<EndpointDefinition, StatReplicator> statReplicatorPair = this.replicatorsMap.<MASK><NEW_LINE>if (statReplicatorPair == null) {<NEW_LINE>logger.error(sputs("ClusteredStatReplicator::removeService() Trying to remove a service that we are not managing", serviceName, "END POINT ID", endpointDefinition.getId(), " replicator count ", replicatorsMap.size()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (statReplicatorPair.getSecond() == null) {<NEW_LINE>logger.error(sputs("ClusteredStatReplicator::removeService() Trying to remove a service that we are nto managing" + "and the getSecond() is null", serviceName, "END POINT ID", endpointDefinition.getId(), " replicator count ", replicatorsMap.size()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>statReplicatorPair.getSecond().stop();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.error("Unable to stop service endpoint that was removed " + endpointDefinition, ex);<NEW_LINE>}<NEW_LINE>this.replicatorsMap.remove(endpointDefinition.getId());<NEW_LINE>this.statReplicators = new ArrayList<>(replicatorsMap.values());<NEW_LINE>logger.info(sputs("ClusteredStatReplicator::removeService() removed", serviceName, endpointDefinition, " replicator count ", replicatorsMap.size()));<NEW_LINE>}
get(endpointDefinition.getId());
138,877
public void run() {<NEW_LINE>synchronized (mAccessibilityLock) {<NEW_LINE>if (mCodeMatcher == null) {<NEW_LINE>mCodeMatcher = mControlCodes.matcher(mAccessibilityBuffer.toString());<NEW_LINE>} else {<NEW_LINE>mCodeMatcher.reset(mAccessibilityBuffer.toString());<NEW_LINE>}<NEW_LINE>// Strip all control codes out.<NEW_LINE>mAccessibilityBuffer.setLength(0);<NEW_LINE>while (mCodeMatcher.find()) {<NEW_LINE>mCodeMatcher.appendReplacement(mAccessibilityBuffer, " ");<NEW_LINE>}<NEW_LINE>// Apply Backspaces using backspace character sequence<NEW_LINE>int <MASK><NEW_LINE>while (i != -1) {<NEW_LINE>mAccessibilityBuffer.replace(i == 0 ? 0 : i - 1, i + BACKSPACE_CODE.length(), "");<NEW_LINE>i = mAccessibilityBuffer.indexOf(BACKSPACE_CODE);<NEW_LINE>}<NEW_LINE>if (mAccessibilityBuffer.length() > 0) {<NEW_LINE>AccessibilityEvent event = AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED);<NEW_LINE>event.setFromIndex(0);<NEW_LINE>event.setAddedCount(mAccessibilityBuffer.length());<NEW_LINE>event.getText().add(mAccessibilityBuffer);<NEW_LINE>sendAccessibilityEventUnchecked(event);<NEW_LINE>mAccessibilityBuffer.setLength(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
i = mAccessibilityBuffer.indexOf(BACKSPACE_CODE);
515,970
public byte[] convertToXmlByteArray(AccessControlList acl) throws AmazonClientException {<NEW_LINE>Owner owner = acl.getOwner();<NEW_LINE>if (owner == null) {<NEW_LINE>throw new AmazonClientException("Invalid AccessControlList: missing an S3Owner");<NEW_LINE>}<NEW_LINE>XmlWriter xml = new XmlWriter();<NEW_LINE>xml.start("AccessControlPolicy", "xmlns", Constants.XML_NAMESPACE);<NEW_LINE>xml.start("Owner");<NEW_LINE>if (owner.getId() != null) {<NEW_LINE>xml.start("ID").value(owner.getId()).end();<NEW_LINE>}<NEW_LINE>if (owner.getDisplayName() != null) {<NEW_LINE>xml.start("DisplayName").value(owner.<MASK><NEW_LINE>}<NEW_LINE>xml.end();<NEW_LINE>xml.start("AccessControlList");<NEW_LINE>for (Grant grant : acl.getGrants()) {<NEW_LINE>xml.start("Grant");<NEW_LINE>convertToXml(grant.getGrantee(), xml);<NEW_LINE>xml.start("Permission").value(grant.getPermission().toString()).end();<NEW_LINE>xml.end();<NEW_LINE>}<NEW_LINE>xml.end();<NEW_LINE>xml.end();<NEW_LINE>return xml.getBytes();<NEW_LINE>}
getDisplayName()).end();
284,318
public void menuWillBeShown(MenuItem menu, Object data) {<NEW_LINE>menu.removeAllChildItems();<NEW_LINE>int vo = subs.getViewOptions();<NEW_LINE>MenuItem m = menu_manager.addMenuItem(menu, "label.full");<NEW_LINE>m.setStyle(MenuItem.STYLE_RADIO);<NEW_LINE>m.setData(Boolean.valueOf(vo == Subscription.VO_FULL));<NEW_LINE>m.addListener(new SubsMenuItemListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void selected(final Subscription subs) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>m = menu_manager.addMenuItem(menu, "label.no.header");<NEW_LINE>m.setStyle(MenuItem.STYLE_RADIO);<NEW_LINE>m.setData(Boolean.valueOf(vo == Subscription.VO_HIDE_HEADER));<NEW_LINE>m.addListener(new SubsMenuItemListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void selected(final Subscription subs) {<NEW_LINE>subs.setViewOptions(Subscription.VO_HIDE_HEADER);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
subs.setViewOptions(Subscription.VO_FULL);
1,641,907
public String checkDependencies(final String containerInode) throws DotDataException, DotSecurityException, PortalException, SystemException {<NEW_LINE>final HttpServletRequest req = WebContextFactory.get().getHttpServletRequest();<NEW_LINE>final User user = userWebAPI.getLoggedInUser(req);<NEW_LINE>final boolean respectFrontendRoles = userWebAPI.isLoggedToFrontend(req);<NEW_LINE>final String[] inodesArray = containerInode.split(",");<NEW_LINE>String templateInfo = null;<NEW_LINE>final TemplateAPI templateAPI = APILocator.getTemplateAPI();<NEW_LINE>for (final String contInode : inodesArray) {<NEW_LINE>final Container container = (Container) InodeFactory.getInode(contInode, Container.class);<NEW_LINE>final List<Template> templates = templateAPI.findTemplates(user, true, null, null, null, null, null, 0, -1, null);<NEW_LINE>templateInfo = checkTemplatesUsedByContainer(<MASK><NEW_LINE>if (UtilMethods.isSet(templateInfo)) {<NEW_LINE>final String containerDependencyResults = formatContainerDependencyMsg(container, templateInfo, user);<NEW_LINE>return UtilMethods.isSet(containerDependencyResults) ? containerDependencyResults : null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return UtilMethods.isSet(templateInfo) ? templateInfo : null;<NEW_LINE>}
templates, container, user, respectFrontendRoles);
198,814
public void propagate(CircuitState circuitState) {<NEW_LINE>final var state = getState(circuitState);<NEW_LINE>final var attrs = getAttributeSet();<NEW_LINE>final var x = addr(circuitState, P_X);<NEW_LINE>final var y = addr(circuitState, P_Y);<NEW_LINE>final var color = addr(circuitState, P_DATA);<NEW_LINE>state.lastX = x;<NEW_LINE>state.lastY = y;<NEW_LINE>state.color = color;<NEW_LINE>Object <MASK><NEW_LINE>if (resetOption == null)<NEW_LINE>resetOption = RESET_OPTIONS[0];<NEW_LINE>final var cm = getColorModel(attrs.getValue(COLOR_OPTION));<NEW_LINE>final var w = attrs.getValue(WIDTH_OPTION);<NEW_LINE>final var h = attrs.getValue(HEIGHT_OPTION);<NEW_LINE>if (state.tick(val(circuitState, P_CLK)) && val(circuitState, P_WE) == Value.TRUE) {<NEW_LINE>final var g = state.img.getGraphics();<NEW_LINE>g.setColor(new Color(cm.getRGB(color)));<NEW_LINE>g.fillRect(x, y, 1, 1);<NEW_LINE>if (RESET_SYNC.equals(resetOption) && val(circuitState, P_RST) == Value.TRUE) {<NEW_LINE>g.setColor(Color.BLACK);<NEW_LINE>g.fillRect(0, 0, w, h);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!RESET_SYNC.equals(resetOption) && val(circuitState, P_RST) == Value.TRUE) {<NEW_LINE>final var g = state.img.getGraphics();<NEW_LINE>g.setColor(Color.BLACK);<NEW_LINE>g.fillRect(0, 0, w, h);<NEW_LINE>}<NEW_LINE>}
resetOption = attrs.getValue(RESET_OPTION);
188,532
public Dialog createView(@NonNull AlertDialog fragment, @NonNull Bundle args) {<NEW_LINE>AppCompatDialog appCompatDialog = new AppCompatDialog(fragment.getContext());<NEW_LINE>LayoutInflater inflater = LayoutInflater.from(fragment.getContext());<NEW_LINE>View root = inflater.inflate(fragment.getLayoutId(), null, false);<NEW_LINE>TextView declineBtn = root.findViewById(R.id.decline_btn);<NEW_LINE>int declineBtnTextId = args.getInt(ARG_NEGATIVE_BUTTON_ID);<NEW_LINE>if (declineBtnTextId != INVALID_ID) {<NEW_LINE>declineBtn.setText(args.getInt(ARG_NEGATIVE_BUTTON_ID));<NEW_LINE>declineBtn.setOnClickListener(v -> fragment.onNegativeClicked(DialogInterface.BUTTON_NEGATIVE));<NEW_LINE>} else {<NEW_LINE>UiUtils.hide(declineBtn);<NEW_LINE>}<NEW_LINE>TextView acceptBtn = root.findViewById(R.id.accept_btn);<NEW_LINE>acceptBtn.setText(args.getInt(ARG_POSITIVE_BUTTON_ID));<NEW_LINE>acceptBtn.setOnClickListener(v -> fragment<MASK><NEW_LINE>TextView descriptionView = root.findViewById(R.id.description);<NEW_LINE>descriptionView.setText(args.getInt(ARG_MESSAGE_ID));<NEW_LINE>TextView titleView = root.findViewById(R.id.title);<NEW_LINE>titleView.setText(args.getInt(ARG_TITLE_ID));<NEW_LINE>ImageView imageView = root.findViewById(R.id.image);<NEW_LINE>int imageResId = args.getInt(ARG_IMAGE_RES_ID);<NEW_LINE>boolean hasImage = imageResId != INVALID_ID;<NEW_LINE>imageView.setImageDrawable(hasImage ? fragment.getResources().getDrawable(imageResId) : null);<NEW_LINE>int negativeBtnTextColor = args.getInt(ARG_NEGATIVE_BTN_TEXT_COLOR_RES_ID);<NEW_LINE>boolean hasNegativeBtnCustomColor = negativeBtnTextColor != INVALID_ID;<NEW_LINE>if (hasNegativeBtnCustomColor)<NEW_LINE>declineBtn.setTextColor(fragment.getResources().getColor(negativeBtnTextColor));<NEW_LINE>UiUtils.showIf(hasImage, imageView);<NEW_LINE>appCompatDialog.setContentView(root);<NEW_LINE>return appCompatDialog;<NEW_LINE>}
.onPositiveClicked(DialogInterface.BUTTON_POSITIVE));
1,173,247
protected RFuture<Long> fastRemoveOperationAsync(K... keys) {<NEW_LINE>long threadId = Thread.currentThread().getId();<NEW_LINE>List<RLock> locks = Arrays.stream(keys).map(k -> getLock(k)).collect(Collectors.toList());<NEW_LINE>return executeLocked(timeout, () -> {<NEW_LINE>AtomicLong counter = new AtomicLong();<NEW_LINE>List<K> keyList = Arrays.asList(keys);<NEW_LINE>for (Iterator<K> iterator = keyList.iterator(); iterator.hasNext(); ) {<NEW_LINE>K key = iterator.next();<NEW_LINE>HashValue keyHash = toKeyHash(key);<NEW_LINE>MapEntry <MASK><NEW_LINE>if (currentValue != null && currentValue != MapEntry.NULL) {<NEW_LINE>operations.add(new MapFastRemoveOperation(map, key, transactionId, threadId));<NEW_LINE>state.put(keyHash, MapEntry.NULL);<NEW_LINE>counter.incrementAndGet();<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO optimize<NEW_LINE>return map.getAllAsync(new HashSet<>(keyList)).thenApply(res -> {<NEW_LINE>for (K key : res.keySet()) {<NEW_LINE>HashValue keyHash = toKeyHash(key);<NEW_LINE>operations.add(new MapFastRemoveOperation(map, key, transactionId, threadId));<NEW_LINE>counter.incrementAndGet();<NEW_LINE>state.put(keyHash, MapEntry.NULL);<NEW_LINE>}<NEW_LINE>return counter.get();<NEW_LINE>});<NEW_LINE>}, locks);<NEW_LINE>}
currentValue = state.get(keyHash);
548,919
public void showLog(User user, @PathVariable("id") long id, @RemainedPath String path, HttpServletResponse response) {<NEW_LINE>getOneWithPermissionCheck(user, id, false);<NEW_LINE>File targetFile = perfTestService.getLogFile(id, path);<NEW_LINE>response.reset();<NEW_LINE>response.setContentType("text/plain");<NEW_LINE>response.setCharacterEncoding("UTF-8");<NEW_LINE>try (FileInputStream fileInputStream = new FileInputStream(targetFile)) {<NEW_LINE><MASK><NEW_LINE>if (FilenameUtils.isExtension(targetFile.getName(), "zip")) {<NEW_LINE>// Limit log view to 1MB<NEW_LINE>outputStream.println(" Only the last 1MB of a log shows.\n");<NEW_LINE>outputStream.println("==========================================================================\n\n");<NEW_LINE>LogCompressUtils.decompress(fileInputStream, outputStream, 1024 * 1024);<NEW_LINE>} else {<NEW_LINE>IOUtils.copy(fileInputStream, outputStream);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>CoreLogger.LOGGER.error("Error while processing log. {}", targetFile, e);<NEW_LINE>}<NEW_LINE>}
ServletOutputStream outputStream = response.getOutputStream();
1,327,404
public SQLStatement parseRename() {<NEW_LINE>acceptIdentifier("RENAME");<NEW_LINE>if (lexer.token() == Token.SEQUENCE) {<NEW_LINE>lexer.nextToken();<NEW_LINE>MySqlRenameSequenceStatement stmt = new MySqlRenameSequenceStatement();<NEW_LINE>SQLName name <MASK><NEW_LINE>stmt.setName(name);<NEW_LINE>accept(Token.TO);<NEW_LINE>SQLName to = this.exprParser.name();<NEW_LINE>stmt.setTo(to);<NEW_LINE>return stmt;<NEW_LINE>}<NEW_LINE>if (lexer.token() == Token.USER) {<NEW_LINE>lexer.nextToken();<NEW_LINE>SQLRenameUserStatement stmt = new SQLRenameUserStatement();<NEW_LINE>SQLName name = this.exprParser.name();<NEW_LINE>stmt.setName(name);<NEW_LINE>accept(Token.TO);<NEW_LINE>SQLName to = this.exprParser.name();<NEW_LINE>stmt.setTo(to);<NEW_LINE>return stmt;<NEW_LINE>}<NEW_LINE>accept(Token.TABLE);<NEW_LINE>MySqlRenameTableStatement stmt = new MySqlRenameTableStatement();<NEW_LINE>for (; ; ) {<NEW_LINE>MySqlRenameTableStatement.Item item = new MySqlRenameTableStatement.Item();<NEW_LINE>item.setName(this.exprParser.name());<NEW_LINE>accept(Token.TO);<NEW_LINE>item.setTo(this.exprParser.name());<NEW_LINE>stmt.addItem(item);<NEW_LINE>if (lexer.token() == Token.COMMA) {<NEW_LINE>lexer.nextToken();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return stmt;<NEW_LINE>}
= this.exprParser.name();
55,677
public EntitlementData unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>EntitlementData entitlementData = new EntitlementData();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>entitlementData.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Value", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>entitlementData.setValue(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Unit", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>entitlementData.setUnit(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 entitlementData;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,534,157
protected void work() {<NEW_LINE>Map<TailFile, List<Map>> serverlogs = null;<NEW_LINE>try {<NEW_LINE>TailFile tf = (TailFile) this.get("tfevent");<NEW_LINE>this.setCurrenttfref((CopyOfProcessOfLogagent) this.get("tfref"));<NEW_LINE>// tfref = ((TaildirLogComponent) this.get("tfref"));<NEW_LINE>serverlogs = this.getCurrenttfref().tailFileProcessSeprate(tf, true);<NEW_LINE>for (Entry<TailFile, List<Map>> applogs : serverlogs.entrySet()) {<NEW_LINE>if (log.isDebugEnable()) {<NEW_LINE>log.debug(this, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!(serverlogs.isEmpty())) {<NEW_LINE>this.getCurrenttfref().sendLogDataBatch(serverlogs);<NEW_LINE>} else {<NEW_LINE>if (log.isDebugEnable()) {<NEW_LINE>log.debug(this, "serverlogs is emptry!!!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.err(this, "Unable to tail files.", t);<NEW_LINE>} finally {<NEW_LINE>if (null != serverlogs) {<NEW_LINE>serverlogs.clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"### Logvalue ###: " + applogs.getValue());
99,241
private Tika instantiateTika(Map<String, Object> conf) {<NEW_LINE>Tika tika = null;<NEW_LINE>String tikaConfigFile = ConfUtils.getString(conf, "parser.tika.config.file", "tika-config.xml");<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>URL tikaConfigUrl = getClass().getClassLoader().getResource(tikaConfigFile);<NEW_LINE>if (tikaConfigUrl == null) {<NEW_LINE>LOG.error("Tika configuration file {} not found on classpath", tikaConfigFile);<NEW_LINE>} else {<NEW_LINE>LOG.info("Instantiating Tika using custom configuration {}", tikaConfigUrl);<NEW_LINE>try {<NEW_LINE>TikaConfig tikaConfig = new TikaConfig(tikaConfigUrl, getClass().getClassLoader());<NEW_LINE>tika = new Tika(tikaConfig);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to instantiate Tika using custom configuration {}", tikaConfigUrl, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tika == null) {<NEW_LINE>LOG.info("Instantiating Tika with default configuration");<NEW_LINE>tika = new Tika();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>LOG.debug("Tika loaded in {} msec", end - start);<NEW_LINE>return tika;<NEW_LINE>}
long end = System.currentTimeMillis();
1,497,872
public static List<Map<String, Object>> run(MysqlContent mysqlContent) throws Exception {<NEW_LINE>HttpResponse<String> response = Requests.get("http://prod-dataops-pmdb.sreworks-dataops/datasource/getDatasourceById?id=" + mysqlContent.getDatasourceId(), null, null);<NEW_LINE>Requests.checkResponseStatus(response);<NEW_LINE>JSONObject connectConfig = JSONObject.parseObject(response.body()).getJSONObject("data").getJSONObject("connectConfig");<NEW_LINE>String host = connectConfig.getString("host");<NEW_LINE>int port = connectConfig.getIntValue("port");<NEW_LINE>String db = connectConfig.getString("db");<NEW_LINE>String username = connectConfig.getString("username");<NEW_LINE>String password = connectConfig.getString("password");<NEW_LINE>Connection con = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>String driver = "com.mysql.cj.jdbc.Driver";<NEW_LINE>String url = String.format("jdbc:mysql://%s:%s/%s?useUnicode=true&characterEncoding=utf-8&useSSL=false", host, port, db);<NEW_LINE>Class.forName(driver);<NEW_LINE>try {<NEW_LINE>con = DriverManager.getConnection(url, username, password);<NEW_LINE><MASK><NEW_LINE>rs = statement.executeQuery(mysqlContent.getSql());<NEW_LINE>return get(rs);<NEW_LINE>} finally {<NEW_LINE>if (rs != null) {<NEW_LINE>rs.close();<NEW_LINE>}<NEW_LINE>if (con != null) {<NEW_LINE>con.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Statement statement = con.createStatement();
460,783
public static <R> R callStaticMethod(Class<?> clazz, String methodName, ClassParameter<?>... classParameters) {<NEW_LINE>perfStatsCollector.incrementCount(String.format("ReflectionHelpers.callStaticMethod-%s_%s", clazz.getName(), methodName));<NEW_LINE>try {<NEW_LINE>Class<?>[] classes = ClassParameter.getClasses(classParameters);<NEW_LINE>Object[] values = ClassParameter.getValues(classParameters);<NEW_LINE>Method method = clazz.getDeclaredMethod(methodName, classes);<NEW_LINE>method.setAccessible(true);<NEW_LINE>if (!Modifier.isStatic(method.getModifiers())) {<NEW_LINE>throw new IllegalArgumentException(method + " is not static");<NEW_LINE>}<NEW_LINE>return (R) <MASK><NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>if (e.getTargetException() instanceof RuntimeException) {<NEW_LINE>throw (RuntimeException) e.getTargetException();<NEW_LINE>}<NEW_LINE>if (e.getTargetException() instanceof Error) {<NEW_LINE>throw (Error) e.getTargetException();<NEW_LINE>}<NEW_LINE>throw new RuntimeException(e.getTargetException());<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>throw new RuntimeException("no such method " + clazz + "." + methodName, e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
method.invoke(null, values);
1,374,280
private static RowSet resultSetFromCSV(List<Var> vars, CSVParser parser) {<NEW_LINE>BindingBuilder builder = Binding.builder();<NEW_LINE>Function<List<String>, Binding> transform = new Function<List<String>, Binding>() {<NEW_LINE><NEW_LINE>private int count = 1;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Binding apply(List<String> row) {<NEW_LINE>if (row.size() != vars.size())<NEW_LINE>FmtLog.warn(log, "Row %d: Length=%d: expected=%d", count, row.size(), vars.size());<NEW_LINE>builder.reset();<NEW_LINE>// Check.<NEW_LINE>for (int i = 0; i < vars.size(); i++) {<NEW_LINE>Var <MASK><NEW_LINE>String field = (i < row.size()) ? row.get(i) : "";<NEW_LINE>Node n = NodeFactory.createLiteral(field);<NEW_LINE>builder.add(v, n);<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>return builder.build();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Iterator<Binding> bindings = Iter.map(parser.iterator(), transform);<NEW_LINE>return RowSetStream.create(vars, bindings);<NEW_LINE>}
v = vars.get(i);
1,127,528
public CompletableFuture<VirtualMachine> addVM(Connector cx, List<String> args) {<NEW_LINE>Map<String, Connector.Argument> arguments = cx.defaultArguments();<NEW_LINE>if (cx instanceof LaunchingConnector) {<NEW_LINE>if (arguments.containsKey("command")) {<NEW_LINE>arguments.get("command").setValue(args.get(0));<NEW_LINE>} else {<NEW_LINE>arguments.get("main").setValue(args.get(0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cx instanceof AttachingConnector) {<NEW_LINE>if (arguments.containsKey("pid")) {<NEW_LINE>arguments.get("pid").setValue("" + Integer.decode(args.get(0)));<NEW_LINE>} else {<NEW_LINE>if (args.size() == 2) {<NEW_LINE>arguments.get("hostname").setValue(args.get(0));<NEW_LINE>arguments.get("port").setValue<MASK><NEW_LINE>} else {<NEW_LINE>arguments.get("port").setValue(args.get(0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cx instanceof ListeningConnector) {<NEW_LINE>arguments.get("port").setValue("0");<NEW_LINE>arguments.get("localAddress").setValue("localhost");<NEW_LINE>}<NEW_LINE>return addVM(cx, arguments);<NEW_LINE>}
(args.get(1));
1,078,115
public static void shortenTooTooLongFile(String filePath) {<NEW_LINE>File file = new File(filePath);<NEW_LINE>if (!file.exists())<NEW_LINE>return;<NEW_LINE>long fileLength = file.length();<NEW_LINE>if (fileLength > TOO_TOO_LONG_FILE_LENGTH) {<NEW_LINE>try (RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rw");<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream()) {<NEW_LINE>randomAccessFile.seek(fileLength - (TOO_TOO_LONG_FILE_LENGTH - TOO_TOO_LONG_FILE_LENGTH_HYSTERESIS));<NEW_LINE>byte[] buffer = new byte[1024];<NEW_LINE>int len;<NEW_LINE>while ((len = randomAccessFile.read(buffer)) != -1) {<NEW_LINE>baos.<MASK><NEW_LINE>}<NEW_LINE>baos.flush();<NEW_LINE>randomAccessFile.seek(0);<NEW_LINE>randomAccessFile.write(baos.toByteArray());<NEW_LINE>randomAccessFile.setLength(baos.size());<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.e(LOG_TAG, "Unable to rewrite too too long file" + filePath + e.getMessage() + " " + e.getCause());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
write(buffer, 0, len);
1,228,977
private int trimBlockToVariant(final VariantContext variantContextToOutput, final List<VariantContextBuilder> completedBlocks, final List<VariantContextBuilder> tailBuffer, final VariantContextBuilder builder) {<NEW_LINE>final int blockStart = (int) builder.getStart();<NEW_LINE>final int variantEnd = variantContextToOutput.getEnd();<NEW_LINE>int blockEnd = (int) builder.getStop();<NEW_LINE>final int variantStart = variantContextToOutput.getStart();<NEW_LINE>if (blockEnd > variantEnd && blockStart < variantStart) {<NEW_LINE>// then this block will be split -- add a post-variant block<NEW_LINE>final VariantContextBuilder blockTailBuilder = new VariantContextBuilder(builder);<NEW_LINE>moveBuilderStart(blockTailBuilder, variantEnd + 1, referenceReader);<NEW_LINE>tailBuffer.add(blockTailBuilder);<NEW_LINE>builder.stop(variantStart - 1);<NEW_LINE>builder.attribute(<MASK><NEW_LINE>blockEnd = variantStart - 1;<NEW_LINE>}<NEW_LINE>if (blockStart < variantStart) {<NEW_LINE>// right trim<NEW_LINE>builder.attribute(VCFConstants.END_KEY, variantStart - 1);<NEW_LINE>builder.stop(variantStart - 1);<NEW_LINE>} else {<NEW_LINE>// left trim<NEW_LINE>if (variantContextToOutput.contains(new SimpleInterval(currentContig, blockStart, blockEnd))) {<NEW_LINE>// if block is entirely overlapped by VC to output, then remove it from the buffer, but don't output<NEW_LINE>completedBlocks.add(builder);<NEW_LINE>} else {<NEW_LINE>if (blockEnd < variantEnd + 1) {<NEW_LINE>throw new GATKException.ShouldNeverReachHereException("ref block end overlaps variant end; current builder: " + builder.getStart() + " to " + builder.getStop());<NEW_LINE>}<NEW_LINE>moveBuilderStart(builder, variantEnd + 1, referenceReader);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (builder.getStart() > builder.getStop()) {<NEW_LINE>throw new GATKException.ShouldNeverReachHereException("builder start follows stop; current builder: " + builder.getStart() + " to " + builder.getStop());<NEW_LINE>}<NEW_LINE>return blockEnd;<NEW_LINE>}
VCFConstants.END_KEY, variantStart - 1);
929,869
public final IndexHintContext indexHint() throws RecognitionException {<NEW_LINE>IndexHintContext _localctx = new IndexHintContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 216, RULE_indexHint);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(3349);<NEW_LINE>((IndexHintContext) _localctx).indexHintAction = _input.LT(1);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (!(_la == FORCE || _la == IGNORE || _la == USE)) {<NEW_LINE>((IndexHintContext) _localctx).indexHintAction = (Token) _errHandler.recoverInline(this);<NEW_LINE>} else {<NEW_LINE>if (_input.LA(1) == Token.EOF)<NEW_LINE>matchedEOF = true;<NEW_LINE>_errHandler.reportMatch(this);<NEW_LINE>consume();<NEW_LINE>}<NEW_LINE>setState(3350);<NEW_LINE>((IndexHintContext) _localctx).keyFormat = _input.LT(1);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (!(_la == INDEX || _la == KEY)) {<NEW_LINE>((IndexHintContext) _localctx).keyFormat = (Token) _errHandler.recoverInline(this);<NEW_LINE>} else {<NEW_LINE>if (_input.LA(1) == Token.EOF)<NEW_LINE>matchedEOF = true;<NEW_LINE>_errHandler.reportMatch(this);<NEW_LINE>consume();<NEW_LINE>}<NEW_LINE>setState(3353);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == FOR) {<NEW_LINE>{<NEW_LINE>setState(3351);<NEW_LINE>match(FOR);<NEW_LINE>setState(3352);<NEW_LINE>indexHintType();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(3355);<NEW_LINE>match(LR_BRACKET);<NEW_LINE>setState(3356);<NEW_LINE>uidList();<NEW_LINE>setState(3357);<NEW_LINE>match(RR_BRACKET);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_errHandler.recover(this, re);
1,199,955
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String activityId, JsonElement jsonElement) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>String job = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Work work = emc.fetch(id, Work.class, ListTools.toList(Work.job_FIELDNAME));<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(id, Work.class);<NEW_LINE>}<NEW_LINE>job = work.getJob();<NEW_LINE>}<NEW_LINE>Callable<String> callable = new Callable<String>() {<NEW_LINE><NEW_LINE>public String call() throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Work work = emc.find(id, Work.class);<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(id, Work.class);<NEW_LINE>}<NEW_LINE>Activity activity = business.element().getActivity(activityId);<NEW_LINE>if (!StringUtils.equals(work.getProcess(), activity.getProcess())) {<NEW_LINE>throw new ExceptionProcessNotMatch();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>emc.beginTransaction(Task.class);<NEW_LINE>// work.setForceRoute(true);<NEW_LINE>work.setSplitting(false);<NEW_LINE>work.setSplitToken("");<NEW_LINE>work.getSplitTokenList().clear();<NEW_LINE>work.setSplitValue("");<NEW_LINE>work.setDestinationActivity(activity.getId());<NEW_LINE>work.setDestinationActivityType(activity.getActivityType());<NEW_LINE>work.setDestinationRoute("");<NEW_LINE>work.setDestinationRouteName("");<NEW_LINE>work.getProperties().getManualForceTaskIdentityList().clear();<NEW_LINE>work.getProperties().getManualForceTaskIdentityList().addAll(wi.getManualForceTaskIdentityList());<NEW_LINE>emc.check(work, CheckPersistType.all);<NEW_LINE>removeTask(business, work);<NEW_LINE>removeOtherWork(business, work);<NEW_LINE>removeOtherWorkLog(business, work);<NEW_LINE>emc.commit();<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ProcessPlatformExecutorFactory.get(job).submit(callable).get(300, TimeUnit.SECONDS);<NEW_LINE>wo = ThisApplication.context().applications().putQuery(x_processplatform_service_processing.class, Applications.joinQueryUri("work", id, "processing"), new ProcessingAttributes(), job).getData(Wo.class);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}
emc.beginTransaction(Work.class);
1,184,905
public static com.jme3.math.Matrix3f convert(javax.vecmath.Matrix3f oldMatrix, com.jme3.math.Matrix3f newMatrix) {<NEW_LINE>newMatrix.set(0, 0, oldMatrix.m00);<NEW_LINE>newMatrix.set(0, 1, oldMatrix.m01);<NEW_LINE>newMatrix.set(0, 2, oldMatrix.m02);<NEW_LINE>newMatrix.set(1, 0, oldMatrix.m10);<NEW_LINE>newMatrix.set(1, 1, oldMatrix.m11);<NEW_LINE>newMatrix.set(1, 2, oldMatrix.m12);<NEW_LINE>newMatrix.set(2, 0, oldMatrix.m20);<NEW_LINE>newMatrix.set(<MASK><NEW_LINE>newMatrix.set(2, 2, oldMatrix.m22);<NEW_LINE>return newMatrix;<NEW_LINE>}
2, 1, oldMatrix.m21);
445,991
private NativeModule create() {<NEW_LINE>SoftAssertions.<MASK><NEW_LINE>ReactMarker.logMarker(CREATE_MODULE_START, mName, mInstanceKey);<NEW_LINE>SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "ModuleHolder.createModule").arg("name", mName).flush();<NEW_LINE>PrinterHolder.getPrinter().logMessage(ReactDebugOverlayTags.NATIVE_MODULE, "NativeModule init: %s", mName);<NEW_LINE>NativeModule module;<NEW_LINE>try {<NEW_LINE>module = assertNotNull(mProvider).get();<NEW_LINE>mProvider = null;<NEW_LINE>boolean shouldInitializeNow = false;<NEW_LINE>synchronized (this) {<NEW_LINE>mModule = module;<NEW_LINE>if (mInitializable && !mIsInitializing) {<NEW_LINE>shouldInitializeNow = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (shouldInitializeNow) {<NEW_LINE>doInitialize(module);<NEW_LINE>}<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>FLog.e("NativeModuleInitError", "Failed to create NativeModule \"" + getName() + "\"", ex);<NEW_LINE>throw ex;<NEW_LINE>} finally {<NEW_LINE>ReactMarker.logMarker(CREATE_MODULE_END, mName, mInstanceKey);<NEW_LINE>SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE).flush();<NEW_LINE>}<NEW_LINE>return module;<NEW_LINE>}
assertCondition(mModule == null, "Creating an already created module.");
927,268
public void init() {<NEW_LINE>addDrawableChild(new CleanUpButton(width / 2 - 100, height / 4 + 168 + 12, () -> "Cancel", "", b -> client.setScreen(prevScreen)));<NEW_LINE>addDrawableChild(cleanUpButton = new CleanUpButton(width / 2 - 100, height / 4 + 144 + 12, () -> "Clean Up", "Start the Clean Up with the settings\n" + "you specified above.\n" + "It might look like the game is not\n" + "responding for a couple of seconds.", b -> cleanUp()));<NEW_LINE>addDrawableChild(new CleanUpButton(width / 2 - 100, height / 4 - 24 + 12, () -> "Unknown Hosts: " + removeOrKeep(cleanupUnknown), "Servers that clearly don't exist.", <MASK><NEW_LINE>addDrawableChild(new CleanUpButton(width / 2 - 100, height / 4 + 0 + 12, () -> "Outdated Servers: " + removeOrKeep(cleanupOutdated), "Servers that run a different Minecraft\n" + "version than you.", b -> cleanupOutdated = !cleanupOutdated));<NEW_LINE>addDrawableChild(new CleanUpButton(width / 2 - 100, height / 4 + 24 + 12, () -> "Failed Ping: " + removeOrKeep(cleanupFailed), "All servers that failed the last ping.\n" + "Make sure that the last ping is complete\n" + "before you do this. That means: Go back,\n" + "press the refresh button and wait until\n" + "all servers are done refreshing.", b -> cleanupFailed = !cleanupFailed));<NEW_LINE>addDrawableChild(new CleanUpButton(width / 2 - 100, height / 4 + 48 + 12, () -> "\"Grief me\" Servers: " + removeOrKeep(cleanupGriefMe), "All servers where the name starts with \"Grief me\"\n" + "Useful for removing servers found by ServerFinder.", b -> cleanupGriefMe = !cleanupGriefMe));<NEW_LINE>addDrawableChild(new CleanUpButton(width / 2 - 100, height / 4 + 72 + 12, () -> "\u00a7cRemove all Servers: " + yesOrNo(removeAll), "This will completely clear your server\n" + "list. \u00a7cUse with caution!\u00a7r", b -> removeAll = !removeAll));<NEW_LINE>addDrawableChild(new CleanUpButton(width / 2 - 100, height / 4 + 96 + 12, () -> "Rename all Servers: " + yesOrNo(cleanupRename), "Renames your servers to \"Grief me #1\",\n" + "\"Grief me #2\", etc.", b -> cleanupRename = !cleanupRename));<NEW_LINE>}
b -> cleanupUnknown = !cleanupUnknown));
1,730,127
private void routeDownward(Vertex2d start, Vertex2d end, FGEdge e, Vertex2dFactory vertex2dFactory, List<Point2D> articulations) {<NEW_LINE>lighten(e);<NEW_LINE>int delta = end.rowIndex - start.rowIndex;<NEW_LINE>int distanceSpacing = delta * EDGE_ENDPOINT_DISTANCE_MULTIPLIER;<NEW_LINE>// update for extra spacing<NEW_LINE>double x1 = start.getX() - distanceSpacing;<NEW_LINE>// hidden<NEW_LINE>double y1 = start.getY();<NEW_LINE>articulations.add(new Point2D.Double(x1, y1));<NEW_LINE>// same distance over<NEW_LINE>double x2 = x1;<NEW_LINE>double y2 = end.getY();<NEW_LINE>articulations.add(new Point2D<MASK><NEW_LINE>double x3 = end.getX() + (-distanceSpacing);<NEW_LINE>double y3 = y2;<NEW_LINE>routeAroundColumnVertices(start, end, vertex2dFactory, articulations, x3);<NEW_LINE>articulations.add(new Point2D.Double(x3, y3));<NEW_LINE>double x4 = end.getX();<NEW_LINE>double y4 = y3;<NEW_LINE>// point is hidden behind the vertex<NEW_LINE>articulations.add(new Point2D.Double(x4, y4));<NEW_LINE>}
.Double(x2, y2));
703,860
public Route.Handler apply(@Nonnull Route.Handler next) {<NEW_LINE>long timestamp = System.currentTimeMillis();<NEW_LINE>return ctx -> {<NEW_LINE>// Take remote address here (less chances of loosing it on interrupted requests).<NEW_LINE>String remoteAddr = ctx.getRemoteAddress();<NEW_LINE>ctx.onComplete(context -> {<NEW_LINE>StringBuilder sb = new StringBuilder(MESSAGE_SIZE);<NEW_LINE>sb.append(remoteAddr);<NEW_LINE>sb.append(SP).append(DASH).append(SP);<NEW_LINE>sb.append(userId.apply(ctx));<NEW_LINE>sb.append(SP);<NEW_LINE>sb.append(BL).append(df.apply(timestamp)).append(BR);<NEW_LINE>sb.append(SP);<NEW_LINE>sb.append(Q).append(ctx.getMethod());<NEW_LINE>sb.append(SP);<NEW_LINE>sb.append(ctx.getRequestPath());<NEW_LINE>sb.append(ctx.queryString());<NEW_LINE>sb.append(SP);<NEW_LINE>sb.append(ctx.getProtocol());<NEW_LINE>sb.append(Q).append(SP);<NEW_LINE>sb.append(ctx.getResponseCode().value());<NEW_LINE>sb.append(SP);<NEW_LINE>long responseLength = ctx.getResponseLength();<NEW_LINE>sb.append(responseLength >= 0 ? responseLength : DASH);<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE>sb.append(SP);<NEW_LINE>sb.append(now - timestamp);<NEW_LINE>appendHeaders(sb, requestHeaders, h -> ctx.header(h).valueOrNull());<NEW_LINE>appendHeaders(sb, responseHeaders, h <MASK><NEW_LINE>logRecord.accept(sb.toString());<NEW_LINE>});<NEW_LINE>return next.apply(ctx);<NEW_LINE>};<NEW_LINE>}
-> ctx.getResponseHeader(h));
1,833,818
public static void loadNearestNeighborBin(InputStream in, RecognitionNearestNeighborInvertedFile<?> nn) {<NEW_LINE>DogArray<InvertedFile> inverted = nn.getInvertedFiles();<NEW_LINE>BigDogArray_I32 imageDB = nn.getImagesDB();<NEW_LINE>inverted.reset();<NEW_LINE>imageDB.reset();<NEW_LINE>var builder = new StringBuilder();<NEW_LINE>try {<NEW_LINE>String line = UtilIO.readLine(in, builder);<NEW_LINE>if (!line.equals("BOOFCV_RECOGNITION_NEAREST_NEIGHBOR"))<NEW_LINE>throw new IOException("Unexpected first line. line.length=" + line.length());<NEW_LINE>int invertedCount = 0;<NEW_LINE>int imageCount = 0;<NEW_LINE>while (true) {<NEW_LINE>line = UtilIO.readLine(in, builder);<NEW_LINE>if (line.startsWith("BEGIN_INVERTED"))<NEW_LINE>break;<NEW_LINE>if (line.startsWith("#"))<NEW_LINE>continue;<NEW_LINE>String[] words = line.split("\\s");<NEW_LINE>if (words[0].equals("inverted.size")) {<NEW_LINE>invertedCount = Integer.parseInt(words[1]);<NEW_LINE>} else if (words[0].equals("images.size")) {<NEW_LINE>imageCount = Integer.parseInt(words[1]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DataInputStream input = new DataInputStream(in);<NEW_LINE>for (int invertedIdx = 0; invertedIdx < invertedCount; invertedIdx++) {<NEW_LINE>InvertedFile inv = inverted.grow();<NEW_LINE>int fileCount = input.readInt();<NEW_LINE>for (int imageIdx = 0; imageIdx < fileCount; imageIdx++) {<NEW_LINE><MASK><NEW_LINE>float weight = input.readFloat();<NEW_LINE>inv.addImage(index, weight);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>readCheckUTF(input, "BEGIN_IMAGES");<NEW_LINE>for (int imageIdx = 0; imageIdx < imageCount; imageIdx++) {<NEW_LINE>imageDB.add(input.readInt());<NEW_LINE>}<NEW_LINE>readCheckUTF(input, "END_BOOFCV_RECOGNITION_NEAREST_NEIGHBOR");<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
int index = input.readInt();
1,819,100
public Table executionList(@ShellOption(help = "the job name to be used as a filter", defaultValue = ShellOption.NULL) String name) {<NEW_LINE>final PagedModel<JobExecutionThinResource> jobs;<NEW_LINE>if (name == null) {<NEW_LINE>jobs = jobOperations().executionThinList();<NEW_LINE>} else {<NEW_LINE>jobs = jobOperations().executionThinListByJobName(name);<NEW_LINE>}<NEW_LINE>TableModelBuilder<Object> <MASK><NEW_LINE>modelBuilder.addRow().addValue("ID ").addValue("Task ID").addValue("Job Name ").addValue("Start Time ").addValue("Step Execution Count ").addValue("Definition Status ");<NEW_LINE>for (JobExecutionThinResource job : jobs) {<NEW_LINE>modelBuilder.addRow().addValue(job.getExecutionId()).addValue(job.getTaskExecutionId()).addValue(job.getName()).addValue(job.getStartDateTime()).addValue(job.getStepExecutionCount()).addValue(job.isDefined() ? "Created" : "Destroyed");<NEW_LINE>}<NEW_LINE>TableBuilder builder = new TableBuilder(modelBuilder.build());<NEW_LINE>DataFlowTables.applyStyle(builder);<NEW_LINE>return builder.build();<NEW_LINE>}
modelBuilder = new TableModelBuilder<>();
774,668
public void visitBinaryExpression(BinaryExpression expression) {<NEW_LINE>boolean writeParanthesis = false;<NEW_LINE>preVisitExpression(expression);<NEW_LINE>if (expression.getOperation().getType() == Types.LEFT_SQUARE_BRACKET) {<NEW_LINE>expression.getLeftExpression().visit(this);<NEW_LINE>groovyCode.append("[");<NEW_LINE>expression.getRightExpression().visit(this);<NEW_LINE>groovyCode.append("]");<NEW_LINE>} else {<NEW_LINE>LineColumn coords = new LineColumn(expression.getLineNumber(), expression.getColumnNumber());<NEW_LINE>try {<NEW_LINE>if (!(getParent() instanceof DeclarationExpression) && FilePartReader.readForwardFromCoordinate(currentDocument, coords).startsWith("(")) {<NEW_LINE>groovyCode.append("(");<NEW_LINE>writeParanthesis = true;<NEW_LINE>}<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>expression.getLeftExpression().visit(this);<NEW_LINE>if (!"null".equals(expression.getRightExpression().getText())) {<NEW_LINE>groovyCode.append(" ");<NEW_LINE>groovyCode.append(expression.getOperation().getText());<NEW_LINE>groovyCode.append(" ");<NEW_LINE>expression.getRightExpression().visit(this);<NEW_LINE>}<NEW_LINE>if (writeParanthesis) {<NEW_LINE>groovyCode.append(")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>postVisitExpression(expression);<NEW_LINE>}
GroovyCore.logException("Error in refactoring", e);
1,779,068
private static void addToBranch(MXCIFQuadTreeNodeBranch<Object> branch, double x, double y, double width, double height, Object value, MXCIFQuadTree<Object> tree) {<NEW_LINE>QuadrantAppliesEnum quadrant = branch.getBb().getQuadrantApplies(x, y, width, height);<NEW_LINE>if (quadrant == QuadrantAppliesEnum.NW) {<NEW_LINE>branch.setNw(setOnNode(x, y, width, height, value, branch.getNw(), tree));<NEW_LINE>} else if (quadrant == QuadrantAppliesEnum.NE) {<NEW_LINE>branch.setNe(setOnNode(x, y, width, height, value, branch.getNe(), tree));<NEW_LINE>} else if (quadrant == QuadrantAppliesEnum.SW) {<NEW_LINE>branch.setSw(setOnNode(x, y, width, height, value, branch.getSw(), tree));<NEW_LINE>} else if (quadrant == QuadrantAppliesEnum.SE) {<NEW_LINE>branch.setSe(setOnNode(x, y, width, height, value, branch<MASK><NEW_LINE>} else if (quadrant == QuadrantAppliesEnum.SOME) {<NEW_LINE>int count = setOnNode(branch, x, y, width, height, value);<NEW_LINE>branch.incCount(count);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Quandrant not applies to any");<NEW_LINE>}<NEW_LINE>}
.getSe(), tree));
969,375
synchronized void requestCheckpoint(boolean persistent) throws ObjectManagerException {<NEW_LINE>if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())<NEW_LINE>trace.entry(this, cclass, "requestCheckpoint", new Object[] { new Boolean(persistent) });<NEW_LINE>// Has something previously gone wrong?<NEW_LINE>if (abnormalTerminationException != null) {<NEW_LINE>if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())<NEW_LINE>trace.exit(<MASK><NEW_LINE>throw new UnexpectedExceptionException(this, abnormalTerminationException);<NEW_LINE>}<NEW_LINE>// if (abnormalTerminationException != null).<NEW_LINE>// Any request arriving after we have stopped running, at shutdown will not be honoured.<NEW_LINE>checkpointRequested = true;<NEW_LINE>persistentTransactions = persistentTransactions || persistent;<NEW_LINE>if (waiting) {<NEW_LINE>notify();<NEW_LINE>}<NEW_LINE>// if (waiting).<NEW_LINE>if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())<NEW_LINE>trace.exit(this, cclass, "requestCheckpoint");<NEW_LINE>}
this, cclass, "requestCheckpoint", abnormalTerminationException);
1,325,426
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject <MASK><NEW_LINE>if (controller == null || sourceObject == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Permanent permanent = game.getPermanent(source.getFirstTarget());<NEW_LINE>if (permanent != null) {<NEW_LINE>Effect effect = new MayTapOrUntapTargetEffect();<NEW_LINE>effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));<NEW_LINE>effect.apply(game, source);<NEW_LINE>Player player = game.getPlayer(permanent.getControllerId());<NEW_LINE>if (player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Cost cost = new ManaCostsImpl("{2}{U}");<NEW_LINE>if (cost.pay(source, game, source, controller.getId(), false)) {<NEW_LINE>if (player.chooseUse(outcome, "Copy the spell?", source, game)) {<NEW_LINE>Spell spell = game.getStack().getSpell(source.getSourceId());<NEW_LINE>if (spell != null) {<NEW_LINE>spell.createCopyOnStack(game, source, player.getId(), true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
sourceObject = source.getSourceObject(game);
921,209
public static ApplyTagPoliciesResponse unmarshall(ApplyTagPoliciesResponse applyTagPoliciesResponse, UnmarshallerContext _ctx) {<NEW_LINE>applyTagPoliciesResponse.setRequestId(_ctx.stringValue("ApplyTagPoliciesResponse.RequestId"));<NEW_LINE>applyTagPoliciesResponse.setHttpStatusCode(_ctx.integerValue("ApplyTagPoliciesResponse.HttpStatusCode"));<NEW_LINE>applyTagPoliciesResponse.setMessage(_ctx.stringValue("ApplyTagPoliciesResponse.Message"));<NEW_LINE>applyTagPoliciesResponse.setCode(_ctx.integerValue("ApplyTagPoliciesResponse.Code"));<NEW_LINE>applyTagPoliciesResponse.setSuccess(_ctx.booleanValue("ApplyTagPoliciesResponse.Success"));<NEW_LINE>List<RouteRuleVO> data = new ArrayList<RouteRuleVO>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ApplyTagPoliciesResponse.Data.Length"); i++) {<NEW_LINE>RouteRuleVO routeRuleVO = new RouteRuleVO();<NEW_LINE>routeRuleVO.setStatus(_ctx.integerValue<MASK><NEW_LINE>routeRuleVO.setInstanceNum(_ctx.integerValue("ApplyTagPoliciesResponse.Data[" + i + "].InstanceNum"));<NEW_LINE>routeRuleVO.setRemove(_ctx.booleanValue("ApplyTagPoliciesResponse.Data[" + i + "].Remove"));<NEW_LINE>routeRuleVO.setCarryData(_ctx.booleanValue("ApplyTagPoliciesResponse.Data[" + i + "].CarryData"));<NEW_LINE>routeRuleVO.setTag(_ctx.stringValue("ApplyTagPoliciesResponse.Data[" + i + "].Tag"));<NEW_LINE>routeRuleVO.setName(_ctx.stringValue("ApplyTagPoliciesResponse.Data[" + i + "].Name"));<NEW_LINE>routeRuleVO.setRules(_ctx.stringValue("ApplyTagPoliciesResponse.Data[" + i + "].Rules"));<NEW_LINE>routeRuleVO.setId(_ctx.longValue("ApplyTagPoliciesResponse.Data[" + i + "].Id"));<NEW_LINE>routeRuleVO.setRate(_ctx.integerValue("ApplyTagPoliciesResponse.Data[" + i + "].Rate"));<NEW_LINE>routeRuleVO.setEnable(_ctx.booleanValue("ApplyTagPoliciesResponse.Data[" + i + "].Enable"));<NEW_LINE>data.add(routeRuleVO);<NEW_LINE>}<NEW_LINE>applyTagPoliciesResponse.setData(data);<NEW_LINE>return applyTagPoliciesResponse;<NEW_LINE>}
("ApplyTagPoliciesResponse.Data[" + i + "].Status"));
1,333,472
final private void fillCallerData(String callerFQCN, LogRecord record) {<NEW_LINE>if (!FILL_CALLER_DATA) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StackTraceElement[] steArray = <MASK><NEW_LINE>int selfIndex = -1;<NEW_LINE>for (int i = 0; i < steArray.length; i++) {<NEW_LINE>final String className = steArray[i].getClassName();<NEW_LINE>if (className.equals(callerFQCN) || className.equals(SUPER)) {<NEW_LINE>selfIndex = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int found = -1;<NEW_LINE>for (int i = selfIndex + 1; i < steArray.length; i++) {<NEW_LINE>final String className = steArray[i].getClassName();<NEW_LINE>if (!(className.equals(callerFQCN) || className.equals(SUPER))) {<NEW_LINE>found = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (found != -1) {<NEW_LINE>StackTraceElement ste = steArray[found];<NEW_LINE>// setting the class name has the side effect of setting<NEW_LINE>// the needToInferCaller variable to false.<NEW_LINE>record.setSourceClassName(ste.getClassName());<NEW_LINE>record.setSourceMethodName(ste.getMethodName());<NEW_LINE>}<NEW_LINE>}
new Throwable().getStackTrace();
1,580,268
private static List<Region> internalParse(final InputStream input, final boolean endpointVerification) throws IOException {<NEW_LINE>Document document;<NEW_LINE>try {<NEW_LINE>DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();<NEW_LINE>factory.setXIncludeAware(false);<NEW_LINE>factory.setExpandEntityReferences(false);<NEW_LINE>factory.<MASK><NEW_LINE>configureDocumentBuilderFactory(factory);<NEW_LINE>DocumentBuilder documentBuilder = factory.newDocumentBuilder();<NEW_LINE>document = documentBuilder.parse(input);<NEW_LINE>} catch (IOException exception) {<NEW_LINE>throw exception;<NEW_LINE>} catch (Exception exception) {<NEW_LINE>throw new IOException("Unable to parse region metadata file: " + exception.getMessage(), exception);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>input.close();<NEW_LINE>} catch (IOException exception) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>NodeList regionNodes = document.getElementsByTagName(REGION_TAG);<NEW_LINE>List<Region> regions = new ArrayList<Region>();<NEW_LINE>for (int i = 0; i < regionNodes.getLength(); i++) {<NEW_LINE>Node node = regionNodes.item(i);<NEW_LINE>if (node.getNodeType() == Node.ELEMENT_NODE) {<NEW_LINE>Element element = (Element) node;<NEW_LINE>regions.add(parseRegionElement(element, endpointVerification));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return regions;<NEW_LINE>}
setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
1,212,060
public static GlobalQRCodeParseResult parse(@NonNull final String string) {<NEW_LINE>String remainingString = string;<NEW_LINE>//<NEW_LINE>// Extract type<NEW_LINE>final GlobalQRCodeType type;<NEW_LINE>{<NEW_LINE>int idx = remainingString.indexOf(SEPARATOR);<NEW_LINE>if (idx <= 0) {<NEW_LINE>return GlobalQRCodeParseResult.error("Invalid global QR code(1): " + string);<NEW_LINE>}<NEW_LINE>type = GlobalQRCodeType.ofString(remainingString<MASK><NEW_LINE>remainingString = remainingString.substring(idx + 1);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Extract version<NEW_LINE>final GlobalQRCodeVersion version;<NEW_LINE>{<NEW_LINE>int idx = remainingString.indexOf(SEPARATOR);<NEW_LINE>if (idx <= 0) {<NEW_LINE>return GlobalQRCodeParseResult.error("Invalid global QR code(2): " + string);<NEW_LINE>}<NEW_LINE>version = GlobalQRCodeVersion.ofString(remainingString.substring(0, idx));<NEW_LINE>remainingString = remainingString.substring(idx + 1);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Payload<NEW_LINE>final String payloadAsJson = remainingString;<NEW_LINE>//<NEW_LINE>return GlobalQRCodeParseResult.ok(builder().type(type).version(version).payloadAsJson(payloadAsJson).build());<NEW_LINE>}
.substring(0, idx));
1,109,813
private void onInit(CallbackInfo info) {<NEW_LINE>addDrawableChild(new ButtonWidget(4, 4, 120, 20, new LiteralText("Copy"), button -> {<NEW_LINE>NbtList listTag = new NbtList();<NEW_LINE>for (int i = 0; i < contents.getPageCount(); i++) listTag.add(NbtString.of(contents.getPage(i).getString()));<NEW_LINE>NbtCompound tag = new NbtCompound();<NEW_LINE>tag.put("pages", listTag);<NEW_LINE>tag.putInt("currentPage", pageIndex);<NEW_LINE>FastByteArrayOutputStream bytes = new FastByteArrayOutputStream();<NEW_LINE>DataOutputStream out = new DataOutputStream(bytes);<NEW_LINE>try {<NEW_LINE>NbtIo.write(tag, out);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>GLFW.glfwSetClipboardString(mc.getWindow().getHandle(), Base64.getEncoder().encodeToString(bytes.array));<NEW_LINE>}));<NEW_LINE>// Edit title & author<NEW_LINE>ItemStack itemStack <MASK><NEW_LINE>Hand hand = Hand.MAIN_HAND;<NEW_LINE>if (itemStack.getItem() != Items.WRITTEN_BOOK) {<NEW_LINE>itemStack = mc.player.getOffHandStack();<NEW_LINE>hand = Hand.OFF_HAND;<NEW_LINE>}<NEW_LINE>if (itemStack.getItem() != Items.WRITTEN_BOOK)<NEW_LINE>return;<NEW_LINE>// Fuck you Java<NEW_LINE>ItemStack book = itemStack;<NEW_LINE>// Honestly<NEW_LINE>Hand hand2 = hand;<NEW_LINE>addDrawableChild(new ButtonWidget(4, 4 + 20 + 2, 120, 20, new LiteralText("Edit title & author"), button -> {<NEW_LINE>mc.setScreen(new EditBookTitleAndAuthorScreen(GuiThemes.get(), book, hand2));<NEW_LINE>}));<NEW_LINE>}
= mc.player.getMainHandStack();
1,449,800
private void loadSettings(PClient newClient, Client client) throws IOException {<NEW_LINE>PSettings newSettings = newClient.getSettings();<NEW_LINE><MASK><NEW_LINE>// remove all auto-created bookmarks<NEW_LINE>settings.clearBookmarks();<NEW_LINE>for (PBookmark newBookmark : newSettings.getBookmarksList()) {<NEW_LINE>settings.getBookmarks().add(new Bookmark(newBookmark.getLabel(), newBookmark.getPattern()));<NEW_LINE>}<NEW_LINE>// remove all auto-created attributes<NEW_LINE>settings.clearAttributeTypes();<NEW_LINE>for (PAttributeType newAttributeType : newSettings.getAttributeTypesList()) {<NEW_LINE>try {<NEW_LINE>AttributeType attributeType = new AttributeType(newAttributeType.getId());<NEW_LINE>attributeType.setName(newAttributeType.getName());<NEW_LINE>attributeType.setColumnLabel(newAttributeType.getColumnLabel());<NEW_LINE>if (newAttributeType.hasSource())<NEW_LINE>attributeType.setSource(newAttributeType.getSource());<NEW_LINE>attributeType.setTarget((Class<? extends Attributable>) Class.forName(newAttributeType.getTarget()));<NEW_LINE>attributeType.setType(Class.forName(newAttributeType.getType()));<NEW_LINE>attributeType.setConverter((Class<? extends Converter>) Class.forName(newAttributeType.getConverterClass()));<NEW_LINE>attributeType.getProperties().fromProto(newAttributeType.getProperties());<NEW_LINE>settings.addAttributeType(attributeType);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (PConfigurationSet newConfigurationSet : newSettings.getConfigurationSetsList()) {<NEW_LINE>String key = newConfigurationSet.getKey();<NEW_LINE>Configuration config = new Configuration(newConfigurationSet.getUuid());<NEW_LINE>config.setName(newConfigurationSet.getName());<NEW_LINE>config.setData(newConfigurationSet.getData());<NEW_LINE>settings.getConfigurationSet(key).add(config);<NEW_LINE>}<NEW_LINE>}
ClientSettings settings = client.getSettings();
295,328
protected JMenu createSizeMenu() {<NEW_LINE>JMenu sizeMenu = new JMenu(I18N.getText("token.popup.menu.size"));<NEW_LINE>JCheckBoxMenuItem freeSize = new JCheckBoxMenuItem(new FreeSizeAction());<NEW_LINE>freeSize.setSelected(!tokenUnderMouse.isSnapToScale());<NEW_LINE>sizeMenu.add(freeSize);<NEW_LINE>JCheckBoxMenuItem resetSize = new JCheckBoxMenuItem(new ResetSizeAction());<NEW_LINE>sizeMenu.add(resetSize);<NEW_LINE>sizeMenu.addSeparator();<NEW_LINE>Grid grid = renderer<MASK><NEW_LINE>for (TokenFootprint footprint : grid.getFootprints()) {<NEW_LINE>JMenuItem menuItem = new JCheckBoxMenuItem(new ChangeSizeAction(footprint));<NEW_LINE>if (tokenUnderMouse.isSnapToScale() && tokenUnderMouse.getFootprint(grid) == footprint) {<NEW_LINE>menuItem.setSelected(true);<NEW_LINE>}<NEW_LINE>sizeMenu.add(menuItem);<NEW_LINE>}<NEW_LINE>return sizeMenu;<NEW_LINE>}
.getZone().getGrid();
843,426
public void runAssertion(RegressionEnvironment env, String createSchemaEPL, Consumer<String[]> sender) {<NEW_LINE>String epl = createSchemaEPL + "@name('s0') select * from LocalEvent;\n" + "@name('s1') select property[0].id as c0, property[1].id as c1," + " exists(property[0].id) as c2, exists(property[1].id) as c3," + " typeof(property[0].id) as c4, typeof(property[1].id) as c5" + " from LocalEvent;\n";<NEW_LINE>env.compileDeploy(epl).addListener("s0").addListener("s1");<NEW_LINE>sender.accept(new String[] { "a", "b" });<NEW_LINE>env.assertEventNew("s0", event -> assertGetters(event, true, "a", true, "b"));<NEW_LINE>assertProps(env, true, "a", true, "b");<NEW_LINE>sender.accept(new String[] { "a" });<NEW_LINE>env.assertEventNew("s0", event -> assertGetters(event, true, "a", false, null));<NEW_LINE>assertProps(env, true, "a", false, null);<NEW_LINE>sender.accept(new String[0]);<NEW_LINE>env.assertEventNew("s0", event -> assertGetters(event, false, null, false, null));<NEW_LINE>assertProps(env, false, null, false, null);<NEW_LINE>sender.accept(null);<NEW_LINE>env.assertEventNew("s0", event -> assertGetters(event, false<MASK><NEW_LINE>assertProps(env, false, null, false, null);<NEW_LINE>env.undeployAll();<NEW_LINE>}
, null, false, null));
1,638,393
public User createUser(String userId, String email) throws DotDataException, DuplicateUserException {<NEW_LINE>Company comp = com.dotmarketing.cms.factories.PublicCompanyFactory.getDefaultCompany();<NEW_LINE>String companyId = comp.getCompanyId();<NEW_LINE>User defaultUser = APILocator.getUserAPI().getDefaultUser();<NEW_LINE>if (!UtilMethods.isSet(userId)) {<NEW_LINE>userId = "user-" + UUIDUtil.uuid();<NEW_LINE>}<NEW_LINE>if (!UtilMethods.isSet(email)) {<NEW_LINE>email = userId + "@fakedotcms.com";<NEW_LINE>}<NEW_LINE>User user;<NEW_LINE>try {<NEW_LINE>user = UserLocalManagerUtil.addUser(companyId, false, userId, true, null, null, false, userId, null, userId, null, true, null, email, defaultUser.getLocale());<NEW_LINE>} catch (DuplicateUserEmailAddressException e) {<NEW_LINE>Logger.info(this, "User already exists with this email");<NEW_LINE>throw new DuplicateUserException(e.getMessage(), e);<NEW_LINE>} catch (DuplicateUserIdException e) {<NEW_LINE>Logger.info(this, "User already exists with this ID");<NEW_LINE>throw new DuplicateUserException(e.getMessage(), e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(this, e.getMessage(), e);<NEW_LINE>throw new DotDataException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>user.setLanguageId(defaultUser.getLocale().toString());<NEW_LINE>user.setTimeZoneId(defaultUser.getTimeZoneId());<NEW_LINE>user.setSkinId(defaultUser.getSkinId());<NEW_LINE>user.setDottedSkins(defaultUser.isDottedSkins());<NEW_LINE>user.setRoundedSkins(defaultUser.isRoundedSkins());<NEW_LINE>user.setResolution(defaultUser.getResolution());<NEW_LINE>user.<MASK><NEW_LINE>user.setLayoutIds("");<NEW_LINE>user.setNew(false);<NEW_LINE>user.setCompanyId(companyId);<NEW_LINE>return user;<NEW_LINE>}
setRefreshRate(defaultUser.getRefreshRate());
1,459,507
private static void addAvailableFixesForGroups(@Nonnull HighlightInfo info, @Nonnull Editor editor, @Nonnull PsiFile file, @Nonnull List<? super HighlightInfo.IntentionActionDescriptor> outList, int group, int offset) {<NEW_LINE>if (info.quickFixActionMarkers == null)<NEW_LINE>return;<NEW_LINE>if (group != -1 && group != info.getGroup())<NEW_LINE>return;<NEW_LINE>boolean fixRangeIsNotEmpty = !info.getFixTextRange().isEmpty();<NEW_LINE>Editor injectedEditor = null;<NEW_LINE>PsiFile injectedFile = null;<NEW_LINE>for (Pair<HighlightInfo.IntentionActionDescriptor, RangeMarker> pair : info.quickFixActionMarkers) {<NEW_LINE>HighlightInfo.IntentionActionDescriptor actionInGroup = pair.first;<NEW_LINE>RangeMarker range = pair.second;<NEW_LINE>if (!range.isValid() || fixRangeIsNotEmpty && isEmpty(range))<NEW_LINE>continue;<NEW_LINE>if (DumbService.isDumb(file.getProject()) && !DumbService.isDumbAware(actionInGroup.getAction())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int start = range.getStartOffset();<NEW_LINE>int end = range.getEndOffset();<NEW_LINE>final Project project = file.getProject();<NEW_LINE>if (start > offset || offset > end) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Editor editorToUse;<NEW_LINE>PsiFile fileToUse;<NEW_LINE>if (info.isFromInjection()) {<NEW_LINE>if (injectedEditor == null) {<NEW_LINE>injectedFile = InjectedLanguageUtil.findInjectedPsiNoCommit(file, offset);<NEW_LINE>injectedEditor = InjectedLanguageUtil.getInjectedEditorForInjectedFile(editor, injectedFile);<NEW_LINE>}<NEW_LINE>editorToUse = injectedFile == null ? editor : injectedEditor;<NEW_LINE>fileToUse <MASK><NEW_LINE>} else {<NEW_LINE>editorToUse = editor;<NEW_LINE>fileToUse = file;<NEW_LINE>}<NEW_LINE>if (actionInGroup.getAction().isAvailable(project, editorToUse, fileToUse)) {<NEW_LINE>outList.add(actionInGroup);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= injectedFile == null ? file : injectedFile;
1,188,440
public void marshall(Finding finding, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (finding == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(finding.getAccountId(), ACCOUNTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(finding.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(finding.getConfidence(), CONFIDENCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(finding.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(finding.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(finding.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(finding.getPartition(), PARTITION_BINDING);<NEW_LINE>protocolMarshaller.marshall(finding.getRegion(), REGION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(finding.getSchemaVersion(), SCHEMAVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(finding.getService(), SERVICE_BINDING);<NEW_LINE>protocolMarshaller.marshall(finding.getSeverity(), SEVERITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(finding.getTitle(), TITLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(finding.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(finding.getUpdatedAt(), UPDATEDAT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
finding.getResource(), RESOURCE_BINDING);
1,661,463
private Object insertRecord(Table table, Context ctx) {<NEW_LINE>if (param.getType() != IParam.Colon || param.getSubSize() != 2) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("insert" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>IParam sub1 = param.getSub(1);<NEW_LINE>if (sub1 == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("insert" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object val = sub1.getLeafExpression().calculate(ctx);<NEW_LINE>Sequence seq;<NEW_LINE>int pos = 0;<NEW_LINE>if (val instanceof Sequence) {<NEW_LINE>seq = (Sequence) val;<NEW_LINE>} else if (val instanceof Record) {<NEW_LINE>seq = new Sequence(1);<NEW_LINE>seq.add(val);<NEW_LINE>} else if (val != null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("insert" + mm.getMessage("function.paramTypeError"));<NEW_LINE>} else {<NEW_LINE>seq = null;<NEW_LINE>}<NEW_LINE>IParam sub0 = param.getSub(0);<NEW_LINE>if (sub0 != null) {<NEW_LINE>Object obj = sub0.<MASK><NEW_LINE>if (!(obj instanceof Number)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("insert" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>pos = ((Number) obj).intValue();<NEW_LINE>return table.modify(pos, seq, true, option);<NEW_LINE>} else {<NEW_LINE>return table.sortedInsert(seq, option);<NEW_LINE>}<NEW_LINE>}
getLeafExpression().calculate(ctx);
1,315,858
void dumpStatistics() {<NEW_LINE>int leafPages = height == 3 ? pagesCount - (1 + root.getNodeView().getChildrenCount() + 1) : height == 2 ? pagesCount - 1 : 1;<NEW_LINE>long leafNodesCapacity = (long) hashedPagesCount * maxLeafNodesInHash + (long) (leafPages - hashedPagesCount) * maxLeafNodes;<NEW_LINE>long leafNodesCapacity2 = (long) leafPages * maxLeafNodes;<NEW_LINE>int usedPercent = (int) (<MASK><NEW_LINE>int usedPercent2 = (int) ((count * 100L) / leafNodesCapacity2);<NEW_LINE>IOStatistics.dump("pagecount:" + pagesCount + ", height:" + height + ", movedMembers:" + movedMembersCount + ", optimized inserts:" + myOptimizedInserts + ", hash steps:" + maxStepsSearchedInHash + ", avg search in hash:" + (hashSearchRequests != 0 ? totalHashStepsSearched / hashSearchRequests : 0) + ", leaf pages used:" + usedPercent + "%, leaf pages used if sorted: " + usedPercent2 + "%, size:" + storage.length());<NEW_LINE>}
(count * 100L) / leafNodesCapacity);
703,542
public IMessage onMessage(PacketRequestMissingItems message, MessageContext ctx) {<NEW_LINE>EntityPlayerMP player = ctx.getServerHandler().player;<NEW_LINE>if (player.openContainer.windowId == message.windowId && player.openContainer instanceof InventoryPanelContainer) {<NEW_LINE>InventoryPanelContainer ipc = (InventoryPanelContainer) player.openContainer;<NEW_LINE><MASK><NEW_LINE>IInventoryDatabaseServer db = teInvPanel.getDatabaseServer();<NEW_LINE>if (db != null) {<NEW_LINE>try {<NEW_LINE>List<? extends IServerItemEntry> items = db.decompressMissingItems(message.compressed);<NEW_LINE>if (!items.isEmpty()) {<NEW_LINE>return new PacketItemInfo(message.windowId, db, items);<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Logger.getLogger(PacketItemInfo.class.getName()).log(Level.SEVERE, "Exception while reading missing item IDs", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
TileInventoryPanel teInvPanel = ipc.getTe();
915,099
public static // }<NEW_LINE>BlockedTerm parse(JSONObject data, String streamLogin) {<NEW_LINE>String id = JSONUtil.getString(data, "id");<NEW_LINE>long createdAt = JSONUtil.getDatetime(data, "created_at", -1);<NEW_LINE>long updatedAt = JSONUtil.getDatetime(data, "updated_at", -1);<NEW_LINE>long expiresAt = JSONUtil.getDatetime<MASK><NEW_LINE>String text = JSONUtil.getString(data, "text");<NEW_LINE>String moderatorId = JSONUtil.getString(data, "moderator_id");<NEW_LINE>String streamId = JSONUtil.getString(data, "broadcaster_id");<NEW_LINE>if (!StringUtil.isNullOrEmpty(id, text, streamId)) {<NEW_LINE>return new BlockedTerm(id, createdAt, updatedAt, expiresAt, text, moderatorId, streamId, streamLogin);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
(data, "expires_at", -1);
534,666
public void lower(LoweringTool tool) {<NEW_LINE>StructuredGraph replacementGraph = getLoweredSnippetGraph(tool);<NEW_LINE>if (replacementGraph != null) {<NEW_LINE>// Replace this node with an invoke but disable verification of the stamp since the<NEW_LINE>// invoke only exists for the purpose of performing the inling.<NEW_LINE>InvokeNode invoke = createInvoke(false);<NEW_LINE>graph().replaceFixedWithFixed(this, invoke);<NEW_LINE>// Pull out the receiver null check so that a replaced<NEW_LINE>// receiver can be lowered if necessary<NEW_LINE>if (!getTargetMethod().isStatic()) {<NEW_LINE>ValueNode nonNullReceiver = InliningUtil.nonNullReceiver(invoke);<NEW_LINE>if (nonNullReceiver instanceof Lowerable) {<NEW_LINE>((Lowerable) nonNullReceiver).lower(tool);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>InliningUtil.inline(invoke, replacementGraph, false, <MASK><NEW_LINE>replacementGraph.getDebug().dump(DebugContext.DETAILED_LEVEL, asNode().graph(), "After inlining replacement %s", replacementGraph);<NEW_LINE>} else {<NEW_LINE>super.lower(tool);<NEW_LINE>}<NEW_LINE>}
getTargetMethod(), "Replace with graph.", "LoweringPhase");
1,225,100
public void handleRequest(HttpServerExchange exchange) throws Exception {<NEW_LINE>var request = (MongoRequest) MongoRequest.of(exchange);<NEW_LINE>var response = (MongoResponse) MongoResponse.of(exchange);<NEW_LINE>if (!request.isWriteDocument() || request.isPatch()) {<NEW_LINE>next(exchange);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var contentToCheck = request.getContent() == null ? new BsonDocument() : request.getContent();<NEW_LINE>try {<NEW_LINE>schema.validate(new JSONObject(contentToCheck.toString()));<NEW_LINE>} catch (ValidationException ve) {<NEW_LINE>var errors <MASK><NEW_LINE>errors.add(ve.getMessage().replaceAll("#: ", ""));<NEW_LINE>ve.getCausingExceptions().stream().map(ValidationException::getMessage).forEach(errors::add);<NEW_LINE>var errMsgBuilder = new StringBuilder();<NEW_LINE>errors.stream().map(e -> e.replaceAll("#: ", "")).forEachOrdered(e -> errMsgBuilder.append(e).append(", "));<NEW_LINE>var errMsg = errMsgBuilder.toString();<NEW_LINE>if (errMsg.length() > 2 && ", ".equals(errMsg.substring(errMsg.length() - 2, errMsg.length()))) {<NEW_LINE>errMsg = errMsg.substring(0, errMsg.length() - 2);<NEW_LINE>}<NEW_LINE>response.setInError(HttpStatus.SC_BAD_REQUEST, "Request content violates JSON Schema meta schema: " + errMsg);<NEW_LINE>}<NEW_LINE>next(exchange);<NEW_LINE>}
= new ArrayList<String>();
442,601
public void onProgressUpdate(Object... values) {<NEW_LINE>Resources res = getResources();<NEW_LINE>if (values[0] instanceof Integer) {<NEW_LINE>int id = (Integer) values[0];<NEW_LINE>if (id != 0) {<NEW_LINE>mCurrentMessage = res.getString(id);<NEW_LINE>}<NEW_LINE>if (values.length >= 3) {<NEW_LINE>mCountUp = (Long) values[1];<NEW_LINE>mCountDown = (Long) values[2];<NEW_LINE>}<NEW_LINE>} else if (values[0] instanceof String) {<NEW_LINE>mCurrentMessage = (String) values[0];<NEW_LINE>if (values.length >= 3) {<NEW_LINE>mCountUp <MASK><NEW_LINE>mCountDown = (Long) values[2];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mProgressDialog != null && mProgressDialog.isShowing()) {<NEW_LINE>mProgressDialog.setContent(mCurrentMessage + "\n" + res.getString(R.string.sync_up_down_size, mCountUp / 1024, mCountDown / 1024));<NEW_LINE>}<NEW_LINE>}
= (Long) values[1];
1,295,129
public void createSubmission(BasicNetwork network) throws IOException {<NEW_LINE>System.out.println("Building submission file.");<NEW_LINE>FileInputStream istream = new FileInputStream(KAGGLE_TEST);<NEW_LINE>final DataSet ds = DataSet.load(istream);<NEW_LINE>istream.close();<NEW_LINE>int columnCount = ds.getHeaderCount();<NEW_LINE>List<String> <MASK><NEW_LINE>ds.deleteColumn(0);<NEW_LINE>for (int i = 0; i < columnCount - 1; i++) {<NEW_LINE>ds.normalizeZScore(i);<NEW_LINE>}<NEW_LINE>final List<BasicData> data = ds.extractSupervised(0, columnCount - 1, 0, 0);<NEW_LINE>CSVWriter writer = new CSVWriter(new FileWriter(KAGGLE_SUBMIT));<NEW_LINE>for (int i = 0; i < data.size(); i++) {<NEW_LINE>double[] output = network.computeRegression(data.get(i).getInput());<NEW_LINE>String[] line = new String[10];<NEW_LINE>line[0] = ids.get(i);<NEW_LINE>for (int j = 0; j < output.length; j++) {<NEW_LINE>line[j + 1] = String.format(Locale.ENGLISH, "%f", output[j]);<NEW_LINE>}<NEW_LINE>writer.writeNext(line);<NEW_LINE>}<NEW_LINE>writer.close();<NEW_LINE>}
ids = ds.columnAsList(0);
1,612,643
private KeywordFieldType buildFieldType(BuilderContext context, FieldType fieldType) {<NEW_LINE>NamedAnalyzer normalizer = Lucene.KEYWORD_ANALYZER;<NEW_LINE>NamedAnalyzer searchAnalyzer = Lucene.KEYWORD_ANALYZER;<NEW_LINE>String normalizerName = this.normalizer.getValue();<NEW_LINE>if (Objects.equals(normalizerName, "default") == false) {<NEW_LINE>assert indexAnalyzers != null;<NEW_LINE>normalizer = indexAnalyzers.getNormalizer(normalizerName);<NEW_LINE>if (normalizer == null) {<NEW_LINE>throw new MapperParsingException("normalizer [" + <MASK><NEW_LINE>}<NEW_LINE>if (splitQueriesOnWhitespace.getValue()) {<NEW_LINE>searchAnalyzer = indexAnalyzers.getWhitespaceNormalizer(normalizerName);<NEW_LINE>} else {<NEW_LINE>searchAnalyzer = normalizer;<NEW_LINE>}<NEW_LINE>} else if (splitQueriesOnWhitespace.getValue()) {<NEW_LINE>searchAnalyzer = Lucene.WHITESPACE_ANALYZER;<NEW_LINE>}<NEW_LINE>return new KeywordFieldType(buildFullName(context), fieldType, normalizer, searchAnalyzer, this);<NEW_LINE>}
normalizerName + "] not found for field [" + name + "]");
179,838
public static Object addArrays(Object first, Object second) {<NEW_LINE>if (first != null && !first.getClass().isArray()) {<NEW_LINE>throw new IllegalArgumentException("Parameter is not an array: " + first);<NEW_LINE>}<NEW_LINE>if (second != null && !second.getClass().isArray()) {<NEW_LINE>throw new IllegalArgumentException("Parameter is not an array: " + second);<NEW_LINE>}<NEW_LINE>if (first == null) {<NEW_LINE>return second;<NEW_LINE>}<NEW_LINE>if (second == null) {<NEW_LINE>return first;<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>int secondLength = Array.getLength(second);<NEW_LINE>int total = firstLength + secondLength;<NEW_LINE>Object dest = Array.newInstance(first.getClass().getComponentType(), total);<NEW_LINE>System.arraycopy(first, 0, dest, 0, firstLength);<NEW_LINE>System.arraycopy(second, 0, dest, firstLength, secondLength);<NEW_LINE>return dest;<NEW_LINE>}
firstLength = Array.getLength(first);
790,409
public boolean checkAuths(Long appId) {<NEW_LINE>if (appId == null) {<NEW_LINE>logger.warn("appId is null");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>AppDesc appDesc = appDao.getAppDescById(appId);<NEW_LINE>if (appDesc == null) {<NEW_LINE><MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String passwordMD5 = "";<NEW_LINE>String pkey = appDesc.getPkey();<NEW_LINE>if (StringUtils.isNotBlank(pkey)) {<NEW_LINE>passwordMD5 = AuthUtil.getAppIdMD5(pkey);<NEW_LINE>}<NEW_LINE>List<InstanceInfo> instanceInfos = instanceDao.getInstListByAppId(appId);<NEW_LINE>List<Jedis> nodeList = Lists.newArrayList();<NEW_LINE>for (InstanceInfo instanceInfo : instanceInfos) {<NEW_LINE>String host = instanceInfo.getIp();<NEW_LINE>try {<NEW_LINE>int port = instanceInfo.getPort();<NEW_LINE>int type = instanceInfo.getType();<NEW_LINE>if (instanceInfo.isOffline()) {<NEW_LINE>logger.info("instanceInfo {}:{} is offline", host, port);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (TypeUtil.isRedisCluster(type) || TypeUtil.isRedisStandalone(type)) {<NEW_LINE>Jedis jedis = redisCenter.getJedis(host, port, passwordMD5);<NEW_LINE>nodeList.add(jedis);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return checkAuthNodes(nodeList, passwordMD5);<NEW_LINE>}
logger.error("appId = {} not exist", appId);
447,272
public void actionPerformed(final ActionEvent e) {<NEW_LINE>List<JavaPlatform> platforms = JavaPlatform.getPlatforms();<NEW_LINE>String[] columnNames = new String[] { Bundle.LBL_JavaPlatform(), Bundle.LBL_LastCalibrated() };<NEW_LINE>Object[][] columnData = new Object[platforms.size()][2];<NEW_LINE>for (int i = 0; i < platforms.size(); i++) columnData[i] = new Object[] { platforms<MASK><NEW_LINE>final TableModel model = new DefaultTableModel(columnData, columnNames) {<NEW_LINE><NEW_LINE>public boolean isCellEditable(int row, int column) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>displayUI(model);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>RequestProcessor.getDefault().post(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>refreshTimes(model);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.get(i), null };
392,802
public SampleSubsetSummary estimateSubsetSum(final Predicate<Long> predicate) {<NEW_LINE>if (itemsSeen_ == 0) {<NEW_LINE>return new SampleSubsetSummary(0.0, 0.0, 0.0, 0.0);<NEW_LINE>}<NEW_LINE>final long numSamples = getNumSamples();<NEW_LINE>final double <MASK><NEW_LINE>assert samplingRate >= 0.0;<NEW_LINE>assert samplingRate <= 1.0;<NEW_LINE>int predTrueCount = 0;<NEW_LINE>for (int i = 0; i < numSamples; ++i) {<NEW_LINE>if (predicate.test(data_[i])) {<NEW_LINE>++predTrueCount;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if in exact mode, we can return an exact answer<NEW_LINE>if (itemsSeen_ <= reservoirSize_) {<NEW_LINE>return new SampleSubsetSummary(predTrueCount, predTrueCount, predTrueCount, numSamples);<NEW_LINE>}<NEW_LINE>final double lbTrueFraction = pseudoHypergeometricLBonP(numSamples, predTrueCount, samplingRate);<NEW_LINE>final double estimatedTrueFraction = (1.0 * predTrueCount) / numSamples;<NEW_LINE>final double ubTrueFraction = pseudoHypergeometricUBonP(numSamples, predTrueCount, samplingRate);<NEW_LINE>return new SampleSubsetSummary(itemsSeen_ * lbTrueFraction, itemsSeen_ * estimatedTrueFraction, itemsSeen_ * ubTrueFraction, itemsSeen_);<NEW_LINE>}
samplingRate = numSamples / (double) itemsSeen_;
6,431
static List<List<Integer>> newPartitionAssignments(int minPartitionNum, int partitionNum, Set<BrokerMetadata> brokers, int rf) {<NEW_LINE>// The replica assignments for the new partitions, and not the old partitions.<NEW_LINE>// .increaseTo(6, asList(asList(1, 2),<NEW_LINE>// asList(2, 3),<NEW_LINE>// asList(3, 1)))<NEW_LINE>// partition 3's preferred leader will be broker 1,<NEW_LINE>// partition 4's preferred leader will be broker 2 and<NEW_LINE>// partition 5's preferred leader will be broker 3.<NEW_LINE>List<List<Integer>> newPartitionAssignments = new ArrayList<>();<NEW_LINE>int partitionDifference = minPartitionNum - partitionNum;<NEW_LINE>// leader assignments -<NEW_LINE>while (newPartitionAssignments.size() != partitionDifference) {<NEW_LINE>List <MASK><NEW_LINE>// leader replica/broker -<NEW_LINE>int brokerMetadata = randomBroker(brokers).id();<NEW_LINE>replicas.add(brokerMetadata);<NEW_LINE>newPartitionAssignments.add(replicas);<NEW_LINE>}<NEW_LINE>// follower assignments -<NEW_LINE>// Regardless of the partition/replica assignments here, maybeReassignPartitionAndElectLeader()<NEW_LINE>// will reassign the partition as needed periodically.<NEW_LINE>for (List<Integer> replicas : newPartitionAssignments) {<NEW_LINE>for (BrokerMetadata broker : brokers) {<NEW_LINE>if (!replicas.contains(broker.id())) {<NEW_LINE>replicas.add(broker.id());<NEW_LINE>}<NEW_LINE>if (replicas.size() == rf) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newPartitionAssignments;<NEW_LINE>}
replicas = new ArrayList<>();
527,815
private void handleErrorState(File report, String firstLine, Deque<String> queue) {<NEW_LINE>System.err.println(firstLine);<NEW_LINE>String remainder = firstLine.substring(LINE_START.length());<NEW_LINE>Matcher m = Pattern.compile("([^(]*).*").matcher(remainder);<NEW_LINE>if (!m.find()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String line = "";<NEW_LINE>while (!queue.isEmpty()) {<NEW_LINE>line = queue.pop();<NEW_LINE>if (line.trim().startsWith("at")) {<NEW_LINE>System.err.println(line);<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.err.println("--------------------------------------------------------------------------------------------");<NEW_LINE>System.err.println("-- WARNING: The above stack trace is not a real stack trace, it is a theoretical call tree---");<NEW_LINE>System.err.println("-- If an interface has multiple implementations SVM will just display one potential call ---");<NEW_LINE>System.err.println("-- path to the interface. This is often meaningless, and what you actually need to know is---");<NEW_LINE>System.err.println("-- the path to the constructor of the object that implements this interface. ---");<NEW_LINE>System.err.println("-- Quarkus has attempted to generate a more meaningful call flow analysis below ---");<NEW_LINE>System.err.println("---------------------------------------------------------------------------------------------\n");<NEW_LINE>try {<NEW_LINE>String fullName = m.group(1);<NEW_LINE>int <MASK><NEW_LINE>String clazz = fullName.substring(0, index);<NEW_LINE>String method = fullName.substring(index + 1);<NEW_LINE>if (reportAnalyzer == null) {<NEW_LINE>reportAnalyzer = new ReportAnalyzer(report.getAbsolutePath());<NEW_LINE>}<NEW_LINE>System.err.println(reportAnalyzer.analyse(clazz, method));<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>System.err.println(line);<NEW_LINE>}
index = fullName.lastIndexOf('.');
996,848
public String formatRecord(RepositoryLogRecord record, Locale locale) {<NEW_LINE>SimpleDateFormat dateFormatGmt = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");<NEW_LINE>String loggerName = record.getLoggerName();<NEW_LINE>String methodName = record.getSourceMethodName();<NEW_LINE>String message = record.getFormattedMessage();<NEW_LINE>if (record.getStackTrace() != null) {<NEW_LINE>message = message.concat("\n");<NEW_LINE>message = message.concat(record.getStackTrace());<NEW_LINE>}<NEW_LINE>String className = record.getSourceClassName();<NEW_LINE>String logLevel = mapLevelToType(record);<NEW_LINE>long date = record.getMillis();<NEW_LINE>String datetime = dateFormatGmt.format(date);<NEW_LINE>String sequence = date + "_" + String.format("%013X", seq.incrementAndGet());<NEW_LINE>String messageID = record.getMessageID();<NEW_LINE>String logType = null;<NEW_LINE>StringBuilder threadSB = new StringBuilder();<NEW_LINE>Map<String, String> extensions = record.getExtensions();<NEW_LINE>formatThreadID(record, threadSB);<NEW_LINE><MASK><NEW_LINE>Object[] parms = record.getParameters();<NEW_LINE>String rawMessage = record.getRawMessage();<NEW_LINE>return jsonify(loggerName, methodName, message, className, logLevel, datetime, messageID, threadID, sequence, extensions, logType, rawMessage, parms);<NEW_LINE>}
String threadID = threadSB.toString();
43,564
public void testSLRemoteEnvEntry_Double() throws Exception {<NEW_LINE>// The test case looks for a environment variable named "envDouble".<NEW_LINE>Double tempDouble = fejb1.getDoubleEnvVar("envDouble");<NEW_LINE>assertNotNull("Get environment double object was null.", tempDouble);<NEW_LINE>assertEquals("Test content of environment was unexpected value", tempDouble.doubleValue(), 7003.0, DDELTA);<NEW_LINE>tempDouble = fejb1.getDoubleEnvVar("envDouble2");<NEW_LINE>assertNotNull("Get environment double object was null.", tempDouble);<NEW_LINE>assertEquals("Test content of environment was unexpected value", tempDouble.<MASK><NEW_LINE>tempDouble = fejb1.getDoubleEnvVar("envDouble3");<NEW_LINE>assertNotNull("Get environment double object was null.", tempDouble);<NEW_LINE>assertEquals("Test content of environment was unexpected value", tempDouble.doubleValue(), 7.0030e3d, DDELTA);<NEW_LINE>}
doubleValue(), 7003.0, DDELTA);
1,152,065
private Mono<Response<Flux<ByteBuffer>>> createWithResponseAsync(String resourceGroupName, String name, RedisCreateParameters parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.create(this.client.getEndpoint(), resourceGroupName, name, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
267,743
public static Entry<String, List<String>> extract(CharSequence typeString) {<NEW_LINE>StringBuilder typeName = new StringBuilder();<NEW_LINE>StringBuilder typeArgument = new StringBuilder();<NEW_LINE>List<String<MASK><NEW_LINE>int anglesOpened = 0;<NEW_LINE>chars: for (int i = 0; i < typeString.length(); i++) {<NEW_LINE>char c = typeString.charAt(i);<NEW_LINE>switch(c) {<NEW_LINE>case '<':<NEW_LINE>if (++anglesOpened > 1) {<NEW_LINE>typeArgument.append(c);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case '>':<NEW_LINE>if (--anglesOpened > 0) {<NEW_LINE>typeArgument.append(c);<NEW_LINE>} else {<NEW_LINE>break chars;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case ',':<NEW_LINE>if (anglesOpened == 1) {<NEW_LINE>typeArguments.add(typeArgument.toString());<NEW_LINE>typeArgument = new StringBuilder();<NEW_LINE>} else {<NEW_LINE>typeArgument.append(c);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case // not sure about this one<NEW_LINE>' ':<NEW_LINE>if (anglesOpened > 1) {<NEW_LINE>typeArgument.append(c);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>if (anglesOpened == 0) {<NEW_LINE>typeName.append(c);<NEW_LINE>} else {<NEW_LINE>typeArgument.append(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String lastArgument = typeArgument.toString();<NEW_LINE>if (!lastArgument.isEmpty()) {<NEW_LINE>typeArguments.add(lastArgument);<NEW_LINE>}<NEW_LINE>return Maps.immutableEntry(typeName.toString(), typeArguments);<NEW_LINE>}
> typeArguments = Lists.newArrayList();
610,648
public void read(org.apache.thrift.protocol.TProtocol prot, revokeNamespacePermission_args 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(5);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct.tinfo = new org.apache.accumulo.core.trace.thrift.TInfo();<NEW_LINE>struct.tinfo.read(iprot);<NEW_LINE>struct.setTinfoIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.credentials = new org.apache.accumulo.core.securityImpl.thrift.TCredentials();<NEW_LINE><MASK><NEW_LINE>struct.setCredentialsIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct.principal = iprot.readString();<NEW_LINE>struct.setPrincipalIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(3)) {<NEW_LINE>struct.ns = iprot.readString();<NEW_LINE>struct.setNsIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(4)) {<NEW_LINE>struct.permission = iprot.readByte();<NEW_LINE>struct.setPermissionIsSet(true);<NEW_LINE>}<NEW_LINE>}
struct.credentials.read(iprot);
265,529
final ListRevisionAssetsResult executeListRevisionAssets(ListRevisionAssetsRequest listRevisionAssetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listRevisionAssetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListRevisionAssetsRequest> request = null;<NEW_LINE>Response<ListRevisionAssetsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListRevisionAssetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listRevisionAssetsRequest));<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, "ListRevisionAssets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListRevisionAssetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListRevisionAssetsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "DataExchange");
40,864
private HashMap<DefaultMutableTreeNode, String> addTreeNodes(Timestamp dateTime, DefaultMutableTreeNode root, MResource r) {<NEW_LINE>HashMap<DefaultMutableTreeNode, String> names = new <MASK><NEW_LINE>DefaultMutableTreeNode parent = new DefaultMutableTreeNode(dateTime);<NEW_LINE>names.put(parent, getTreeNodeRepresentation(null, parent, r));<NEW_LINE>root.add(parent);<NEW_LINE>for (MPPOrder order : getPPOrders(dateTime, r)) {<NEW_LINE>DefaultMutableTreeNode childOrder = new DefaultMutableTreeNode(order);<NEW_LINE>parent.add(childOrder);<NEW_LINE>names.put(childOrder, getTreeNodeRepresentation(dateTime, childOrder, r));<NEW_LINE>for (MPPOrderNode node : getPPOrderNodes(dateTime, r)) {<NEW_LINE>DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(node);<NEW_LINE>childOrder.add(childNode);<NEW_LINE>names.put(childNode, getTreeNodeRepresentation(dateTime, childNode, r));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return names;<NEW_LINE>}
HashMap<DefaultMutableTreeNode, String>();
1,258,208
private void initUI() {<NEW_LINE>paint = new Paint();<NEW_LINE>paint.setStyle(Style.STROKE);<NEW_LINE>paint.setAntiAlias(true);<NEW_LINE>borderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);<NEW_LINE>borderPaint.setStyle(Style.STROKE);<NEW_LINE>borderPaint.setStrokeJoin(Paint.Join.ROUND);<NEW_LINE>borderPaint.setStrokeCap(Paint.Cap.ROUND);<NEW_LINE>borderPaint.setColor(0x80000000);<NEW_LINE>shadowPaint = new Paint();<NEW_LINE>shadowPaint.setStyle(Style.STROKE);<NEW_LINE>shadowPaint.setAntiAlias(true);<NEW_LINE>paintTextIcon = new Paint();<NEW_LINE>paintTextIcon.setTextSize(10 * view.getDensity());<NEW_LINE>paintTextIcon.setTextAlign(Align.CENTER);<NEW_LINE>paintTextIcon.setFakeBoldText(true);<NEW_LINE>paintTextIcon.setAntiAlias(true);<NEW_LINE>textLayer = view.getLayerByClass(MapTextLayer.class);<NEW_LINE>paintInnerRect = new Paint();<NEW_LINE>paintInnerRect.setStyle(Style.FILL);<NEW_LINE>paintInnerRect.setAntiAlias(true);<NEW_LINE>paintOuterRect = new Paint();<NEW_LINE>paintOuterRect.setStyle(Style.STROKE);<NEW_LINE>paintOuterRect.setAntiAlias(true);<NEW_LINE>paintOuterRect.setStrokeWidth(3);<NEW_LINE>paintOuterRect.setAlpha(255);<NEW_LINE>UiUtilities iconsCache = view.getApplication().getUIUtilities();<NEW_LINE>startPointIcon = iconsCache.getIcon(R.drawable.map_track_point_start);<NEW_LINE>finishPointIcon = iconsCache.getIcon(R.drawable.map_track_point_finish);<NEW_LINE>startAndFinishIcon = iconsCache.getIcon(R.drawable.map_track_point_start_finish);<NEW_LINE>contextMenuLayer = view.getLayerByClass(ContextMenuLayer.class);<NEW_LINE>visitedColor = ContextCompat.getColor(view.getApplication(), R.color.color_ok);<NEW_LINE>defPointColor = ContextCompat.getColor(view.getApplication(<MASK><NEW_LINE>grayColor = ContextCompat.getColor(view.getApplication(), R.color.color_favorite_gray);<NEW_LINE>wayContext = new GpxGeometryWayContext(view.getContext(), view.getDensity());<NEW_LINE>}
), R.color.gpx_color_point);
895,326
private void addWurstCape(GameProfile profile, HashMap<MinecraftProfileTexture.Type, MinecraftProfileTexture> map) {<NEW_LINE>String name = profile.getName();<NEW_LINE>String uuid = profile<MASK><NEW_LINE>try {<NEW_LINE>if (capes == null)<NEW_LINE>setupWurstCapes();<NEW_LINE>if (capes.has(name)) {<NEW_LINE>String capeURL = capes.get(name).getAsString();<NEW_LINE>map.put(Type.CAPE, new MinecraftProfileTexture(capeURL, null));<NEW_LINE>} else if (capes.has(uuid)) {<NEW_LINE>String capeURL = capes.get(uuid).getAsString();<NEW_LINE>map.put(Type.CAPE, new MinecraftProfileTexture(capeURL, null));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("[Wurst] Failed to load cape for '" + name + "' (" + uuid + ")");<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
.getId().toString();
220,566
public void compactTable(AdminCompactTableStmt stmt) throws DdlException {<NEW_LINE>String dbName = stmt.getDbName();<NEW_LINE>String tableName = stmt.getTblName();<NEW_LINE><MASK><NEW_LINE>Database db = this.getDbOrDdlException(dbName);<NEW_LINE>OlapTable olapTable = db.getOlapTableOrDdlException(tableName);<NEW_LINE>AgentBatchTask batchTask = new AgentBatchTask();<NEW_LINE>olapTable.readLock();<NEW_LINE>try {<NEW_LINE>List<String> partitionNames = stmt.getPartitions();<NEW_LINE>LOG.info("Table compaction. database: {}, table: {}, partition: {}, type: {}", dbName, tableName, Joiner.on(", ").join(partitionNames), type);<NEW_LINE>for (String parName : partitionNames) {<NEW_LINE>Partition partition = olapTable.getPartition(parName);<NEW_LINE>if (partition == null) {<NEW_LINE>throw new DdlException("partition[" + parName + "] not exist in table[" + tableName + "]");<NEW_LINE>}<NEW_LINE>for (MaterializedIndex idx : partition.getMaterializedIndices(IndexExtState.VISIBLE)) {<NEW_LINE>for (Tablet tablet : idx.getTablets()) {<NEW_LINE>for (Replica replica : tablet.getReplicas()) {<NEW_LINE>CompactionTask compactionTask = new CompactionTask(replica.getBackendId(), db.getId(), olapTable.getId(), partition.getId(), idx.getId(), tablet.getId(), olapTable.getSchemaHashByIndexId(idx.getId()), type);<NEW_LINE>batchTask.addTask(compactionTask);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// indices<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>olapTable.readUnlock();<NEW_LINE>}<NEW_LINE>// send task immediately<NEW_LINE>AgentTaskExecutor.submit(batchTask);<NEW_LINE>}
String type = stmt.getCompactionType();
1,512,064
private JComponent createActionsPanel() {<NEW_LINE>final JButton include = new JButton(IdeBundle.message("button.include"));<NEW_LINE>final JButton includeRec = new JButton(IdeBundle.message("button.include.recursively"));<NEW_LINE>final JButton exclude = new JButton<MASK><NEW_LINE>final JButton excludeRec = new JButton(IdeBundle.message("button.exclude.recursively"));<NEW_LINE>myPackageTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void valueChanged(TreeSelectionEvent e) {<NEW_LINE>final boolean recursiveEnabled = isButtonEnabled(true, e.getPaths(), e);<NEW_LINE>includeRec.setEnabled(recursiveEnabled);<NEW_LINE>excludeRec.setEnabled(recursiveEnabled);<NEW_LINE>final boolean nonRecursiveEnabled = isButtonEnabled(false, e.getPaths(), e);<NEW_LINE>include.setEnabled(nonRecursiveEnabled);<NEW_LINE>exclude.setEnabled(nonRecursiveEnabled);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>JPanel buttonsPanel = new JPanel(new VerticalFlowLayout());<NEW_LINE>buttonsPanel.add(include);<NEW_LINE>buttonsPanel.add(includeRec);<NEW_LINE>buttonsPanel.add(exclude);<NEW_LINE>buttonsPanel.add(excludeRec);<NEW_LINE>include.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>includeSelected(false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>includeRec.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>includeSelected(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>exclude.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>excludeSelected(false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>excludeRec.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>excludeSelected(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return buttonsPanel;<NEW_LINE>}
(IdeBundle.message("button.exclude"));
514,704
private Unit pickObject(String flag) throws Exception {<NEW_LINE>Unit o = this.entityManagerContainer().flag(flag, Unit.class);<NEW_LINE>if (o != null) {<NEW_LINE>this.entityManagerContainer().get(Unit.class).detach(o);<NEW_LINE>} else {<NEW_LINE>String name = flag;<NEW_LINE>Matcher matcher = PersistenceProperties.<MASK><NEW_LINE>if (matcher.find()) {<NEW_LINE>name = matcher.group(1);<NEW_LINE>String unique = matcher.group(2);<NEW_LINE>o = this.entityManagerContainer().flag(unique, Unit.class);<NEW_LINE>if (null != o) {<NEW_LINE>this.entityManagerContainer().get(Unit.class).detach(o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null == o) {<NEW_LINE>EntityManager em = this.entityManagerContainer().get(Unit.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Unit> cq = cb.createQuery(Unit.class);<NEW_LINE>Root<Unit> root = cq.from(Unit.class);<NEW_LINE>Predicate p = cb.equal(root.get(Unit_.name), name);<NEW_LINE>List<Unit> os = em.createQuery(cq.select(root).where(p)).getResultList();<NEW_LINE>if (os.size() == 1) {<NEW_LINE>o = os.get(0);<NEW_LINE>em.detach(o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null == o && StringUtils.contains(flag, PersistenceProperties.Unit.levelNameSplit)) {<NEW_LINE>List<String> names = Arrays.asList(StringUtils.split(flag, PersistenceProperties.Unit.levelNameSplit));<NEW_LINE>EntityManager em = this.entityManagerContainer().get(Unit.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Unit> cq = cb.createQuery(Unit.class);<NEW_LINE>Root<Unit> root = cq.from(Unit.class);<NEW_LINE>Predicate p = root.get(Unit_.name).in(names);<NEW_LINE>List<Unit> os = em.createQuery(cq.select(root).where(p)).getResultList();<NEW_LINE>os = os.stream().sorted(Comparator.comparing(Unit::getLevel, Comparator.nullsLast(Integer::compareTo))).collect(Collectors.toList());<NEW_LINE>List<String> values = ListTools.extractProperty(os, "name", String.class, false, false);<NEW_LINE>if (StringUtils.equals(flag, StringUtils.join(values, PersistenceProperties.Unit.levelNameSplit))) {<NEW_LINE>o = os.get(os.size() - 1);<NEW_LINE>em.detach(o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return o;<NEW_LINE>}
Unit.distinguishedName_pattern.matcher(flag);
1,113,663
public void onWindowUpdate(WindowUpdateFrame frame) {<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("Received {} on {}", frame, this);<NEW_LINE>int streamId = frame.getStreamId();<NEW_LINE>int windowDelta = frame.getWindowDelta();<NEW_LINE>if (streamId > 0) {<NEW_LINE>IStream stream = getStream(streamId);<NEW_LINE>if (stream != null) {<NEW_LINE>int streamSendWindow = stream.updateSendWindow(0);<NEW_LINE>if (MathUtils.sumOverflows(streamSendWindow, windowDelta)) {<NEW_LINE>reset(stream, new ResetFrame(streamId, ErrorCode.FLOW_CONTROL_ERROR<MASK><NEW_LINE>} else {<NEW_LINE>stream.process(frame, Callback.NOOP);<NEW_LINE>onWindowUpdate(stream, frame);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!isStreamClosed(streamId))<NEW_LINE>onConnectionFailure(ErrorCode.PROTOCOL_ERROR.code, "unexpected_window_update_frame");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int sessionSendWindow = updateSendWindow(0);<NEW_LINE>if (MathUtils.sumOverflows(sessionSendWindow, windowDelta))<NEW_LINE>onConnectionFailure(ErrorCode.FLOW_CONTROL_ERROR.code, "invalid_flow_control_window");<NEW_LINE>else<NEW_LINE>onWindowUpdate(null, frame);<NEW_LINE>}<NEW_LINE>}
.code), Callback.NOOP);
1,701,808
public Request<DescribeStackSetOperationRequest> marshall(DescribeStackSetOperationRequest describeStackSetOperationRequest) {<NEW_LINE>if (describeStackSetOperationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DescribeStackSetOperationRequest> request = new DefaultRequest<DescribeStackSetOperationRequest>(describeStackSetOperationRequest, "AmazonCloudFormation");<NEW_LINE>request.addParameter("Action", "DescribeStackSetOperation");<NEW_LINE><MASK><NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (describeStackSetOperationRequest.getStackSetName() != null) {<NEW_LINE>request.addParameter("StackSetName", StringUtils.fromString(describeStackSetOperationRequest.getStackSetName()));<NEW_LINE>}<NEW_LINE>if (describeStackSetOperationRequest.getOperationId() != null) {<NEW_LINE>request.addParameter("OperationId", StringUtils.fromString(describeStackSetOperationRequest.getOperationId()));<NEW_LINE>}<NEW_LINE>if (describeStackSetOperationRequest.getCallAs() != null) {<NEW_LINE>request.addParameter("CallAs", StringUtils.fromString(describeStackSetOperationRequest.getCallAs()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addParameter("Version", "2010-05-15");
852,898
protected void executeTasks(final AccessPathTask[] tasks) throws Exception {<NEW_LINE>if (executor == null) {<NEW_LINE>for (AccessPathTask task : tasks) {<NEW_LINE>task.call();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<FutureTask<Void>> futureTasks = new LinkedList<FutureTask<Void>>();<NEW_LINE>for (AccessPathTask task : tasks) {<NEW_LINE>final FutureTask<Void> ft = new FutureTask<Void>(task);<NEW_LINE>futureTasks.add(ft);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>for (FutureTask<Void> ft : futureTasks) {<NEW_LINE>if (halt)<NEW_LINE>throw new <MASK><NEW_LINE>// Queue for execution.<NEW_LINE>executor.execute(ft);<NEW_LINE>}<NEW_LINE>// next task.<NEW_LINE>for (FutureTask<Void> ft : futureTasks) {<NEW_LINE>// Wait for a task.<NEW_LINE>if (!halt)<NEW_LINE>ft.get();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>for (FutureTask<Void> ft : futureTasks) {<NEW_LINE>ft.cancel(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
RuntimeException(firstCause.get());
1,756,333
public void createConfirmation() {<NEW_LINE>final MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());<NEW_LINE>final boolean pick = dt.isPickQAConfirm();<NEW_LINE>final boolean ship = dt.isShipConfirm();<NEW_LINE>// Nothing to do<NEW_LINE>if (!pick && !ship) {<NEW_LINE>log.trace("Create confirmations not need");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Create Both .. after each other<NEW_LINE>if (pick && ship) {<NEW_LINE>boolean havePick = false;<NEW_LINE>boolean haveShip = false;<NEW_LINE>final MInOutConfirm<MASK><NEW_LINE>for (final MInOutConfirm confirmation : confirmations) {<NEW_LINE>final MInOutConfirm confirm = confirmation;<NEW_LINE>if (MInOutConfirm.CONFIRMTYPE_PickQAConfirm.equals(confirm.getConfirmType())) {<NEW_LINE>if (// wait intil done<NEW_LINE>!confirm.isProcessed()) {<NEW_LINE>log.debug("Unprocessed: {}", confirm);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>havePick = true;<NEW_LINE>} else if (MInOutConfirm.CONFIRMTYPE_ShipReceiptConfirm.equals(confirm.getConfirmType())) {<NEW_LINE>haveShip = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Create Pick<NEW_LINE>if (!havePick) {<NEW_LINE>MInOutConfirm.create(this, MInOutConfirm.CONFIRMTYPE_PickQAConfirm, false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Create Ship<NEW_LINE>if (!haveShip) {<NEW_LINE>MInOutConfirm.create(this, MInOutConfirm.CONFIRMTYPE_ShipReceiptConfirm, false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Create just one<NEW_LINE>if (pick) {<NEW_LINE>MInOutConfirm.create(this, MInOutConfirm.CONFIRMTYPE_PickQAConfirm, true);<NEW_LINE>} else if (ship) {<NEW_LINE>MInOutConfirm.create(this, MInOutConfirm.CONFIRMTYPE_ShipReceiptConfirm, true);<NEW_LINE>}<NEW_LINE>}
[] confirmations = getConfirmations(false);
933,440
public Tree transformTree(Tree t, Tree root) {<NEW_LINE><MASK><NEW_LINE>StringBuilder newCategory = new StringBuilder();<NEW_LINE>// Add manual state splits<NEW_LINE>for (Pair<TregexPattern, Function<TregexMatcher, String>> e : activeAnnotations) {<NEW_LINE>TregexMatcher m = e.first().matcher(root);<NEW_LINE>if (m.matchesAt(t))<NEW_LINE>newCategory.append(e.second().apply(m));<NEW_LINE>}<NEW_LINE>// WSGDEBUG<NEW_LINE>// Add morphosyntactic features if this is a POS tag<NEW_LINE>if (t.isPreTerminal() && tagSpec != null) {<NEW_LINE>if (!(t.firstChild().label() instanceof CoreLabel) || ((CoreLabel) t.firstChild().label()).originalText() == null)<NEW_LINE>throw new RuntimeException(String.format("%s: Term lacks morpho analysis: %s", this.getClass().getName(), t.toString()));<NEW_LINE>String morphoStr = ((CoreLabel) t.firstChild().label()).originalText();<NEW_LINE>MorphoFeatures feats = tagSpec.strToFeatures(morphoStr);<NEW_LINE>baseCat = feats.getTag(baseCat);<NEW_LINE>}<NEW_LINE>// Update the label(s)<NEW_LINE>String newCat = baseCat + newCategory;<NEW_LINE>t.setValue(newCat);<NEW_LINE>if (t.isPreTerminal() && t.label() instanceof HasTag)<NEW_LINE>((HasTag) t.label()).setTag(newCat);<NEW_LINE>return t;<NEW_LINE>}
String baseCat = t.value();
218,345
private static DecryptedGroup performLocalMigration(@NonNull Context context, @NonNull GroupId.V1 gv1Id, long threadId, @NonNull Recipient groupRecipient) throws IOException, GroupChangeBusyException {<NEW_LINE>Log.i(TAG, "performLocalMigration(" + gv1Id + ", " + threadId + ", " + groupRecipient.getId());<NEW_LINE>try (Closeable ignored = GroupsV2ProcessingLock.acquireGroupProcessingLock()) {<NEW_LINE>DecryptedGroup decryptedGroup;<NEW_LINE>try {<NEW_LINE>decryptedGroup = GroupManager.addedGroupVersion(context, gv1Id.deriveV2MigrationMasterKey());<NEW_LINE>} catch (GroupDoesNotExistException e) {<NEW_LINE>throw new IOException("[Local] The group should exist already!");<NEW_LINE>} catch (GroupNotAMemberException e) {<NEW_LINE><MASK><NEW_LINE>handleLeftBehind(context, gv1Id, groupRecipient, threadId);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Log.i(TAG, "[Local] Migrating group over to the version we were added to: V" + decryptedGroup.getRevision());<NEW_LINE>SignalDatabase.groups().migrateToV2(threadId, gv1Id, decryptedGroup);<NEW_LINE>Log.i(TAG, "[Local] Applying all changes since V" + decryptedGroup.getRevision());<NEW_LINE>try {<NEW_LINE>GroupManager.updateGroupFromServer(context, gv1Id.deriveV2MigrationMasterKey(), LATEST, System.currentTimeMillis(), null);<NEW_LINE>} catch (GroupChangeBusyException | GroupNotAMemberException e) {<NEW_LINE>Log.w(TAG, e);<NEW_LINE>}<NEW_LINE>return decryptedGroup;<NEW_LINE>}<NEW_LINE>}
Log.w(TAG, "[Local] We are not in the group. Doing a local leave.");
144,859
private void readZapAddOnXmlFile(ZapAddOnXmlFile zapAddOnXml) {<NEW_LINE>this.name = zapAddOnXml.getName();<NEW_LINE>this.version = zapAddOnXml.getVersion();<NEW_LINE>this.semVer = zapAddOnXml.getSemVer();<NEW_LINE>this.status = AddOn.Status.valueOf(zapAddOnXml.getStatus());<NEW_LINE>this.description = zapAddOnXml.getDescription();<NEW_LINE>this.changes = zapAddOnXml.getChanges();<NEW_LINE>this.author = zapAddOnXml.getAuthor();<NEW_LINE>this.notBeforeVersion = zapAddOnXml.getNotBeforeVersion();<NEW_LINE>this.notFromVersion = zapAddOnXml.getNotFromVersion();<NEW_LINE>this.dependencies = zapAddOnXml.getDependencies();<NEW_LINE>this.info = createUrl(zapAddOnXml.getUrl());<NEW_LINE>this.repo = <MASK><NEW_LINE>this.ascanrules = zapAddOnXml.getAscanrules();<NEW_LINE>this.extensions = zapAddOnXml.getExtensions();<NEW_LINE>this.extensionsWithDeps = zapAddOnXml.getExtensionsWithDeps();<NEW_LINE>this.files = zapAddOnXml.getFiles();<NEW_LINE>this.libs = createLibs(zapAddOnXml.getLibs());<NEW_LINE>this.pscanrules = zapAddOnXml.getPscanrules();<NEW_LINE>this.addOnClassnames = zapAddOnXml.getAddOnClassnames();<NEW_LINE>String bundleBaseName = zapAddOnXml.getBundleBaseName();<NEW_LINE>if (!bundleBaseName.isEmpty()) {<NEW_LINE>bundleData = new BundleData(bundleBaseName, zapAddOnXml.getBundlePrefix());<NEW_LINE>}<NEW_LINE>String helpSetBaseName = zapAddOnXml.getHelpSetBaseName();<NEW_LINE>if (!helpSetBaseName.isEmpty()) {<NEW_LINE>this.helpSetData = new HelpSetData(helpSetBaseName, zapAddOnXml.getHelpSetLocaleToken());<NEW_LINE>}<NEW_LINE>hasZapAddOnEntry = true;<NEW_LINE>}
createUrl(zapAddOnXml.getRepo());
628,620
void putFieldInfo(final ByteVector output) {<NEW_LINE>boolean useSyntheticAttribute = symbolTable.getMajorVersion() < Opcodes.V1_5;<NEW_LINE>// Put the access_flags, name_index and descriptor_index fields.<NEW_LINE>int mask = useSyntheticAttribute ? Opcodes.ACC_SYNTHETIC : 0;<NEW_LINE>output.putShort(accessFlags & ~mask).putShort(nameIndex).putShort(descriptorIndex);<NEW_LINE>// Compute and put the attributes_count field.<NEW_LINE>// For ease of reference, we use here the same attribute order as in Section 4.7 of the JVMS.<NEW_LINE>int attributesCount = 0;<NEW_LINE>if (constantValueIndex != 0) {<NEW_LINE>++attributesCount;<NEW_LINE>}<NEW_LINE>if ((accessFlags & Opcodes.ACC_SYNTHETIC) != 0 && useSyntheticAttribute) {<NEW_LINE>++attributesCount;<NEW_LINE>}<NEW_LINE>if (signatureIndex != 0) {<NEW_LINE>++attributesCount;<NEW_LINE>}<NEW_LINE>if ((accessFlags & Opcodes.ACC_DEPRECATED) != 0) {<NEW_LINE>++attributesCount;<NEW_LINE>}<NEW_LINE>if (firstAttribute != null) {<NEW_LINE>attributesCount += firstAttribute.getAttributeCount();<NEW_LINE>}<NEW_LINE>output.putShort(attributesCount);<NEW_LINE>// Put the field_info attributes.<NEW_LINE>// For ease of reference, we use here the same attribute order as in Section 4.7 of the JVMS.<NEW_LINE>if (constantValueIndex != 0) {<NEW_LINE>output.putShort(symbolTable.addConstantUtf8(Constants.CONSTANT_VALUE)).putInt(2).putShort(constantValueIndex);<NEW_LINE>}<NEW_LINE>if ((accessFlags & Opcodes.ACC_SYNTHETIC) != 0 && useSyntheticAttribute) {<NEW_LINE>output.putShort(symbolTable.addConstantUtf8(Constants.<MASK><NEW_LINE>}<NEW_LINE>if (signatureIndex != 0) {<NEW_LINE>output.putShort(symbolTable.addConstantUtf8(Constants.SIGNATURE)).putInt(2).putShort(signatureIndex);<NEW_LINE>}<NEW_LINE>if ((accessFlags & Opcodes.ACC_DEPRECATED) != 0) {<NEW_LINE>output.putShort(symbolTable.addConstantUtf8(Constants.DEPRECATED)).putInt(0);<NEW_LINE>}<NEW_LINE>if (firstAttribute != null) {<NEW_LINE>firstAttribute.putAttributes(symbolTable, output);<NEW_LINE>}<NEW_LINE>}
SYNTHETIC)).putInt(0);
1,254,112
final DeleteEndpointResult executeDeleteEndpoint(DeleteEndpointRequest deleteEndpointRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteEndpointRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteEndpointRequest> request = null;<NEW_LINE>Response<DeleteEndpointResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteEndpointRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Database Migration Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteEndpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteEndpointResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteEndpointResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(deleteEndpointRequest));
876,511
public void abortTxn(String reason) throws TException, TimeoutException, InterruptedException, ExecutionException {<NEW_LINE>if (!isTxnBegin()) {<NEW_LINE>LOG.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>this.txnExecutor.abortTransaction();<NEW_LINE>LOG.info("abort txn in channel {}, table: {}, txn id: {}, last batch: {}, reason: {}", id, targetTable, txnExecutor.getTxnId(), lastBatchId, reason);<NEW_LINE>} catch (TException e) {<NEW_LINE>LOG.warn("Failed to abort txn in channel {}, table: {}, txn: {}, msg:{}", id, targetTable, txnExecutor.getTxnId(), e.getMessage());<NEW_LINE>throw e;<NEW_LINE>} catch (InterruptedException | ExecutionException | TimeoutException e) {<NEW_LINE>LOG.warn("Error occur while waiting abort txn response in channel {}, table: {}, txn: {}, msg:{}", id, targetTable, txnExecutor.getTxnId(), e.getMessage());<NEW_LINE>throw e;<NEW_LINE>} finally {<NEW_LINE>this.batchBuffer = new Data<>();<NEW_LINE>updateBatchId(-1L);<NEW_LINE>}<NEW_LINE>}
warn("No transaction to abort in channel {}, table: {}", id, targetTable);
1,350,491
public static CreatePrometheusAlertRuleResponse unmarshall(CreatePrometheusAlertRuleResponse createPrometheusAlertRuleResponse, UnmarshallerContext _ctx) {<NEW_LINE>createPrometheusAlertRuleResponse.setRequestId(_ctx.stringValue("CreatePrometheusAlertRuleResponse.RequestId"));<NEW_LINE>PrometheusAlertRule prometheusAlertRule = new PrometheusAlertRule();<NEW_LINE>prometheusAlertRule.setStatus(_ctx.integerValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.Status"));<NEW_LINE>prometheusAlertRule.setType(_ctx.stringValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.Type"));<NEW_LINE>prometheusAlertRule.setNotifyType(_ctx.stringValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.NotifyType"));<NEW_LINE>prometheusAlertRule.setExpression(_ctx.stringValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.Expression"));<NEW_LINE>prometheusAlertRule.setMessage(_ctx.stringValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.Message"));<NEW_LINE>prometheusAlertRule.setDuration(_ctx.stringValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.Duration"));<NEW_LINE>prometheusAlertRule.setDispatchRuleId(_ctx.longValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.DispatchRuleId"));<NEW_LINE>prometheusAlertRule.setAlertName(_ctx.stringValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.AlertName"));<NEW_LINE>prometheusAlertRule.setAlertId(_ctx.longValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.AlertId"));<NEW_LINE>prometheusAlertRule.setClusterId(_ctx.stringValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.ClusterId"));<NEW_LINE>List<Label> labels <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.Labels.Length"); i++) {<NEW_LINE>Label label = new Label();<NEW_LINE>label.setName(_ctx.stringValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.Labels[" + i + "].Name"));<NEW_LINE>label.setValue(_ctx.stringValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.Labels[" + i + "].Value"));<NEW_LINE>labels.add(label);<NEW_LINE>}<NEW_LINE>prometheusAlertRule.setLabels(labels);<NEW_LINE>List<Annotation> annotations = new ArrayList<Annotation>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.Annotations.Length"); i++) {<NEW_LINE>Annotation annotation = new Annotation();<NEW_LINE>annotation.setName(_ctx.stringValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.Annotations[" + i + "].Name"));<NEW_LINE>annotation.setValue(_ctx.stringValue("CreatePrometheusAlertRuleResponse.PrometheusAlertRule.Annotations[" + i + "].Value"));<NEW_LINE>annotations.add(annotation);<NEW_LINE>}<NEW_LINE>prometheusAlertRule.setAnnotations(annotations);<NEW_LINE>createPrometheusAlertRuleResponse.setPrometheusAlertRule(prometheusAlertRule);<NEW_LINE>return createPrometheusAlertRuleResponse;<NEW_LINE>}
= new ArrayList<Label>();
1,019,419
private boolean login(String username, String password) throws IOException {<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>String dbPath = this.getDatabasePath("Users.db").getPath();<NEW_LINE>SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(dbPath, dbPassword, null);<NEW_LINE>String query = ("SELECT * FROM Users WHERE memName='" + <MASK><NEW_LINE>Cursor cursor = db.rawQuery(query, null);<NEW_LINE>if (cursor != null) {<NEW_LINE>if (cursor.getCount() <= 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>Toast error = Toast.makeText(CSInjection1.this, "An error occurred.", Toast.LENGTH_LONG);<NEW_LINE>error.show();<NEW_LINE>key.getText().clear();<NEW_LINE>key.setHint("The key is only shown to authenticated users.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} catch (SQLiteException e) {<NEW_LINE>Toast error = Toast.makeText(CSInjection1.this, "An database error occurred.", Toast.LENGTH_LONG);<NEW_LINE>error.show();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
username + "' AND memPass = '" + password + "';");
727,262
public QueryDumpInfo deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {<NEW_LINE>QueryDumpInfo dumpInfo = new QueryDumpInfo();<NEW_LINE>JsonObject dumpJsonObject = jsonElement.getAsJsonObject();<NEW_LINE>// 1. statement<NEW_LINE>String statement = dumpJsonObject.get("statement").getAsString();<NEW_LINE>dumpInfo.setOriginStmt(statement);<NEW_LINE>// 2. table meta data<NEW_LINE>JsonObject tableMeta = dumpJsonObject.getAsJsonObject("table_meta");<NEW_LINE>for (String key : tableMeta.keySet()) {<NEW_LINE>dumpInfo.addTableCreateStmt(key, tableMeta.get(key).getAsString());<NEW_LINE>}<NEW_LINE>// 3. table row count<NEW_LINE>JsonObject tableRowCount = dumpJsonObject.getAsJsonObject("table_row_count");<NEW_LINE>for (String tableKey : tableRowCount.keySet()) {<NEW_LINE>JsonObject partitionRowCount = tableRowCount.get(tableKey).getAsJsonObject();<NEW_LINE>for (String partitionKey : partitionRowCount.keySet()) {<NEW_LINE>long partitionRowCountNum = partitionRowCount.get(partitionKey).getAsLong();<NEW_LINE>dumpInfo.addPartitionRowCount(tableKey, partitionKey, partitionRowCountNum);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// 4. session variables<NEW_LINE>if (dumpJsonObject.has("session_variables")) {<NEW_LINE>try {<NEW_LINE>dumpInfo.getSessionVariable().replayFromJson(dumpJsonObject.get("session_variables").getAsString());<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.warn("deserialize from json failed. " + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// 5. column statistics<NEW_LINE>JsonObject tableColumnStatistics = dumpJsonObject.getAsJsonObject("column_statistics");<NEW_LINE>for (String tableKey : tableColumnStatistics.keySet()) {<NEW_LINE>JsonObject columnStatistics = tableColumnStatistics.get(tableKey).getAsJsonObject();<NEW_LINE>for (String columnKey : columnStatistics.keySet()) {<NEW_LINE>String columnStatistic = columnStatistics.get(columnKey).getAsString();<NEW_LINE>dumpInfo.addTableStatistics(tableKey, columnKey, ColumnStatistic.buildFrom<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// 6. BE number<NEW_LINE>int beNum = dumpJsonObject.get("be_number").getAsInt();<NEW_LINE>dumpInfo.setBeNum(beNum);<NEW_LINE>return dumpInfo;<NEW_LINE>}
(columnStatistic).build());
168,659
final ImportSnapshotResult executeImportSnapshot(ImportSnapshotRequest importSnapshotRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(importSnapshotRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ImportSnapshotRequest> request = null;<NEW_LINE>Response<ImportSnapshotResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ImportSnapshotRequestMarshaller().marshall(super.beforeMarshalling(importSnapshotRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ImportSnapshot");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ImportSnapshotResult> responseHandler = new StaxResponseHandler<ImportSnapshotResult>(new ImportSnapshotResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
894,421
public static void registerType(final ModelBuilder modelBuilder) {<NEW_LINE>final ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(SendTask.class, BPMN_ELEMENT_SEND_TASK).namespaceUri(BPMN20_NS).extendsType(Task.class).instanceProvider(new ModelTypeInstanceProvider<SendTask>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public SendTask newInstance(final ModelTypeInstanceContext instanceContext) {<NEW_LINE>return new SendTaskImpl(instanceContext);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>implementationAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_IMPLEMENTATION).defaultValue("##WebService").build();<NEW_LINE>messageRefAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_MESSAGE_REF).qNameAttributeReference(Message.class).build();<NEW_LINE>operationRefAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_OPERATION_REF).qNameAttributeReference(<MASK><NEW_LINE>typeBuilder.build();<NEW_LINE>}
Operation.class).build();
1,276,112
public void addConsent(String clientId, String user, String scopeString, String resource, String providerId, int keyLifeTimeInSeconds) {<NEW_LINE>// TODO Auto-generated method stub<NEW_LINE>boolean error = true;<NEW_LINE>Connection conn = null;<NEW_LINE>// String cacheKey = getCacheKey(lookupKey);<NEW_LINE>// cache.put(cacheKey, new CacheEntry(entry, lifetime));<NEW_LINE>long expires = 0;<NEW_LINE>if (keyLifeTimeInSeconds > 0) {<NEW_LINE>expires = new Date().getTime() + (1000L * keyLifeTimeInSeconds);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>conn = getInitializedConnection();<NEW_LINE>conn.setAutoCommit(false);<NEW_LINE>add(conn, clientId, user, scopeString, resource, providerId, expires);<NEW_LINE>error = false;<NEW_LINE>} catch (java.sql.SQLSyntaxErrorException sqle) {<NEW_LINE>Tr.error(tc, "Internal error adding consent entry: " + sqle.getMessage(), sqle);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Tr.error(tc, "Internal error adding consent entry: " + e.getMessage(), e);<NEW_LINE>} finally {<NEW_LINE>closeConnection(conn, error);<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>if (error != true) {<NEW_LINE>Tr.debug(tc, "entry added, details follow:");<NEW_LINE>Tr.debug(tc, " table: " + TABLE_NAME);<NEW_LINE>Tr.debug(tc, " client id: " + clientId);<NEW_LINE>Tr.debug(tc, " user: " + user);<NEW_LINE>Tr.debug(tc, " scopes: " + scopeString);<NEW_LINE>Tr.<MASK><NEW_LINE>// Tr.debug(tc, " resource id: " + resourceId);<NEW_LINE>Tr.debug(tc, " provider id: " + providerId);<NEW_LINE>Tr.debug(tc, " expires: " + expires);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
debug(tc, " resource: " + resource);
18,345
private static String genericsBounds(final ClassNode theType, final Set<String> visited) {<NEW_LINE>StringBuilder ret = new StringBuilder();<NEW_LINE>if (theType.getOuterClass() == null) {<NEW_LINE>ret.append(nameOf(theType));<NEW_LINE>} else {<NEW_LINE>String parentClassNodeName = theType<MASK><NEW_LINE>if (Modifier.isStatic(theType.getModifiers()) || theType.isInterface()) {<NEW_LINE>ret.append(parentClassNodeName);<NEW_LINE>} else {<NEW_LINE>ret.append(genericsBounds(theType.getOuterClass(), new HashSet<>()));<NEW_LINE>}<NEW_LINE>ret.append('.');<NEW_LINE>ret.append(theType.getName(), parentClassNodeName.length() + 1, theType.getName().length());<NEW_LINE>}<NEW_LINE>GenericsType[] genericsTypes = theType.getGenericsTypes();<NEW_LINE>if (genericsTypes == null || genericsTypes.length == 0) {<NEW_LINE>return ret.toString();<NEW_LINE>}<NEW_LINE>// TODO: instead of catching Object<T> here stop it from being placed into type in first place<NEW_LINE>if (genericsTypes.length == 1 && genericsTypes[0].isPlaceholder() && theType.getName().equals("java.lang.Object")) {<NEW_LINE>return genericsTypes[0].getName();<NEW_LINE>}<NEW_LINE>ret.append('<');<NEW_LINE>for (int i = 0, n = genericsTypes.length; i < n; i += 1) {<NEW_LINE>if (i != 0)<NEW_LINE>ret.append(", ");<NEW_LINE>GenericsType type = genericsTypes[i];<NEW_LINE>if (type.isPlaceholder() && visited.contains(type.getName())) {<NEW_LINE>ret.append(type.getName());<NEW_LINE>} else {<NEW_LINE>ret.append(toString(type, visited));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ret.append('>');<NEW_LINE>return ret.toString();<NEW_LINE>}
.getOuterClass().getName();
335,867
public static Document createXmlDocument(InputStream in, boolean validate, EntityResolver er) throws Schema2BeansRuntimeException {<NEW_LINE>if (in == null)<NEW_LINE>// NOI18N<NEW_LINE>throw new IllegalArgumentException("in == null");<NEW_LINE>try {<NEW_LINE>if (DDLogFlags.debug) {<NEW_LINE>// Dump the contents to stdout<NEW_LINE>in = tee(in);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Change the references to map the newly created doc<NEW_LINE>// The BaseBean instance is not created yet. The doc<NEW_LINE>// document will be used to get back the factories.<NEW_LINE>//<NEW_LINE>Object o = <MASK><NEW_LINE>if (o != null) {<NEW_LINE>GraphManager.Factory f = (GraphManager.Factory) o;<NEW_LINE>Document doc = f.createDocument(in, validate);<NEW_LINE>GraphManager.factoryMap.remove(in);<NEW_LINE>GraphManager.factoryMap.put(doc, o);<NEW_LINE>Object o2 = GraphManager.writerMap.get(in);<NEW_LINE>if (o2 != null) {<NEW_LINE>GraphManager.writerMap.remove(in);<NEW_LINE>GraphManager.writerMap.put(doc, o2);<NEW_LINE>}<NEW_LINE>return doc;<NEW_LINE>} else {<NEW_LINE>return createXmlDocument(new InputSource(in), validate, er, null);<NEW_LINE>}<NEW_LINE>} catch (Schema2BeansException e) {<NEW_LINE>throw new Schema2BeansRuntimeException(e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new Schema2BeansRuntimeException(e);<NEW_LINE>}<NEW_LINE>}
GraphManager.factoryMap.get(in);
1,306,280
private void createArchive(final I_C_Print_Package printPackage, final byte[] data, final I_C_Async_Batch asyncBatch, final int current) {<NEW_LINE>final TableRecordReference printPackageRef = TableRecordReference.of(printPackage);<NEW_LINE>final Properties ctx = InterfaceWrapperHelper.getCtx(asyncBatch);<NEW_LINE>final org.adempiere.archive.api.IArchiveBL archiveService = Services.get(org.adempiere.archive.api.IArchiveBL.class);<NEW_LINE>final ArchiveResult archiveResult = archiveService.archive(ArchiveRequest.builder().flavor(DocumentReportFlavor.PRINT).data(new ByteArrayResource(data)).trxName(ITrx.TRXNAME_ThreadInherited).archiveName(printPackage.getTransactionID() + "_" + printPackage.getBinaryFormat()).recordRef(printPackageRef).build());<NEW_LINE>final I_AD_Archive archive = archiveResult.getArchiveRecord();<NEW_LINE>final de.metas.printing.model.I_AD_Archive directArchive = InterfaceWrapperHelper.create(archive, de.metas.printing.model.I_AD_Archive.class);<NEW_LINE>directArchive.setIsDirectEnqueue(true);<NEW_LINE>final Timestamp today = SystemTime.asDayTimestamp();<NEW_LINE>final <MASK><NEW_LINE>final String name = Services.get(IMsgBL.class).getMsg(ctx, PDFArchiveName) + "_" + dt.format(today) + "_PDF_" + current + "_von_" + asyncBatch.getCountExpected() + "_" + asyncBatch.getC_Async_Batch_ID();<NEW_LINE>directArchive.setName(name);<NEW_LINE>//<NEW_LINE>// set async batch<NEW_LINE>InterfaceWrapperHelper.setDynAttribute(archive, Async_Constants.C_Async_Batch, asyncBatch);<NEW_LINE>InterfaceWrapperHelper.save(directArchive);<NEW_LINE>}
SimpleDateFormat dt = new SimpleDateFormat("dd-MM-yyyy");
727,572
private void processFeatureRange(FeatureRange range, PredicateOptions options) {<NEW_LINE>range.clearPartitions();<NEW_LINE>int arity = options.getArity();<NEW_LINE>RangePruner rangePruner = new RangePruner(range, options, arity);<NEW_LINE>long from = rangePruner.getFrom();<NEW_LINE>long to = rangePruner.getTo();<NEW_LINE>if (from < 0) {<NEW_LINE>if (to < 0) {<NEW_LINE>// Special case for to==-1. -X-0 means the same as -X-1, but is more efficient.<NEW_LINE>partitionRange(range, (to == -1 ? 0 : -to), -from, arity, true);<NEW_LINE>} else {<NEW_LINE>partitionRange(range, 0, -from, arity, true);<NEW_LINE>partitionRange(range, <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>partitionRange(range, from, to, arity, false);<NEW_LINE>}<NEW_LINE>}
0, to, arity, false);
1,254,108
private void handleRemovedResources(ClassLoadingConfig classLoadingConfig, CurateOutcomeBuildItem curateOutcomeBuildItem, Map<Path, Set<TransformedClassesBuildItem.TransformedClass>> transformedClassesByJar, List<RemovedResourceBuildItem> removedResourceBuildItems) {<NEW_LINE>// a little bit of a hack, but we use an empty transformed class to represent removed resources, as transforming a class removes it from the original archive<NEW_LINE>Map<ArtifactKey, Set<String>> removed = new HashMap<>();<NEW_LINE>for (Map.Entry<String, Set<String>> entry : classLoadingConfig.removedResources.entrySet()) {<NEW_LINE>removed.put(new GACT(entry.getKey().split(":")), entry.getValue());<NEW_LINE>}<NEW_LINE>for (RemovedResourceBuildItem i : removedResourceBuildItems) {<NEW_LINE>removed.computeIfAbsent(i.getArtifact(), k -> new HashSet<>()).addAll(i.getResources());<NEW_LINE>}<NEW_LINE>if (!removed.isEmpty()) {<NEW_LINE>ApplicationModel applicationModel = curateOutcomeBuildItem.getApplicationModel();<NEW_LINE>Collection<ResolvedDependency> runtimeDependencies = applicationModel.getRuntimeDependencies();<NEW_LINE>List<ResolvedDependency> allArtifacts = new ArrayList<>(runtimeDependencies.size() + 1);<NEW_LINE>allArtifacts.addAll(runtimeDependencies);<NEW_LINE>allArtifacts.<MASK><NEW_LINE>for (ResolvedDependency i : allArtifacts) {<NEW_LINE>Set<String> filtered = removed.remove(i.getKey());<NEW_LINE>if (filtered != null) {<NEW_LINE>for (Path path : i.getResolvedPaths()) {<NEW_LINE>transformedClassesByJar.computeIfAbsent(path, s -> new HashSet<>()).addAll(filtered.stream().map(file -> new TransformedClassesBuildItem.TransformedClass(null, null, file, false)).collect(Collectors.toSet()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!removed.isEmpty()) {<NEW_LINE>log.warn("Could not remove configured resources from the following artifacts as they were not found in the model: " + removed.keySet());<NEW_LINE>}<NEW_LINE>}
add(applicationModel.getAppArtifact());
127,779
private void changeTemperatureUnits(boolean isImperial, @NonNull Style loadedMapStyle) {<NEW_LINE>if (mapboxMap != null && this.isImperial != isImperial) {<NEW_LINE>this.isImperial = isImperial;<NEW_LINE>// Apply new units to the data displayed in text fields of SymbolLayers<NEW_LINE>SymbolLayer maxTempLayer = (SymbolLayer) loadedMapStyle.getLayer(MAX_TEMP_LAYER_ID);<NEW_LINE>if (maxTempLayer != null) {<NEW_LINE>maxTempLayer.withProperties(textField(getTemperatureValue()));<NEW_LINE>}<NEW_LINE>SymbolLayer minTempLayer = (<MASK><NEW_LINE>if (minTempLayer != null) {<NEW_LINE>minTempLayer.withProperties(textField(getTemperatureValue()));<NEW_LINE>}<NEW_LINE>unitsText.setText(isImperial ? DEGREES_C : DEGREES_F);<NEW_LINE>}<NEW_LINE>}
SymbolLayer) loadedMapStyle.getLayer(MIN_TEMP_LAYER_ID);
547,972
public DoubleMatrix apply(DoubleArray x) {<NEW_LINE>SabrParametersIborCapletFloorletVolatilities volsNew = updateParameters(sabrDefinition, volatilities, x);<NEW_LINE>double[][] jacobian <MASK><NEW_LINE>for (int i = 0; i < nCaps; ++i) {<NEW_LINE>PointSensitivities point = sabrPricer.presentValueSensitivityModelParamsSabr(capList.get(i), ratesProvider, volsNew).build();<NEW_LINE>CurrencyParameterSensitivities sensi = volsNew.parameterSensitivity(point);<NEW_LINE>double targetPriceInv = 1d / priceList.get(i);<NEW_LINE>DoubleArray sensitivities = sensi.getSensitivity(alphaName, currency).getSensitivity();<NEW_LINE>if (sabrDefinition.getBetaCurve().isPresent()) {<NEW_LINE>// beta fixed<NEW_LINE>sensitivities = sensitivities.concat(sensi.getSensitivity(rhoName, currency).getSensitivity());<NEW_LINE>} else {<NEW_LINE>// rho fixed<NEW_LINE>sensitivities = sensitivities.concat(sensi.getSensitivity(betaName, currency).getSensitivity());<NEW_LINE>}<NEW_LINE>jacobian[i] = sensitivities.concat(sensi.getSensitivity(nuName, currency).getSensitivity()).multipliedBy(targetPriceInv).toArray();<NEW_LINE>}<NEW_LINE>return DoubleMatrix.ofUnsafe(jacobian);<NEW_LINE>}
= new double[nCaps][];