idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,583,754
public List<HealthRecord> healthCheck(final SystemHealthCheckRequest systemHealthCheckRequest) {<NEW_LINE>final AppConfig config = systemHealthCheckRequest.getDomainConfig();<NEW_LINE>final Locale locale = systemHealthCheckRequest.getLocale();<NEW_LINE>final String separator = LocaleHelper.getLocalizedMessage(locale, Config.Display_SettingNavigationSeparator, null);<NEW_LINE>final List<HealthRecord> records = new ArrayList<>();<NEW_LINE>if (Boolean.parseBoolean(config.readAppProperty(AppProperty.LDAP_PROMISCUOUS_ENABLE))) {<NEW_LINE>final String appPropertyKey = "AppProperty" + separator + AppProperty.LDAP_PROMISCUOUS_ENABLE.getKey();<NEW_LINE>records.add(HealthRecord.forMessage(DomainID.systemId()<MASK><NEW_LINE>}<NEW_LINE>if (config.readSettingAsBoolean(PwmSetting.DISPLAY_SHOW_DETAILED_ERRORS)) {<NEW_LINE>records.add(HealthRecord.forMessage(DomainID.systemId(), HealthMessage.Config_ShowDetailedErrors, PwmSetting.DISPLAY_SHOW_DETAILED_ERRORS.toMenuLocationDebug(null, locale)));<NEW_LINE>}<NEW_LINE>return Collections.unmodifiableList(records);<NEW_LINE>}
, HealthMessage.Config_PromiscuousLDAP, appPropertyKey));
917,119
private void receiveTransportAccept(JinglePacket packet) {<NEW_LINE>if (responding()) {<NEW_LINE>Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": received out of order transport-accept (we were responding)");<NEW_LINE>respondToIqWithOutOfOrder(packet);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final boolean validState = mJingleStatus == JINGLE_STATUS_ACCEPTED || (proxyActivationFailed && mJingleStatus == JINGLE_STATUS_TRANSMITTING);<NEW_LINE>if (!validState) {<NEW_LINE>Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": received out of order transport-accept");<NEW_LINE>respondToIqWithOutOfOrder(packet);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// fallback accepted; now we no longer need to accept another one;<NEW_LINE>this.proxyActivationFailed = false;<NEW_LINE>final Content content = packet.getJingleContent();<NEW_LINE>final GenericTransportInfo transportInfo = content == null ? null : content.getTransport();<NEW_LINE>if (transportInfo instanceof IbbTransportInfo) {<NEW_LINE>final IbbTransportInfo ibbTransportInfo = (IbbTransportInfo) transportInfo;<NEW_LINE>final int remoteBlockSize = ibbTransportInfo.getBlockSize();<NEW_LINE>if (remoteBlockSize > 0) {<NEW_LINE>this.ibbBlockSize = Math.min(MAX_IBB_BLOCK_SIZE, remoteBlockSize);<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>this.transport = new JingleInBandTransport(this, this.transportId, this.ibbBlockSize);<NEW_LINE>if (sid == null || !sid.equals(this.transportId)) {<NEW_LINE>Log.w(Config.LOGTAG, String.format("%s: sid in transport-accept (%s) did not match our sid (%s) ", id.account.getJid().asBareJid(), sid, transportId));<NEW_LINE>}<NEW_LINE>respondToIq(packet, true);<NEW_LINE>// might be receive instead if we are not initiating<NEW_LINE>if (isInitiator()) {<NEW_LINE>this.transport.connect(onIbbTransportConnected);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": received invalid transport-accept");<NEW_LINE>respondToIq(packet, false);<NEW_LINE>}<NEW_LINE>}
String sid = ibbTransportInfo.getTransportId();
1,516,611
private static SetArgs createSetArgs4(Object[] argsArr) {<NEW_LINE>if (argsArr.length != 4) {<NEW_LINE>MatrixLog.w(TAG, "createSetArgs args length invalid : %d", argsArr.length);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SetArgs setArgs = new SetArgs();<NEW_LINE>if (!(argsArr[0] instanceof Integer)) {<NEW_LINE>MatrixLog.w(TAG, "createSetArgs args idx 0 not Integer, %s", argsArr[0]);<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>setArgs.type = (Integer) argsArr[0];<NEW_LINE>}<NEW_LINE>if (!(argsArr[1] instanceof Long)) {<NEW_LINE>MatrixLog.w(TAG, "createSetArgs args idx 1 not Long, %s", argsArr[1]);<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>setArgs.triggerAtMillis <MASK><NEW_LINE>}<NEW_LINE>if (!(argsArr[2] instanceof Long)) {<NEW_LINE>MatrixLog.w(TAG, "createSetArgs args idx 2 not Long, %s", argsArr[2]);<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>setArgs.intervalMillis = (Long) argsArr[2];<NEW_LINE>}<NEW_LINE>if (argsArr[3] != null && !(argsArr[3] instanceof PendingIntent)) {<NEW_LINE>MatrixLog.w(TAG, "createSetArgs args idx 3 not PendingIntent, %s", argsArr[3]);<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>setArgs.operation = (PendingIntent) argsArr[3];<NEW_LINE>}<NEW_LINE>return setArgs;<NEW_LINE>}
= (Long) argsArr[1];
1,087,903
public final VsplatparameterContext vsplatparameter(ArgDefListBuilder args) throws RecognitionException {<NEW_LINE>VsplatparameterContext _localctx = new VsplatparameterContext(_ctx, getState(), args);<NEW_LINE>enterRule(_localctx, 32, RULE_vsplatparameter);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(555);<NEW_LINE>match(STAR);<NEW_LINE>String name = null;<NEW_LINE>setState(559);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == NAME) {<NEW_LINE>{<NEW_LINE>setState(557);<NEW_LINE>_localctx.NAME = match(NAME);<NEW_LINE>name = (_localctx.NAME != null ? _localctx.NAME.getText() : null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>args.addSplat(name != null ? factory.mangleNameInCurrentScope<MASK><NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
(name) : null, null);
452,059
public UnmodifiableIterator<N> iterator() {<NEW_LINE>if (orderedNodeConnections == null) {<NEW_LINE>Iterator<Entry<N, Object>> entries = adjacentNodeValues.entrySet().iterator();<NEW_LINE>return new AbstractIterator<N>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@CheckForNull<NEW_LINE>protected N computeNext() {<NEW_LINE>while (entries.hasNext()) {<NEW_LINE>Entry<N, Object<MASK><NEW_LINE>if (isPredecessor(entry.getValue())) {<NEW_LINE>return entry.getKey();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return endOfData();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else {<NEW_LINE>Iterator<NodeConnection<N>> nodeConnections = orderedNodeConnections.iterator();<NEW_LINE>return new AbstractIterator<N>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@CheckForNull<NEW_LINE>protected N computeNext() {<NEW_LINE>while (nodeConnections.hasNext()) {<NEW_LINE>NodeConnection<N> nodeConnection = nodeConnections.next();<NEW_LINE>if (nodeConnection instanceof NodeConnection.Pred) {<NEW_LINE>return nodeConnection.node;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return endOfData();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>}
> entry = entries.next();
847,815
public LustreLogConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>LustreLogConfiguration lustreLogConfiguration = new LustreLogConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Level", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>lustreLogConfiguration.setLevel(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Destination", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>lustreLogConfiguration.setDestination(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 lustreLogConfiguration;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
750,804
public static String replace(String text, String repl, String with, int max) {<NEW_LINE>if (isEmpty(text) || isEmpty(repl) || with == null || max == 0) {<NEW_LINE>return text;<NEW_LINE>}<NEW_LINE>int start = 0;<NEW_LINE>int end = text.indexOf(repl, start);<NEW_LINE>if (end == -1) {<NEW_LINE>return text;<NEW_LINE>}<NEW_LINE>int replLength = repl.length();<NEW_LINE>int increase = with.length() - replLength;<NEW_LINE>increase = (increase < 0 ? 0 : increase);<NEW_LINE>increase *= (max < 0 ? 16 : (max > 64 ? 64 : max));<NEW_LINE>StringBuilder buf = new StringBuilder(<MASK><NEW_LINE>while (end != -1) {<NEW_LINE>buf.append(text.substring(start, end)).append(with);<NEW_LINE>start = end + replLength;<NEW_LINE>if (--max == 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>end = text.indexOf(repl, start);<NEW_LINE>}<NEW_LINE>buf.append(text.substring(start));<NEW_LINE>return buf.toString();<NEW_LINE>}
text.length() + increase);
1,102,092
public void askForAccess() {<NEW_LINE>askPermissions = false;<NEW_LINE>showStorageAlertWithDelay = true;<NEW_LINE>// If mobile device, only portrait mode is allowed<NEW_LINE>if (!isTablet(this)) {<NEW_LINE>logDebug("Mobile only portrait mode");<NEW_LINE>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);<NEW_LINE>}<NEW_LINE>boolean writeStorageGranted = hasPermissions(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);<NEW_LINE>boolean readStorageGranted = hasPermissions(this, Manifest.permission.READ_EXTERNAL_STORAGE);<NEW_LINE>boolean cameraGranted = hasPermissions(this, Manifest.permission.CAMERA);<NEW_LINE>boolean microphoneGranted = hasPermissions(this, Manifest.permission.RECORD_AUDIO);<NEW_LINE>if (!writeStorageGranted || !readStorageGranted || !cameraGranted || !microphoneGranted) /* || !writeCallsGranted*/<NEW_LINE>{<NEW_LINE>deleteCurrentFragment();<NEW_LINE>if (permissionsFragment == null) {<NEW_LINE>permissionsFragment = new PermissionsFragment();<NEW_LINE>}<NEW_LINE>replaceFragment(permissionsFragment, FragmentTag.PERMISSIONS.getTag());<NEW_LINE>onAskingPermissionsFragment = true;<NEW_LINE>abL.setVisibility(View.GONE);<NEW_LINE>setTabsVisibility();<NEW_LINE><MASK><NEW_LINE>supportInvalidateOptionsMenu();<NEW_LINE>hideFabButton();<NEW_LINE>showHideBottomNavigationView(true);<NEW_LINE>}<NEW_LINE>}
drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
723,980
public MultivaluedMap<String, String> update(MultivaluedMap<String, String> incomingHeaders, MultivaluedMap<String, String> clientOutgoingHeaders) {<NEW_LINE>MultivaluedMap<String, String> myHeaders = new MultivaluedHashMap<>();<NEW_LINE>myHeaders.putSingle("HEADER_FROM_CUSTOM_CLIENTHEADERSFACTORY", "456");<NEW_LINE>LOG.info("update - adding HEADER_FROM_CUSTOM_CLIENTHEADERSFACTORY=456");<NEW_LINE>if (uriInfo != null) {<NEW_LINE>URI uri = uriInfo.getAbsolutePath();<NEW_LINE>myHeaders.putSingle("INJECTED_URI_INFO", uri == null ? "null" : uri.toString());<NEW_LINE>}<NEW_LINE>LOG.info("UriInfo injected by @Context: " + uriInfo);<NEW_LINE>if (foo != null) {<NEW_LINE>myHeaders.putSingle(<MASK><NEW_LINE>}<NEW_LINE>LOG.info("Foo injected by @Inject: " + foo);<NEW_LINE>return myHeaders;<NEW_LINE>}
"INJECTED_FOO", foo.getWord());
147,553
public void testNoClassloaderContext(HttpServletRequest request, PrintWriter out) throws Exception {<NEW_LINE>LoadClassTask task = new LoadClassTask();<NEW_LINE>System.out.println("Servlet thread class loader " + Thread.currentThread().getContextClassLoader());<NEW_LINE>// Validate that it works from the servlet thread<NEW_LINE>Class<?> result = task.call();<NEW_LINE>if (!PersistentErrorTestServlet.class.equals(result))<NEW_LINE>throw new Exception("Unexpected class loaded from servlet thread: " + result);<NEW_LINE>// Validate that it fails from persistent executor thread that lacks Classloader Context<NEW_LINE>TaskStatus<Class<?>> status = scheduler.submit(task);<NEW_LINE>for (long start = System.nanoTime(); !status.hasResult() && System.nanoTime() - start < TIMEOUT_NS; Thread.sleep(POLL_INTERVAL)) status = scheduler.getStatus(status.getTaskId());<NEW_LINE>if (status.isCancelled())<NEW_LINE>throw new Exception("Task should not be canceled. " + status);<NEW_LINE>if (!status.isDone())<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>result = status.get();<NEW_LINE>throw new Exception("Unexpectedly able to obtain result: " + result);<NEW_LINE>} catch (ExecutionException x) {<NEW_LINE>if (x.getCause() instanceof ClassNotFoundException || x.getCause() instanceof NullPointerException) {<NEW_LINE>StringWriter sw = new StringWriter();<NEW_LINE>x.getCause().printStackTrace(new PrintWriter(sw));<NEW_LINE>String stack = sw.toString();<NEW_LINE>if (!stack.contains("at web.LoadClassTask.call(LoadClassTask.java:"))<NEW_LINE>throw x;<NEW_LINE>} else<NEW_LINE>throw x;<NEW_LINE>}<NEW_LINE>}
throw new Exception("Task did not complete in a timely manner. " + status);
638,124
private void handleTargetsForVMware(long hostId, long storagePoolId) {<NEW_LINE>HostVO host = hostDao.findById(hostId);<NEW_LINE>if (host.getHypervisorType() == HypervisorType.VMware) {<NEW_LINE>String storageAddress = storagePoolDetailsDao.findDetail(storagePoolId, SolidFireUtil.STORAGE_VIP).getValue();<NEW_LINE>int storagePort = Integer.parseInt(storagePoolDetailsDao.findDetail(storagePoolId, SolidFireUtil.STORAGE_PORT).getValue());<NEW_LINE>String iqn = storagePoolDetailsDao.findDetail(storagePoolId, SolidFireUtil.IQN).getValue();<NEW_LINE>ModifyTargetsCommand cmd = new ModifyTargetsCommand();<NEW_LINE>List<Map<String, String>> targets = new ArrayList<>();<NEW_LINE>Map<String, String> target = new HashMap<>();<NEW_LINE>target.put(ModifyTargetsCommand.STORAGE_HOST, storageAddress);<NEW_LINE>target.put(ModifyTargetsCommand.STORAGE_PORT, String.valueOf(storagePort));<NEW_LINE>target.put(ModifyTargetsCommand.IQN, iqn);<NEW_LINE>targets.add(target);<NEW_LINE>cmd.setTargets(targets);<NEW_LINE>cmd.setApplyToAllHostsInCluster(true);<NEW_LINE>cmd.setAdd(false);<NEW_LINE>cmd.<MASK><NEW_LINE>cmd.setRemoveAsync(true);<NEW_LINE>sendModifyTargetsCommand(cmd, hostId);<NEW_LINE>}<NEW_LINE>}
setTargetTypeToRemove(ModifyTargetsCommand.TargetTypeToRemove.DYNAMIC);
1,364,655
public static <T extends Node<?>, P1, P2> NodeInfo<T> create(T n, NodeCtor2<P1, P2, T> ctor, P1 p1, P2 p2) {<NEW_LINE>return new NodeInfo<T>(n) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected List<Object> innerProperties() {<NEW_LINE>return Arrays.asList(p1, p2);<NEW_LINE>}<NEW_LINE><NEW_LINE>protected T innerTransform(Function<Object, Object> rule) {<NEW_LINE>boolean same = true;<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>P1 newP1 = (P1) rule.apply(p1);<NEW_LINE>same &= <MASK><NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>P2 newP2 = (P2) rule.apply(p2);<NEW_LINE>same &= Objects.equals(p2, newP2);<NEW_LINE>return same ? node : ctor.apply(node.source(), newP1, newP2);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
Objects.equals(p1, newP1);
605,499
public void simpleLayout(Comparator<SortableElement> comparator, List<SortableElement> elements) {<NEW_LINE>int maxHeight = 0;<NEW_LINE>int sumWidth = 0;<NEW_LINE>for (SortableElement e : elements) {<NEW_LINE>if (e.getElement().getRectangle().height > maxHeight) {<NEW_LINE>maxHeight = e.getElement<MASK><NEW_LINE>}<NEW_LINE>sumWidth += e.getElement().getRectangle().width;<NEW_LINE>}<NEW_LINE>// start with a rectangle with one row with all elements in it and determine<NEW_LINE>// the multiplicator by solving: (x / m) / (y * m) = desired relation of width to height<NEW_LINE>double m = Math.sqrt(sumWidth / (0.4 * maxHeight));<NEW_LINE>int desiredWidth = (int) (sumWidth / m);<NEW_LINE>Collections.sort(elements, comparator);<NEW_LINE>int rows = 1;<NEW_LINE>int curX = GRIDSIZE;<NEW_LINE>int curY = GRIDSIZE;<NEW_LINE>Dimension d = new Dimension(curX, curY);<NEW_LINE>int maxHeightThisRow = 0;<NEW_LINE>for (SortableElement e : elements) {<NEW_LINE>e.getElement().setLocation(curX, curY);<NEW_LINE>if (e.getElement().getRectangle().height > maxHeightThisRow) {<NEW_LINE>maxHeightThisRow = e.getElement().getRectangle().height;<NEW_LINE>}<NEW_LINE>// determine outer x-bounds of all elements placed<NEW_LINE>Rectangle dim = e.getElement().getRectangle();<NEW_LINE>if (curX + dim.width > d.width) {<NEW_LINE>d.width = curX + e.getElement().getRectangle().width;<NEW_LINE>}<NEW_LINE>if (curX > desiredWidth) {<NEW_LINE>++rows;<NEW_LINE>curY += maxHeightThisRow + GRIDSIZE;<NEW_LINE>curX = GRIDSIZE;<NEW_LINE>maxHeightThisRow = 0;<NEW_LINE>} else {<NEW_LINE>curX += e.getElement().getRectangle().width + GRIDSIZE;<NEW_LINE>}<NEW_LINE>// determine outer y-bounds of alle elements placed<NEW_LINE>if (elements.indexOf(e) == elements.size() - 1) {<NEW_LINE>// element is the last one<NEW_LINE>d.height = curY + maxHeightThisRow + (rows + 1) * GRIDSIZE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>d.width += GRIDSIZE;<NEW_LINE>bounds = d;<NEW_LINE>}
().getRectangle().height;
759,920
static int isPointInPolygon(Polygon inputPolygon, double inputPointXVal, double inputPointYVal, double tolerance) {<NEW_LINE>if (inputPolygon.isEmpty())<NEW_LINE>return 0;<NEW_LINE>Envelope2D env = new Envelope2D();<NEW_LINE>inputPolygon.queryLooseEnvelope(env);<NEW_LINE>env.inflate(tolerance, tolerance);<NEW_LINE>if (!env.contains(inputPointXVal, inputPointYVal))<NEW_LINE>return 0;<NEW_LINE>MultiPathImpl mpImpl = (MultiPathImpl) inputPolygon._getImpl();<NEW_LINE>GeometryAccelerators accel = mpImpl._getAccelerators();<NEW_LINE>if (accel != null) {<NEW_LINE><MASK><NEW_LINE>if (rgeom != null) {<NEW_LINE>RasterizedGeometry2D.HitType hit = rgeom.queryPointInGeometry(inputPointXVal, inputPointYVal);<NEW_LINE>if (hit == RasterizedGeometry2D.HitType.Inside)<NEW_LINE>return 1;<NEW_LINE>else if (hit == RasterizedGeometry2D.HitType.Outside)<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return _isPointInPolygonInternal(inputPolygon, new Point2D(inputPointXVal, inputPointYVal), tolerance);<NEW_LINE>}
RasterizedGeometry2D rgeom = accel.getRasterizedGeometry();
976,883
private static void parseMethods(String id, NodeList nodeList, RootBeanDefinition beanDefinition, ParserContext parserContext) throws ClassNotFoundException {<NEW_LINE>if (nodeList != null && nodeList.getLength() > 0) {<NEW_LINE>ManagedList methods = null;<NEW_LINE>for (int i = 0; i < nodeList.getLength(); i++) {<NEW_LINE>Node <MASK><NEW_LINE>if (node instanceof Element) {<NEW_LINE>Element element = (Element) node;<NEW_LINE>if ("method".equals(node.getNodeName()) || "method".equals(node.getLocalName())) {<NEW_LINE>String methodName = element.getAttribute("name");<NEW_LINE>if (methodName == null || methodName.length() == 0) {<NEW_LINE>throw new IllegalStateException("<motan:method> name attribute == null");<NEW_LINE>}<NEW_LINE>if (methods == null) {<NEW_LINE>methods = new ManagedList();<NEW_LINE>}<NEW_LINE>BeanDefinition methodBeanDefinition = parse((Element) node, parserContext, MethodConfig.class, false);<NEW_LINE>String name = id + "." + methodName;<NEW_LINE>BeanDefinitionHolder methodBeanDefinitionHolder = new BeanDefinitionHolder(methodBeanDefinition, name);<NEW_LINE>methods.add(methodBeanDefinitionHolder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (methods != null) {<NEW_LINE>beanDefinition.getPropertyValues().addPropertyValue("methods", methods);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
node = nodeList.item(i);
197,984
protected void executeTasksOnWorker(Id server) {<NEW_LINE>String page = this.supportsPaging() ? PageInfo.PAGE_NONE : null;<NEW_LINE>do {<NEW_LINE>Iterator<HugeTask<Object>> tasks = this.tasks(TaskStatus.SCHEDULED, PAGE_SIZE, page);<NEW_LINE>while (tasks.hasNext()) {<NEW_LINE>HugeTask<?<MASK><NEW_LINE>this.initTaskCallable(task);<NEW_LINE>Id taskServer = task.server();<NEW_LINE>if (taskServer == null) {<NEW_LINE>LOG.warn("Task '{}' may not be scheduled", task.id());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>HugeTask<?> memTask = this.tasks.get(task.id());<NEW_LINE>if (memTask != null) {<NEW_LINE>assert memTask.status().code() > task.status().code();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (taskServer.equals(server)) {<NEW_LINE>task.status(TaskStatus.QUEUED);<NEW_LINE>this.save(task);<NEW_LINE>this.submitTask(task);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (page != null) {<NEW_LINE>page = PageInfo.pageInfo(tasks);<NEW_LINE>}<NEW_LINE>} while (page != null);<NEW_LINE>}
> task = tasks.next();
1,604,977
final RevokeInvitationResult executeRevokeInvitation(RevokeInvitationRequest revokeInvitationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(revokeInvitationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RevokeInvitationRequest> request = null;<NEW_LINE>Response<RevokeInvitationResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new RevokeInvitationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(revokeInvitationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Alexa For Business");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RevokeInvitation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RevokeInvitationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RevokeInvitationResultJsonUnmarshaller());<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);
997,078
private void initDxSettings() {<NEW_LINE>try {<NEW_LINE>Boolean d3d = !settings.getBoolean("nod3d");<NEW_LINE>Boolean ddraw = settings.getBoolean("noddraw");<NEW_LINE>String uiScale = null;<NEW_LINE>if (settings.getLong("uiScale") > 0) {<NEW_LINE>uiScale = String.valueOf(settings<MASK><NEW_LINE>}<NEW_LINE>LOGGER.info(String.format("d3d: %s (%s) / noddraw: %s (%s) / opengl: (%s) / retina: %s / uiScale: %s", d3d, System.getProperty("sun.java2d.d3d"), ddraw, System.getProperty("sun.java2d.noddraw"), System.getProperty("sun.java2d.opengl"), GuiUtil.hasRetinaDisplay(), uiScale));<NEW_LINE>System.setProperty("sun.java2d.d3d", d3d.toString());<NEW_LINE>System.setProperty("sun.java2d.noddraw", ddraw.toString());<NEW_LINE>if (uiScale != null) {<NEW_LINE>System.setProperty("sun.java2d.uiScale", uiScale);<NEW_LINE>}<NEW_LINE>} catch (SecurityException ex) {<NEW_LINE>LOGGER.warning("Error setting drawing settings: " + ex.getLocalizedMessage());<NEW_LINE>}<NEW_LINE>}
.getLong("uiScale") / 100.0);
1,535,307
protected static String calculateCodeCommitPassword(URIish uri, String awsSecretKey) {<NEW_LINE>String[] split = uri.getHost().split("\\.");<NEW_LINE>if (split.length < 4) {<NEW_LINE>throw new CredentialException("Cannot detect AWS region from URI", null);<NEW_LINE>}<NEW_LINE>String region = split[1];<NEW_LINE>Date now = new Date();<NEW_LINE>SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd'T'HHmmss");<NEW_LINE>dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));<NEW_LINE>String dateStamp = dateFormat.format(now);<NEW_LINE>String shortDateStamp = dateStamp.substring(0, 8);<NEW_LINE>String codeCommitPassword;<NEW_LINE>try {<NEW_LINE>StringBuilder stringToSign = new StringBuilder();<NEW_LINE>stringToSign.append("AWS4-HMAC-SHA256\n").append(dateStamp).append("\n").append(shortDateStamp).append("/").append(region).append("/codecommit/aws4_request\n").append(bytesToHexString(canonicalRequestDigest(uri)));<NEW_LINE>byte[] signedRequest = sign(awsSecretKey, shortDateStamp, region, stringToSign.toString());<NEW_LINE>codeCommitPassword = dateStamp + "Z" + bytesToHexString(signedRequest);<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return codeCommitPassword;<NEW_LINE>}
throw new CredentialException("Error calculating AWS CodeCommit password", e);
486,898
public static Map<String, String> analyzeBackendTagsProperties(Map<String, String> properties, Tag defaultValue) throws AnalysisException {<NEW_LINE>Map<String, String> tagMap = Maps.newHashMap();<NEW_LINE>Iterator<Map.Entry<String, String>> iter = properties.entrySet().iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Map.Entry<String, String> entry = iter.next();<NEW_LINE>if (!entry.getKey().startsWith("tag.")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String[] keyParts = entry.getKey().split("\\.");<NEW_LINE>if (keyParts.length != 2) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String val = entry.getValue().replaceAll(" ", "");<NEW_LINE>tagMap.put<MASK><NEW_LINE>iter.remove();<NEW_LINE>}<NEW_LINE>if (tagMap.isEmpty() && defaultValue != null) {<NEW_LINE>tagMap.put(defaultValue.type, defaultValue.value);<NEW_LINE>}<NEW_LINE>return tagMap;<NEW_LINE>}
(keyParts[1], val);
968,526
public void showAdminPreferenceFunction(final RequestContext context) {<NEW_LINE>final String templateName = "admin-preference.ftl";<NEW_LINE>final AbstractFreeMarkerRenderer renderer = new ConsoleRenderer(context, templateName);<NEW_LINE>final Locale locale = Latkes.getLocale();<NEW_LINE>final Map<String, String> langs = langPropsService.getAll(locale);<NEW_LINE>final Map<String, Object> dataModel = renderer.getDataModel();<NEW_LINE>dataModel.putAll(langs);<NEW_LINE>dataModel.put(Option.ID_C_LOCALE_STRING, locale.toString());<NEW_LINE>final JSONObject preference = optionQueryService.getPreference();<NEW_LINE>final StringBuilder timeZoneIdOptions = new StringBuilder();<NEW_LINE>final String[] availableIDs = TimeZone.getAvailableIDs();<NEW_LINE>for (int i = 0; i < availableIDs.length; i++) {<NEW_LINE><MASK><NEW_LINE>String option;<NEW_LINE>if (id.equals(preference.optString(Option.ID_C_TIME_ZONE_ID))) {<NEW_LINE>option = "<option value=\"" + id + "\" selected=\"true\">" + id + "</option>";<NEW_LINE>} else {<NEW_LINE>option = "<option value=\"" + id + "\">" + id + "</option>";<NEW_LINE>}<NEW_LINE>timeZoneIdOptions.append(option);<NEW_LINE>}<NEW_LINE>dataModel.put(Common.LUTE_AVAILABLE, Markdowns.LUTE_AVAILABLE);<NEW_LINE>dataModel.put("timeZoneIdOptions", timeZoneIdOptions.toString());<NEW_LINE>fireFreeMarkerActionEvent(templateName, dataModel);<NEW_LINE>}
final String id = availableIDs[i];
813,452
// -------------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public PortfolioItemSummary summarize() {<NEW_LINE>// 5Y USD 2mm Rec USD-LIBOR-6M Cap 1% / Pay Premium : 21Jan17-21Jan22<NEW_LINE>StringBuilder buf = new StringBuilder(96);<NEW_LINE>IborCapFloorLeg mainLeg = product.getCapFloorLeg();<NEW_LINE>buf.append(SummarizerUtils.datePeriod(mainLeg.getStartDate().getUnadjusted(), mainLeg.getEndDate().getUnadjusted()));<NEW_LINE>buf.append(' ');<NEW_LINE>buf.append(SummarizerUtils.amount(mainLeg.getCurrency(), mainLeg.getNotional<MASK><NEW_LINE>buf.append(' ');<NEW_LINE>if (mainLeg.getPayReceive().isReceive()) {<NEW_LINE>buf.append("Rec ");<NEW_LINE>summarizeMainLeg(mainLeg, buf);<NEW_LINE>buf.append(getPremium().isPresent() ? " / Pay Premium" : (product.getPayLeg().isPresent() ? " / Pay Periodic" : ""));<NEW_LINE>} else {<NEW_LINE>buf.append(getPremium().isPresent() ? "Rec Premium / Pay " : (product.getPayLeg().isPresent() ? "Rec Periodic / Pay " : ""));<NEW_LINE>summarizeMainLeg(mainLeg, buf);<NEW_LINE>}<NEW_LINE>buf.append(" : ");<NEW_LINE>buf.append(SummarizerUtils.dateRange(mainLeg.getStartDate().getUnadjusted(), mainLeg.getEndDate().getUnadjusted()));<NEW_LINE>return SummarizerUtils.summary(this, ProductType.IBOR_CAP_FLOOR, buf.toString(), mainLeg.getCurrency());<NEW_LINE>}
().getInitialValue()));
950,895
default Map<String, String> buildJobContext(LineageEvent event) {<NEW_LINE>Map<String, String> <MASK><NEW_LINE>if (event.getJob().getFacets() != null) {<NEW_LINE>if (event.getJob().getFacets().getSourceCodeLocation() != null) {<NEW_LINE>if (event.getJob().getFacets().getSourceCodeLocation().getType() != null) {<NEW_LINE>args.put("job.facets.sourceCodeLocation.type", event.getJob().getFacets().getSourceCodeLocation().getType());<NEW_LINE>}<NEW_LINE>if (event.getJob().getFacets().getSourceCodeLocation().getUrl() != null) {<NEW_LINE>args.put("job.facets.sourceCodeLocation.url", event.getJob().getFacets().getSourceCodeLocation().getUrl());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (event.getJob().getFacets().getSql() != null) {<NEW_LINE>args.put("sql", event.getJob().getFacets().getSql().getQuery());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return args;<NEW_LINE>}
args = new LinkedHashMap<>();
1,172,548
public MatchResult match(List<YamlContract> contracts, Request request, Parameters parameters) {<NEW_LINE>YamlContract contract = contracts.get(0);<NEW_LINE>// TODO: What if the body is in files?<NEW_LINE>Map body = (Map) contract.request.body;<NEW_LINE>try {<NEW_LINE>Map jsonBodyFromContract = body;<NEW_LINE>Map jsonBodyFromRequest = this.objectMapper.readerForMapOf(Object.class).readValue(request.getBody());<NEW_LINE>String query = (String) jsonBodyFromContract.get("query");<NEW_LINE>String queryFromRequest = (String) jsonBodyFromRequest.get("query");<NEW_LINE>Map variables = (Map) jsonBodyFromContract.get("variables");<NEW_LINE>Map variablesFromRequest = (<MASK><NEW_LINE>String operationName = (String) jsonBodyFromContract.get("operationName");<NEW_LINE>String operationNameFromRequest = (String) jsonBodyFromRequest.get("operationName");<NEW_LINE>boolean queryMatches = assertThat(() -> Assertions.assertThat(query).isEqualToIgnoringWhitespace(queryFromRequest));<NEW_LINE>boolean variablesMatch = assertThat(() -> JsonAssertions.assertThatJson(variables).isEqualTo(variablesFromRequest));<NEW_LINE>boolean operationMatches = StringUtils.equals(operationName, operationNameFromRequest);<NEW_LINE>return MatchResult.of(queryMatches && variablesMatch && operationMatches);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (log.isWarnEnabled()) {<NEW_LINE>log.warn("An exception occurred while trying to parse the graphql entries", e);<NEW_LINE>}<NEW_LINE>return MatchResult.noMatch();<NEW_LINE>}<NEW_LINE>}
Map) jsonBodyFromRequest.get("variables");
1,196,376
public void marshall(Condition condition, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (condition == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(condition.getEq(), EQ_BINDING);<NEW_LINE>protocolMarshaller.marshall(condition.getNeq(), NEQ_BINDING);<NEW_LINE>protocolMarshaller.marshall(condition.getGt(), GT_BINDING);<NEW_LINE>protocolMarshaller.marshall(condition.getGte(), GTE_BINDING);<NEW_LINE>protocolMarshaller.marshall(condition.getLt(), LT_BINDING);<NEW_LINE>protocolMarshaller.marshall(condition.getLte(), LTE_BINDING);<NEW_LINE>protocolMarshaller.marshall(condition.getEquals(), EQUALS_BINDING);<NEW_LINE>protocolMarshaller.marshall(condition.getNotEquals(), NOTEQUALS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(condition.getGreaterThanOrEqual(), GREATERTHANOREQUAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(condition.getLessThan(), LESSTHAN_BINDING);<NEW_LINE>protocolMarshaller.marshall(condition.getLessThanOrEqual(), LESSTHANOREQUAL_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
condition.getGreaterThan(), GREATERTHAN_BINDING);
218,075
public DBClusterRole unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DBClusterRole dBClusterRole = new DBClusterRole();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return dBClusterRole;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("RoleArn", targetDepth)) {<NEW_LINE>dBClusterRole.setRoleArn(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Status", targetDepth)) {<NEW_LINE>dBClusterRole.setStatus(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return dBClusterRole;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
808,809
public boolean apply(Game game, Ability source) {<NEW_LINE>FilterCard filterCardInHand = new FilterCard();<NEW_LINE>filterCardInHand.add(SubType.AURA.getPredicate());<NEW_LINE>Player controller = game.<MASK><NEW_LINE>Permanent academyResearchers = game.getPermanent(source.getSourceId());<NEW_LINE>if (controller != null && academyResearchers != null) {<NEW_LINE>filterCardInHand.add(new AuraCardCanAttachToPermanentId(academyResearchers.getId()));<NEW_LINE>TargetCardInHand target = new TargetCardInHand(0, 1, filterCardInHand);<NEW_LINE>if (controller.choose(Outcome.PutCardInPlay, target, source, game)) {<NEW_LINE>Card auraInHand = game.getCard(target.getFirstTarget());<NEW_LINE>if (auraInHand != null) {<NEW_LINE>game.getState().setValue("attachTo:" + auraInHand.getId(), academyResearchers);<NEW_LINE>controller.moveCards(auraInHand, Zone.BATTLEFIELD, source, game);<NEW_LINE>if (academyResearchers.addAttachment(auraInHand.getId(), source, game)) {<NEW_LINE>game.informPlayers(controller.getLogName() + " put " + auraInHand.getLogName() + " on the battlefield attached to " + academyResearchers.getLogName() + '.');<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getPlayer(source.getControllerId());
1,178,321
public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(game.getActivePlayerId());<NEW_LINE>Permanent permanent = game.getPermanent(source.getSourceId());<NEW_LINE>if (player == null || permanent == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Choice choice = new ChoiceImpl();<NEW_LINE>choice.setChoices(new HashSet(Arrays.asList(<MASK><NEW_LINE>player.choose(outcome, choice, game);<NEW_LINE>switch(choice.getChoice()) {<NEW_LINE>case "Add a doom counter":<NEW_LINE>permanent.addCounters(CounterType.DOOM.createInstance(), player.getId(), source, game);<NEW_LINE>break;<NEW_LINE>case "Remove a doom counter":<NEW_LINE>permanent.removeCounters(CounterType.DOOM.createInstance(), source, game);<NEW_LINE>break;<NEW_LINE>case "Do nothing":<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (permanent.getCounters(game).getCount(CounterType.DOOM) < 3 || !permanent.sacrifice(source, game)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>game.fireReflexiveTriggeredAbility(new ReflexiveTriggeredAbility(new DamageAllEffect(6, StaticFilters.FILTER_PERMANENT_CREATURE), false, "it deals 6 damage to each creature."), source);<NEW_LINE>return true;<NEW_LINE>}
"Add a doom counter", "Remove a doom counter", "Do nothing")));
1,343,252
private int bfsToGetShortestCycle(Graph graph, int sourceVertex) {<NEW_LINE>int shortestCycle = Integer.MAX_VALUE;<NEW_LINE>int[] distTo = new int[graph.vertices()];<NEW_LINE>int[] edgeTo = new int[graph.vertices()];<NEW_LINE>Queue<Integer> queue = new Queue<>();<NEW_LINE>boolean[] visited = new boolean[graph.vertices()];<NEW_LINE>visited[sourceVertex] = true;<NEW_LINE>edgeTo[sourceVertex] = Integer.MAX_VALUE;<NEW_LINE>queue.enqueue(sourceVertex);<NEW_LINE>while (!queue.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>for (int neighbor : graph.adjacent(currentVertex)) {<NEW_LINE>if (!visited[neighbor]) {<NEW_LINE>visited[neighbor] = true;<NEW_LINE>distTo[neighbor] = distTo[currentVertex] + 1;<NEW_LINE>edgeTo[neighbor] = currentVertex;<NEW_LINE>queue.enqueue(neighbor);<NEW_LINE>} else if (neighbor != edgeTo[currentVertex]) {<NEW_LINE>// Cycle found<NEW_LINE>int cycleLength = distTo[currentVertex] + distTo[neighbor] + 1;<NEW_LINE>shortestCycle = Math.min(shortestCycle, cycleLength);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return shortestCycle;<NEW_LINE>}
int currentVertex = queue.dequeue();
856,404
protected ListPopup createPopup(DataContext context) {<NEW_LINE>WidgetState state = getWidgetState(context.getData(CommonDataKeys.VIRTUAL_FILE));<NEW_LINE>Editor editor = getEditor();<NEW_LINE>PsiFile psiFile = getPsiFile();<NEW_LINE>if (state instanceof MyWidgetState && editor != null && psiFile != null) {<NEW_LINE>final CodeStyleStatusBarUIContributor uiContributor = ((<MASK><NEW_LINE>AnAction[] actions = getActions(uiContributor, psiFile);<NEW_LINE>ActionGroup actionGroup = new ActionGroup() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@Nonnull<NEW_LINE>public AnAction[] getChildren(@Nullable AnActionEvent e) {<NEW_LINE>return actions;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return JBPopupFactory.getInstance().createActionGroupPopup(uiContributor != null ? uiContributor.getActionGroupTitle() : null, actionGroup, context, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
MyWidgetState) state).getContributor();
1,326,763
public void removeUser(Long userId, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'userId' is set<NEW_LINE>if (userId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'userId' when calling removeUser");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/users/{user_id}".replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String <MASK><NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>}
localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
700,718
protected void bindServer() {<NEW_LINE>// Bind and start to accept incoming connections.<NEW_LINE>final InetAddress[] hostAddresses;<NEW_LINE>try {<NEW_LINE>hostAddresses = networkService.resolveBindHostAddresses(bindHosts);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new BindHttpException("Failed to resolve host [" + Arrays.toString(bindHosts) + "]", e);<NEW_LINE>}<NEW_LINE>List<TransportAddress> boundAddresses = new <MASK><NEW_LINE>for (InetAddress address : hostAddresses) {<NEW_LINE>boundAddresses.add(bindAddress(address));<NEW_LINE>}<NEW_LINE>final InetAddress publishInetAddress;<NEW_LINE>try {<NEW_LINE>publishInetAddress = networkService.resolvePublishHostAddresses(publishHosts);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new BindTransportException("Failed to resolve publish address", e);<NEW_LINE>}<NEW_LINE>final int publishPort = resolvePublishPort(settings, boundAddresses, publishInetAddress);<NEW_LINE>TransportAddress publishAddress = new TransportAddress(new InetSocketAddress(publishInetAddress, publishPort));<NEW_LINE>this.boundAddress = new BoundTransportAddress(boundAddresses.toArray(new TransportAddress[0]), publishAddress);<NEW_LINE>logger.info("{}", boundAddress);<NEW_LINE>}
ArrayList<>(hostAddresses.length);
389,887
public static void downloadNovel(BaseActivity<?> activity, String displayName, String content, Callback<Uri> targetCallback) {<NEW_LINE>check(activity, new FeedBack() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void doSomething() {<NEW_LINE>File textFile = LegacyFile.textFile(activity, displayName);<NEW_LINE>try {<NEW_LINE>OutputStream outStream = new FileOutputStream(textFile);<NEW_LINE>outStream.<MASK><NEW_LINE>outStream.close();<NEW_LINE>Common.showLog("downloadNovel displayName " + displayName);<NEW_LINE>OutPut.outPutNovel(activity, textFile, displayName);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>Uri fileURI = FileProvider.getUriForFile(activity, activity.getApplicationContext().getPackageName() + ".provider", textFile);<NEW_LINE>if (targetCallback != null) {<NEW_LINE>targetCallback.doSomething(fileURI);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
write(content.getBytes());
710,981
protected void checkImage(XMLElement e, String attrNS, String attr) {<NEW_LINE>// if it's an SVG image, fall back to super's logic<NEW_LINE>String ns = e.getNamespace();<NEW_LINE>if ("http://www.w3.org/2000/svg".equals(ns)) {<NEW_LINE>super.checkImage(e, attrNS, attr);<NEW_LINE>} else // else process image source sets in HTML<NEW_LINE>if (xrefChecker.isPresent()) {<NEW_LINE>String src = e.getAttribute("src");<NEW_LINE>String <MASK><NEW_LINE>// if we're in a 'picture' element<NEW_LINE>if (inPicture) {<NEW_LINE>String type = e.getAttribute("type");<NEW_LINE>// if in a 'source' element specifying a foreign MIME type,<NEW_LINE>// register as foreign picture source<NEW_LINE>if ("source".equals(e.getName()) && type != null && !OPFChecker.isBlessedImageType(type)) {<NEW_LINE>registerImageSources(src, srcset, XRefChecker.Type.PICTURE_SOURCE_FOREIGN);<NEW_LINE>} else // else register as regular picture source (must be a CMT)<NEW_LINE>// register as picture source<NEW_LINE>{<NEW_LINE>registerImageSources(src, srcset, XRefChecker.Type.PICTURE_SOURCE);<NEW_LINE>}<NEW_LINE>} else // register as regular image sources (must be a CMT or have a manifest fallback<NEW_LINE>{<NEW_LINE>registerImageSources(src, srcset, XRefChecker.Type.IMAGE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
srcset = e.getAttribute("srcset");
1,652,422
private void saveBPartnerLocations(@NonNull final BPartnerComposite bPartnerComposite, final boolean validatePermissions) {<NEW_LINE>final List<BPartnerLocation> bpartnerLocations = bPartnerComposite.getLocations();<NEW_LINE>final BPartnerId bpartnerId = bPartnerComposite.getBpartner().getId();<NEW_LINE>final OrgId orgId = bPartnerComposite.getOrgId();<NEW_LINE>final ArrayList<BPartnerLocationId> savedBPartnerLocationIds = new ArrayList<>();<NEW_LINE>for (final BPartnerLocation bPartnerLocation : bpartnerLocations) {<NEW_LINE>final BPartnerLocationSaveRequest request = BPartnerLocationSaveRequest.builder().location(bPartnerLocation).bpartnerId(bpartnerId).orgId(orgId).<MASK><NEW_LINE>saveBPartnerLocation(request);<NEW_LINE>savedBPartnerLocationIds.add(bPartnerLocation.getId());<NEW_LINE>}<NEW_LINE>// set location records that we don't have in 'bpartnerLocations' to inactive<NEW_LINE>final ICompositeQueryUpdater<I_C_BPartner_Location> columnUpdater = queryBL.createCompositeQueryUpdater(I_C_BPartner_Location.class).addSetColumnValue(I_C_BPartner_Location.COLUMNNAME_IsActive, false);<NEW_LINE>queryBL.createQueryBuilder(I_C_BPartner_Location.class).addOnlyActiveRecordsFilter().addOnlyContextClient().addEqualsFilter(I_C_BPartner_Location.COLUMNNAME_C_BPartner_ID, bpartnerId).addNotInArrayFilter(I_C_BPartner_Location.COLUMN_C_BPartner_Location_ID, savedBPartnerLocationIds).create().update(columnUpdater);<NEW_LINE>}
validatePermissions(validatePermissions).build();
191,128
protected void observerShardLeader(final Long clusterDbId, final Long shardDbId) {<NEW_LINE>logger.info("[observerShardLeader]cluster_{},shard_{}", clusterDbId, shardDbId);<NEW_LINE>final CuratorFramework client = zkClient.get();<NEW_LINE>if (currentMetaManager.watchIfNotWatched(clusterDbId, shardDbId)) {<NEW_LINE>try {<NEW_LINE>List<PathChildrenCache> pathChildrenCaches = new ArrayList<>();<NEW_LINE>pathChildrenCaches.add(buildPathChildrenCacheByDbId(clusterDbId, shardDbId, client));<NEW_LINE>ReentrantLock lock = new ReentrantLock();<NEW_LINE>pathChildrenCaches.forEach(pathChildrenCache -> {<NEW_LINE>pathChildrenCache.getListenable().addListener(new PathChildrenCacheListener() {<NEW_LINE><NEW_LINE>private AtomicBoolean isFirst = new AtomicBoolean(true);<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws Exception {<NEW_LINE>if (isFirst.get()) {<NEW_LINE>isFirst.set(false);<NEW_LINE>try {<NEW_LINE>logger.info("[childEvent][first sleep]{}", FIRST_PATH_CHILDREN_CACHE_SLEEP_MILLI);<NEW_LINE>TimeUnit.MILLISECONDS.sleep(FIRST_PATH_CHILDREN_CACHE_SLEEP_MILLI);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("[childEvent]", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>lock.lock();<NEW_LINE>logger.info("[childEvent]cluster_{}, shard_{}, {}, {}", clusterDbId, shardDbId, event.getType(), ZkUtils.toString(event.getData()));<NEW_LINE>updateShardLeader(aggregateChildData(pathChildrenCaches), clusterDbId, shardDbId);<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>pathChildrenCache.start();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.info("[observerShardLeader][cluster{}][shard_{}] start cache fail {}", <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>registerJob(clusterDbId, shardDbId, new Releasable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void release() throws Exception {<NEW_LINE>pathChildrenCaches.forEach(pathChildrenCache -> {<NEW_LINE>try {<NEW_LINE>logger.info("[release][release children cache]cluster_{}, shard_{}", clusterDbId, shardDbId);<NEW_LINE>pathChildrenCache.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(String.format("[release][release children cache]cluster_%s, shard_%s", clusterDbId, shardDbId), e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("[observerShardLeader]cluster_" + clusterDbId + " shard_" + shardDbId, e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.warn("[observerShardLeader][already watched]cluster_{}, shard_{}", clusterDbId, shardDbId);<NEW_LINE>}<NEW_LINE>}
clusterDbId, shardDbId, pathChildrenCache, e);
767,263
public boolean register(final InferableJavaFileObject jfo) {<NEW_LINE>Parameters.notNull("jfo", jfo);<NEW_LINE>final String inferedName = jfo.inferBinaryName();<NEW_LINE>final String[] pkgName = FileObjects.getPackageAndName(inferedName);<NEW_LINE>List<Integer> ids = this.packages.get(pkgName[0]);<NEW_LINE>if (ids == null) {<NEW_LINE>ids = new LinkedList<Integer>();<NEW_LINE>this.packages.put(pkgName[0], ids);<NEW_LINE>}<NEW_LINE>// Check for duplicate<NEW_LINE>for (Iterator<Integer> it = ids.iterator(); it.hasNext(); ) {<NEW_LINE>final <MASK><NEW_LINE>final InferableJavaFileObject rfo = this.content.get(id);<NEW_LINE>assert rfo != null;<NEW_LINE>if (inferedName.equals(rfo.inferBinaryName())) {<NEW_LINE>this.content.put(id, jfo);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Todo: add<NEW_LINE>final Integer id = currentId.getAndIncrement();<NEW_LINE>this.content.put(id, jfo);<NEW_LINE>ids.add(id);<NEW_LINE>return false;<NEW_LINE>}
Integer id = it.next();
156,794
private void cmd_button() {<NEW_LINE>log.config("Activity=" + m_activity);<NEW_LINE>if (m_activity == null)<NEW_LINE>return;<NEW_LINE>//<NEW_LINE>MWFNode node = m_activity.getNode();<NEW_LINE>if (MWFNode.ACTION_UserWindow.equals(node.getAction())) {<NEW_LINE>// Explicit Window<NEW_LINE>int AD_Window_ID = node.getAD_Window_ID();<NEW_LINE>String ColumnName = m_activity.getPO().get_TableName() + "_ID";<NEW_LINE>int Record_ID = m_activity.getRecord_ID();<NEW_LINE>MQuery query = MQuery.getEqualQuery(ColumnName, Record_ID);<NEW_LINE>boolean IsSOTrx = m_activity.isSOTrx();<NEW_LINE>//<NEW_LINE>log.info("Zoom to AD_Window_ID=" + AD_Window_ID + " - " + query + " (IsSOTrx=" + IsSOTrx + ")");<NEW_LINE>AEnv.zoom(AD_Window_ID, query);<NEW_LINE>} else if (MWFNode.ACTION_UserForm.equals(node.getAction())) {<NEW_LINE>int AD_Form_ID = node.getAD_Form_ID();<NEW_LINE>Window <MASK><NEW_LINE>AEnv.showWindow(form);<NEW_LINE>} else if (MWFNode.ACTION_SmartBrowse.equals(node.getAction())) {<NEW_LINE>int AD_Browse_ID = node.getAD_Browse_ID();<NEW_LINE>Window browse = WBrowser.openBrowse(0, AD_Browse_ID, "", m_activity.isSOTrx());<NEW_LINE>AEnv.showWindow(browse);<NEW_LINE>} else<NEW_LINE>log.log(Level.SEVERE, "No User Action:" + node.getAction());<NEW_LINE>}
form = ADForm.openForm(AD_Form_ID);
826,570
protected void exportStyledTextRun(Map<AttributedCharacterIterator.Attribute, Object> styledTextAttributes, String text, Locale locale, Color backcolor) throws IOException, JRException {<NEW_LINE>JRFont styleFont = new JRBaseFont(styledTextAttributes);<NEW_LINE>Color styleForeground = (Color) styledTextAttributes.get(TextAttribute.FOREGROUND);<NEW_LINE>Color styleBackground = (Color) styledTextAttributes.get(TextAttribute.BACKGROUND);<NEW_LINE>contentWriter.write("\\f");<NEW_LINE>contentWriter.write(String.valueOf(getFontIndex(styleFont, locale)));<NEW_LINE>contentWriter.write("\\fs");<NEW_LINE>contentWriter.write(String.valueOf((int) (2 * styleFont.getFontsize())));<NEW_LINE>if (styleFont.isBold()) {<NEW_LINE>contentWriter.write("\\b");<NEW_LINE>}<NEW_LINE>if (styleFont.isItalic()) {<NEW_LINE>contentWriter.write("\\i");<NEW_LINE>}<NEW_LINE>if (styleFont.isUnderline()) {<NEW_LINE>contentWriter.write("\\ul");<NEW_LINE>}<NEW_LINE>if (styleFont.isStrikeThrough()) {<NEW_LINE>contentWriter.write("\\strike");<NEW_LINE>}<NEW_LINE>if (TextAttribute.SUPERSCRIPT_SUPER.equals(styledTextAttributes.get(TextAttribute.SUPERSCRIPT))) {<NEW_LINE>contentWriter.write("\\super");<NEW_LINE>} else if (TextAttribute.SUPERSCRIPT_SUB.equals(styledTextAttributes.get(TextAttribute.SUPERSCRIPT))) {<NEW_LINE>contentWriter.write("\\sub");<NEW_LINE>}<NEW_LINE>if (!(null == styleBackground || styleBackground.equals(backcolor))) {<NEW_LINE>contentWriter.write("\\highlight");<NEW_LINE>contentWriter.write(String.<MASK><NEW_LINE>}<NEW_LINE>contentWriter.write("\\cf");<NEW_LINE>contentWriter.write(String.valueOf(getColorIndex(styleForeground)));<NEW_LINE>contentWriter.write(" ");<NEW_LINE>contentWriter.write(handleUnicodeText(text));<NEW_LINE>// reset all styles in the paragraph<NEW_LINE>contentWriter.write("\\plain");<NEW_LINE>}
valueOf(getColorIndex(styleBackground)));
1,639,318
public void afterActionPerformed(AnAction action, DataContext dataContext, AnActionEvent event) {<NEW_LINE>StringBuffer out = new StringBuffer();<NEW_LINE>final ActionManager actionManager = ActionManager.getInstance();<NEW_LINE>final String id = actionManager.getId(action);<NEW_LINE>out.append("id=" + id);<NEW_LINE>if (id != null) {<NEW_LINE>out.append(" shortcuts:");<NEW_LINE>final Shortcut[] shortcuts = KeymapManager.getInstance().getActiveKeymap().getShortcuts(id);<NEW_LINE>for (int i = 0; i < shortcuts.length; i++) {<NEW_LINE>Shortcut shortcut = shortcuts[i];<NEW_LINE>out.append(shortcut);<NEW_LINE>if (i < shortcuts.length - 1) {<NEW_LINE>out.append(",");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.append("\n");<NEW_LINE>final Document doc = myText.getDocument();<NEW_LINE>try {<NEW_LINE>doc.insertString(doc.getLength(), <MASK><NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>final int y = (int) myText.getBounds().getMaxY();<NEW_LINE>myText.scrollRectToVisible(new Rectangle(0, y, myText.getBounds().width, 0));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>LOG.error(e);<NEW_LINE>}<NEW_LINE>}
out.toString(), null);
1,246,219
public final FieldContext field() throws RecognitionException {<NEW_LINE>FieldContext _localctx = new <MASK><NEW_LINE>enterRule(_localctx, 58, RULE_field);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(285);<NEW_LINE>type();<NEW_LINE>setState(286);<NEW_LINE>((FieldContext) _localctx).fieldName = identOrReserved();<NEW_LINE>setState(287);<NEW_LINE>match(ASSIGN);<NEW_LINE>setState(288);<NEW_LINE>match(IntegerLiteral);<NEW_LINE>setState(290);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == LBRACK) {<NEW_LINE>{<NEW_LINE>setState(289);<NEW_LINE>optionList();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(292);<NEW_LINE>match(SEMI);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
FieldContext(_ctx, getState());
704,951
public List<MappingField> resolveAndValidateFields(List<MappingField> userFields, Map<String, String> options, NodeEngine nodeEngine) {<NEW_LINE>InternalSerializationService ss = (InternalSerializationService) nodeEngine.getSerializationService();<NEW_LINE>// normalize and validate the names and external names<NEW_LINE>for (MappingField field : userFields) {<NEW_LINE>String name = field.name();<NEW_LINE>String externalName = field.externalName();<NEW_LINE>if (externalName == null) {<NEW_LINE>if (name.equals(KEY) || name.equals(VALUE)) {<NEW_LINE>externalName = name;<NEW_LINE>} else {<NEW_LINE>externalName = VALUE_PREFIX + name;<NEW_LINE>}<NEW_LINE>field.setExternalName(name);<NEW_LINE>}<NEW_LINE>if ((name.equals(KEY) && !externalName.equals(KEY)) || (name.equals(VALUE) && !externalName.equals(VALUE))) {<NEW_LINE>throw QueryException.error("Cannot rename field: '" + name + '\'');<NEW_LINE>}<NEW_LINE>if (!EXT_NAME_PATTERN.matcher(externalName).matches()) {<NEW_LINE>throw QueryException.error("Invalid external name: " + externalName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Stream<MappingField> keyFields = findMetadataResolver(options, true).resolveAndValidateFields(true, userFields, options, ss).filter(field -> !field.name().equals(KEY) || field.externalName().equals(KEY));<NEW_LINE>Stream<MappingField> valueFields = findMetadataResolver(options, false).resolveAndValidateFields(false, userFields, options, ss).filter(field -> !field.name().equals(VALUE) || field.externalName().equals(VALUE));<NEW_LINE>Map<String, MappingField> fields = concat(keyFields, valueFields).collect(LinkedHashMap::new, (map, field) -> map.putIfAbsent(field.name(), field), Map::putAll);<NEW_LINE>if (fields.isEmpty()) {<NEW_LINE>throw QueryException.error("The resolved field list is empty");<NEW_LINE>}<NEW_LINE>return new ArrayList<<MASK><NEW_LINE>}
>(fields.values());
337,670
public void reduce(Text key, Iterator<Text> values, OutputCollector<Text, Text> output, Reporter reporter) throws IOException {<NEW_LINE>String field = key.toString();<NEW_LINE>reporter.setStatus("starting " + field + " ::host = " + hostName);<NEW_LINE>// concatenate strings<NEW_LINE>if (field.startsWith(VALUE_TYPE_STRING)) {<NEW_LINE>StringBuffer sSum = new StringBuffer();<NEW_LINE>while (values.hasNext()) sSum.append(values.next().toString()).append(";");<NEW_LINE>output.collect(key, new Text(sSum.toString()));<NEW_LINE>reporter.setStatus("finished " + field + " ::host = " + hostName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// sum long values<NEW_LINE>if (field.startsWith(VALUE_TYPE_FLOAT)) {<NEW_LINE>float fSum = 0;<NEW_LINE>while (values.hasNext()) fSum += Float.parseFloat(values.next().toString());<NEW_LINE>output.collect(key, new Text(String.valueOf(fSum)));<NEW_LINE>reporter.setStatus("finished " + field + " ::host = " + hostName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// sum long values<NEW_LINE>if (field.startsWith(VALUE_TYPE_LONG)) {<NEW_LINE>long lSum = 0;<NEW_LINE>while (values.hasNext()) {<NEW_LINE>lSum += Long.parseLong(values.next().toString());<NEW_LINE>}<NEW_LINE>output.collect(key, new Text(String.valueOf(lSum)));<NEW_LINE>}<NEW_LINE>reporter.setStatus(<MASK><NEW_LINE>}
"finished " + field + " ::host = " + hostName);
705,990
private List<IViewRow> retrieveRowLines(final ViewEvaluationCtx viewEvalCtx, final ViewId viewId, final DocumentIdsSelection rowIds) {<NEW_LINE>logger.debug("Getting row lines: rowId={} - {}", rowIds, this);<NEW_LINE>logger.debug("Using: {}", viewId);<NEW_LINE>final SqlAndParams sqlAndParams = sqlViewSelect.selectIncludedLines().viewEvalCtx(viewEvalCtx).viewId(viewId).rowIds(rowIds).build();<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sqlAndParams.getSql(), ITrx.TRXNAME_ThreadInherited);<NEW_LINE>DB.setParameters(<MASK><NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>return loadViewRows(rs, viewEvalCtx, viewId, -1);<NEW_LINE>} catch (final SQLException | DBException e) {<NEW_LINE>throw DBException.wrapIfNeeded(e).setSqlIfAbsent(sqlAndParams.getSql(), sqlAndParams.getSqlParams());<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>}<NEW_LINE>}
pstmt, sqlAndParams.getSqlParams());
974,442
public <S, D> D map(MappingContext<S, D> context) {<NEW_LINE>MappingContextImpl<S, D> contextImpl = (MappingContextImpl<S, D>) context;<NEW_LINE>Class<D<MASK><NEW_LINE>// Resolve some circular dependencies<NEW_LINE>if (!Iterables.isIterable(destinationType)) {<NEW_LINE>D circularDest = contextImpl.destinationForSource();<NEW_LINE>if (circularDest != null && circularDest.getClass().isAssignableFrom(contextImpl.getDestinationType()))<NEW_LINE>return circularDest;<NEW_LINE>}<NEW_LINE>D destination = null;<NEW_LINE>TypeMap<S, D> typeMap = typeMapStore.get(context.getSourceType(), context.getDestinationType(), context.getTypeMapName());<NEW_LINE>if (typeMap != null) {<NEW_LINE>destination = typeMap(contextImpl, typeMap);<NEW_LINE>} else {<NEW_LINE>Converter<S, D> converter = converterFor(context);<NEW_LINE>if (converter != null && (context.getDestination() == null || context.getParent() != null))<NEW_LINE>destination = convert(context, converter);<NEW_LINE>else if (!Primitives.isPrimitive(context.getSourceType()) && !Primitives.isPrimitive(context.getDestinationType())) {<NEW_LINE>// Call getOrCreate in case TypeMap was created concurrently<NEW_LINE>typeMap = typeMapStore.getOrCreate(context.getSource(), context.getSourceType(), context.getDestinationType(), context.getTypeMapName(), this);<NEW_LINE>destination = typeMap(contextImpl, typeMap);<NEW_LINE>} else if (context.getDestinationType().isAssignableFrom(context.getSourceType()))<NEW_LINE>destination = (D) context.getSource();<NEW_LINE>}<NEW_LINE>contextImpl.setDestination(destination, true);<NEW_LINE>return destination;<NEW_LINE>}
> destinationType = context.getDestinationType();
978,886
public static ImportSwaggerResponse unmarshall(ImportSwaggerResponse importSwaggerResponse, UnmarshallerContext _ctx) {<NEW_LINE>importSwaggerResponse.setRequestId(_ctx.stringValue("ImportSwaggerResponse.RequestId"));<NEW_LINE>List<ApiImportSwaggerSuccess> success = new ArrayList<ApiImportSwaggerSuccess>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ImportSwaggerResponse.Success.Length"); i++) {<NEW_LINE>ApiImportSwaggerSuccess apiImportSwaggerSuccess = new ApiImportSwaggerSuccess();<NEW_LINE>apiImportSwaggerSuccess.setPath(_ctx.stringValue("ImportSwaggerResponse.Success[" + i + "].Path"));<NEW_LINE>apiImportSwaggerSuccess.setHttpMethod(_ctx.stringValue<MASK><NEW_LINE>apiImportSwaggerSuccess.setApiUid(_ctx.stringValue("ImportSwaggerResponse.Success[" + i + "].ApiUid"));<NEW_LINE>apiImportSwaggerSuccess.setApiOperation(_ctx.stringValue("ImportSwaggerResponse.Success[" + i + "].ApiOperation"));<NEW_LINE>success.add(apiImportSwaggerSuccess);<NEW_LINE>}<NEW_LINE>importSwaggerResponse.setSuccess(success);<NEW_LINE>List<ApiImportSwaggerFailed> failed = new ArrayList<ApiImportSwaggerFailed>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ImportSwaggerResponse.Failed.Length"); i++) {<NEW_LINE>ApiImportSwaggerFailed apiImportSwaggerFailed = new ApiImportSwaggerFailed();<NEW_LINE>apiImportSwaggerFailed.setPath(_ctx.stringValue("ImportSwaggerResponse.Failed[" + i + "].Path"));<NEW_LINE>apiImportSwaggerFailed.setHttpMethod(_ctx.stringValue("ImportSwaggerResponse.Failed[" + i + "].HttpMethod"));<NEW_LINE>apiImportSwaggerFailed.setErrorMsg(_ctx.stringValue("ImportSwaggerResponse.Failed[" + i + "].ErrorMsg"));<NEW_LINE>failed.add(apiImportSwaggerFailed);<NEW_LINE>}<NEW_LINE>importSwaggerResponse.setFailed(failed);<NEW_LINE>return importSwaggerResponse;<NEW_LINE>}
("ImportSwaggerResponse.Success[" + i + "].HttpMethod"));
708,609
public Object interpret(ExecutionContext context, boolean debug) {<NEW_LINE>Object lhs = getValue(this.lhsGet, context, getLhs().interpret(context, debug));<NEW_LINE>Long lhsNum = null;<NEW_LINE>if (getOp().equals(">>>")) {<NEW_LINE>lhsNum = Types.toUint32(context, lhs);<NEW_LINE>} else {<NEW_LINE>lhsNum = Types.toInt32(context, lhs);<NEW_LINE>}<NEW_LINE>Object value = getRhs().interpret(context, debug);<NEW_LINE>if (getOp().equals("<<")) {<NEW_LINE>// 11.7.1<NEW_LINE>Long rhsNum = Types.toUint32(context, getValue(this.rhsGet, context, value));<NEW_LINE>int shiftCount = rhsNum.intValue() & 0x1F;<NEW_LINE>return ((int) (lhsNum.longValue() << shiftCount));<NEW_LINE>} else if (getOp().equals(">>")) {<NEW_LINE>// 11.7.2<NEW_LINE>Long rhsNum = Types.toUint32(context, getValue(this.rhsGet, context, value));<NEW_LINE>int shiftCount = rhsNum.intValue() & 0x1F;<NEW_LINE>return ((int) (lhsNum.longValue() >> shiftCount));<NEW_LINE>} else if (getOp().equals(">>>")) {<NEW_LINE>// 11.7.3<NEW_LINE>Long rhsNum = Types.toUint32(context, getValue(this.rhsGet, context, value));<NEW_LINE>int shiftCount = rhsNum.intValue() & 0x1F;<NEW_LINE>return (lhsNum.longValue() >>> shiftCount);<NEW_LINE>} else if (getOp().equals("&")) {<NEW_LINE>Long rhsNum = Types.toInt32(context, getValue(this.rhsGet, context, value));<NEW_LINE>return (lhsNum.longValue() & rhsNum.longValue());<NEW_LINE>} else if (getOp().equals("|")) {<NEW_LINE>Long rhsNum = Types.toInt32(context, getValue(this<MASK><NEW_LINE>return (lhsNum.longValue() | rhsNum.longValue());<NEW_LINE>} else if (getOp().equals("^")) {<NEW_LINE>Long rhsNum = Types.toInt32(context, getValue(this.rhsGet, context, value));<NEW_LINE>return (lhsNum.longValue() ^ rhsNum.longValue());<NEW_LINE>}<NEW_LINE>// not reached<NEW_LINE>return null;<NEW_LINE>}
.rhsGet, context, value));
787,900
private void addEdgeColoringControls(final DefaultFormBuilder formBuilder) {<NEW_LINE>TranslatedObject[] automaticLayoutTypes = TranslatedObject.fromEnum(AutomaticEdgeColor.class.getSimpleName() + ".", AutomaticEdgeColor.Rule.class);<NEW_LINE>mAutomaticEdgeColorComboBox = JComboBoxFactory.create(automaticLayoutTypes);<NEW_LINE>DefaultComboBoxModel automaticEdgeColorComboBoxModel = (DefaultComboBoxModel) mAutomaticEdgeColorComboBox.getModel();<NEW_LINE>automaticEdgeColorComboBoxModel.addElement(AUTOMATIC_LAYOUT_DISABLED);<NEW_LINE>automaticEdgeColorComboBoxModel.setSelectedItem(AUTOMATIC_LAYOUT_DISABLED);<NEW_LINE>mAutomaticEdgeColorComboBox.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>if (internalChange)<NEW_LINE>return;<NEW_LINE>final ModeController modeController = Controller.getCurrentModeController();<NEW_LINE>AutomaticEdgeColorHook hook = modeController.getExtension(AutomaticEdgeColorHook.class);<NEW_LINE>TranslatedObject selectedItem = (TranslatedObject) mAutomaticEdgeColorComboBox.getSelectedItem();<NEW_LINE>final MapModel map = Controller.getCurrentController().getMap();<NEW_LINE>final AutomaticEdgeColor oldExtension = (AutomaticEdgeColor) hook.getMapHook(map);<NEW_LINE>final int colorCount = oldExtension == null ? 0 : oldExtension.getColorCounter();<NEW_LINE>final NodeModel rootNode = map.getRootNode();<NEW_LINE>hook.undoableDeactivateHook(rootNode);<NEW_LINE>if (!selectedItem.equals(AUTOMATIC_LAYOUT_DISABLED)) {<NEW_LINE>final AutomaticEdgeColor newExtension = new AutomaticEdgeColor((AutomaticEdgeColor.Rule) selectedItem.getObject(), colorCount);<NEW_LINE>hook.undoableActivateHook(rootNode, newExtension);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>appendLabeledComponent(formBuilder, "AutomaticEdgeColorHookAction.text", mAutomaticEdgeColorComboBox);<NEW_LINE>mEditEdgeColorsBtn = TranslatedElementFactory.createButton("editEdgeColors");<NEW_LINE>mEditEdgeColorsBtn.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>final MEdgeController edgeController = (MEdgeController) modeController.getExtension(EdgeController.class);<NEW_LINE>edgeController.editEdgeColorConfiguration(Controller.getCurrentController().getMap());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>formBuilder.appendLineGapRow();<NEW_LINE>formBuilder.nextLine();<NEW_LINE>formBuilder.appendRow(FormSpecs.PREF_ROWSPEC);<NEW_LINE>formBuilder.setColumn(1);<NEW_LINE>formBuilder.append(<MASK><NEW_LINE>formBuilder.nextLine();<NEW_LINE>}
mEditEdgeColorsBtn, formBuilder.getColumnCount());
411,962
public com.amazonaws.services.workspacesweb.model.ThrottlingException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.workspacesweb.model.ThrottlingException throttlingException = new com.amazonaws.services.workspacesweb.model.ThrottlingException(null);<NEW_LINE>if (context.isStartOfDocument()) {<NEW_LINE>if (context.getHeader("Retry-After") != null) {<NEW_LINE>context.setCurrentHeader("Retry-After");<NEW_LINE>throttlingException.setRetryAfterSeconds(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("quotaCode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>throttlingException.setQuotaCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("serviceCode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>throttlingException.setServiceCode(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 throttlingException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
220,642
public static ClickHouseBitmap wrap(Object bitmap, ClickHouseDataType innerType) {<NEW_LINE>final ClickHouseBitmap b;<NEW_LINE>if (bitmap instanceof RoaringBitmap) {<NEW_LINE>b = new ClickHouseRoaringBitmap((RoaringBitmap) bitmap, innerType);<NEW_LINE>} else if (bitmap instanceof MutableRoaringBitmap) {<NEW_LINE>b = new ClickHouseMutableRoaringBitmap((MutableRoaringBitmap) bitmap, innerType);<NEW_LINE>} else if (bitmap instanceof ImmutableRoaringBitmap) {<NEW_LINE>b = new ClickHouseImmutableRoaringBitmap((ImmutableRoaringBitmap) bitmap, innerType);<NEW_LINE>} else if (bitmap instanceof Roaring64Bitmap) {<NEW_LINE>b = new ClickHouseRoaring64NavigableMap(Roaring64NavigableMap.bitmapOf(((Roaring64Bitmap) bitmap).toArray()), innerType);<NEW_LINE>} else if (bitmap instanceof Roaring64NavigableMap) {<NEW_LINE>b = new ClickHouseRoaring64NavigableMap<MASK><NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Only RoaringBitmap is supported but got: " + bitmap);<NEW_LINE>}<NEW_LINE>return b;<NEW_LINE>}
((Roaring64NavigableMap) bitmap, innerType);
1,580,865
private void buildExceptionDashboard(Model model, Payload payload, long date) {<NEW_LINE>model.setReportStart(new Date(payload.getDate()));<NEW_LINE>model.setReportEnd(new Date(payload.getDate() + TimeHelper.ONE_HOUR - 1));<NEW_LINE>int minuteCount = payload.getMinuteCounts();<NEW_LINE>int minute = model.getMinute();<NEW_LINE>TopReport report = queryTopReport(payload);<NEW_LINE>List<String> excludeDomains = <MASK><NEW_LINE>TopMetric topMetric = new TopMetric(minuteCount, payload.getTopCounts(), m_configManager, excludeDomains);<NEW_LINE>Date end = new Date(payload.getDate() + TimeHelper.ONE_MINUTE * minute);<NEW_LINE>Date start = new Date(end.getTime() - TimeHelper.ONE_MINUTE * minuteCount);<NEW_LINE>topMetric.setStart(start).setEnd(end);<NEW_LINE>if (minuteCount > minute) {<NEW_LINE>Payload lastPayload = new Payload();<NEW_LINE>Date lastHour = new Date(payload.getDate() - TimeHelper.ONE_HOUR);<NEW_LINE>lastPayload.setDate(new SimpleDateFormat("yyyyMMddHH").format(lastHour));<NEW_LINE>TopReport lastReport = queryTopReport(lastPayload);<NEW_LINE>topMetric.visitTopReport(lastReport);<NEW_LINE>model.setLastTopReport(lastReport);<NEW_LINE>}<NEW_LINE>topMetric.visitTopReport(report);<NEW_LINE>model.setTopReport(report);<NEW_LINE>model.setTopMetric(topMetric);<NEW_LINE>}
Arrays.asList(Constants.FRONT_END);
1,145,585
public void handleCommand(Command command) {<NEW_LINE>Thing thing = thingProvider.apply(link.getLinkedUID().getThingUID());<NEW_LINE>if (thing != null) {<NEW_LINE>final <MASK><NEW_LINE>if (handler != null) {<NEW_LINE>if (ThingHandlerHelper.isHandlerInitialized(thing)) {<NEW_LINE>logger.debug("Delegating command '{}' for item '{}' to handler for channel '{}'", command, link.getItemName(), link.getLinkedUID());<NEW_LINE>safeCaller.create(handler, ThingHandler.class).withTimeout(CommunicationManager.THINGHANDLER_EVENT_TIMEOUT).onTimeout(() -> {<NEW_LINE>logger.warn("Handler for thing '{}' takes more than {}ms for handling a command", handler.getThing().getUID(), CommunicationManager.THINGHANDLER_EVENT_TIMEOUT);<NEW_LINE>}).build().handleCommand(link.getLinkedUID(), command);<NEW_LINE>} else {<NEW_LINE>logger.debug("Not delegating command '{}' for item '{}' to handler for channel '{}', " + "because handler is not initialized (thing must be in status UNKNOWN, ONLINE or OFFLINE but was {}).", command, link.getItemName(), link.getLinkedUID(), thing.getStatus());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.warn("Cannot delegate command '{}' for item '{}' to handler for channel '{}', " + "because no handler is assigned. Maybe the binding is not installed or not " + "propertly initialized.", command, link.getItemName(), link.getLinkedUID());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.warn("Cannot delegate command '{}' for item '{}' to handler for channel '{}', " + "because no thing with the UID '{}' could be found.", command, link.getItemName(), link.getLinkedUID(), link.getLinkedUID().getThingUID());<NEW_LINE>}<NEW_LINE>}
ThingHandler handler = thing.getHandler();
1,512,327
private void printOccupancyInfo(JavaHeap theHeap, PrintStream out) {<NEW_LINE>long size = 0;<NEW_LINE>long totalObjectSize = 0;<NEW_LINE>// total number of objects on the heap<NEW_LINE>long totalObjects = 0;<NEW_LINE>// total number of corrupt objects<NEW_LINE>long totalCorruptObjects = 0;<NEW_LINE>Iterator<?> itSections = theHeap.getSections();<NEW_LINE>// object returned from various iterators<NEW_LINE>Object obj = null;<NEW_LINE>// corrupt data<NEW_LINE>CorruptData cdata = null;<NEW_LINE>while (itSections.hasNext()) {<NEW_LINE>obj = itSections.next();<NEW_LINE>if (obj instanceof CorruptData) {<NEW_LINE>// returned section is corrupt<NEW_LINE>cdata = (CorruptData) obj;<NEW_LINE>out.print("\t\t Warning - corrupt image section found");<NEW_LINE>if (cdata.getAddress() != null) {<NEW_LINE>out.print(" at 0x" + cdata.getAddress().toString());<NEW_LINE>}<NEW_LINE>out.print("\n");<NEW_LINE>} else {<NEW_LINE>// returned section is valid, so process it<NEW_LINE>ImageSection theSection = (ImageSection) obj;<NEW_LINE>size = size + theSection.getSize();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.print("\t Size of heap: " + size + " bytes\n");<NEW_LINE>Iterator<?> itObjects = theHeap.getObjects();<NEW_LINE>try {<NEW_LINE>while (itObjects.hasNext()) {<NEW_LINE>obj = itObjects.next();<NEW_LINE>totalObjects++;<NEW_LINE>if (obj instanceof CorruptData) {<NEW_LINE>totalCorruptObjects++;<NEW_LINE>cdata = (CorruptData) obj;<NEW_LINE>out.print("\t\t Warning - corrupt heap object found at position " + totalObjects);<NEW_LINE>if (cdata.getAddress() != null) {<NEW_LINE>out.print(" address 0x" + cdata.getAddress().toString());<NEW_LINE>}<NEW_LINE>out.print("\n");<NEW_LINE>} else {<NEW_LINE>JavaObject theObject = (JavaObject) obj;<NEW_LINE>totalObjectSize <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>float percentage = ((float) totalObjectSize / (float) size) * 10000;<NEW_LINE>// Sending this float through an int gets it down to 2 decimal places.<NEW_LINE>int trimmedPercent = ((int) percentage);<NEW_LINE>percentage = ((float) trimmedPercent) / 100;<NEW_LINE>out.print("\t Occupancy : " + totalObjectSize + " bytes (" + percentage + "%)\n");<NEW_LINE>out.print("\t Total objects : " + totalObjects + "\n");<NEW_LINE>out.print("\t Total corrupted objects : " + totalCorruptObjects + "\n");<NEW_LINE>} catch (CorruptDataException e) {<NEW_LINE>out.print("\t Occupancy : <unknown>\n");<NEW_LINE>}<NEW_LINE>}
= totalObjectSize + theObject.getSize();
1,306,701
public void parse(ReadableByteChannel dataSource, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException {<NEW_LINE>ByteBuffer content = ByteBuffer.allocate(CastUtils.l2i(contentSize));<NEW_LINE>dataSource.read(content);<NEW_LINE>((Buffer) content).position(6);<NEW_LINE>dataReferenceIndex = IsoTypeReader.readUInt16(content);<NEW_LINE>displayFlags = content.getInt();<NEW_LINE>textJustification = content.getInt();<NEW_LINE>backgroundR = IsoTypeReader.readUInt16(content);<NEW_LINE>backgroundG = IsoTypeReader.readUInt16(content);<NEW_LINE>backgroundB = IsoTypeReader.readUInt16(content);<NEW_LINE>defaultTextBox = IsoTypeReader.readUInt64(content);<NEW_LINE>reserved1 = IsoTypeReader.readUInt64(content);<NEW_LINE>fontNumber = content.getShort();<NEW_LINE>fontFace = content.getShort();<NEW_LINE>reserved2 = content.get();<NEW_LINE>reserved3 = content.getShort();<NEW_LINE><MASK><NEW_LINE>foregroundG = IsoTypeReader.readUInt16(content);<NEW_LINE>foregroundB = IsoTypeReader.readUInt16(content);<NEW_LINE>if (content.remaining() > 0) {<NEW_LINE>int length = IsoTypeReader.readUInt8(content);<NEW_LINE>byte[] myFontName = new byte[length];<NEW_LINE>content.get(myFontName);<NEW_LINE>fontName = new String(myFontName);<NEW_LINE>} else {<NEW_LINE>fontName = null;<NEW_LINE>}<NEW_LINE>// initContainer(); there are no child boxes!?<NEW_LINE>}
foregroundR = IsoTypeReader.readUInt16(content);
1,275,490
private boolean legalize_edge(Corner p_corner, Edge p_edge) {<NEW_LINE>if (p_edge.is_legal()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Triangle triangle_to_change;<NEW_LINE>if (p_edge.left_triangle.opposite_corner(p_edge) == p_corner) {<NEW_LINE>triangle_to_change = p_edge.right_triangle;<NEW_LINE>} else if (p_edge.right_triangle.opposite_corner(p_edge) == p_corner) {<NEW_LINE>triangle_to_change = p_edge.left_triangle;<NEW_LINE>} else {<NEW_LINE>FRLogger.warn("PlanarDelaunayTriangulation.legalize_edge: edge lines inconsistant");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Edge flipped_edge = p_edge.flip();<NEW_LINE>// Update the search graph.<NEW_LINE>this.search_graph.insert(flipped_edge.left_triangle, p_edge.left_triangle);<NEW_LINE>this.search_graph.insert(flipped_edge.right_triangle, p_edge.left_triangle);<NEW_LINE>this.search_graph.insert(flipped_edge.left_triangle, p_edge.right_triangle);<NEW_LINE>this.search_graph.insert(flipped_edge.right_triangle, p_edge.right_triangle);<NEW_LINE>// Call this function recursively for the other edge lines of triangle_to_change.<NEW_LINE>for (int i = 0; i < 3; ++i) {<NEW_LINE>Edge <MASK><NEW_LINE>if (curr_edge != p_edge) {<NEW_LINE>legalize_edge(p_corner, curr_edge);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
curr_edge = triangle_to_change.edge_lines[i];
1,490,584
public ProcessingConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ProcessingConfiguration processingConfiguration = new ProcessingConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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("Enabled", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>processingConfiguration.setEnabled(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Processors", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>processingConfiguration.setProcessors(new ListUnmarshaller<Processor>(ProcessorJsonUnmarshaller.getInstance(<MASK><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 processingConfiguration;<NEW_LINE>}
)).unmarshall(context));
1,015,406
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {<NEW_LINE>int horzPadding = getPaddingLeft() + getPaddingRight();<NEW_LINE>int vertPadding = getPaddingTop() + getPaddingBottom();<NEW_LINE>int childWidthMSpec, childHeightMSpec;<NEW_LINE>if (isChildRotated()) {<NEW_LINE>// Swap both measure specs, and subtracted paddings.<NEW_LINE>childWidthMSpec = MeasureSpec.makeMeasureSpec(Math.max(MeasureSpec.getSize(heightMeasureSpec) - vertPadding, 0), MeasureSpec.getMode(heightMeasureSpec));<NEW_LINE>childHeightMSpec = MeasureSpec.makeMeasureSpec(Math.max(MeasureSpec.getSize(widthMeasureSpec) - horzPadding, 0)<MASK><NEW_LINE>} else {<NEW_LINE>// Subtract the paddings from measure specs.<NEW_LINE>childWidthMSpec = MeasureSpec.makeMeasureSpec(Math.max(MeasureSpec.getSize(widthMeasureSpec) - horzPadding, 0), MeasureSpec.getMode(widthMeasureSpec));<NEW_LINE>childHeightMSpec = MeasureSpec.makeMeasureSpec(Math.max(MeasureSpec.getSize(heightMeasureSpec) - vertPadding, 0), MeasureSpec.getMode(heightMeasureSpec));<NEW_LINE>}<NEW_LINE>int maxChildWidth = 0, maxChildHeight = 0;<NEW_LINE>int childCount = getChildCount();<NEW_LINE>for (int i = 0; i < childCount; ++i) {<NEW_LINE>View child = getChildAt(i);<NEW_LINE>child.measure(childWidthMSpec, childHeightMSpec);<NEW_LINE>maxChildWidth = Math.max(maxChildWidth, child.getMeasuredWidth());<NEW_LINE>maxChildHeight = Math.max(maxChildHeight, child.getMeasuredHeight());<NEW_LINE>}<NEW_LINE>if (isChildRotated()) {<NEW_LINE>setMeasuredDimension(maxChildHeight + horzPadding, maxChildWidth + vertPadding);<NEW_LINE>} else {<NEW_LINE>setMeasuredDimension(maxChildWidth + horzPadding, maxChildHeight + vertPadding);<NEW_LINE>}<NEW_LINE>}
, MeasureSpec.getMode(widthMeasureSpec));
346,837
final DeleteImagePipelineResult executeDeleteImagePipeline(DeleteImagePipelineRequest deleteImagePipelineRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteImagePipelineRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteImagePipelineRequest> request = null;<NEW_LINE>Response<DeleteImagePipelineResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteImagePipelineRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteImagePipelineRequest));<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, "DeleteImagePipeline");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteImagePipelineResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteImagePipelineResultJsonUnmarshaller());<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, "imagebuilder");
1,631,365
static void showUpdateAvailableNotification(Context context, String title, String content, UpdateFrom updateFrom, URL apk, int smallIconResourceId) {<NEW_LINE>NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);<NEW_LINE>initNotificationChannel(context, notificationManager);<NEW_LINE>PendingIntent contentIntent = PendingIntent.getActivity(context, 0, context.getPackageManager().getLaunchIntentForPackage(UtilsLibrary.getAppPackageName(context)), PendingIntent.FLAG_CANCEL_CURRENT);<NEW_LINE>PendingIntent pendingIntentUpdate = PendingIntent.getActivity(context, 0, UtilsLibrary.intentToUpdate(context, updateFrom, apk), PendingIntent.FLAG_CANCEL_CURRENT);<NEW_LINE>NotificationCompat.Builder builder = getBaseNotification(context, contentIntent, title, content, smallIconResourceId).addAction(R.drawable.ic_system_update_white_24dp, context.getResources().getString(R.string.appupdater_btn_update), pendingIntentUpdate);<NEW_LINE>notificationManager.notify(<MASK><NEW_LINE>}
0, builder.build());
1,105,011
public int removeImageTypeOwner(ImageType imageType) throws ImageMgmtException {<NEW_LINE>final Set<ImageOwnership> currentOwners = new HashSet<>(getImageTypeOwnership(imageType.getName()));<NEW_LINE>final Set<ImageOwnership> ownersToRemove = new HashSet<>(imageType.getOwnerships());<NEW_LINE>ownersToRemove.retainAll(currentOwners);<NEW_LINE>currentOwners.removeAll(ownersToRemove);<NEW_LINE>// Check if it's removing all owners<NEW_LINE>if (!(currentOwners.size() > 1)) {<NEW_LINE>throw new ImageMgmtDaoException(ErrorCode.BAD_REQUEST, "Exception while deleting " + " image owners, need greater than two owners to be present");<NEW_LINE>}<NEW_LINE>int imageTypeId = getImageTypeByName(imageType.getName()).map(BaseModel::getId).orElse(0);<NEW_LINE>if (imageTypeId < 1) {<NEW_LINE>log.error(String.format("Exception while removing owner due to invalid " + "imageTypeId: %d.", imageTypeId));<NEW_LINE>throw new ImageMgmtDaoException(<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>for (final ImageOwnership imageOwnership : ownersToRemove) {<NEW_LINE>this.databaseOperator.update(DELETE_IMAGE_OWNERSHIP, imageTypeId, imageOwnership.getOwner());<NEW_LINE>}<NEW_LINE>log.info("Successfully removed owner(s) image type id :" + imageTypeId);<NEW_LINE>} catch (final SQLException e) {<NEW_LINE>log.error("Unable to update the image type metadata", e);<NEW_LINE>handleSqlException(e);<NEW_LINE>}<NEW_LINE>return imageTypeId;<NEW_LINE>}
ErrorCode.BAD_REQUEST, "Exception while removing " + "image owners. Invalid imageTypeId");
187,292
public static SubscriptionCriteria parse(String theCriteria) {<NEW_LINE>String criteria = trim(theCriteria);<NEW_LINE>if (isBlank(criteria)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (criteria.startsWith(Constants.SUBSCRIPTION_MULTITYPE_PREFIX)) {<NEW_LINE>if (criteria.endsWith(Constants.SUBSCRIPTION_MULTITYPE_SUFFIX)) {<NEW_LINE>String multitypeExpression = criteria.substring(1, criteria.length() - 1);<NEW_LINE>StringTokenizer tok = new StringTokenizer(multitypeExpression, ",");<NEW_LINE>tok.setTrimmerMatcher(new StringTrimmingTrimmerMatcher());<NEW_LINE>List<String> types = tok.getTokenList();<NEW_LINE>if (types.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (types.contains(Constants.SUBSCRIPTION_MULTITYPE_STAR)) {<NEW_LINE>return new SubscriptionCriteria(TypeEnum.STARTYPE_EXPRESSION, null, null);<NEW_LINE>}<NEW_LINE>Set<String> <MASK><NEW_LINE>return new SubscriptionCriteria(TypeEnum.MULTITYPE_EXPRESSION, null, typesSet);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (Character.isLetter(criteria.charAt(0))) {<NEW_LINE>String criteriaType = criteria;<NEW_LINE>int questionMarkIdx = criteriaType.indexOf('?');<NEW_LINE>if (questionMarkIdx > 0) {<NEW_LINE>criteriaType = criteriaType.substring(0, questionMarkIdx);<NEW_LINE>}<NEW_LINE>Set<String> types = Collections.singleton(criteriaType);<NEW_LINE>return new SubscriptionCriteria(TypeEnum.SEARCH_EXPRESSION, criteria, types);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
typesSet = Sets.newHashSet(types);
1,189,098
private Sequence checkOptionX(Sequence[] srcSeries, Sequence table, String[] names) {<NEW_LINE>if (option == null || option.indexOf('x') == -1 || table == null) {<NEW_LINE>return table;<NEW_LINE>}<NEW_LINE>ListBase1 mems = table.getMems();<NEW_LINE>int size = mems.size();<NEW_LINE>if (size == 0) {<NEW_LINE>return table;<NEW_LINE>}<NEW_LINE>int count = names.length;<NEW_LINE>int newCount = count;<NEW_LINE>boolean hasAllRecord = false;<NEW_LINE>boolean[] isAllRecord = new boolean[count];<NEW_LINE>int[<MASK><NEW_LINE>ArrayList<String> list = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>fcount[i] = srcSeries[i].dataStruct().getFieldCount();<NEW_LINE>isAllRecord[i] = true;<NEW_LINE>for (int j = 0; j < fcount[i]; j++) {<NEW_LINE>boolean b = isAllRecord(mems, i, j, list, names);<NEW_LINE>if (!b) {<NEW_LINE>isAllRecord[i] = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isAllRecord[i]) {<NEW_LINE>newCount += (fcount[i] - 1);<NEW_LINE>hasAllRecord = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!hasAllRecord) {<NEW_LINE>return table;<NEW_LINE>}<NEW_LINE>String[] newNames = new String[newCount];<NEW_LINE>list.toArray(newNames);<NEW_LINE>int findex = 0;<NEW_LINE>Table out = new Table(newNames);<NEW_LINE>for (int i = 1; i <= size; ++i) {<NEW_LINE>findex = 0;<NEW_LINE>Record record = out.newLast();<NEW_LINE>Record oldRecord = (Record) mems.get(i);<NEW_LINE>for (int j = 0; j < count; j++) {<NEW_LINE>if (isAllRecord[j]) {<NEW_LINE>Record subRecord = (Record) oldRecord.getFieldValue(j);<NEW_LINE>for (int f = 0; f < fcount[j]; f++) {<NEW_LINE>record.set(findex + f, subRecord.getFieldValue(f));<NEW_LINE>}<NEW_LINE>findex += fcount[j];<NEW_LINE>} else {<NEW_LINE>record.set(findex, oldRecord.getFieldValue(j));<NEW_LINE>findex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return out;<NEW_LINE>}
] fcount = new int[count];
39,224
public static Pair<Edge, NaviEdge> convertEdge(final INaviEdge edge, final NaviNode sourceNode, final NaviNode targetNode, final Graph2D graph2D, final boolean adjustColors) {<NEW_LINE>// Build the edge label if necessary<NEW_LINE>final ZyLabelContent content = ZyEdgeBuilder.buildContent(edge);<NEW_LINE>// Create the edge realizer of the new edge<NEW_LINE>final ZyEdgeRealizer<NaviEdge> realizer = new ZyEdgeRealizer<NaviEdge>(content, new CEdgeUpdater(edge));<NEW_LINE>// Create the edge<NEW_LINE>final Edge g2dEdge = graph2D.createEdge(sourceNode.getNode(), targetNode.getNode(), realizer);<NEW_LINE>// ATTENTION: If you change the switch below, you also have to update<NEW_LINE>// a comparable switch in ZyGraph.<NEW_LINE>if (adjustColors) {<NEW_LINE>EdgeInitializer.adjustColor(edge);<NEW_LINE>}<NEW_LINE>EdgeInitializer.initializeEdgeType(edge, realizer);<NEW_LINE>graph2D.getRealizer(g2dEdge).<MASK><NEW_LINE>// Associate user data with the edge<NEW_LINE>final NaviEdge zyEdge = new NaviEdge(sourceNode, targetNode, g2dEdge, realizer, edge);<NEW_LINE>NaviNode.link(sourceNode, targetNode);<NEW_LINE>final ZyEdgeData<NaviEdge> data = new ZyEdgeData<NaviEdge>(zyEdge);<NEW_LINE>realizer.setUserData(data);<NEW_LINE>return new Pair<Edge, NaviEdge>(g2dEdge, zyEdge);<NEW_LINE>}
setLineColor(edge.getColor());
685,144
public void doInTransactionWithoutResult(TransactionStatus status) {<NEW_LINE>for (String accountName : accountNamesFinal) {<NEW_LINE>Account permittedAccount = _accountDao.findActiveAccount(accountName, domain.getId());<NEW_LINE>if (permittedAccount != null) {<NEW_LINE>if (permittedAccount.getId() == caller.getId()) {<NEW_LINE>// don't grant permission to the template<NEW_LINE>continue;<NEW_LINE>// owner, they implicitly have permission<NEW_LINE>}<NEW_LINE>accountIds.<MASK><NEW_LINE>LaunchPermissionVO existingPermission = _launchPermissionDao.findByTemplateAndAccount(id, permittedAccount.getId());<NEW_LINE>if (existingPermission == null) {<NEW_LINE>LaunchPermissionVO launchPermission = new LaunchPermissionVO(id, permittedAccount.getId());<NEW_LINE>_launchPermissionDao.persist(launchPermission);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new InvalidParameterValueException("Unable to grant a launch permission to account " + accountName + " in domain id=" + domain.getUuid() + ", account not found. " + "No permissions updated, please verify the account names and retry.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
add(permittedAccount.getId());
78,126
private void addDocumentTypes(List<SDDocumentType> docList) {<NEW_LINE>LinkedList<NewDocumentType> lst = new LinkedList<>();<NEW_LINE>for (SDDocumentType doc : docList) {<NEW_LINE>lst.add(convert(doc));<NEW_LINE>model.getDocumentManager().add(lst.getLast());<NEW_LINE>}<NEW_LINE>Map<DataType, DataType> replacements = new IdentityHashMap<>();<NEW_LINE>for (NewDocumentType doc : lst) {<NEW_LINE>resolveTemporaries(doc.getAllTypes(), lst, replacements);<NEW_LINE>resolveTemporariesRecurse(doc.getContentStruct(), doc.getAllTypes(), lst, replacements);<NEW_LINE>}<NEW_LINE>for (NewDocumentType doc : lst) {<NEW_LINE>for (var entry : replacements.entrySet()) {<NEW_LINE><MASK><NEW_LINE>if (doc.getDataType(old.getId()) == old) {<NEW_LINE>doc.replace(entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
var old = entry.getKey();
106,301
private void cmp(Locatable locatable, int opIdx) {<NEW_LINE>assert opIdx >= UnitCompiler<MASK><NEW_LINE>VerificationTypeInfo operand2 = this.getCodeContext().currentInserter().getStackMap().peekOperand();<NEW_LINE>this.getCodeContext().popOperand();<NEW_LINE>VerificationTypeInfo operand1 = this.getCodeContext().currentInserter().getStackMap().peekOperand();<NEW_LINE>this.getCodeContext().popOperand();<NEW_LINE>if (operand1 == StackMapTableAttribute.LONG_VARIABLE_INFO && operand2 == StackMapTableAttribute.LONG_VARIABLE_INFO) {<NEW_LINE>this.write(Opcode.LCMP);<NEW_LINE>} else if (operand1 == StackMapTableAttribute.FLOAT_VARIABLE_INFO && operand2 == StackMapTableAttribute.FLOAT_VARIABLE_INFO) {<NEW_LINE>this.write(opIdx == UnitCompiler.GE || opIdx == UnitCompiler.GT ? Opcode.FCMPL : Opcode.FCMPG);<NEW_LINE>} else if (operand1 == StackMapTableAttribute.DOUBLE_VARIABLE_INFO && operand2 == StackMapTableAttribute.DOUBLE_VARIABLE_INFO) {<NEW_LINE>this.write(opIdx == UnitCompiler.GE || opIdx == UnitCompiler.GT ? Opcode.DCMPL : Opcode.DCMPG);<NEW_LINE>} else {<NEW_LINE>throw new AssertionError(operand1 + " and " + operand2);<NEW_LINE>}<NEW_LINE>this.getCodeContext().pushIntOperand();<NEW_LINE>}
.EQ && opIdx <= UnitCompiler.LE;
1,389,683
final UpdateResourceEventConfigurationResult executeUpdateResourceEventConfiguration(UpdateResourceEventConfigurationRequest updateResourceEventConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateResourceEventConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateResourceEventConfigurationRequest> request = null;<NEW_LINE>Response<UpdateResourceEventConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateResourceEventConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateResourceEventConfigurationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT Wireless");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateResourceEventConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateResourceEventConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateResourceEventConfigurationResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,344,548
public void addDebugText(List<String> messages) {<NEW_LINE><MASK><NEW_LINE>messages.add("[Iris] Shadow Distance Terrain: " + terrainFrustumHolder.getDistanceInfo() + " Entity: " + entityFrustumHolder.getDistanceInfo());<NEW_LINE>messages.add("[Iris] Shadow Culling Terrain: " + terrainFrustumHolder.getCullingInfo() + " Entity: " + entityFrustumHolder.getCullingInfo());<NEW_LINE>messages.add("[Iris] Shadow Terrain: " + debugStringTerrain + (shouldRenderTerrain ? "" : " (no terrain) ") + (shouldRenderTranslucent ? "" : "(no translucent)"));<NEW_LINE>messages.add("[Iris] Shadow Entities: " + getEntitiesDebugString());<NEW_LINE>messages.add("[Iris] Shadow Block Entities: " + getBlockEntitiesDebugString());<NEW_LINE>if (buffers instanceof DrawCallTrackingRenderBuffers && shouldRenderEntities) {<NEW_LINE>DrawCallTrackingRenderBuffers drawCallTracker = (DrawCallTrackingRenderBuffers) buffers;<NEW_LINE>messages.add("[Iris] Shadow Entity Batching: " + BatchingDebugMessageHelper.getDebugMessage(drawCallTracker));<NEW_LINE>}<NEW_LINE>}
messages.add("[Iris] Shadow Maps: " + debugStringOverall);
61,014
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_map_realtime);<NEW_LINE>Toolbar toolbar = findViewById(R.id.toolbar);<NEW_LINE>setSupportActionBar(toolbar);<NEW_LINE>ButterKnife.bind(this);<NEW_LINE>mHandler = new Handler(Looper.getMainLooper());<NEW_LINE>mMap = findViewById(R.id.map);<NEW_LINE>scrollView.setVisibility(View.GONE);<NEW_LINE>SharedPreferences <MASK><NEW_LINE>mToken = mSharedPreferences.getString(USER_TOKEN, null);<NEW_LINE>initMap();<NEW_LINE>setTitle("Map View");<NEW_LINE>// Get user's current location<NEW_LINE>tracker = new GPSTracker(this);<NEW_LINE>if (!tracker.canGetLocation()) {<NEW_LINE>tracker.displayLocationRequest(this, mMap);<NEW_LINE>} else {<NEW_LINE>mCurlat = Double.toString(tracker.getLatitude());<NEW_LINE>mCurlon = Double.toString(tracker.getLongitude());<NEW_LINE>showDialogToSelectitems();<NEW_LINE>}<NEW_LINE>Objects.requireNonNull(getSupportActionBar()).setHomeButtonEnabled(true);<NEW_LINE>getSupportActionBar().setDisplayHomeAsUpEnabled(true);<NEW_LINE>}
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
521,950
public List<CompletionItem> complete() {<NEW_LINE>namePrefix = ctx.getPrefix();<NEW_LINE>if (namePrefix.startsWith("<")) {<NEW_LINE>namePrefix = namePrefix.substring(1);<NEW_LINE>}<NEW_LINE>int dot = namePrefix.indexOf('.');<NEW_LINE>if (dot != -1) {<NEW_LINE>packagePrefix = namePrefix.substring(0, dot);<NEW_LINE>namePrefix = namePrefix.substring(dot + 1);<NEW_LINE>}<NEW_LINE>TypeMirror tm = getPropertyType();<NEW_LINE>if (tm != null && tm.getKind() != TypeKind.DECLARED) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Set<ElementHandle<TypeElement>> handles;<NEW_LINE>if (ctx.getCompletionType() == CompletionProvider.COMPLETION_QUERY_TYPE) {<NEW_LINE>handles = loadImportedClasses();<NEW_LINE>List<CompletionItem> items = createItems(handles, IMPORTED_PRIORITY);<NEW_LINE>if (!items.isEmpty()) {<NEW_LINE>moreItems = true;<NEW_LINE>return items;<NEW_LINE>}<NEW_LINE>} else if (ctx.getCompletionType() != CompletionProvider.COMPLETION_ALL_QUERY_TYPE) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Set<ElementHandle<TypeElement>> nodeCandidates = loadDescenantsOfNode();<NEW_LINE>List<CompletionItem> items = new ArrayList<CompletionItem>();<NEW_LINE>items.addAll(createItems(nodeCandidates, NODE_PRIORITY));<NEW_LINE>// offer all classes for some prefixes<NEW_LINE>if (!namePrefix.isEmpty()) {<NEW_LINE>Set<ElementHandle<TypeElement>> allCandidates = new HashSet<ElementHandle<<MASK><NEW_LINE>allCandidates.removeAll(nodeCandidates);<NEW_LINE>items.addAll(createItems(allCandidates, OTHER_PRIORITY));<NEW_LINE>}<NEW_LINE>return items;<NEW_LINE>}
TypeElement>>(loadFromAllTypes());
501,558
public void run(RegressionEnvironment env) {<NEW_LINE>SupportContextListener listener = new SupportContextListener(env);<NEW_LINE>env.runtime().getContextPartitionService().addContextStateListener(listener);<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@name('ctx') @public create context MyContext start SupportBean_S0 as s0 end SupportBean_S1", path);<NEW_LINE>String depIdCtx = env.deploymentId("ctx");<NEW_LINE>listener.assertAndReset(eventContext(depIdCtx, "MyContext", ContextStateEventContextCreated.class));<NEW_LINE>env.compileDeploy("@name('s0') context MyContext select count(*) from SupportBean", path);<NEW_LINE>String depIdStmt = env.deploymentId("s0");<NEW_LINE>listener.assertAndReset(eventContextWStmt(depIdCtx, "MyContext", ContextStateEventContextStatementAdded.class, depIdStmt, "s0"), eventContext(depIdCtx, "MyContext", ContextStateEventContextActivated.class));<NEW_LINE>env.sendEventBean(new SupportBean_S0(1));<NEW_LINE>listener.assertAndReset(eventPartitionInitTerm(depIdCtx, "MyContext", ContextStateEventContextPartitionAllocated.class));<NEW_LINE>env.sendEventBean(new SupportBean_S1(1));<NEW_LINE>listener.assertAndReset(eventPartitionInitTerm(depIdCtx, "MyContext", ContextStateEventContextPartitionDeallocated.class));<NEW_LINE>env.undeployModuleContaining("s0");<NEW_LINE>listener.assertAndReset(eventContextWStmt(depIdCtx, "MyContext", ContextStateEventContextStatementRemoved.class, depIdStmt, "s0"), eventContext(depIdCtx, "MyContext", ContextStateEventContextDeactivated.class));<NEW_LINE>env.undeployModuleContaining("ctx");<NEW_LINE>listener.assertAndReset(eventContext(depIdCtx, "MyContext", ContextStateEventContextDestroyed.class));<NEW_LINE>env.runtime()<MASK><NEW_LINE>}
.getContextPartitionService().removeContextStateListeners();
1,302,287
public boolean load(String date, Collection<Integer> hashes, int serverId) {<NEW_LINE>if (hashes == null || hashes.size() == 0)<NEW_LINE>return false;<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("date", date);<NEW_LINE>param.put("type", type);<NEW_LINE>ListValue hashLv = param.newList("hash");<NEW_LINE>Iterator<Integer> itr = hashes.iterator();<NEW_LINE>Set<Integer> failedSet = failedHashesInScope.get();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>int key = itr.next();<NEW_LINE>if (entries.containsKey(key) == false) {<NEW_LINE>if (scopeStarted.get() == true && failedSet.contains(key)) {<NEW_LINE>// skip<NEW_LINE>} else {<NEW_LINE>hashLv.add(key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hashLv.size() == 0)<NEW_LINE>return false;<NEW_LINE>List<Pack> packList;<NEW_LINE>try (TcpProxy tcp = TcpProxy.getTcpProxy(serverId)) {<NEW_LINE>packList = tcp.process(cmd, param);<NEW_LINE>}<NEW_LINE>if (packList == null)<NEW_LINE>return false;<NEW_LINE>for (Pack pack : packList) {<NEW_LINE>MapPack re = (MapPack) pack;<NEW_LINE>Iterator<String> en = re.keys();<NEW_LINE>while (en.hasNext()) {<NEW_LINE><MASK><NEW_LINE>String value = re.getText(key);<NEW_LINE>if (StringUtil.isNotEmpty(value)) {<NEW_LINE>int resultKey = (int) Hexa32.toLong32(key);<NEW_LINE>cache(resultKey, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (scopeStarted.get() == true) {<NEW_LINE>for (int i = 0; i < hashLv.size(); i++) {<NEW_LINE>if (entries.containsKey(hashLv.getInt(i)) == false) {<NEW_LINE>failedSet.add(hashLv.getInt(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
String key = en.next();
466,919
void add(String field, int docUpTo, int ord, boolean hasValue) {<NEW_LINE>assert finished == false : "buffer was finished already";<NEW_LINE>if (fields[0].equals(field) == false || fields.length != 1) {<NEW_LINE>if (fields.length <= ord) {<NEW_LINE>String[] array = ArrayUtil.grow(fields, ord + 1);<NEW_LINE>if (fields.length == 1) {<NEW_LINE>Arrays.fill(array, 1, ord, fields[0]);<NEW_LINE>}<NEW_LINE>bytesUsed.addAndGet((array.length - fields.length) * RamUsageEstimator.NUM_BYTES_OBJECT_REF);<NEW_LINE>fields = array;<NEW_LINE>}<NEW_LINE>if (field != fields[0]) {<NEW_LINE>// that's an easy win of not accounting if there is an outlier<NEW_LINE>bytesUsed.addAndGet(sizeOfString(field));<NEW_LINE>}<NEW_LINE>fields[ord] = field;<NEW_LINE>}<NEW_LINE>if (docsUpTo[0] != docUpTo || docsUpTo.length != 1) {<NEW_LINE>if (docsUpTo.length <= ord) {<NEW_LINE>int[] array = ArrayUtil.grow(docsUpTo, ord + 1);<NEW_LINE>if (docsUpTo.length == 1) {<NEW_LINE>Arrays.fill(array, 1, ord, docsUpTo[0]);<NEW_LINE>}<NEW_LINE>bytesUsed.addAndGet((array.length - docsUpTo.length) * Integer.BYTES);<NEW_LINE>docsUpTo = array;<NEW_LINE>}<NEW_LINE>docsUpTo[ord] = docUpTo;<NEW_LINE>}<NEW_LINE>if (hasValue == false || hasValues != null) {<NEW_LINE>if (hasValues == null) {<NEW_LINE>hasValues <MASK><NEW_LINE>hasValues.set(0, ord);<NEW_LINE>bytesUsed.addAndGet(hasValues.ramBytesUsed());<NEW_LINE>} else if (hasValues.length() <= ord) {<NEW_LINE>FixedBitSet fixedBitSet = FixedBitSet.ensureCapacity(hasValues, ArrayUtil.oversize(ord + 1, 1));<NEW_LINE>bytesUsed.addAndGet(fixedBitSet.ramBytesUsed() - hasValues.ramBytesUsed());<NEW_LINE>hasValues = fixedBitSet;<NEW_LINE>}<NEW_LINE>if (hasValue) {<NEW_LINE>hasValues.set(ord);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new FixedBitSet(ord + 1);
217,875
protected Object createNode(JSContext context, JSBuiltin builtin, boolean construct, boolean newTarget, Reflect builtinEnum) {<NEW_LINE>assert context.getEcmaScriptVersion() >= 6;<NEW_LINE>switch(builtinEnum) {<NEW_LINE>case apply:<NEW_LINE>return ReflectApplyNodeGen.create(context, builtin, args().fixedArgs(3).createArgumentNodes(context));<NEW_LINE>case construct:<NEW_LINE>return ReflectConstructNodeGen.create(context, builtin, args().fixedArgs(2).varArgs().createArgumentNodes(context));<NEW_LINE>case defineProperty:<NEW_LINE>return ReflectDefinePropertyNodeGen.create(context, builtin, args().fixedArgs(3).createArgumentNodes(context));<NEW_LINE>case deleteProperty:<NEW_LINE>return ReflectDeletePropertyNodeGen.create(context, builtin, args().fixedArgs(2).createArgumentNodes(context));<NEW_LINE>case get:<NEW_LINE>return ReflectGetNodeGen.create(context, builtin, args().fixedArgs(2).varArgs().createArgumentNodes(context));<NEW_LINE>case getOwnPropertyDescriptor:<NEW_LINE>return ReflectGetOwnPropertyDescriptorNodeGen.create(context, builtin, args().fixedArgs(<MASK><NEW_LINE>case getPrototypeOf:<NEW_LINE>return ReflectGetPrototypeOfNodeGen.create(context, builtin, args().fixedArgs(1).createArgumentNodes(context));<NEW_LINE>case has:<NEW_LINE>return ReflectHasNodeGen.create(context, builtin, args().fixedArgs(2).createArgumentNodes(context));<NEW_LINE>case isExtensible:<NEW_LINE>return ReflectIsExtensibleNodeGen.create(context, builtin, args().fixedArgs(1).createArgumentNodes(context));<NEW_LINE>case ownKeys:<NEW_LINE>return ReflectOwnKeysNodeGen.create(context, builtin, args().fixedArgs(1).createArgumentNodes(context));<NEW_LINE>case preventExtensions:<NEW_LINE>return ReflectPreventExtensionsNodeGen.create(context, builtin, args().fixedArgs(1).createArgumentNodes(context));<NEW_LINE>case set:<NEW_LINE>return ReflectSetNodeGen.create(context, builtin, args().fixedArgs(3).varArgs().createArgumentNodes(context));<NEW_LINE>case setPrototypeOf:<NEW_LINE>return ReflectSetPrototypeOfNodeGen.create(context, builtin, args().fixedArgs(2).createArgumentNodes(context));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
2).createArgumentNodes(context));
512,833
public int reactTagForTouch(float touchX, float touchY) {<NEW_LINE>CharSequence text = getText();<NEW_LINE>int target = getId();<NEW_LINE>int x = (int) touchX;<NEW_LINE>int y = (int) touchY;<NEW_LINE>Layout layout = getLayout();<NEW_LINE>if (layout == null) {<NEW_LINE>// If the layout is null, the view hasn't been properly laid out yet. Therefore, we can't find<NEW_LINE>// the exact text tag that has been touched, and the correct tag to return is the default one.<NEW_LINE>return target;<NEW_LINE>}<NEW_LINE>int line = layout.getLineForVertical(y);<NEW_LINE>int lineStartX = (int) layout.getLineLeft(line);<NEW_LINE>int lineEndX = (int) layout.getLineRight(line);<NEW_LINE>// TODO(5966918): Consider extending touchable area for text spans by some DP constant<NEW_LINE>if (text instanceof Spanned && x >= lineStartX && x <= lineEndX) {<NEW_LINE>Spanned spannedText = (Spanned) text;<NEW_LINE>int index = -1;<NEW_LINE>try {<NEW_LINE>index = layout.getOffsetForHorizontal(line, x);<NEW_LINE>} catch (ArrayIndexOutOfBoundsException e) {<NEW_LINE>// https://issuetracker.google.com/issues/113348914<NEW_LINE>FLog.e(ReactConstants.TAG, "Crash in HorizontalMeasurementProvider: " + e.getMessage());<NEW_LINE>return target;<NEW_LINE>}<NEW_LINE>// We choose the most inner span (shortest) containing character at the given index<NEW_LINE>// if no such span can be found we will send the textview's react id as a touch handler<NEW_LINE>// In case when there are more than one spans with same length we choose the last one<NEW_LINE>// from the spans[] array, since it correspond to the most inner react element<NEW_LINE>ReactTagSpan[] spans = spannedText.getSpans(index, index, ReactTagSpan.class);<NEW_LINE>if (spans != null) {<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < spans.length; i++) {<NEW_LINE>int spanStart = spannedText.getSpanStart(spans[i]);<NEW_LINE>int spanEnd = spannedText.getSpanEnd(spans[i]);<NEW_LINE>if (spanEnd >= index && (spanEnd - spanStart) <= targetSpanTextLength) {<NEW_LINE>target = spans[i].getReactTag();<NEW_LINE>targetSpanTextLength = (spanEnd - spanStart);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return target;<NEW_LINE>}
int targetSpanTextLength = text.length();
1,477,200
public static final SipURI creatLocalRouteHeader(SipServletRequestImpl request, Serializable stateInfo) {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>c_logger.traceEntry(SipUtil.class, "creatLocalRouteHeader", new Object[] { request, stateInfo });<NEW_LINE>}<NEW_LINE>SipProvider provider = request.getSipProvider();<NEW_LINE>ListeningPoint lp = provider.getListeningPoint();<NEW_LINE>String host = null;<NEW_LINE>int port = -1;<NEW_LINE>String transport = null;<NEW_LINE>host = lp.getSentBy();<NEW_LINE>port = lp.getPort();<NEW_LINE>// Take transport from listening point to make sure they match<NEW_LINE>transport = ((ListeningPointImpl) lp).isSecure() ? "TLS" : lp.getTransport();<NEW_LINE>SipURI routeUri = null;<NEW_LINE>try {<NEW_LINE>SipURL url = AddressFactoryImpl.createSipURL(null, null, null, host, port, null, null, null, transport);<NEW_LINE>routeUri = new SipURIImpl(url);<NEW_LINE>// set the route header parameters<NEW_LINE>routeUri.setParameter(SipURIImpl.LR, "");<NEW_LINE>routeUri.setParameter(IBM_ROUTE_BACK_PARAM, "");<NEW_LINE>if (stateInfo != null) {<NEW_LINE>SipApplicationSessionImpl sas = (SipApplicationSessionImpl) SipServletsFactoryImpl.getInstance().createApplicationSession();<NEW_LINE>// we do not need this SAS to use the invalidate when ready mechanism, we will invalidate it when the request is routed back to the container<NEW_LINE>sas.setInvalidateWhenReady(false);<NEW_LINE>// add the encoded uri parameter so the request that is routed back will be routed to this specific container, this is because<NEW_LINE>// this container has the SAS with the stateInfo information<NEW_LINE>routeUri.setParameter(SipApplicationSessionImpl.ENCODED_APP_SESSION_ID, sas.getId());<NEW_LINE>// put the infoState as a sip app session attribute for future use when the request is routed back to this container<NEW_LINE>sas.setAttribute(IBM_STATE_INFO_ATTR, stateInfo);<NEW_LINE>}<NEW_LINE>} catch (SipParseException e) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(SipUtil.class, "creatLocalRouteHeader", "failed to create the route back route header", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>c_logger.traceExit(<MASK><NEW_LINE>}<NEW_LINE>return routeUri;<NEW_LINE>}
SipUtil.class, "creatLocalRouteHeader", routeUri);
1,624,099
private void ensureParent(Box box, AbstractTreeItem child) {<NEW_LINE>if (child.parent == null) {<NEW_LINE>if (child instanceof TableHeadStructualElement || child instanceof TableFootStructualElement) {<NEW_LINE>child.parent = (TableStructualElement) box.getParent().getAccessibilityObject();<NEW_LINE>} else if (child instanceof TableBodyStructualElement) {<NEW_LINE>child.parent = (TableStructualElement) box.getParent().getAccessibilityObject();<NEW_LINE>((TableStructualElement) child.parent).tbodies<MASK><NEW_LINE>} else if (box.getParent() != null) {<NEW_LINE>AbstractStructualElement parent = (AbstractStructualElement) box.getParent().getAccessibilityObject();<NEW_LINE>parent.addChild(child);<NEW_LINE>child.parent = parent;<NEW_LINE>} else {<NEW_LINE>_root.children.add(child);<NEW_LINE>child.parent = _root;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.add((TableBodyStructualElement) child);
126,123
default int reserveTickets(String reservationId, List<Integer> ticketIds, TicketCategory category, String userLanguage, PriceContainer.VatStatus vatStatus, IntFunction<String> ticketMetadataSupplier) {<NEW_LINE>var idx = new AtomicInteger();<NEW_LINE>var batchReserveParameters = ticketIds.stream().map(id -> new MapSqlParameterSource("reservationId", reservationId).addValue("id", id).addValue("categoryId", category.getId()).addValue("userLanguage", userLanguage).addValue("srcPriceCts", category.getSrcPriceCts()).addValue("currencyCode", category.getCurrencyCode()).addValue("ticketMetadata", Objects.requireNonNullElse(ticketMetadataSupplier.apply(idx.getAndIncrement()), "{}")).addValue("vatStatus", vatStatus.name())).<MASK><NEW_LINE>return (int) Arrays.stream(getNamedParameterJdbcTemplate().batchUpdate(batchReserveTickets(), batchReserveParameters)).asLongStream().sum();<NEW_LINE>}
toArray(MapSqlParameterSource[]::new);
531,443
public static int interpolateColor(int[] colors, float proportion) {<NEW_LINE>int rTotal = 0, gTotal = 0, bTotal = 0;<NEW_LINE>// We correct the ratio to colors.length - 1 so that<NEW_LINE>// for i == colors.length - 1 and p == 1, then the final ratio is 1 (see below)<NEW_LINE>float p = proportion * (colors.length - 1);<NEW_LINE>for (int i = 0; i < colors.length; i++) {<NEW_LINE>// The ratio mostly resides on the 1 - Math.abs(p - i) calculation :<NEW_LINE>// Since for p == i, then the ratio is 1 and for p == i + 1 or p == i -1, then the ratio is 0<NEW_LINE>// This calculation works BECAUSE p lies within [0, length - 1] and i lies within [0, length - 1] as well<NEW_LINE>float iRatio = Math.max(1 - Math.abs<MASK><NEW_LINE>rTotal += (int) (Color.red(colors[i]) * iRatio);<NEW_LINE>gTotal += (int) (Color.green(colors[i]) * iRatio);<NEW_LINE>bTotal += (int) (Color.blue(colors[i]) * iRatio);<NEW_LINE>}<NEW_LINE>return Color.rgb(rTotal, gTotal, bTotal);<NEW_LINE>}
(p - i), 0.0f);
1,202,401
public WebGraphQlHandler build() {<NEW_LINE>Chain endOfChain = request -> this.service.execute(request<MASK><NEW_LINE>Chain executionChain = this.interceptors.stream().reduce(WebGraphQlInterceptor::andThen).map(interceptor -> interceptor.apply(endOfChain)).orElse(endOfChain);<NEW_LINE>ThreadLocalAccessor accessor = (CollectionUtils.isEmpty(this.accessors) ? null : ThreadLocalAccessor.composite(this.accessors));<NEW_LINE>return new WebGraphQlHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public WebSocketGraphQlInterceptor getWebSocketInterceptor() {<NEW_LINE>return (webSocketInterceptor != null ? webSocketInterceptor : new WebSocketGraphQlInterceptor() {<NEW_LINE>});<NEW_LINE>}<NEW_LINE><NEW_LINE>@Nullable<NEW_LINE>@Override<NEW_LINE>public ThreadLocalAccessor getThreadLocalAccessor() {<NEW_LINE>return accessor;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Mono<WebGraphQlResponse> handleRequest(WebGraphQlRequest request) {<NEW_LINE>return executionChain.next(request).contextWrite(context -> {<NEW_LINE>if (accessor != null) {<NEW_LINE>return ReactorContextManager.extractThreadLocalValues(accessor, context);<NEW_LINE>}<NEW_LINE>return context;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
).map(WebGraphQlResponse::new);
1,332,907
final GetCanaryRunsResult executeGetCanaryRuns(GetCanaryRunsRequest getCanaryRunsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getCanaryRunsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetCanaryRunsRequest> request = null;<NEW_LINE>Response<GetCanaryRunsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetCanaryRunsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getCanaryRunsRequest));<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, "synthetics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetCanaryRuns");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetCanaryRunsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetCanaryRunsResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig);
1,424,754
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(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, "Migration Hub Refactor Spaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<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(untagResourceRequest));
225,900
public Page<Task> tasks(Pageable pageable, GetTasksPayload getTasksPayload) {<NEW_LINE>TaskQuery taskQuery = taskService.createTaskQuery();<NEW_LINE>if (getTasksPayload == null) {<NEW_LINE>getTasksPayload = TaskPayloadBuilder.tasks().build();<NEW_LINE>}<NEW_LINE>String authenticatedUserId = securityManager.getAuthenticatedUserId();<NEW_LINE>if (authenticatedUserId != null && !authenticatedUserId.isEmpty()) {<NEW_LINE>List<String> userGroups = securityManager.getAuthenticatedUserGroups();<NEW_LINE>getTasksPayload.setAssigneeId(authenticatedUserId);<NEW_LINE>getTasksPayload.setGroups(userGroups);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("You need an authenticated user to perform a task query");<NEW_LINE>}<NEW_LINE>taskQuery = taskQuery.or().taskCandidateOrAssigned(getTasksPayload.getAssigneeId(), getTasksPayload.getGroups()).<MASK><NEW_LINE>if (getTasksPayload.getProcessInstanceId() != null) {<NEW_LINE>taskQuery = taskQuery.processInstanceId(getTasksPayload.getProcessInstanceId());<NEW_LINE>}<NEW_LINE>if (getTasksPayload.getParentTaskId() != null) {<NEW_LINE>taskQuery = taskQuery.taskParentTaskId(getTasksPayload.getParentTaskId());<NEW_LINE>}<NEW_LINE>List<Task> tasks = taskConverter.from(taskQuery.listPage(pageable.getStartIndex(), pageable.getMaxItems()));<NEW_LINE>return new PageImpl<>(tasks, Math.toIntExact(taskQuery.count()));<NEW_LINE>}
taskOwner(authenticatedUserId).endOr();
677,878
public RegisterAppInstanceUserEndpointResult registerAppInstanceUserEndpoint(RegisterAppInstanceUserEndpointRequest registerAppInstanceUserEndpointRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(registerAppInstanceUserEndpointRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RegisterAppInstanceUserEndpointRequest> request = null;<NEW_LINE>Response<RegisterAppInstanceUserEndpointResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RegisterAppInstanceUserEndpointRequestMarshaller().marshall(registerAppInstanceUserEndpointRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<RegisterAppInstanceUserEndpointResult, JsonUnmarshallerContext> unmarshaller = new RegisterAppInstanceUserEndpointResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<RegisterAppInstanceUserEndpointResult> responseHandler = new JsonResponseHandler<RegisterAppInstanceUserEndpointResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(<MASK><NEW_LINE>}<NEW_LINE>}
awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
360,083
protected void validateModelSpecificInfo() throws InvalidDataTypeException {<NEW_LINE>Program program = getProgram();<NEW_LINE>// Num1 is dword at SIGNATURE_OFFSET.<NEW_LINE>// No additional validation for this yet.<NEW_LINE>// Num2 is dword at ATTRIBUTES_OFFSET.<NEW_LINE>// No additional validation for this yet.<NEW_LINE>// Next four bytes after 2 dwords should be number of RTTI1 pointers in RTTI2.<NEW_LINE>int rtti1Count = getRtti1Count();<NEW_LINE>if (rtti1Count < 1 || rtti1Count > MAX_RTTI_1_COUNT) {<NEW_LINE>// For now assume we shouldn't be seeing more than 1000 pointers in RTTI2.<NEW_LINE>throw new InvalidDataTypeException(getName() + " data type at " + getAddress() + " doesn't have a valid " + Rtti1Model.DATA_TYPE_NAME + " count.");<NEW_LINE>}<NEW_LINE>boolean validateReferredToData = validationOptions.shouldValidateReferredToData();<NEW_LINE>// Last component should refer to RTTI2.<NEW_LINE>Address rtti2Address = getRtti2Address();<NEW_LINE>if (rtti2Address == null) {<NEW_LINE>throw new InvalidDataTypeException(getName() + " data type at " + getAddress() + <MASK><NEW_LINE>}<NEW_LINE>rtti2Model = new Rtti2Model(program, rtti1Count, rtti2Address, validationOptions);<NEW_LINE>if (validateReferredToData) {<NEW_LINE>rtti2Model.validate();<NEW_LINE>} else if (!rtti2Model.isLoadedAndInitializedAddress()) {<NEW_LINE>throw new InvalidDataTypeException("Data referencing " + rtti2Model.getName() + " data type isn't a loaded and initialized address " + rtti2Address + ".");<NEW_LINE>}<NEW_LINE>}
" doesn't refer to a valid location for the " + Rtti2Model.DATA_TYPE_NAME + ".");
1,508,375
private static void fillApiDeclarationOutRepresentation(Operation operation, ResourceOperationDeclaration rod, Collection<String> usedModels) {<NEW_LINE>// Get out representation<NEW_LINE>PayLoad outRepr = null;<NEW_LINE>for (Response response : operation.getResponses()) {<NEW_LINE>if (Status.isSuccess(response.getCode())) {<NEW_LINE>outRepr = response.getOutputPayLoad();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (outRepr != null && outRepr.getType() != null) {<NEW_LINE>if (outRepr.isArray()) {<NEW_LINE>rod.setType("array");<NEW_LINE>if (Types.isPrimitiveType(outRepr.getType())) {<NEW_LINE>SwaggerTypeFormat swaggerTypeFormat = SwaggerTypes.toSwaggerType(outRepr.getType());<NEW_LINE>rod.getItems().<MASK><NEW_LINE>rod.getItems().setFormat(swaggerTypeFormat.getFormat());<NEW_LINE>} else {<NEW_LINE>rod.getItems().setRef(outRepr.getType());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>rod.setType(outRepr.getType());<NEW_LINE>}<NEW_LINE>usedModels.add(outRepr.getType());<NEW_LINE>} else {<NEW_LINE>rod.setType("void");<NEW_LINE>}<NEW_LINE>}
setType(swaggerTypeFormat.getType());
599,920
private Map<String, Object> normalizeHeaders(Map<String, Object> headers) {<NEW_LINE>Map<String, Object> normalizedHeaders = new HashMap<>();<NEW_LINE>for (Entry<String, Object> entry : headers.entrySet()) {<NEW_LINE>String headerName = entry.getKey();<NEW_LINE>Object headerValue = entry.getValue();<NEW_LINE>if (headerValue instanceof Bson) {<NEW_LINE>Bson source = (Bson) headerValue;<NEW_LINE>Map<String, Object> document = asMap(source);<NEW_LINE>try {<NEW_LINE>Class<?> typeClass = null;<NEW_LINE>if (document.containsKey(CLASS)) {<NEW_LINE>Object type = document.get(CLASS);<NEW_LINE>typeClass = ClassUtils.forName(type.toString(), MongoDbMessageStore.this.classLoader);<NEW_LINE>} else if (source instanceof BasicDBList) {<NEW_LINE>typeClass = List.class;<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unsupported 'Bson' type: " + source.getClass());<NEW_LINE>}<NEW_LINE>normalizedHeaders.put(headerName, super.read(typeClass, source));<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("Header '" + headerName + "' could not be deserialized.", e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return normalizedHeaders;<NEW_LINE>}
normalizedHeaders.put(headerName, headerValue);
1,252,771
public static void computeNormalization(List<AssociatedPair> points, NormalizationPoint2D N1, NormalizationPoint2D N2) {<NEW_LINE>double meanX1 = 0;<NEW_LINE>double meanY1 = 0;<NEW_LINE>double meanX2 = 0;<NEW_LINE>double meanY2 = 0;<NEW_LINE>for (int pointIdx = 0; pointIdx < points.size(); pointIdx++) {<NEW_LINE>AssociatedPair p = points.get(pointIdx);<NEW_LINE>meanX1 += p.p1.x;<NEW_LINE>meanY1 += p.p1.y;<NEW_LINE>meanX2 += p.p2.x;<NEW_LINE>meanY2 += p.p2.y;<NEW_LINE>}<NEW_LINE>meanX1 /= points.size();<NEW_LINE>meanY1 /= points.size();<NEW_LINE>meanX2 /= points.size();<NEW_LINE>meanY2 /= points.size();<NEW_LINE>double stdX1 = 0;<NEW_LINE>double stdY1 = 0;<NEW_LINE>double stdX2 = 0;<NEW_LINE>double stdY2 = 0;<NEW_LINE>for (int pointIdx = 0; pointIdx < points.size(); pointIdx++) {<NEW_LINE>AssociatedPair p = points.get(pointIdx);<NEW_LINE>double dx = p.p1.x - meanX1;<NEW_LINE>double dy = p.p1.y - meanY1;<NEW_LINE>stdX1 += dx * dx;<NEW_LINE>stdY1 += dy * dy;<NEW_LINE>dx <MASK><NEW_LINE>dy = p.p2.y - meanY2;<NEW_LINE>stdX2 += dx * dx;<NEW_LINE>stdY2 += dy * dy;<NEW_LINE>}<NEW_LINE>N1.meanX = meanX1;<NEW_LINE>N1.meanY = meanY1;<NEW_LINE>N2.meanX = meanX2;<NEW_LINE>N2.meanY = meanY2;<NEW_LINE>N1.stdX = Math.sqrt(stdX1 / points.size());<NEW_LINE>N1.stdY = Math.sqrt(stdY1 / points.size());<NEW_LINE>N2.stdX = Math.sqrt(stdX2 / points.size());<NEW_LINE>N2.stdY = Math.sqrt(stdY2 / points.size());<NEW_LINE>}
= p.p2.x - meanX2;
594,981
public Request<DescribeSentimentDetectionJobRequest> marshall(DescribeSentimentDetectionJobRequest describeSentimentDetectionJobRequest) {<NEW_LINE>if (describeSentimentDetectionJobRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DescribeSentimentDetectionJobRequest)");<NEW_LINE>}<NEW_LINE>Request<DescribeSentimentDetectionJobRequest> request = new DefaultRequest<DescribeSentimentDetectionJobRequest>(describeSentimentDetectionJobRequest, "AmazonComprehend");<NEW_LINE>String target = "Comprehend_20171127.DescribeSentimentDetectionJob";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE><MASK><NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (describeSentimentDetectionJobRequest.getJobId() != null) {<NEW_LINE>String jobId = describeSentimentDetectionJobRequest.getJobId();<NEW_LINE>jsonWriter.name("JobId");<NEW_LINE>jsonWriter.value(jobId);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.setHttpMethod(HttpMethodName.POST);
1,600,700
void serialize(TransformerHandler handler, File outputFile) throws SAXException, IOException, ExportException {<NEW_LINE>String filenameWithoutExtension = getFilenameWithoutExtension(outputFile);<NEW_LINE>handler.startDocument();<NEW_LINE>AttributesImpl attrs = new AttributesImpl();<NEW_LINE>writeViews(getUIFacade(), handler);<NEW_LINE>startElement("ganttproject", attrs, handler);<NEW_LINE>textElement("title", attrs, "GanttProject - " + filenameWithoutExtension, handler);<NEW_LINE>addAttribute("prefix", filenameWithoutExtension, attrs);<NEW_LINE>startElement("links", attrs, handler);<NEW_LINE>textElement("home", attrs, i18n("home"), handler);<NEW_LINE>textElement("chart", attrs, i18n("gantt"), handler);<NEW_LINE>textElement("tasks", attrs, i18n("task"), handler);<NEW_LINE>textElement("resources", attrs, i18n("human"), handler);<NEW_LINE>endElement("links", handler);<NEW_LINE>startElement("project", attrs, handler);<NEW_LINE>addAttribute("title", i18n("project"), attrs);<NEW_LINE>textElement("name", attrs, getProject().getProjectName(), handler);<NEW_LINE>addAttribute("title", i18n("organization"), attrs);<NEW_LINE>textElement("organization", attrs, getProject().getOrganization(), handler);<NEW_LINE>addAttribute("title", i18n("webLink"), attrs);<NEW_LINE>textElement("webLink", attrs, getProject().getWebLink(), handler);<NEW_LINE>addAttribute("title", i18n("shortDescription"), attrs);<NEW_LINE>textElement("description", attrs, getProject().getDescription(), handler);<NEW_LINE>endElement("project", handler);<NEW_LINE>// TODO: [dbarashev, 10.09.2005] introduce output files grouping structure<NEW_LINE>String ganttChartFileName = ExporterToHTML.replaceExtension(outputFile, ExporterToHTML.GANTT_CHART_FILE_EXTENSION).getName();<NEW_LINE>textElement("chart", attrs, ganttChartFileName, handler);<NEW_LINE>addAttribute("name", i18n("colName"), attrs);<NEW_LINE>addAttribute("role", i18n("colRole"), attrs);<NEW_LINE>addAttribute("mail", i18n("colMail"), attrs);<NEW_LINE>addAttribute("phone", i18n("colPhone"), attrs);<NEW_LINE>startElement("resources", attrs, handler);<NEW_LINE>writeResources(getProject().getHumanResourceManager(), handler);<NEW_LINE>String resourceChartFileName = ExporterToHTML.replaceExtension(outputFile, ExporterToHTML.RESOURCE_CHART_FILE_EXTENSION).getName();<NEW_LINE>addAttribute("path", resourceChartFileName, attrs);<NEW_LINE>emptyElement("chart", attrs, handler);<NEW_LINE>endElement("resources", handler);<NEW_LINE>// addAttribute("name", i18n("name"), attrs);<NEW_LINE>// addAttribute("begin", i18n("start"), attrs);<NEW_LINE>// addAttribute("end", i18n("end"), attrs);<NEW_LINE>// addAttribute("milestone", i18n("meetingPoint"), attrs);<NEW_LINE>// addAttribute("progress", i18n("advancement"), attrs);<NEW_LINE>// addAttribute("assigned-to", i18n("assignTo"), attrs);<NEW_LINE>// addAttribute("notes", i18n("notesTask"), attrs);<NEW_LINE>try {<NEW_LINE>writeTasks(getProject().getTaskManager(), handler);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ExportException("Failed to write tasks", e);<NEW_LINE>}<NEW_LINE>addAttribute("version", "Ganttproject (" + GPVersion.<MASK><NEW_LINE>Calendar c = CalendarFactory.newCalendar();<NEW_LINE>String dateAndTime = GanttLanguage.getInstance().formatShortDate(c) + " - " + GanttLanguage.getInstance().formatTime(c);<NEW_LINE>addAttribute("date", dateAndTime, attrs);<NEW_LINE>emptyElement("footer", attrs, handler);<NEW_LINE>endElement("ganttproject", handler);<NEW_LINE>handler.endDocument();<NEW_LINE>}
getCurrentVersionNumber() + ")", attrs);
760,807
public static ScanHeader read(ByteBuffer bb) {<NEW_LINE>ScanHeader scan = new ScanHeader();<NEW_LINE>scan.ls <MASK><NEW_LINE>scan.ns = bb.get() & 0xff;<NEW_LINE>scan.components = new Component[scan.ns];<NEW_LINE>for (int i = 0; i < scan.components.length; i++) {<NEW_LINE>Component c = scan.components[i] = new Component();<NEW_LINE>c.cs = bb.get() & 0xff;<NEW_LINE>int tdta = bb.get() & 0xff;<NEW_LINE>c.td = (tdta & 0xf0) >>> 4;<NEW_LINE>c.ta = (tdta & 0x0f);<NEW_LINE>}<NEW_LINE>scan.ss = bb.get() & 0xff;<NEW_LINE>scan.se = bb.get() & 0xff;<NEW_LINE>int ahal = bb.get() & 0xff;<NEW_LINE>scan.ah = (ahal & 0xf0) >>> 4;<NEW_LINE>scan.al = (ahal & 0x0f);<NEW_LINE>return scan;<NEW_LINE>}
= bb.getShort() & 0xffff;
408,258
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {<NEW_LINE>Context context = getActivity();<NEW_LINE>if (context == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (id == R.id.spDefaultBridges) {<NEW_LINE>preferenceRepository.get().setStringPreference(DEFAULT_BRIDGES_OBFS, String.valueOf(i));<NEW_LINE>if (rbDefaultBridges.isChecked()) {<NEW_LINE>currentBridgesFilePath = bridgesDefaultFilePath;<NEW_LINE>if (areDefaultVanillaBridgesSelected()) {<NEW_LINE>if (areRelayBridgesWereRequested() && areBridgesVanilla(bridgesInUse)) {<NEW_LINE>FileManager.readTextFile(context, currentBridgesFilePath, DEFAULT_BRIDGES_OPERATION_TAG);<NEW_LINE>} else {<NEW_LINE>saveRelayBridgesWereRequested(true);<NEW_LINE>requestRelayBridges(true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>FileManager.readTextFile(context, currentBridgesFilePath, DEFAULT_BRIDGES_OPERATION_TAG);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (id == R.id.spOwnBridges) {<NEW_LINE>preferenceRepository.get().setStringPreference(OWN_BRIDGES_OBFS, String.valueOf(i));<NEW_LINE>if (rbOwnBridges.isChecked()) {<NEW_LINE>currentBridgesFilePath = bridgesCustomFilePath;<NEW_LINE>FileManager.readTextFile(context, currentBridgesFilePath, OWN_BRIDGES_OPERATION_TAG);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int id = adapterView.getId();
178,038
private static CompletionStage<DataFolder> findTargetForTemplate(CompletionStage<DataObject> findTemplate, NbCodeLanguageClient client, ExecuteCommandParams params) {<NEW_LINE>final DataObject[] templateObject = new DataObject[1];<NEW_LINE>return findTemplate.thenCompose(any -> {<NEW_LINE>templateObject[0] = any;<NEW_LINE>return client.workspaceFolders();<NEW_LINE>}).thenCompose(folders -> {<NEW_LINE>boolean[] suggestionIsExact = { true };<NEW_LINE>DataFolder suggestion = findTargetFolder(params, templateObject[0], folders, suggestionIsExact);<NEW_LINE>if (suggestionIsExact[0]) {<NEW_LINE>return CompletableFuture.completedFuture(suggestion);<NEW_LINE>}<NEW_LINE>class VerifyPath implements Function<String, CompletionStage<DataFolder>> {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public CompletionStage<DataFolder> apply(String path) {<NEW_LINE>if (path == null) {<NEW_LINE>throw raise(RuntimeException.class, new UserCancelException(path));<NEW_LINE>}<NEW_LINE>FileObject fo = FileUtil.toFileObject(new File(path));<NEW_LINE>if (fo == null || !fo.isFolder()) {<NEW_LINE>client.showMessage(new MessageParams(MessageType.Error, Bundle.ERR_InvalidPath(path)));<NEW_LINE>return client.showInputBox(new ShowInputBoxParams(Bundle.CTL_TemplateUI_SelectTarget(), suggestion.getPrimaryFile().getPath(<MASK><NEW_LINE>}<NEW_LINE>return CompletableFuture.completedFuture(DataFolder.findFolder(fo));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return client.showInputBox(new ShowInputBoxParams(Bundle.CTL_TemplateUI_SelectTarget(), suggestion.getPrimaryFile().getPath())).thenCompose(new VerifyPath());<NEW_LINE>});<NEW_LINE>}
))).thenCompose(this);
1,811,127
public boolean onMenuItemClick(MenuItem item) {<NEW_LINE>LogUtil.v("Chosen is " + item.getOrder());<NEW_LINE>int i = 0;<NEW_LINE>for (Spannable s : base) {<NEW_LINE>if (s.equals(item.getTitle())) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>switch(i) {<NEW_LINE>case 0:<NEW_LINE>SortingUtil.setTime(subreddit, TimePeriod.HOUR);<NEW_LINE>reloadSubs();<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>SortingUtil.<MASK><NEW_LINE>reloadSubs();<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>SortingUtil.setTime(subreddit, TimePeriod.WEEK);<NEW_LINE>reloadSubs();<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>SortingUtil.setTime(subreddit, TimePeriod.MONTH);<NEW_LINE>reloadSubs();<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>SortingUtil.setTime(subreddit, TimePeriod.YEAR);<NEW_LINE>reloadSubs();<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>SortingUtil.setTime(subreddit, TimePeriod.ALL);<NEW_LINE>reloadSubs();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
setTime(subreddit, TimePeriod.DAY);
1,227,861
protected void handleOptionalParam(Map<String, String> existingConverters, String errorLocation, boolean hasRuntimeConverters, ServerIndexedParameter builder, String elementType, String genericElementType) {<NEW_LINE>ParameterConverterSupplier converter = null;<NEW_LINE>if (genericElementType != null) {<NEW_LINE>ParameterConverterSupplier genericTypeConverter = extractConverter(genericElementType, index, existingConverters, errorLocation, hasRuntimeConverters);<NEW_LINE>if (LIST.toString().equals(elementType)) {<NEW_LINE>converter = new ListConverter.ListSupplier(genericTypeConverter);<NEW_LINE>builder.setSingle(false);<NEW_LINE>} else if (SET.toString().equals(elementType)) {<NEW_LINE>converter <MASK><NEW_LINE>builder.setSingle(false);<NEW_LINE>} else if (SORTED_SET.toString().equals(elementType)) {<NEW_LINE>converter = new SortedSetConverter.SortedSetSupplier(genericTypeConverter);<NEW_LINE>builder.setSingle(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (converter == null) {<NEW_LINE>// If no generic type provided or element type is not supported, then we try to use a custom runtime converter:<NEW_LINE>converter = extractConverter(elementType, index, existingConverters, errorLocation, hasRuntimeConverters);<NEW_LINE>}<NEW_LINE>builder.setConverter(new OptionalConverter.OptionalSupplier(converter));<NEW_LINE>}
= new SetConverter.SetSupplier(genericTypeConverter);
644,709
protected MessageHandler createHandler(Object bean, Method method, List<Annotation> annotations) {<NEW_LINE>String applySequence = MessagingAnnotationUtils.resolveAttribute(annotations, "applySequence", String.class);<NEW_LINE>AbstractMessageSplitter splitter;<NEW_LINE>if (AnnotatedElementUtils.isAnnotated(method, Bean.class.getName())) {<NEW_LINE>Object target = resolveTargetBeanFromMethodWithBeanAnnotation(method);<NEW_LINE>splitter = this.extractTypeIfPossible(target, AbstractMessageSplitter.class);<NEW_LINE>if (splitter == null) {<NEW_LINE>if (target instanceof MessageHandler) {<NEW_LINE>Assert.hasText(applySequence, "'applySequence' can be applied to 'AbstractMessageSplitter', but " + "target handler is: " + target.getClass());<NEW_LINE>return (MessageHandler) target;<NEW_LINE>} else {<NEW_LINE>splitter = new MethodInvokingSplitter(target);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>checkMessageHandlerAttributes(resolveTargetBeanName(method), annotations);<NEW_LINE>return splitter;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>splitter <MASK><NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(applySequence)) {<NEW_LINE>splitter.setApplySequence(resolveAttributeToBoolean(applySequence));<NEW_LINE>}<NEW_LINE>this.setOutputChannelIfPresent(annotations, splitter);<NEW_LINE>return splitter;<NEW_LINE>}
= new MethodInvokingSplitter(bean, method);
1,054,263
public void init(String name) {<NEW_LINE>Properties p = new Properties();<NEW_LINE>ClassLoader classLoader = getClass().getClassLoader();<NEW_LINE>try {<NEW_LINE>URL url = classLoader.getResource(name + ".properties");<NEW_LINE>if (url != null) {<NEW_LINE>InputStream is = url.openStream();<NEW_LINE>p.load(is);<NEW_LINE>is.close();<NEW_LINE>Logger.info(this, "Loading " + url);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(this, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>URL url = classLoader.getResource(name + "-ext.properties");<NEW_LINE>if (url != null) {<NEW_LINE>InputStream is = url.openStream();<NEW_LINE>p.load(is);<NEW_LINE>is.close();<NEW_LINE>Logger.info(this, "Loading " + url);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(this, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>// Use a fast synchronized hash map implementation instead of the slower<NEW_LINE>// java.util.Properties<NEW_LINE><MASK><NEW_LINE>}
PropertiesUtil.fromProperties(p, _props);
1,387,650
final IndexFacesResult executeIndexFaces(IndexFacesRequest indexFacesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(indexFacesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<IndexFacesRequest> request = null;<NEW_LINE>Response<IndexFacesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new IndexFacesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(indexFacesRequest));<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, "Rekognition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "IndexFaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<IndexFacesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new IndexFacesResultJsonUnmarshaller());
538,705
public static int[] sortInstances(InstanceList ilist, int[] instIndices, int featureIndex) {<NEW_LINE>ArrayList list = new ArrayList();<NEW_LINE>for (int ii = 0; ii < instIndices.length; ii++) {<NEW_LINE>Instance inst = ilist.get(instIndices[ii]);<NEW_LINE>FeatureVector fv = (FeatureVector) inst.getData();<NEW_LINE>list.add(new Point2D.Double(instIndices[ii], fv.value(featureIndex)));<NEW_LINE>}<NEW_LINE>Collections.sort(list, new Comparator() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(Object o1, Object o2) {<NEW_LINE>Point2D.Double p1 = (Point2D.Double) o1;<NEW_LINE>Point2D.Double p2 = (Point2D.Double) o2;<NEW_LINE>if (p1.y == p2.y) {<NEW_LINE>assert (p1.x != p2.x);<NEW_LINE>return p1.x > p2.x ? 1 : -1;<NEW_LINE>} else<NEW_LINE>return p1.y > <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>int[] sorted = new int[instIndices.length];<NEW_LINE>for (int i = 0; i < list.size(); i++) sorted[i] = (int) ((Point2D.Double) list.get(i)).getX();<NEW_LINE>return sorted;<NEW_LINE>}
p2.y ? 1 : -1;
820,412
public void selectFolder(final HttpServletRequest request, final String fullFolderPath, final User user, final boolean respectFrontendRoles) throws DotDataException, DotSecurityException {<NEW_LINE>final Optional<Host> hostOpt = findHostFromPath(fullFolderPath, user);<NEW_LINE>final Host host = hostOpt.isPresent() ? hostOpt.get() : APILocator.getHostAPI().findDefaultHost(user, respectFrontendRoles);<NEW_LINE>final Host currentHost = WebAPILocator.getHostWebAPI().getCurrentHostNoThrow(request);<NEW_LINE>final String folderPath = getFolderPath(fullFolderPath);<NEW_LINE>final Folder folder = APILocator.getFolderAPI().findFolderByPath(folderPath, host, user, respectFrontendRoles);<NEW_LINE>if (null != folder && UtilMethods.isSet(folder.getIdentifier()) && null != host) {<NEW_LINE>if (null == currentHost || !host.getIdentifier().equals(currentHost.getIdentifier())) {<NEW_LINE>HostUtil.switchSite(request, host);<NEW_LINE>}<NEW_LINE>BrowserAjax browserAjax = (BrowserAjax) request.getSession().getAttribute("BrowserAjax");<NEW_LINE>if (null == browserAjax) {<NEW_LINE>browserAjax = new BrowserAjax();<NEW_LINE>request.getSession(<MASK><NEW_LINE>}<NEW_LINE>browserAjax.setCurrentOpenFolder(folder.getInode(), host.getIdentifier(), user);<NEW_LINE>request.getSession().setAttribute("siteBrowserActiveFolderInode", folder.getInode());<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("The path seems to be not valid: " + fullFolderPath);<NEW_LINE>}<NEW_LINE>}
).setAttribute("BrowserAjax", browserAjax);