idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,478,948
public IngestConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>IngestConfiguration ingestConfiguration = new IngestConfiguration();<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("audio", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>ingestConfiguration.setAudio(AudioConfigurationJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("video", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>ingestConfiguration.setVideo(VideoConfigurationJsonUnmarshaller.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 ingestConfiguration;<NEW_LINE>}
().unmarshall(context));
630,757
private void collectExtensionDependencies(Project project, Configuration deploymentConfiguration, Map<ArtifactKey, ResolvedDependencyBuilder> appDependencies) {<NEW_LINE>final ResolvedConfiguration rc = deploymentConfiguration.getResolvedConfiguration();<NEW_LINE>for (ResolvedArtifact a : rc.getResolvedArtifacts()) {<NEW_LINE>if (a.getId().getComponentIdentifier() instanceof ProjectComponentIdentifier) {<NEW_LINE>final Project projectDep = project.getRootProject().findProject(((ProjectComponentIdentifier) a.getId().getComponentIdentifier()).getProjectPath());<NEW_LINE>final JavaPluginConvention javaExtension = projectDep == null ? null : projectDep.getConvention().findPlugin(JavaPluginConvention.class);<NEW_LINE>SourceSet mainSourceSet = javaExtension.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);<NEW_LINE>final ResolvedDependencyBuilder dep = appDependencies.computeIfAbsent(toAppDependenciesKey(a.getModuleVersion().getId().getGroup(), a.getName(), a.getClassifier()), k -> toDependency(a, mainSourceSet));<NEW_LINE>dep.setDeploymentCp();<NEW_LINE><MASK><NEW_LINE>} else if (isDependency(a)) {<NEW_LINE>final ResolvedDependencyBuilder dep = appDependencies.computeIfAbsent(toAppDependenciesKey(a.getModuleVersion().getId().getGroup(), a.getName(), a.getClassifier()), k -> toDependency(a));<NEW_LINE>dep.setDeploymentCp();<NEW_LINE>dep.clearFlag(DependencyFlags.RELOADABLE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
dep.clearFlag(DependencyFlags.RELOADABLE);
1,412,050
private <T extends RemoteFile> void list(String remoteFilePath, Map<String, T> remoteFiles, Class<T> remoteFileClass) throws StorageException {<NEW_LINE>logger.log(Level.INFO, "Listing folder for files matching " + remoteFileClass.getSimpleName() + ": " + remoteFilePath);<NEW_LINE>Map<String, FileType> folderList = pathAwareFeatureExtension.listFolder(remoteFilePath);<NEW_LINE>for (Map.Entry<String, FileType> folderListEntry : folderList.entrySet()) {<NEW_LINE>String fileName = folderListEntry.getKey();<NEW_LINE><MASK><NEW_LINE>if (fileType == FileType.FILE) {<NEW_LINE>try {<NEW_LINE>remoteFiles.put(fileName, RemoteFile.createRemoteFile(fileName, remoteFileClass));<NEW_LINE>logger.log(Level.INFO, "- File: " + fileName);<NEW_LINE>} catch (StorageException e) {<NEW_LINE>// We don't care and ignore non-matching files!<NEW_LINE>}<NEW_LINE>} else if (fileType == FileType.FOLDER) {<NEW_LINE>logger.log(Level.INFO, "- Folder: " + fileName);<NEW_LINE>String newRemoteFilePath = remoteFilePath + folderSeparator + fileName;<NEW_LINE>list(newRemoteFilePath, remoteFiles, remoteFileClass);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
FileType fileType = folderListEntry.getValue();
1,388,502
/* Answer true if the method use is considered deprecated.<NEW_LINE>* An access in the same compilation unit is allowed.<NEW_LINE>*/<NEW_LINE>public final boolean isMethodUseDeprecated(MethodBinding method, Scope scope, boolean isExplicitUse, InvocationSite invocation) {<NEW_LINE>// ignore references insing Javadoc comments<NEW_LINE>if ((this.bits & ASTNode.InsideJavadoc) == 0 && method.isOrEnclosedByPrivateType() && !scope.isDefinedInMethod(method)) {<NEW_LINE>// ignore cases where method is used from inside itself (e.g. direct recursions)<NEW_LINE>method.original().modifiers |= ExtraCompilerModifiers.AccLocallyUsed;<NEW_LINE>}<NEW_LINE>// TODO (maxime) consider separating concerns between deprecation and access restriction.<NEW_LINE>// Caveat: this was not the case when access restriction funtion was added.<NEW_LINE>if (isExplicitUse && (method.modifiers & ExtraCompilerModifiers.AccRestrictedAccess) != 0) {<NEW_LINE>// note: explicit constructors calls warnings are kept despite the 'new C1()' case (two<NEW_LINE>// warnings, one on type, the other on constructor), because of the 'super()' case.<NEW_LINE>ModuleBinding module = method.declaringClass.module();<NEW_LINE>LookupEnvironment env = (module == null) ? scope<MASK><NEW_LINE>AccessRestriction restriction = env.getAccessRestriction(method.declaringClass.erasure());<NEW_LINE>if (restriction != null) {<NEW_LINE>scope.problemReporter().forbiddenReference(method, invocation, restriction.classpathEntryType, restriction.classpathEntryName, restriction.getProblemId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!method.isViewedAsDeprecated())<NEW_LINE>return false;<NEW_LINE>// inside same unit - no report<NEW_LINE>if (scope.isDefinedInSameUnit(method.declaringClass))<NEW_LINE>return false;<NEW_LINE>// non explicit use and non explicitly deprecated - no report<NEW_LINE>if (!isExplicitUse && (method.modifiers & ClassFileConstants.AccDeprecated) == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// if context is deprecated, may avoid reporting<NEW_LINE>if (!scope.compilerOptions().reportDeprecationInsideDeprecatedCode && scope.isInsideDeprecatedCode())<NEW_LINE>return false;<NEW_LINE>return true;<NEW_LINE>}
.environment() : module.environment;
436,473
private static IRubyObject collectCommon(ThreadContext context, IRubyObject self, final Block block, String methodName) {<NEW_LINE>final Ruby runtime = context.runtime;<NEW_LINE>if (block.isGiven()) {<NEW_LINE>final <MASK><NEW_LINE>eachSite(context).call(context, self, self, CallBlock19.newCallClosure(self, runtime.getEnumerable(), block.getSignature(), new BlockCallback() {<NEW_LINE><NEW_LINE>public IRubyObject call(ThreadContext ctx, IRubyObject[] largs, Block blk) {<NEW_LINE>final IRubyObject larg;<NEW_LINE>boolean ary = false;<NEW_LINE>switch(largs.length) {<NEW_LINE>case 0:<NEW_LINE>larg = ctx.nil;<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>larg = largs[0];<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>larg = RubyArray.newArrayMayCopy(ctx.runtime, largs);<NEW_LINE>ary = true;<NEW_LINE>}<NEW_LINE>IRubyObject val = ary ? block.yieldArray(ctx, larg, null) : block.yield(ctx, larg);<NEW_LINE>synchronized (result) {<NEW_LINE>result.append(val);<NEW_LINE>}<NEW_LINE>return ctx.nil;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public IRubyObject call(ThreadContext ctx, IRubyObject larg, Block blk) {<NEW_LINE>IRubyObject val = block.yield(ctx, larg);<NEW_LINE>synchronized (result) {<NEW_LINE>result.append(val);<NEW_LINE>}<NEW_LINE>return ctx.nil;<NEW_LINE>}<NEW_LINE>}, context));<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>return enumeratorizeWithSize(context, self, methodName, (SizeFn) RubyEnumerable::size);<NEW_LINE>}<NEW_LINE>}
RubyArray result = runtime.newArray();
441,174
public static Document parseFromString(final HtmlUnitScriptable scriptable, final String str, final Object type) throws IOException {<NEW_LINE>if (type == null || Undefined.isUndefined(type)) {<NEW_LINE>throw Context.reportRuntimeError("Missing 'type' parameter");<NEW_LINE>}<NEW_LINE>if (MimeType.TEXT_XML.equals(type) || MimeType.APPLICATION_XML.equals(type) || MimeType.APPLICATION_XHTML.equals(type) || "image/svg+xml".equals(type)) {<NEW_LINE>final XMLDocument document = new XMLDocument();<NEW_LINE>document.setParentScope(scriptable.getParentScope());<NEW_LINE>document.setPrototype(scriptable.getPrototype(XMLDocument.class));<NEW_LINE>document.loadXML(str);<NEW_LINE>return document;<NEW_LINE>}<NEW_LINE>if (MimeType.TEXT_HTML.equals(type)) {<NEW_LINE>final WebWindow webWindow = scriptable.getWindow().getWebWindow();<NEW_LINE>final WebClient webClient = webWindow.getWebClient();<NEW_LINE>final WebResponse webResponse = new StringWebResponse(str, webWindow.getEnclosedPage().getUrl());<NEW_LINE>// a similar impl is in<NEW_LINE>// com.gargoylesoftware.htmlunit.javascript.host.dom.DOMImplementation.createHTMLDocument(Object)<NEW_LINE>final HtmlPage page = new HtmlPage(webResponse, webWindow);<NEW_LINE>page.setEnclosingWindow(null);<NEW_LINE>final <MASK><NEW_LINE>// document knows the window but is not the windows document<NEW_LINE>final HTMLDocument document = new HTMLDocument();<NEW_LINE>document.setParentScope(window);<NEW_LINE>document.setPrototype(window.getPrototype(document.getClass()));<NEW_LINE>// document.setWindow(window);<NEW_LINE>document.setDomNode(page);<NEW_LINE>final HTMLParser htmlParser = webClient.getPageCreator().getHtmlParser();<NEW_LINE>htmlParser.parse(webResponse, page, false, true);<NEW_LINE>return page.getScriptableObject();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
Window window = webWindow.getScriptableObject();
830,383
public float call(ItemStack stack, @Nullable ClientWorld worldIn, @Nullable LivingEntity entityIn) {<NEW_LINE>final float IDLE_FRAME_INDEX = 0.0F;<NEW_LINE>final float FULLY_CHARGED_INDEX = 1.0F;<NEW_LINE>World world = worldIn;<NEW_LINE>if (worldIn == null && entityIn != null) {<NEW_LINE>world = entityIn.world;<NEW_LINE>}<NEW_LINE>if (entityIn == null || worldIn == null)<NEW_LINE>return IDLE_FRAME_INDEX;<NEW_LINE>if (!entityIn.isHandActive()) {<NEW_LINE>// player isn't holding down the right mouse button, i.e. not charging<NEW_LINE>animationHasStarted = false;<NEW_LINE>return IDLE_FRAME_INDEX;<NEW_LINE>}<NEW_LINE>long worldTicks = world.getGameTime();<NEW_LINE>if (!animationHasStarted) {<NEW_LINE>startingTick = worldTicks;<NEW_LINE>animationHasStarted = true;<NEW_LINE>}<NEW_LINE>final long ticksInUse = worldTicks - startingTick;<NEW_LINE>if (ticksInUse <= ItemNBTAnimate.CHARGE_UP_INITIAL_PAUSE_TICKS) {<NEW_LINE>return IDLE_FRAME_INDEX;<NEW_LINE>}<NEW_LINE>final long chargeTicksSoFar = ticksInUse - ItemNBTAnimate.CHARGE_UP_INITIAL_PAUSE_TICKS;<NEW_LINE>final double fractionCharged = <MASK><NEW_LINE>if (fractionCharged < 0.0)<NEW_LINE>return IDLE_FRAME_INDEX;<NEW_LINE>if (fractionCharged > FULLY_CHARGED_INDEX)<NEW_LINE>return FULLY_CHARGED_INDEX;<NEW_LINE>return (float) fractionCharged * FULLY_CHARGED_INDEX;<NEW_LINE>}
chargeTicksSoFar / (double) ItemNBTAnimate.CHARGE_UP_DURATION_TICKS;
282,484
public static Scaler of(String scaler, double[] data) {<NEW_LINE>if (scaler == null || scaler.isEmpty())<NEW_LINE>return null;<NEW_LINE>scaler = scaler.trim().toLowerCase(Locale.ROOT);<NEW_LINE>if (scaler.equals("minmax")) {<NEW_LINE>return Scaler.minmax(data);<NEW_LINE>}<NEW_LINE>Pattern winsor = Pattern.compile(String.format("winsor\\((%s),\\s*(%s)\\)", DOUBLE_REGEX, DOUBLE_REGEX));<NEW_LINE>Matcher m = winsor.matcher(scaler);<NEW_LINE>if (m.matches()) {<NEW_LINE>double lower = Double.parseDouble(m.group(1));<NEW_LINE>double upper = Double.parseDouble(m.group(2));<NEW_LINE>return Scaler.winsor(data, lower, upper);<NEW_LINE>}<NEW_LINE>Pattern standardizer = Pattern.compile(String.format("standardizer(\\(\\s*(%s)\\))?", BOOLEAN_REGEX));<NEW_LINE><MASK><NEW_LINE>if (m.matches()) {<NEW_LINE>boolean robust = false;<NEW_LINE>if (m.group(1) != null) {<NEW_LINE>robust = Boolean.parseBoolean(m.group(2));<NEW_LINE>}<NEW_LINE>return Scaler.standardizer(data, robust);<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("Unsupported scaler: " + scaler);<NEW_LINE>}
m = standardizer.matcher(scaler);
883,841
private void run(String[] argv) throws Exception {<NEW_LINE>MaxwellBootstrapUtilityConfig config = new MaxwellBootstrapUtilityConfig(argv);<NEW_LINE>if (config.log_level != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>ConnectionPool connectionPool = getConnectionPool(config);<NEW_LINE>ConnectionPool replConnectionPool = getReplicationConnectionPool(config);<NEW_LINE>try (final Connection connection = connectionPool.getConnection();<NEW_LINE>final Connection replicationConnection = replConnectionPool.getConnection()) {<NEW_LINE>if (config.abortBootstrapID != null) {<NEW_LINE>getInsertedRowsCount(connection, config.abortBootstrapID);<NEW_LINE>removeBootstrapRow(connection, config.abortBootstrapID);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long rowId;<NEW_LINE>if (config.monitorBootstrapID != null) {<NEW_LINE>getInsertedRowsCount(connection, config.monitorBootstrapID);<NEW_LINE>rowId = config.monitorBootstrapID;<NEW_LINE>} else {<NEW_LINE>Long totalRows = calculateRowCount(replicationConnection, config.databaseName, config.tableName, config.whereClause);<NEW_LINE>rowId = insertBootstrapStartRow(connection, config.databaseName, config.tableName, config.whereClause, config.clientID, config.comment, totalRows);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>monitorProgress(connection, rowId);<NEW_LINE>} catch (MissingBootstrapRowException e) {<NEW_LINE>LOGGER.error("bootstrap aborted.");<NEW_LINE>Runtime.getRuntime().halt(1);<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>LOGGER.error("failed to connect to mysql server @ " + config.getConnectionURI());<NEW_LINE>LOGGER.error(e.getLocalizedMessage());<NEW_LINE>e.printStackTrace();<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
Logging.setLevel(config.log_level);
1,734,465
public void buy() {<NEW_LINE>mSession = new Session();<NEW_LINE>mSession.addOnJoinListener(this::onJoin);<NEW_LINE>mSession.addOnLeaveListener(this::onLeave);<NEW_LINE>mSession.addOnDisconnectListener(this::onDisconnected);<NEW_LINE>ECKeyPair keyPair = ECKeyPair.create(Numeric.hexStringToByteArray(MEMBER_ETH_KEY));<NEW_LINE>String addressHex = Credentials.<MASK><NEW_LINE>byte[] addressRaw = Numeric.hexStringToByteArray(addressHex);<NEW_LINE>String pubkeyHex = CryptosignAuth.getPublicKey(AuthUtil.toBinary(CS_KEY));<NEW_LINE>Map<String, Object> extras = new HashMap<>();<NEW_LINE>extras.put("wallet_address", addressRaw);<NEW_LINE>extras.put("pubkey", pubkeyHex);<NEW_LINE>MarketMemberLogin.sign(keyPair, addressHex, pubkeyHex).thenCompose(signature -> {<NEW_LINE>extras.put("signature", signature);<NEW_LINE>CryptosignAuth auth = new CryptosignAuth("public", CS_KEY, extras);<NEW_LINE>Client client = new Client(mSession, mURI, mRealm, auth);<NEW_LINE>return client.connect();<NEW_LINE>}).whenComplete((exitInfo, throwable) -> {<NEW_LINE>if (throwable != null) {<NEW_LINE>throwable.printStackTrace();<NEW_LINE>} else {<NEW_LINE>System.out.println("Exit...");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
create(keyPair).getAddress();
451,144
protected Map<String, Object> loadParams(MenuItem item) {<NEW_LINE>Element descriptor = item.getDescriptor();<NEW_LINE>if (descriptor == null) {<NEW_LINE>return Collections.emptyMap();<NEW_LINE>}<NEW_LINE>ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();<NEW_LINE>for (Element element : descriptor.elements("param")) {<NEW_LINE>String value = element.attributeValue("value");<NEW_LINE>EntityLoadInfo info = EntityLoadInfo.parse(value);<NEW_LINE>if (info == null) {<NEW_LINE>if ("true".equalsIgnoreCase(value) || "false".equalsIgnoreCase(value)) {<NEW_LINE>Boolean booleanValue = Boolean.valueOf(value);<NEW_LINE>builder.put(element<MASK><NEW_LINE>} else {<NEW_LINE>if (value.startsWith("${") && value.endsWith("}")) {<NEW_LINE>String property = AppContext.getProperty(value.substring(2, value.length() - 1));<NEW_LINE>if (!StringUtils.isEmpty(property)) {<NEW_LINE>value = property;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.put(element.attributeValue("name"), value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>builder.put(element.attributeValue("name"), loadEntityInstance(info));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String screen = item.getScreen();<NEW_LINE>if (StringUtils.isNotEmpty(screen)) {<NEW_LINE>WindowInfo windowInfo = windowConfig.getWindowInfo(screen);<NEW_LINE>// caption is passed only for legacy screens<NEW_LINE>if (windowInfo.getDescriptor() != null) {<NEW_LINE>String caption = menuConfig.getItemCaption(item);<NEW_LINE>builder.put(WindowParams.CAPTION.name(), caption);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
.attributeValue("name"), booleanValue);
307,240
private void validateGELFMessage(JsonNode jsonNode, UUID id, ResolvableInetSocketAddress remoteAddress) {<NEW_LINE>final String prefix = "GELF message <" + id + "> " + (remoteAddress == null ? "" : "(received from <" + remoteAddress + ">) ");<NEW_LINE>final JsonNode hostNode = jsonNode.path("host");<NEW_LINE>if (hostNode.isMissingNode()) {<NEW_LINE>log.warn(prefix + "is missing mandatory \"host\" field.");<NEW_LINE>} else {<NEW_LINE>if (!hostNode.isTextual()) {<NEW_LINE>throw new IllegalArgumentException(prefix + "has invalid \"host\": " + hostNode.asText());<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(hostNode.asText())) {<NEW_LINE>throw new IllegalArgumentException(prefix + "has empty mandatory \"host\" field.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final JsonNode shortMessageNode = jsonNode.path("short_message");<NEW_LINE>final JsonNode messageNode = jsonNode.path("message");<NEW_LINE>if (!shortMessageNode.isMissingNode()) {<NEW_LINE>if (!shortMessageNode.isTextual()) {<NEW_LINE>throw new IllegalArgumentException(prefix + <MASK><NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(shortMessageNode.asText()) && StringUtils.isBlank(messageNode.asText())) {<NEW_LINE>throw new IllegalArgumentException(prefix + "has empty mandatory \"short_message\" field.");<NEW_LINE>}<NEW_LINE>} else if (!messageNode.isMissingNode()) {<NEW_LINE>if (!messageNode.isTextual()) {<NEW_LINE>throw new IllegalArgumentException(prefix + "has invalid \"message\": " + messageNode.asText());<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(messageNode.asText())) {<NEW_LINE>throw new IllegalArgumentException(prefix + "has empty mandatory \"message\" field.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(prefix + "is missing mandatory \"short_message\" or \"message\" field.");<NEW_LINE>}<NEW_LINE>final JsonNode timestampNode = jsonNode.path("timestamp");<NEW_LINE>if (timestampNode.isValueNode() && !timestampNode.isNumber()) {<NEW_LINE>log.warn(prefix + "has invalid \"timestamp\": {} (type: {})", timestampNode.asText(), timestampNode.getNodeType().name());<NEW_LINE>}<NEW_LINE>}
"has invalid \"short_message\": " + shortMessageNode.asText());
298,580
protected void init() {<NEW_LINE>setTitle(Msg.translate(Env.getCtx(), "C_DocType_ID"));<NEW_LINE>// North<NEW_LINE>parameterPanel.setLayout(new MigLayout("fill", "", "[50][50][]"));<NEW_LINE>parameterPanel.setBorder(new TitledBorder(Msg.getMsg(ctx, "Query")));<NEW_LINE>//<NEW_LINE>CLabel lname = new CLabel(Msg.translate(ctx, "Name"));<NEW_LINE>parameterPanel.add(lname, " growy");<NEW_LINE>f_Name = new POSTextField("", posPanel.getKeyboard());<NEW_LINE>lname.setLabelFor(f_Name);<NEW_LINE>parameterPanel.add(f_Name, "h 30, w 200");<NEW_LINE>f_Name.addActionListener(this);<NEW_LINE>CLabel ldescription = new CLabel(Msg.translate(ctx, "Description"));<NEW_LINE>parameterPanel.add(ldescription, " growy");<NEW_LINE>f_Description = new POSTextField("", posPanel.getKeyboard());<NEW_LINE>lname.setLabelFor(f_Description);<NEW_LINE>parameterPanel.add(f_Description, "h 30, w 200");<NEW_LINE>f_Description.addActionListener(this);<NEW_LINE>// Center<NEW_LINE>posTable.prepareTable(s_layout, <MASK><NEW_LINE>//<NEW_LINE>posTable.growScrollbars();<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>f_Name.requestFocus();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
s_sqlFrom, s_sqlWhere, false, "C_DocType");
834,779
public SizeConstraintSetUpdate unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SizeConstraintSetUpdate sizeConstraintSetUpdate = new SizeConstraintSetUpdate();<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("Action", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sizeConstraintSetUpdate.setAction(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("SizeConstraint", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sizeConstraintSetUpdate.setSizeConstraint(SizeConstraintJsonUnmarshaller.getInstance().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 sizeConstraintSetUpdate;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,759,336
public double[][] chooseInitialMeans(Relation<? extends NumberVector> relation, int k, NumberVectorDistance<?> distance) {<NEW_LINE>double[][] minmax = RelationUtil.computeMinMax(relation);<NEW_LINE>final int dim = minmax[0].length;<NEW_LINE>double[] min = minmax[0], scale = minmax[1];<NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>scale[d] = scale[d] - min[d];<NEW_LINE>}<NEW_LINE>double[][] means = new double[k][];<NEW_LINE>final <MASK><NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>double[] r = new double[dim];<NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>r[d] = min[d] + scale[d] * random.nextDouble();<NEW_LINE>}<NEW_LINE>means[i] = r;<NEW_LINE>}<NEW_LINE>return means;<NEW_LINE>}
Random random = rnd.getSingleThreadedRandom();
675,265
static <T> void handleOldApiRequest(final Server server, final RoutingContext routingContext, final Class<T> requestClass, final Optional<MetricsCallbackHolder> metricsCallbackHolder, final BiFunction<T, ApiSecurityContext, CompletableFuture<EndpointResponse>> requestor) {<NEW_LINE>final long startTimeNanos = Time.SYSTEM.nanoseconds();<NEW_LINE>final T requestObject;<NEW_LINE>if (requestClass != null) {<NEW_LINE>final Optional<T> optRequestObject = ServerUtils.deserialiseObject(routingContext.getBody(), routingContext, requestClass);<NEW_LINE>if (!optRequestObject.isPresent()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>requestObject = optRequestObject.get();<NEW_LINE>} else {<NEW_LINE>requestObject = null;<NEW_LINE>}<NEW_LINE>final CompletableFuture<EndpointResponse> completableFuture = requestor.apply(requestObject, DefaultApiSecurityContext.create(routingContext));<NEW_LINE>completableFuture.thenAccept(endpointResponse -> {<NEW_LINE>handleOldApiResponse(server, routingContext, endpointResponse, metricsCallbackHolder, startTimeNanos);<NEW_LINE>}).exceptionally(t -> {<NEW_LINE>if (t instanceof CompletionException) {<NEW_LINE>t = t.getCause();<NEW_LINE>}<NEW_LINE>handleOldApiResponse(server, routingContext, mapException<MASK><NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>}
(t), metricsCallbackHolder, startTimeNanos);
1,802,413
protected List<? extends SoapUIAction> registerActions(List<? extends SoapUIAction> actions) {<NEW_LINE>// sort actions so references work consistently<NEW_LINE>Collections.sort(actions, new Comparator<SoapUIAction>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(SoapUIAction o1, SoapUIAction o2) {<NEW_LINE>return o1.getId().compareTo(o2.getId());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (SoapUIAction action : actions) {<NEW_LINE>actionRegistry.addAction(action.getId(), action);<NEW_LINE>ActionConfiguration configuration = PluginProxies.getAnnotation(action, ActionConfiguration.class);<NEW_LINE>if (configuration != null) {<NEW_LINE>configureAction(action, configuration);<NEW_LINE>}<NEW_LINE>ActionConfigurations configurations = PluginProxies.<MASK><NEW_LINE>if (configurations != null) {<NEW_LINE>for (ActionConfiguration config : configurations.configurations()) {<NEW_LINE>configureAction(action, config);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return actions;<NEW_LINE>}
getAnnotation(action, ActionConfigurations.class);
1,319,898
private void encodeUserInfo(AAssociateRQAC rqac) {<NEW_LINE>encodeItemHeader(ItemType.USER_INFO, rqac.userInfoLength());<NEW_LINE>encodeMaxPDULength(rqac.getMaxPDULength());<NEW_LINE>encodeStringItem(ItemType.<MASK><NEW_LINE>if (rqac.isAsyncOps())<NEW_LINE>encodeAsyncOpsWindow(rqac);<NEW_LINE>for (RoleSelection rs : rqac.getRoleSelections()) encode(rs);<NEW_LINE>encodeStringItem(ItemType.IMPL_VERSION_NAME, rqac.getImplVersionName());<NEW_LINE>for (ExtendedNegotiation extNeg : rqac.getExtendedNegotiations()) encode(extNeg);<NEW_LINE>for (CommonExtendedNegotiation extNeg : rqac.getCommonExtendedNegotiations()) encode(extNeg);<NEW_LINE>encode(rqac.getUserIdentityRQ());<NEW_LINE>encode(rqac.getUserIdentityAC());<NEW_LINE>}
IMPL_CLASS_UID, rqac.getImplClassUID());
1,114,026
// suppressing warnings because I expect headers and query strings to be checked by the underlying<NEW_LINE>// servlet implementation<NEW_LINE>@SuppressFBWarnings({ "SERVLET_HEADER", "SERVLET_QUERY_STRING" })<NEW_LINE>private ContainerRequest servletRequestToContainerRequest(ServletRequest request) {<NEW_LINE>Timer.start("JERSEY_SERVLET_REQUEST_TO_CONTAINER");<NEW_LINE>HttpServletRequest servletRequest = (HttpServletRequest) request;<NEW_LINE>if (baseUri == null) {<NEW_LINE>baseUri = getBaseUri(request, "/");<NEW_LINE>}<NEW_LINE>String requestFullPath = servletRequest.getRequestURI();<NEW_LINE>if (LambdaContainerHandler.getContainerConfig().getServiceBasePath() != null && LambdaContainerHandler.getContainerConfig().isStripBasePath()) {<NEW_LINE>if (requestFullPath.startsWith(LambdaContainerHandler.getContainerConfig().getServiceBasePath())) {<NEW_LINE>requestFullPath = requestFullPath.replaceFirst(LambdaContainerHandler.getContainerConfig().getServiceBasePath(), "");<NEW_LINE>if (!requestFullPath.startsWith("/")) {<NEW_LINE>requestFullPath = "/" + requestFullPath;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>UriBuilder uriBuilder = UriBuilder.fromUri(baseUri).path(requestFullPath);<NEW_LINE>uriBuilder.replaceQuery(servletRequest.getQueryString());<NEW_LINE>PropertiesDelegate apiGatewayProperties = new MapPropertiesDelegate();<NEW_LINE>apiGatewayProperties.setProperty(API_GATEWAY_CONTEXT_PROPERTY, servletRequest.getAttribute(API_GATEWAY_CONTEXT_PROPERTY));<NEW_LINE>apiGatewayProperties.setProperty(API_GATEWAY_STAGE_VARS_PROPERTY, servletRequest.getAttribute(API_GATEWAY_STAGE_VARS_PROPERTY));<NEW_LINE>apiGatewayProperties.setProperty(LAMBDA_CONTEXT_PROPERTY, servletRequest.getAttribute(LAMBDA_CONTEXT_PROPERTY));<NEW_LINE>apiGatewayProperties.setProperty(JERSEY_SERVLET_REQUEST_PROPERTY, servletRequest);<NEW_LINE>ContainerRequest requestContext = new // jersey uses "/" by default<NEW_LINE>ContainerRequest(null, uriBuilder.build(), servletRequest.getMethod().toUpperCase(Locale.ENGLISH), (SecurityContext) servletRequest.getAttribute(JAX_SECURITY_CONTEXT_PROPERTY), apiGatewayProperties);<NEW_LINE>InputStream requestInputStream;<NEW_LINE>try {<NEW_LINE>requestInputStream = servletRequest.getInputStream();<NEW_LINE>if (requestInputStream != null) {<NEW_LINE>requestContext.setEntityStream(requestInputStream);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("Could not read input stream from request", e);<NEW_LINE>throw new RuntimeException("Could not read request input stream", e);<NEW_LINE>}<NEW_LINE>Enumeration<String> headerNames = servletRequest.getHeaderNames();<NEW_LINE>while (headerNames.hasMoreElements()) {<NEW_LINE>String headerKey = headerNames.nextElement();<NEW_LINE>requestContext.getHeaders().addAll(headerKey, Collections.list(<MASK><NEW_LINE>}<NEW_LINE>Timer.stop("JERSEY_SERVLET_REQUEST_TO_CONTAINER");<NEW_LINE>return requestContext;<NEW_LINE>}
servletRequest.getHeaders(headerKey)));
1,572,468
private DonutChartModel initDonutModel() {<NEW_LINE>DonutChartModel model = new DonutChartModel();<NEW_LINE>Map<String, Number> circle1 = new LinkedHashMap<String, Number>();<NEW_LINE><MASK><NEW_LINE>circle1.put("Brand 2", 400);<NEW_LINE>circle1.put("Brand 3", 200);<NEW_LINE>circle1.put("Brand 4", 10);<NEW_LINE>model.addCircle(circle1);<NEW_LINE>Map<String, Number> circle2 = new LinkedHashMap<String, Number>();<NEW_LINE>circle2.put("Brand 1", 540);<NEW_LINE>circle2.put("Brand 2", 125);<NEW_LINE>circle2.put("Brand 3", 702);<NEW_LINE>circle2.put("Brand 4", 421);<NEW_LINE>model.addCircle(circle2);<NEW_LINE>Map<String, Number> circle3 = new LinkedHashMap<String, Number>();<NEW_LINE>circle3.put("Brand 1", 40);<NEW_LINE>circle3.put("Brand 2", 325);<NEW_LINE>circle3.put("Brand 3", 402);<NEW_LINE>circle3.put("Brand 4", 421);<NEW_LINE>model.addCircle(circle3);<NEW_LINE>return model;<NEW_LINE>}
circle1.put("Brand 1", 150);
1,036,262
private void rollback(Workflow wf, WorkflowContext ctxt, Failure failure, int lastCompletedStepIdx) {<NEW_LINE>ctxt = refresh(ctxt);<NEW_LINE>final List<WorkflowStepData> steps = wf.getSteps();<NEW_LINE>for (int stepIdx = lastCompletedStepIdx; stepIdx >= 0; --stepIdx) {<NEW_LINE>WorkflowStepData wsd = steps.get(stepIdx);<NEW_LINE>WorkflowStep step = createStep(wsd);<NEW_LINE>try {<NEW_LINE>logger.log(Level.INFO, "Workflow {0} step {1}: Rollback", new Object[] { ctxt.getInvocationId(), stepIdx });<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.log(Level.WARNING, "Workflow " + ctxt.getInvocationId() + " step " + stepIdx + ": Rollback error: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.log(Level.INFO, "Removing workflow lock");<NEW_LINE>try {<NEW_LINE>unlockDataset(ctxt);<NEW_LINE>} catch (CommandException ex) {<NEW_LINE>logger.log(Level.SEVERE, "Error restoring dataset locks state after rollback: " + ex.getMessage(), ex);<NEW_LINE>}<NEW_LINE>}
rollbackStep(step, ctxt, failure);
162,848
public final // JPA2.g:199:1: where_clause : wh= 'WHERE' conditional_expression -> ^( T_CONDITION[$wh] conditional_expression ) ;<NEW_LINE>JPA2Parser.where_clause_return where_clause() throws RecognitionException {<NEW_LINE>JPA2Parser.where_clause_return retval = new JPA2Parser.where_clause_return();<NEW_LINE>retval.start = input.LT(1);<NEW_LINE>Object root_0 = null;<NEW_LINE>Token wh = null;<NEW_LINE>ParserRuleReturnScope conditional_expression134 = null;<NEW_LINE>Object wh_tree = null;<NEW_LINE>RewriteRuleTokenStream stream_143 = new RewriteRuleTokenStream(adaptor, "token 143");<NEW_LINE>RewriteRuleSubtreeStream stream_conditional_expression = new RewriteRuleSubtreeStream(adaptor, "rule conditional_expression");<NEW_LINE>try {<NEW_LINE>// JPA2.g:200:5: (wh= 'WHERE' conditional_expression -> ^( T_CONDITION[$wh] conditional_expression ) )<NEW_LINE>// JPA2.g:200:7: wh= 'WHERE' conditional_expression<NEW_LINE>{<NEW_LINE>wh = (Token) match(input, 143, FOLLOW_143_in_where_clause1710);<NEW_LINE>if (state.failed)<NEW_LINE>return retval;<NEW_LINE>if (state.backtracking == 0)<NEW_LINE>stream_143.add(wh);<NEW_LINE>pushFollow(FOLLOW_conditional_expression_in_where_clause1712);<NEW_LINE>conditional_expression134 = conditional_expression();<NEW_LINE>state._fsp--;<NEW_LINE>if (state.failed)<NEW_LINE>return retval;<NEW_LINE>if (state.backtracking == 0)<NEW_LINE>stream_conditional_expression.<MASK><NEW_LINE>// AST REWRITE<NEW_LINE>// elements: conditional_expression<NEW_LINE>// token labels:<NEW_LINE>// rule labels: retval<NEW_LINE>// token list labels:<NEW_LINE>// rule list labels:<NEW_LINE>// wildcard labels:<NEW_LINE>if (state.backtracking == 0) {<NEW_LINE>retval.tree = root_0;<NEW_LINE>RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.getTree() : null);<NEW_LINE>root_0 = (Object) adaptor.nil();<NEW_LINE>// 200:40: -> ^( T_CONDITION[$wh] conditional_expression )<NEW_LINE>{<NEW_LINE>// JPA2.g:200:43: ^( T_CONDITION[$wh] conditional_expression )<NEW_LINE>{<NEW_LINE>Object root_1 = (Object) adaptor.nil();<NEW_LINE>root_1 = (Object) adaptor.becomeRoot(new WhereNode(T_CONDITION, wh), root_1);<NEW_LINE>adaptor.addChild(root_1, stream_conditional_expression.nextTree());<NEW_LINE>adaptor.addChild(root_0, root_1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>retval.tree = root_0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>retval.stop = input.LT(-1);<NEW_LINE>if (state.backtracking == 0) {<NEW_LINE>retval.tree = (Object) adaptor.rulePostProcessing(root_0);<NEW_LINE>adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>reportError(re);<NEW_LINE>recover(input, re);<NEW_LINE>retval.tree = (Object) adaptor.errorNode(input, retval.start, input.LT(-1), re);<NEW_LINE>} finally {<NEW_LINE>// do for sure before leaving<NEW_LINE>}<NEW_LINE>return retval;<NEW_LINE>}
add(conditional_expression134.getTree());
326,611
protected void registerDefaultAnnotationBinders(Map<Class<? extends Annotation>, RequestArgumentBinder> byAnnotation) {<NEW_LINE>DefaultBodyAnnotationBinder bodyBinder = new DefaultBodyAnnotationBinder(conversionService);<NEW_LINE>byAnnotation.put(Body.class, bodyBinder);<NEW_LINE>CookieAnnotationBinder<Object> cookieAnnotationBinder = new CookieAnnotationBinder<>(conversionService);<NEW_LINE>byAnnotation.put(cookieAnnotationBinder.getAnnotationType(), cookieAnnotationBinder);<NEW_LINE>HeaderAnnotationBinder<Object> headerAnnotationBinder = new HeaderAnnotationBinder<>(conversionService);<NEW_LINE>byAnnotation.put(headerAnnotationBinder.getAnnotationType(), headerAnnotationBinder);<NEW_LINE>ParameterAnnotationBinder<Object> parameterAnnotationBinder <MASK><NEW_LINE>byAnnotation.put(parameterAnnotationBinder.getAnnotationType(), parameterAnnotationBinder);<NEW_LINE>RequestAttributeAnnotationBinder<Object> requestAttributeAnnotationBinder = new RequestAttributeAnnotationBinder<>(conversionService);<NEW_LINE>byAnnotation.put(requestAttributeAnnotationBinder.getAnnotationType(), requestAttributeAnnotationBinder);<NEW_LINE>PathVariableAnnotationBinder<Object> pathVariableAnnotationBinder = new PathVariableAnnotationBinder<>(conversionService);<NEW_LINE>byAnnotation.put(pathVariableAnnotationBinder.getAnnotationType(), pathVariableAnnotationBinder);<NEW_LINE>RequestBeanAnnotationBinder<Object> requestBeanAnnotationBinder = new RequestBeanAnnotationBinder<>(this, conversionService);<NEW_LINE>byAnnotation.put(requestBeanAnnotationBinder.getAnnotationType(), requestBeanAnnotationBinder);<NEW_LINE>if (KOTLIN_COROUTINES_SUPPORTED) {<NEW_LINE>ContinuationArgumentBinder continuationArgumentBinder = new ContinuationArgumentBinder();<NEW_LINE>byType.put(continuationArgumentBinder.argumentType().typeHashCode(), continuationArgumentBinder);<NEW_LINE>}<NEW_LINE>}
= new ParameterAnnotationBinder<>(conversionService);
47,338
void pushBatch(NettyMessage message) {<NEW_LINE>if (message == null || message.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>synchronized (writeLock) {<NEW_LINE><MASK><NEW_LINE>if (channel == null) {<NEW_LINE>messageBuffer.add(message, false);<NEW_LINE>LOG.debug("Pending requested message, the size is {}, because channel is not ready.", messageBuffer.size());<NEW_LINE>} else {<NEW_LINE>if (channel.isWritable()) {<NEW_LINE>MessageBatch messageBatch = messageBuffer.add(message);<NEW_LINE>if (messageBatch != null) {<NEW_LINE>flushRequest(channel, messageBatch);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>messageBuffer.add(message, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (messageBuffer.size() >= BATCH_THRESHOLD_WARN) {<NEW_LINE>channel = waitForChannelReady();<NEW_LINE>if (channel != null) {<NEW_LINE>MessageBatch messageBatch = messageBuffer.drain();<NEW_LINE>flushRequest(channel, messageBatch);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Channel channel = channelRef.get();
822,296
public static DescribeInstanceAutoRenewAttributeResponse unmarshall(DescribeInstanceAutoRenewAttributeResponse describeInstanceAutoRenewAttributeResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeInstanceAutoRenewAttributeResponse.setRequestId(_ctx.stringValue("DescribeInstanceAutoRenewAttributeResponse.RequestId"));<NEW_LINE>describeInstanceAutoRenewAttributeResponse.setPageNumber(_ctx.integerValue("DescribeInstanceAutoRenewAttributeResponse.PageNumber"));<NEW_LINE>describeInstanceAutoRenewAttributeResponse.setPageSize(_ctx.integerValue("DescribeInstanceAutoRenewAttributeResponse.PageSize"));<NEW_LINE>describeInstanceAutoRenewAttributeResponse.setTotalCount<MASK><NEW_LINE>List<InstanceRenewAttribute> instanceRenewAttributes = new ArrayList<InstanceRenewAttribute>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeInstanceAutoRenewAttributeResponse.InstanceRenewAttributes.Length"); i++) {<NEW_LINE>InstanceRenewAttribute instanceRenewAttribute = new InstanceRenewAttribute();<NEW_LINE>instanceRenewAttribute.setPeriodUnit(_ctx.stringValue("DescribeInstanceAutoRenewAttributeResponse.InstanceRenewAttributes[" + i + "].PeriodUnit"));<NEW_LINE>instanceRenewAttribute.setDuration(_ctx.integerValue("DescribeInstanceAutoRenewAttributeResponse.InstanceRenewAttributes[" + i + "].Duration"));<NEW_LINE>instanceRenewAttribute.setRenewalStatus(_ctx.stringValue("DescribeInstanceAutoRenewAttributeResponse.InstanceRenewAttributes[" + i + "].RenewalStatus"));<NEW_LINE>instanceRenewAttribute.setInstanceId(_ctx.stringValue("DescribeInstanceAutoRenewAttributeResponse.InstanceRenewAttributes[" + i + "].InstanceId"));<NEW_LINE>instanceRenewAttribute.setAutoRenewEnabled(_ctx.booleanValue("DescribeInstanceAutoRenewAttributeResponse.InstanceRenewAttributes[" + i + "].AutoRenewEnabled"));<NEW_LINE>instanceRenewAttributes.add(instanceRenewAttribute);<NEW_LINE>}<NEW_LINE>describeInstanceAutoRenewAttributeResponse.setInstanceRenewAttributes(instanceRenewAttributes);<NEW_LINE>return describeInstanceAutoRenewAttributeResponse;<NEW_LINE>}
(_ctx.integerValue("DescribeInstanceAutoRenewAttributeResponse.TotalCount"));
945,428
public static TypeConstraint of(TypeVariable owner, com.vaticle.typeql.lang.pattern.constraint.TypeConstraint constraint, VariableRegistry registry) {<NEW_LINE>if (constraint.isLabel())<NEW_LINE>return LabelConstraint.of(owner, constraint.asLabel());<NEW_LINE>else if (constraint.isSub())<NEW_LINE>return SubConstraint.of(owner, constraint.asSub(), registry);<NEW_LINE>else if (constraint.isAbstract())<NEW_LINE>return AbstractConstraint.of(owner);<NEW_LINE>else if (constraint.isValueType())<NEW_LINE>return ValueTypeConstraint.of(<MASK><NEW_LINE>else if (constraint.isRegex())<NEW_LINE>return RegexConstraint.of(owner, constraint.asRegex());<NEW_LINE>else if (constraint.isOwns())<NEW_LINE>return OwnsConstraint.of(owner, constraint.asOwns(), registry);<NEW_LINE>else if (constraint.isPlays())<NEW_LINE>return PlaysConstraint.of(owner, constraint.asPlays(), registry);<NEW_LINE>else if (constraint.isRelates())<NEW_LINE>return RelatesConstraint.of(owner, constraint.asRelates(), registry);<NEW_LINE>else<NEW_LINE>throw TypeDBException.of(ILLEGAL_STATE);<NEW_LINE>}
owner, constraint.asValueType());
904,299
private void appendAverageDistinctDerivedProjection(final AggregationDistinctProjection averageDistinctProjection) {<NEW_LINE>String innerExpression = averageDistinctProjection.getInnerExpression();<NEW_LINE>String distinctInnerExpression = averageDistinctProjection.getDistinctInnerExpression();<NEW_LINE>String countAlias = DerivedColumn.AVG_COUNT_ALIAS.getDerivedColumnAlias(aggregationAverageDerivedColumnCount);<NEW_LINE>AggregationDistinctProjection countDistinctProjection = new AggregationDistinctProjection(0, 0, AggregationType.COUNT, innerExpression, countAlias, distinctInnerExpression, databaseType);<NEW_LINE>String sumAlias = DerivedColumn.AVG_SUM_ALIAS.getDerivedColumnAlias(aggregationAverageDerivedColumnCount);<NEW_LINE>AggregationDistinctProjection sumDistinctProjection = new AggregationDistinctProjection(0, 0, AggregationType.SUM, innerExpression, sumAlias, distinctInnerExpression, databaseType);<NEW_LINE>averageDistinctProjection.getDerivedAggregationProjections().add(countDistinctProjection);<NEW_LINE>averageDistinctProjection.<MASK><NEW_LINE>aggregationAverageDerivedColumnCount++;<NEW_LINE>}
getDerivedAggregationProjections().add(sumDistinctProjection);
797,806
public static QuerySavingPlanInstanceInnerResponse unmarshall(QuerySavingPlanInstanceInnerResponse querySavingPlanInstanceInnerResponse, UnmarshallerContext _ctx) {<NEW_LINE>querySavingPlanInstanceInnerResponse.setRequestId(_ctx.stringValue("QuerySavingPlanInstanceInnerResponse.RequestId"));<NEW_LINE>querySavingPlanInstanceInnerResponse.setMessage(_ctx.stringValue("QuerySavingPlanInstanceInnerResponse.Message"));<NEW_LINE>querySavingPlanInstanceInnerResponse.setCode(_ctx.stringValue("QuerySavingPlanInstanceInnerResponse.Code"));<NEW_LINE>querySavingPlanInstanceInnerResponse.setSuccess(_ctx.booleanValue("QuerySavingPlanInstanceInnerResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotalCount(_ctx.integerValue("QuerySavingPlanInstanceInnerResponse.Data.TotalCount"));<NEW_LINE>data.setPageSize(_ctx.integerValue("QuerySavingPlanInstanceInnerResponse.Data.PageSize"));<NEW_LINE>data.setCurrentPage(_ctx.integerValue("QuerySavingPlanInstanceInnerResponse.Data.CurrentPage"));<NEW_LINE>List<SpnInstanceDetailDTO> datas <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QuerySavingPlanInstanceInnerResponse.Data.Datas.Length"); i++) {<NEW_LINE>SpnInstanceDetailDTO spnInstanceDetailDTO = new SpnInstanceDetailDTO();<NEW_LINE>spnInstanceDetailDTO.setSpnInstanceId(_ctx.longValue("QuerySavingPlanInstanceInnerResponse.Data.Datas[" + i + "].SpnInstanceId"));<NEW_LINE>spnInstanceDetailDTO.setSpnInstanceCode(_ctx.stringValue("QuerySavingPlanInstanceInnerResponse.Data.Datas[" + i + "].SpnInstanceCode"));<NEW_LINE>spnInstanceDetailDTO.setPayMode(_ctx.stringValue("QuerySavingPlanInstanceInnerResponse.Data.Datas[" + i + "].PayMode"));<NEW_LINE>spnInstanceDetailDTO.setSpnType(_ctx.stringValue("QuerySavingPlanInstanceInnerResponse.Data.Datas[" + i + "].SpnType"));<NEW_LINE>spnInstanceDetailDTO.setInstanceFamily(_ctx.stringValue("QuerySavingPlanInstanceInnerResponse.Data.Datas[" + i + "].InstanceFamily"));<NEW_LINE>spnInstanceDetailDTO.setRegion(_ctx.stringValue("QuerySavingPlanInstanceInnerResponse.Data.Datas[" + i + "].Region"));<NEW_LINE>spnInstanceDetailDTO.setCycle(_ctx.stringValue("QuerySavingPlanInstanceInnerResponse.Data.Datas[" + i + "].Cycle"));<NEW_LINE>spnInstanceDetailDTO.setStartTime(_ctx.longValue("QuerySavingPlanInstanceInnerResponse.Data.Datas[" + i + "].StartTime"));<NEW_LINE>spnInstanceDetailDTO.setEndTime(_ctx.longValue("QuerySavingPlanInstanceInnerResponse.Data.Datas[" + i + "].EndTime"));<NEW_LINE>spnInstanceDetailDTO.setPoolValue(_ctx.floatValue("QuerySavingPlanInstanceInnerResponse.Data.Datas[" + i + "].PoolValue"));<NEW_LINE>spnInstanceDetailDTO.setUserId(_ctx.longValue("QuerySavingPlanInstanceInnerResponse.Data.Datas[" + i + "].UserId"));<NEW_LINE>spnInstanceDetailDTO.setSite(_ctx.stringValue("QuerySavingPlanInstanceInnerResponse.Data.Datas[" + i + "].Site"));<NEW_LINE>spnInstanceDetailDTO.setCurrency(_ctx.stringValue("QuerySavingPlanInstanceInnerResponse.Data.Datas[" + i + "].Currency"));<NEW_LINE>spnInstanceDetailDTO.setCommodityCode(_ctx.stringValue("QuerySavingPlanInstanceInnerResponse.Data.Datas[" + i + "].CommodityCode"));<NEW_LINE>spnInstanceDetailDTO.setStatus(_ctx.stringValue("QuerySavingPlanInstanceInnerResponse.Data.Datas[" + i + "].Status"));<NEW_LINE>datas.add(spnInstanceDetailDTO);<NEW_LINE>}<NEW_LINE>data.setDatas(datas);<NEW_LINE>querySavingPlanInstanceInnerResponse.setData(data);<NEW_LINE>return querySavingPlanInstanceInnerResponse;<NEW_LINE>}
= new ArrayList<SpnInstanceDetailDTO>();
1,509,066
public void process() {<NEW_LINE>StringBuilder sb = new StringBuilder(100);<NEW_LINE>// for request Data<NEW_LINE>StringBuilder rd = new StringBuilder(20);<NEW_LINE>SampleResult sr = new SampleResult();<NEW_LINE>sr.setSampleLabel(getName());<NEW_LINE>sr.sampleStart();<NEW_LINE>JMeterContext threadContext = getThreadContext();<NEW_LINE>if (isDisplaySamplerProperties()) {<NEW_LINE>rd.append("SamplerProperties\n");<NEW_LINE>sb.append("SamplerProperties:\n");<NEW_LINE>formatPropertyIterator(sb, threadContext.getCurrentSampler().propertyIterator());<NEW_LINE>sb.append("\n");<NEW_LINE>}<NEW_LINE>if (isDisplayJMeterVariables()) {<NEW_LINE>rd.append("JMeterVariables\n");<NEW_LINE>sb.append("JMeterVariables:\n");<NEW_LINE>formatSet(sb, threadContext.getVariables().entrySet());<NEW_LINE>sb.append("\n");<NEW_LINE>}<NEW_LINE>if (isDisplayJMeterProperties()) {<NEW_LINE>rd.append("JMeterProperties\n");<NEW_LINE>sb.append("JMeterProperties:\n");<NEW_LINE>formatSet(sb, JMeterUtils.getJMeterProperties().entrySet());<NEW_LINE>sb.append("\n");<NEW_LINE>}<NEW_LINE>if (isDisplaySystemProperties()) {<NEW_LINE>rd.append("SystemProperties\n");<NEW_LINE>sb.append("SystemProperties:\n");<NEW_LINE>formatSet(sb, System.getProperties().entrySet());<NEW_LINE>sb.append("\n");<NEW_LINE>}<NEW_LINE>sr.setThreadName(threadContext.getThread().getThreadName());<NEW_LINE>sr.setGroupThreads(threadContext.getThreadGroup().getNumberOfThreads());<NEW_LINE>sr.<MASK><NEW_LINE>sr.setResponseData(sb.toString(), null);<NEW_LINE>sr.setDataType(SampleResult.TEXT);<NEW_LINE>sr.setSamplerData(rd.toString());<NEW_LINE>sr.setResponseOK();<NEW_LINE>sr.sampleEnd();<NEW_LINE>threadContext.getPreviousResult().addSubResult(sr);<NEW_LINE>}
setAllThreads(JMeterContextService.getNumberOfThreads());
948,755
public void undoScale(SceneStructureProjective structure, SceneObservations observations) {<NEW_LINE>if (!structure.homogenous) {<NEW_LINE>double scale = desiredDistancePoint / medianDistancePoint;<NEW_LINE>undoNormPoints3D(structure, scale);<NEW_LINE>DMatrixRMaj A = new DMatrixRMaj(3, 3);<NEW_LINE>DMatrixRMaj A_inv = new DMatrixRMaj(3, 3);<NEW_LINE>Point3D_F64 a = new Point3D_F64();<NEW_LINE>Point3D_F64 c = new Point3D_F64();<NEW_LINE>for (int i = 0; i < structure.views.size; i++) {<NEW_LINE>SceneStructureProjective.View view = structure.views.data[i];<NEW_LINE>// X_w = inv(A)*(X_c - T) let X_c = 0 then X_w = -inv(A)*T is center of camera in world<NEW_LINE>CommonOps_DDRM.extract(view.<MASK><NEW_LINE>PerspectiveOps.extractColumn(view.worldToView, 3, a);<NEW_LINE>CommonOps_DDRM.invert(A, A_inv);<NEW_LINE>GeometryMath_F64.mult(A_inv, a, c);<NEW_LINE>// Apply transform<NEW_LINE>c.x = -c.x / scale + medianPoint.x;<NEW_LINE>c.y = -c.y / scale + medianPoint.y;<NEW_LINE>c.z = -c.z / scale + medianPoint.z;<NEW_LINE>// -A*T<NEW_LINE>GeometryMath_F64.mult(A, c, a);<NEW_LINE>a.scale(-1);<NEW_LINE>PerspectiveOps.insertColumn(view.worldToView, 3, a);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>undoScaleToPixelsAndCameraMatrix(structure, observations);<NEW_LINE>}
worldToView, 0, 0, A);
1,714,514
public int maxSumMinProduct(int[] nums) {<NEW_LINE>int n = nums.length;<NEW_LINE>long[] preSum = new long[n + 1];<NEW_LINE>for (int i = 1; i < n + 1; ++i) {<NEW_LINE>preSum[i] = preSum[i - 1] + nums[i - 1];<NEW_LINE>}<NEW_LINE>Deque<Integer> <MASK><NEW_LINE>int[] nextLesser = new int[n];<NEW_LINE>Arrays.fill(nextLesser, n);<NEW_LINE>for (int i = 0; i < n; ++i) {<NEW_LINE>while (!stack.isEmpty() && nums[stack.peek()] > nums[i]) {<NEW_LINE>nextLesser[stack.pop()] = i;<NEW_LINE>}<NEW_LINE>stack.push(i);<NEW_LINE>}<NEW_LINE>stack = new ArrayDeque<>();<NEW_LINE>int[] prevLesser = new int[n];<NEW_LINE>Arrays.fill(prevLesser, -1);<NEW_LINE>for (int i = n - 1; i >= 0; --i) {<NEW_LINE>while (!stack.isEmpty() && nums[stack.peek()] > nums[i]) {<NEW_LINE>prevLesser[stack.pop()] = i;<NEW_LINE>}<NEW_LINE>stack.push(i);<NEW_LINE>}<NEW_LINE>long res = 0;<NEW_LINE>for (int i = 0; i < n; ++i) {<NEW_LINE>int start = prevLesser[i], end = nextLesser[i];<NEW_LINE>long t = nums[i] * (preSum[end] - preSum[start + 1]);<NEW_LINE>res = Math.max(res, t);<NEW_LINE>}<NEW_LINE>return (int) (res % 1000000007);<NEW_LINE>}
stack = new ArrayDeque<>();
1,653,677
public void run() {<NEW_LINE>switch(opCode) {<NEW_LINE>case FIND_LINE_NUMBER:<NEW_LINE>{<NEW_LINE>Element paragraphsParent = findLineRootElement(doc);<NEW_LINE>// argInt is offset<NEW_LINE>retInt = paragraphsParent.getElementIndex(argInt);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case FIND_LINE_COLUMN:<NEW_LINE>{<NEW_LINE>Element paragraphsParent = findLineRootElement(doc);<NEW_LINE>// argInt is offset<NEW_LINE>int indx = paragraphsParent.getElementIndex(argInt);<NEW_LINE>retInt = argInt - paragraphsParent.getElement(indx).getStartOffset();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case FIND_LINE_OFFSET:<NEW_LINE>{<NEW_LINE>Element paragraphsParent = findLineRootElement(doc);<NEW_LINE>// argInt is lineNumber<NEW_LINE>Element <MASK><NEW_LINE>if (line == null) {<NEW_LINE>// NOI18N<NEW_LINE>throw new IndexOutOfBoundsException("Index=" + argInt + " is out of bounds.");<NEW_LINE>}<NEW_LINE>retInt = line.getStartOffset();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>}
line = paragraphsParent.getElement(argInt);
1,616,237
final PrepareQueryResult executePrepareQuery(PrepareQueryRequest prepareQueryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(prepareQueryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PrepareQueryRequest> request = null;<NEW_LINE>Response<PrepareQueryResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new PrepareQueryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(prepareQueryRequest));<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, "Timestream Query");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PrepareQuery");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI cachedEndpoint = null;<NEW_LINE>if (endpointDiscoveryEnabled) {<NEW_LINE>DescribeEndpointsRequest discoveryRequest = new DescribeEndpointsRequest();<NEW_LINE>cachedEndpoint = cache.get(awsCredentialsProvider.getCredentials().getAWSAccessKeyId(), discoveryRequest, true, endpoint);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PrepareQueryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PrepareQueryResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, cachedEndpoint, null);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,553,762
protected void parseClause(JRQueryChunkHandler chunkHandler, String clauseChunk) {<NEW_LINE>List<String> tokens = new ArrayList<>();<NEW_LINE>boolean wasClauseToken = false;<NEW_LINE>char separator = determineClauseTokenSeparator(clauseChunk);<NEW_LINE>String <MASK><NEW_LINE>StringTokenizer tokenizer = new StringTokenizer(clauseChunk, separatorString, true);<NEW_LINE>while (tokenizer.hasMoreTokens()) {<NEW_LINE>String token = tokenizer.nextToken();<NEW_LINE>if (token.equals(separatorString)) {<NEW_LINE>if (!wasClauseToken) {<NEW_LINE>tokens.add("");<NEW_LINE>}<NEW_LINE>wasClauseToken = false;<NEW_LINE>} else {<NEW_LINE>tokens.add(token);<NEW_LINE>wasClauseToken = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!wasClauseToken) {<NEW_LINE>tokens.add("");<NEW_LINE>}<NEW_LINE>String[] tokensArray = tokens.toArray(new String[tokens.size()]);<NEW_LINE>chunkHandler.handleClauseChunk(tokensArray, separator);<NEW_LINE>}
separatorString = String.valueOf(separator);
709,061
public static String format(Locale locale, String pattern, Object[] arguments, boolean translateArguments) throws LanguageException {<NEW_LINE>String value = null;<NEW_LINE>User fakeUser = new User();<NEW_LINE>fakeUser.setLocale(locale);<NEW_LINE>String pattern2 = get(fakeUser, pattern);<NEW_LINE>if (!pattern.equals(pattern2)) {<NEW_LINE>pattern = pattern2;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Logger.<MASK><NEW_LINE>if (arguments != null) {<NEW_LINE>Object[] formattedArguments = new Object[arguments.length];<NEW_LINE>for (int i = 0; i < arguments.length; i++) {<NEW_LINE>if (translateArguments) {<NEW_LINE>formattedArguments[i] = get(fakeUser, arguments[i].toString());<NEW_LINE>} else {<NEW_LINE>formattedArguments[i] = arguments[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>value = MessageFormat.format(pattern, formattedArguments);<NEW_LINE>} else {<NEW_LINE>Logger.warn(LanguageUtil.class, pattern);<NEW_LINE>value = pattern;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new LanguageException(e);<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}
debug(LanguageUtil.class, pattern);
124,018
public void layoutContainer(Container c) {<NEW_LINE>if (lastOrientation != getOrientation()) {<NEW_LINE>if (leftButton != null) {<NEW_LINE>leftButton.setIcon(getOrientation() == JSplitPane.VERTICAL_SPLIT ? upArrow : leftArrow);<NEW_LINE>leftButton.setMinimumSize(getOrientation() == JSplitPane.VERTICAL_SPLIT ? new Dimension(8, 6) : new Dimension(6, 8));<NEW_LINE>}<NEW_LINE>if (rightButton != null) {<NEW_LINE>rightButton.setIcon(getOrientation() == JSplitPane.VERTICAL_SPLIT ? downArrow : rightArrow);<NEW_LINE>rightButton.setMinimumSize(getOrientation() == JSplitPane.VERTICAL_SPLIT ? new Dimension(8, 6) : new Dimension(6, 8));<NEW_LINE>}<NEW_LINE>lastOrientation = getOrientation();<NEW_LINE>}<NEW_LINE>if (getOrientation() == JSplitPane.VERTICAL_SPLIT) {<NEW_LINE>if (leftButton != null) {<NEW_LINE>leftButton.setBounds(<MASK><NEW_LINE>}<NEW_LINE>if (rightButton != null) {<NEW_LINE>rightButton.setBounds(12, 2, 8, 6);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (leftButton != null) {<NEW_LINE>leftButton.setBounds(2, 2, 6, 8);<NEW_LINE>}<NEW_LINE>if (rightButton != null) {<NEW_LINE>rightButton.setBounds(2, 12, 6, 8);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
2, 2, 8, 6);
792,330
public static Map<String, Object> buildCodestartProjectData(Collection<Codestart> baseCodestarts, Collection<Codestart> extraCodestarts) {<NEW_LINE>final HashMap<String, Object> data = new HashMap<>();<NEW_LINE>baseCodestarts.forEach((c) -> data.put(INPUT_BASE_CODESTART_KEY_PREFIX + c.getSpec().getType().toString().toLowerCase(), c.getName()));<NEW_LINE>data.put(INPUT_BASE_CODESTARTS_KEY, baseCodestarts.stream().map(Codestart::getName).collect<MASK><NEW_LINE>data.put(INPUT_EXTRA_CODESTARTS_KEY, extraCodestarts.stream().map(Codestart::getName).collect(Collectors.toList()));<NEW_LINE>return NestedMaps.unflatten(data);<NEW_LINE>}
(Collectors.toList()));
790,385
private DeviceAuthorization createDeviceAuthorization(String rawResponse) throws IOException {<NEW_LINE>final JsonNode response = OBJECT_MAPPER.readTree(rawResponse);<NEW_LINE>final DeviceAuthorization deviceAuthorization = new DeviceAuthorization(extractRequiredParameter(response, "device_code", rawResponse).textValue(), extractRequiredParameter(response, "user_code", rawResponse).textValue(), extractRequiredParameter(response, getVerificationUriParamName(), rawResponse).textValue(), extractRequiredParameter(response, "expires_in", rawResponse).intValue());<NEW_LINE>final JsonNode intervalSeconds = response.get("interval");<NEW_LINE>if (intervalSeconds != null) {<NEW_LINE>deviceAuthorization.setIntervalSeconds(intervalSeconds.asInt(5));<NEW_LINE>}<NEW_LINE>final JsonNode verificationUriComplete = response.get("verification_uri_complete");<NEW_LINE>if (verificationUriComplete != null) {<NEW_LINE>deviceAuthorization.<MASK><NEW_LINE>}<NEW_LINE>return deviceAuthorization;<NEW_LINE>}
setVerificationUriComplete(verificationUriComplete.asText());
174,759
public static void init(String[] args, ClientBaseConfig config, boolean createEndpoint) throws IOException {<NEW_LINE>CommandLine cmd = new CommandLine(config);<NEW_LINE>config.register(cmd);<NEW_LINE>try {<NEW_LINE>ParseResult <MASK><NEW_LINE>if (result.isVersionHelpRequested()) {<NEW_LINE>String version = StringUtil.CALIFORNIUM_VERSION == null ? "" : StringUtil.CALIFORNIUM_VERSION;<NEW_LINE>System.out.println("\nCalifornium (Cf) " + cmd.getCommandName() + " " + version);<NEW_LINE>cmd.printVersionHelp(System.out);<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>config.defaults();<NEW_LINE>if (config.helpRequested) {<NEW_LINE>cmd.usage(System.out);<NEW_LINE>if (config.authHelpRequested) {<NEW_LINE>System.out.println();<NEW_LINE>System.out.println(" --auth: values");<NEW_LINE>print(" ", ConnectorConfig.MAX_WIDTH, Arrays.asList(AuthenticationMode.values()), System.out);<NEW_LINE>}<NEW_LINE>if (config.cipherHelpRequested) {<NEW_LINE>List<CipherSuite> list = new ArrayList<CipherSuite>();<NEW_LINE>for (CipherSuite cipherSuite : CipherSuite.values()) {<NEW_LINE>if (cipherSuite.isSupported() && !CipherSuite.TLS_NULL_WITH_NULL_NULL.equals(cipherSuite)) {<NEW_LINE>list.add(cipherSuite);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println(" --cipher: values");<NEW_LINE>print(" ", ConnectorConfig.MAX_WIDTH, list, System.out);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (ParameterException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>System.err.println(ex.getMessage());<NEW_LINE>System.err.println();<NEW_LINE>cmd.usage(System.err);<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>if (createEndpoint) {<NEW_LINE>CoapEndpoint coapEndpoint = createEndpoint(config, null);<NEW_LINE>coapEndpoint.start();<NEW_LINE>LOGGER.info("endpoint started at {}", coapEndpoint.getAddress());<NEW_LINE>EndpointManager.getEndpointManager().setDefaultEndpoint(coapEndpoint);<NEW_LINE>}<NEW_LINE>}
result = cmd.parseArgs(args);
761,940
public int match(Annotation node, MatchingNodeSet nodeSet) {<NEW_LINE>if (!this.pattern.findReferences)<NEW_LINE>return IMPOSSIBLE_MATCH;<NEW_LINE>MemberValuePair[] pairs = node.memberValuePairs();<NEW_LINE>if (pairs == null || pairs.length == 0)<NEW_LINE>return IMPOSSIBLE_MATCH;<NEW_LINE>int length = pairs.length;<NEW_LINE>MemberValuePair pair = null;<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>pair = node.memberValuePairs()[i];<NEW_LINE>if (matchesName(this.pattern.selector, pair.name)) {<NEW_LINE>ASTNode possibleNode = (node instanceof SingleMemberAnnotation<MASK><NEW_LINE>return nodeSet.addMatch(possibleNode, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return IMPOSSIBLE_MATCH;<NEW_LINE>}
) ? (ASTNode) node : pair;
1,382,813
private FlowScope traverseAdd(Node n, FlowScope scope) {<NEW_LINE><MASK><NEW_LINE>Node right = left.getNext();<NEW_LINE>scope = traverseChildren(n, scope);<NEW_LINE>JSType leftType = left.getJSType();<NEW_LINE>JSType rightType = right.getJSType();<NEW_LINE>JSType type = unknownType;<NEW_LINE>if (leftType != null && rightType != null) {<NEW_LINE>boolean leftIsUnknown = leftType.isUnknownType();<NEW_LINE>boolean rightIsUnknown = rightType.isUnknownType();<NEW_LINE>if ((!leftIsUnknown && leftType.isString()) || (!rightIsUnknown && rightType.isString())) {<NEW_LINE>type = getNativeType(STRING_TYPE);<NEW_LINE>} else if (getBigIntPresence(leftType) != BigIntPresence.NO_BIGINT || getBigIntPresence(rightType) != BigIntPresence.NO_BIGINT) {<NEW_LINE>return traverseBigIntCompatibleBinaryOperator(n, scope);<NEW_LINE>} else if (leftIsUnknown || rightIsUnknown) {<NEW_LINE>type = unknownType;<NEW_LINE>} else if (isAddedAsNumber(leftType) && isAddedAsNumber(rightType)) {<NEW_LINE>type = getNativeType(NUMBER_TYPE);<NEW_LINE>} else {<NEW_LINE>type = getNativeType(NUMBER_STRING);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>n.setJSType(type);<NEW_LINE>if (n.isAssignAdd()) {<NEW_LINE>// TODO(johnlenz): this should not update the type of the lhs as that is use as a<NEW_LINE>// input and need to be preserved for type checking.<NEW_LINE>// Instead call this overload `updateScopeForAssignment(scope, left, leftType, type, null);`<NEW_LINE>scope = updateScopeForAssignment(scope, left, type, AssignmentType.ASSIGN);<NEW_LINE>}<NEW_LINE>return scope;<NEW_LINE>}
Node left = n.getFirstChild();
1,189,234
public void onFocusChange(View v, boolean hasFocus) {<NEW_LINE>mHasFocus = mAddressStreetView.hasFocus() || mAddressExtendedStreetView.hasFocus() || mAddressCityView.hasFocus() || mAddressPostcodeView.hasFocus() || mAddressPoBoxView.hasFocus() || mAddressRegionView.hasFocus() || mAddressCountryView.hasFocus();<NEW_LINE>if (mHasFocus) {<NEW_LINE>mAddressDetailsParentView.setVisibility(View.VISIBLE);<NEW_LINE>mAddressFullCombinedView.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>mAddressDetailsParentView.setVisibility(View.GONE);<NEW_LINE>String streetAddress = mAddressStreetView.getText().toString();<NEW_LINE>streetAddress = streetAddress == null ? "" : streetAddress;<NEW_LINE>String extendedStreetAddress = mAddressExtendedStreetView.getText().toString();<NEW_LINE>extendedStreetAddress = extendedStreetAddress == null ? "" : extendedStreetAddress;<NEW_LINE>String postalCodeAddress = mAddressPostcodeView.getText().toString();<NEW_LINE>postalCodeAddress = postalCodeAddress == null ? "" : postalCodeAddress;<NEW_LINE>String localityAddress = mAddressCityView.getText().toString();<NEW_LINE>localityAddress = localityAddress == null ? "" : localityAddress;<NEW_LINE>String poBoxAddress = mAddressPoBoxView.getText().toString();<NEW_LINE>poBoxAddress = poBoxAddress == null ? "" : poBoxAddress;<NEW_LINE>String regionAddress = mAddressRegionView.getText().toString();<NEW_LINE>regionAddress = regionAddress == null ? "" : regionAddress;<NEW_LINE>String countryAddress = mAddressCountryView.getText().toString();<NEW_LINE>countryAddress <MASK><NEW_LINE>fillAddressValues(streetAddress, extendedStreetAddress, postalCodeAddress, localityAddress, poBoxAddress, regionAddress, countryAddress);<NEW_LINE>mAddressFullCombinedView.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>}
= countryAddress == null ? "" : countryAddress;
961,219
public void index(Record record) {<NEW_LINE>if (directory == null)<NEW_LINE>init();<NEW_LINE>if (!overwrite && path != null)<NEW_LINE>delete(record);<NEW_LINE>Document doc = new Document();<NEW_LINE>for (String propname : record.getProperties()) {<NEW_LINE>Property prop = config.getPropertyByName(propname);<NEW_LINE>if (prop == null)<NEW_LINE>throw new DukeConfigException("Record has property " + propname + " for which there is no configuration");<NEW_LINE>if (prop.getComparator() instanceof GeopositionComparator && geoprop != null) {<NEW_LINE>// index specially as geocoordinates<NEW_LINE>String v = record.getValue(propname);<NEW_LINE>if (v == null || v.equals(""))<NEW_LINE>continue;<NEW_LINE>// this gives us a searchable geoindexed value<NEW_LINE>for (IndexableField f : geoprop.createIndexableFields(v<MASK><NEW_LINE>// this preserves the coordinates in readable form for display purposes<NEW_LINE>doc.add(new Field(propname, v, Field.Store.YES, Field.Index.NOT_ANALYZED));<NEW_LINE>} else {<NEW_LINE>Field.Index ix;<NEW_LINE>if (prop.isIdProperty())<NEW_LINE>// so findRecordById will work<NEW_LINE>ix = Field.Index.NOT_ANALYZED;<NEW_LINE>else<NEW_LINE>// if (prop.isAnalyzedProperty())<NEW_LINE>ix = Field.Index.ANALYZED;<NEW_LINE>// FIXME: it turns out that with the StandardAnalyzer you can't have a<NEW_LINE>// multi-token value that's not analyzed if you want to find it again...<NEW_LINE>// else<NEW_LINE>// ix = Field.Index.NOT_ANALYZED;<NEW_LINE>Float boost = getBoostFactor(prop.getHighProbability(), BoostMode.INDEX);<NEW_LINE>for (String v : record.getValues(propname)) {<NEW_LINE>if (v.equals(""))<NEW_LINE>// FIXME: not sure if this is necessary<NEW_LINE>continue;<NEW_LINE>Field field = new Field(propname, v, Field.Store.YES, ix);<NEW_LINE>if (boost != null)<NEW_LINE>field.setBoost(boost);<NEW_LINE>doc.add(field);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>iwriter.addDocument(doc);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new DukeException(e);<NEW_LINE>}<NEW_LINE>}
)) doc.add(f);
1,641,924
public static GetElastictaskResponse unmarshall(GetElastictaskResponse getElastictaskResponse, UnmarshallerContext _ctx) {<NEW_LINE>getElastictaskResponse.setRequestId(_ctx.stringValue("GetElastictaskResponse.RequestId"));<NEW_LINE>Result result = new Result();<NEW_LINE>ElasticExpansionTask elasticExpansionTask = new ElasticExpansionTask();<NEW_LINE>elasticExpansionTask.setTriggerType(_ctx.stringValue("GetElastictaskResponse.Result.elasticExpansionTask.triggerType"));<NEW_LINE>elasticExpansionTask.setCronExpression<MASK><NEW_LINE>elasticExpansionTask.setElasticNodeCount(_ctx.integerValue("GetElastictaskResponse.Result.elasticExpansionTask.elasticNodeCount"));<NEW_LINE>elasticExpansionTask.setReplicaCount(_ctx.integerValue("GetElastictaskResponse.Result.elasticExpansionTask.replicaCount"));<NEW_LINE>List<String> targetIndices = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetElastictaskResponse.Result.elasticExpansionTask.targetIndices.Length"); i++) {<NEW_LINE>targetIndices.add(_ctx.stringValue("GetElastictaskResponse.Result.elasticExpansionTask.targetIndices[" + i + "]"));<NEW_LINE>}<NEW_LINE>elasticExpansionTask.setTargetIndices(targetIndices);<NEW_LINE>result.setElasticExpansionTask(elasticExpansionTask);<NEW_LINE>ElasticShrinkTask elasticShrinkTask = new ElasticShrinkTask();<NEW_LINE>elasticShrinkTask.setTriggerType(_ctx.stringValue("GetElastictaskResponse.Result.elasticShrinkTask.triggerType"));<NEW_LINE>elasticShrinkTask.setCronExpression(_ctx.stringValue("GetElastictaskResponse.Result.elasticShrinkTask.cronExpression"));<NEW_LINE>elasticShrinkTask.setElasticNodeCount(_ctx.integerValue("GetElastictaskResponse.Result.elasticShrinkTask.elasticNodeCount"));<NEW_LINE>elasticShrinkTask.setReplicaCount(_ctx.integerValue("GetElastictaskResponse.Result.elasticShrinkTask.replicaCount"));<NEW_LINE>List<String> targetIndices1 = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetElastictaskResponse.Result.elasticShrinkTask.targetIndices.Length"); i++) {<NEW_LINE>targetIndices1.add(_ctx.stringValue("GetElastictaskResponse.Result.elasticShrinkTask.targetIndices[" + i + "]"));<NEW_LINE>}<NEW_LINE>elasticShrinkTask.setTargetIndices1(targetIndices1);<NEW_LINE>result.setElasticShrinkTask(elasticShrinkTask);<NEW_LINE>getElastictaskResponse.setResult(result);<NEW_LINE>return getElastictaskResponse;<NEW_LINE>}
(_ctx.stringValue("GetElastictaskResponse.Result.elasticExpansionTask.cronExpression"));
1,083,084
public BeanDefinition parse(Element element, ParserContext parserContext) {<NEW_LINE>this.headerWriters = new ManagedList<>();<NEW_LINE>BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(HeaderWriterFilter.class);<NEW_LINE>boolean disabled = element != null && "true".equals(resolveAttribute(parserContext, element, "disabled"));<NEW_LINE>boolean defaultsDisabled = element != null && "true".equals(resolveAttribute(parserContext, element, "defaults-disabled"));<NEW_LINE>boolean addIfNotPresent = element == null || !disabled && !defaultsDisabled;<NEW_LINE>parseCacheControlElement(addIfNotPresent, element);<NEW_LINE>parseHstsElement(addIfNotPresent, element, parserContext);<NEW_LINE><MASK><NEW_LINE>parseFrameOptionsElement(addIfNotPresent, element, parserContext);<NEW_LINE>parseContentTypeOptionsElement(addIfNotPresent, element);<NEW_LINE>parseHpkpElement(element == null || !disabled, element, parserContext);<NEW_LINE>parseContentSecurityPolicyElement(disabled, element, parserContext);<NEW_LINE>parseReferrerPolicyElement(element, parserContext);<NEW_LINE>parseFeaturePolicyElement(element, parserContext);<NEW_LINE>parsePermissionsPolicyElement(element, parserContext);<NEW_LINE>parseCrossOriginOpenerPolicy(disabled, element);<NEW_LINE>parseCrossOriginEmbedderPolicy(disabled, element);<NEW_LINE>parseCrossOriginResourcePolicy(disabled, element);<NEW_LINE>parseHeaderElements(element);<NEW_LINE>boolean noWriters = this.headerWriters.isEmpty();<NEW_LINE>if (disabled && !noWriters) {<NEW_LINE>parserContext.getReaderContext().error("Cannot specify <headers disabled=\"true\"> with child elements.", element);<NEW_LINE>} else if (noWriters) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>builder.addConstructorArgValue(this.headerWriters);<NEW_LINE>return builder.getBeanDefinition();<NEW_LINE>}
parseXssElement(addIfNotPresent, element, parserContext);
1,764,011
public SubnetAssociation unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>SubnetAssociation subnetAssociation = new SubnetAssociation();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return subnetAssociation;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("subnetId", targetDepth)) {<NEW_LINE>subnetAssociation.setSubnetId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("state", targetDepth)) {<NEW_LINE>subnetAssociation.setState(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return subnetAssociation;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
XMLEvent xmlEvent = context.nextEvent();
129,500
public void marshall(CreateGraphqlApiRequest createGraphqlApiRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createGraphqlApiRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createGraphqlApiRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createGraphqlApiRequest.getLogConfig(), LOGCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(createGraphqlApiRequest.getAuthenticationType(), AUTHENTICATIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createGraphqlApiRequest.getUserPoolConfig(), USERPOOLCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(createGraphqlApiRequest.getOpenIDConnectConfig(), OPENIDCONNECTCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(createGraphqlApiRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createGraphqlApiRequest.getAdditionalAuthenticationProviders(), ADDITIONALAUTHENTICATIONPROVIDERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createGraphqlApiRequest.getXrayEnabled(), XRAYENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(createGraphqlApiRequest.getLambdaAuthorizerConfig(), LAMBDAAUTHORIZERCONFIG_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
168,048
public static LocalVariableAnnotation findUniqueBestMatchingParameter(ClassContext classContext, Method method, String name, String signature) {<NEW_LINE>LocalVariableAnnotation match = null;<NEW_LINE>int localsThatAreParameters = PreorderVisitor.getNumberArguments(method.getSignature());<NEW_LINE>int startIndex = 0;<NEW_LINE>if (!method.isStatic()) {<NEW_LINE>startIndex = 1;<NEW_LINE>}<NEW_LINE>SignatureParser parser = new SignatureParser(method.getSignature());<NEW_LINE>Iterator<String<MASK><NEW_LINE>int lowestCost = Integer.MAX_VALUE;<NEW_LINE>for (int i = startIndex; i < localsThatAreParameters + startIndex; i++) {<NEW_LINE>String sig = signatureIterator.next();<NEW_LINE>if (signature.equals(sig)) {<NEW_LINE>LocalVariableAnnotation potentialMatch = LocalVariableAnnotation.getLocalVariableAnnotation(method, i, 0, 0);<NEW_LINE>if (!potentialMatch.isNamed()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int distance = EditDistance.editDistance(name, potentialMatch.getName());<NEW_LINE>if (distance < lowestCost) {<NEW_LINE>match = potentialMatch;<NEW_LINE>match.setDescription(DID_YOU_MEAN_ROLE);<NEW_LINE>lowestCost = distance;<NEW_LINE>} else if (distance == lowestCost) {<NEW_LINE>// not unique best match<NEW_LINE>match = null;<NEW_LINE>}<NEW_LINE>// signatures match<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (lowestCost < 5) {<NEW_LINE>return match;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
> signatureIterator = parser.parameterSignatureIterator();
486,658
public void listen(UpdateRefusedEvent updateRefusedEvent) {<NEW_LINE>jabRefFrame.getDialogService().notify(Localization.lang("Update refused."));<NEW_LINE>BibEntry localBibEntry = updateRefusedEvent.getLocalBibEntry();<NEW_LINE>BibEntry sharedBibEntry = updateRefusedEvent.getSharedBibEntry();<NEW_LINE>StringBuilder message = new StringBuilder();<NEW_LINE>message.append(Localization.lang("Update could not be performed due to existing change conflicts."));<NEW_LINE>message.append("\r\n");<NEW_LINE>message.append(Localization.lang("You are not working on the newest version of BibEntry."));<NEW_LINE>message.append("\r\n");<NEW_LINE>message.append(Localization.lang("Shared version: %0", String.valueOf(sharedBibEntry.getSharedBibEntryData().getVersion())));<NEW_LINE>message.append("\r\n");<NEW_LINE>message.append(Localization.lang("Local version: %0", String.valueOf(localBibEntry.getSharedBibEntryData().getVersion())));<NEW_LINE>message.append("\r\n");<NEW_LINE>message.append(Localization.lang("Press \"Merge entries\" to merge the changes and resolve this problem."));<NEW_LINE>message.append("\r\n");<NEW_LINE>message.append(Localization.lang("Canceling this operation will leave your changes unsynchronized."));<NEW_LINE>ButtonType merge = new ButtonType(Localization.lang("Merge entries"), ButtonBar.ButtonData.YES);<NEW_LINE>Optional<ButtonType> response = dialogService.showCustomButtonDialogAndWait(AlertType.CONFIRMATION, Localization.lang("Update refused"), message.toString(<MASK><NEW_LINE>if (response.isPresent() && response.get().equals(merge)) {<NEW_LINE>MergeEntriesDialog dialog = new MergeEntriesDialog(localBibEntry, sharedBibEntry);<NEW_LINE>Optional<BibEntry> mergedEntry = dialogService.showCustomDialogAndWait(dialog);<NEW_LINE>mergedEntry.ifPresent(mergedBibEntry -> {<NEW_LINE>mergedBibEntry.getSharedBibEntryData().setSharedID(sharedBibEntry.getSharedBibEntryData().getSharedID());<NEW_LINE>mergedBibEntry.getSharedBibEntryData().setVersion(sharedBibEntry.getSharedBibEntryData().getVersion());<NEW_LINE>dbmsSynchronizer.synchronizeSharedEntry(mergedBibEntry);<NEW_LINE>dbmsSynchronizer.synchronizeLocalDatabase();<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
), ButtonType.CANCEL, merge);
1,501,026
private void writeResponse(SolrQueryRequest solrReq, SolrQueryResponse solrRsp, HttpServletResponse response, QueryResponseWriter responseWriter, Method reqMethod) throws IOException {<NEW_LINE>try {<NEW_LINE>Object invalidStates = solrReq.getContext().get(CloudSolrClient.STATE_VERSION);<NEW_LINE>// This is the last item added to the response and the client would expect it<NEW_LINE>// that way.<NEW_LINE>// If that assumption is changed , it would fail. This is done to avoid an O(n)<NEW_LINE>// scan on<NEW_LINE>// the response for each request<NEW_LINE>if (invalidStates != null)<NEW_LINE>solrRsp.<MASK><NEW_LINE>// Now write it out<NEW_LINE>final String ct = responseWriter.getContentType(solrReq, solrRsp);<NEW_LINE>// don't call setContentType on null<NEW_LINE>if (null != ct)<NEW_LINE>response.setContentType(ct);<NEW_LINE>if (solrRsp.getException() != null) {<NEW_LINE>@SuppressWarnings("rawtypes")<NEW_LINE>NamedList info = new SimpleOrderedMap();<NEW_LINE>int code = ResponseUtils.getErrorInfo(solrRsp.getException(), info, null);<NEW_LINE>solrRsp.add("error", info);<NEW_LINE>response.setStatus(code);<NEW_LINE>}<NEW_LINE>if (Method.HEAD != reqMethod) {<NEW_LINE>OutputStream out = response.getOutputStream();<NEW_LINE>QueryResponseWriterUtil.writeQueryResponse(out, responseWriter, solrReq, solrRsp, ct);<NEW_LINE>}<NEW_LINE>// else http HEAD request, nothing to write out, waited this long just to get<NEW_LINE>// ContentType<NEW_LINE>} catch (EOFException e) {<NEW_LINE>ConcurrentLog.info("SolrServlet", "Unable to write response, client closed connection or we are shutting down", e);<NEW_LINE>}<NEW_LINE>}
add(CloudSolrClient.STATE_VERSION, invalidStates);
1,149,880
public final Condition lessThan(Field<T1> t1, Field<T2> t2, Field<T3> t3, Field<T4> t4, Field<T5> t5, Field<T6> t6, Field<T7> t7, Field<T8> t8, Field<T9> t9, Field<T10> t10, Field<T11> t11, Field<T12> t12, Field<T13> t13, Field<T14> t14, Field<T15> t15, Field<T16> t16, Field<T17> t17, Field<T18> t18) {<NEW_LINE>return compare(Comparator.LESS, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, <MASK><NEW_LINE>}
t15, t16, t17, t18);
407,761
/*<NEW_LINE>* This method takes in a node as an argument and will create a new one if<NEW_LINE>* it should be displayed in the tree. If it is to be displayed, it also<NEW_LINE>* figures out if it is a leaf or not (i.e. should it have a + sign in the<NEW_LINE>* tree).<NEW_LINE>*<NEW_LINE>* It does NOT create children nodes<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected Node[] createNodes(Node origNode) {<NEW_LINE>if (origNode == null || !(origNode instanceof DisplayableItemNode)) {<NEW_LINE>return new Node[] {};<NEW_LINE>}<NEW_LINE>// Shoudl this node be displayed in the tree or not<NEW_LINE><MASK><NEW_LINE>if (diNode.accept(showItemV) == false) {<NEW_LINE>// do not show<NEW_LINE>return new Node[] {};<NEW_LINE>}<NEW_LINE>// If it is going to be displayed, then determine if it should<NEW_LINE>// have a '+' next to it based on if it has children of itself.<NEW_LINE>// We will filter out the "." and ".." directories<NEW_LINE>final boolean isLeaf = diNode.accept(isLeafItemV);<NEW_LINE>return new Node[] { this.copyNode(origNode, !isLeaf) };<NEW_LINE>}
final DisplayableItemNode diNode = (DisplayableItemNode) origNode;
1,596,625
@Consumes({ MediaType.APPLICATION_JSON, SmileMediaTypes.APPLICATION_JACKSON_SMILE })<NEW_LINE>public // used only to get request content-type<NEW_LINE>Response // used only to get request content-type<NEW_LINE>serviceAnnouncementPOSTAll(// used only to get request content-type<NEW_LINE>final InputStream inputStream, @Context final HttpServletRequest req) {<NEW_LINE>final String reqContentType = req.getContentType();<NEW_LINE>final boolean isSmile = SmileMediaTypes.APPLICATION_JACKSON_SMILE.equals(reqContentType);<NEW_LINE>final ObjectMapper mapper = isSmile ? smileMapper : jsonMapper;<NEW_LINE>try {<NEW_LINE>return handler.handlePOSTAll(inputStream, mapper);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(e, "Exception in handling POSTAll request");<NEW_LINE>return Response.serverError().entity(ServletResourceUtils.sanitizeException<MASK><NEW_LINE>}<NEW_LINE>}
(e)).build();
1,335,008
public void onTestStart(ITestResult result) {<NEW_LINE>// create new folder for test report<NEW_LINE>ReportContext.createTestDir();<NEW_LINE>LOGGER.debug("AbstractTestListener->onTestStart");<NEW_LINE>LOGGER.debug("Test Directory: {}", ReportContext.<MASK><NEW_LINE>IRetryAnalyzer curRetryAnalyzer = getRetryAnalyzer(result);<NEW_LINE>if (curRetryAnalyzer == null || curRetryAnalyzer instanceof DisabledRetryAnalyzer || curRetryAnalyzer instanceof RetryAnalyzerInterceptor) {<NEW_LINE>// this call register retryAnalyzer.class both in Carina and Zebrunner client<NEW_LINE>RetryService.setRetryAnalyzerClass(RetryAnalyzer.class, result.getTestContext(), result.getMethod());<NEW_LINE>result.getMethod().setRetryAnalyzerClass(RetryAnalyzerInterceptor.class);<NEW_LINE>} else if (!(curRetryAnalyzer instanceof RetryAnalyzerInterceptor)) {<NEW_LINE>LOGGER.warn("Custom RetryAnalyzer is used: " + curRetryAnalyzer.getClass().getName());<NEW_LINE>RetryService.setRetryAnalyzerClass(curRetryAnalyzer.getClass(), result.getTestContext(), result.getMethod());<NEW_LINE>result.getMethod().setRetryAnalyzerClass(RetryAnalyzerInterceptor.class);<NEW_LINE>}<NEW_LINE>generateParameters(result);<NEW_LINE>if (// set parameters from XLS only if test contains any parameter at<NEW_LINE>!result.getTestContext().getCurrentXmlTest().getAllParameters().containsKey(SpecialKeywords.EXCEL_DS_CUSTOM_PROVIDER) && // all)<NEW_LINE>result.getParameters().length > 0) {<NEW_LINE>if (result.getTestContext().getCurrentXmlTest().getAllParameters().containsKey(SpecialKeywords.EXCEL_DS_ARGS)) {<NEW_LINE>DSBean dsBean = new DSBean(result.getTestContext());<NEW_LINE>int index = 0;<NEW_LINE>for (String arg : dsBean.getArgs()) {<NEW_LINE>dsBean.getTestParams().put(arg, (String) result.getParameters()[index++]);<NEW_LINE>}<NEW_LINE>result.getTestContext().getCurrentXmlTest().setParameters(dsBean.getTestParams());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO: do not write STARTED at message for retry! or move it into the DEBUG level!<NEW_LINE>startItem(result, Messager.TEST_STARTED);<NEW_LINE>super.onTestStart(result);<NEW_LINE>}
getTestDir().getName());
110,304
public <T, X> void processObserverMethod(@Observes ProcessObserverMethod<T, X> pot) {<NEW_LINE>AnnotatedMethod<X> annotatedMethod = pot.getAnnotatedMethod();<NEW_LINE>if (annotatedMethod != null) {<NEW_LINE>List<AnnotatedParameter<X>> parameters = annotatedMethod.getParameters();<NEW_LINE>for (AnnotatedParameter<X> parameter : parameters) {<NEW_LINE>Type type = parameter.getBaseType();<NEW_LINE>Set<Annotation> annotations = parameter.getAnnotations();<NEW_LINE>for (Annotation annotation : annotations) {<NEW_LINE>if (ConfigProperty.class.isAssignableFrom(annotation.annotationType())) {<NEW_LINE>ConfigProperty configProperty = (ConfigProperty) annotation;<NEW_LINE>String propertyName = configProperty.name();<NEW_LINE>String defaultValue = configProperty.defaultValue();<NEW_LINE>ClassLoader classLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ClassLoader run() {<NEW_LINE>return annotatedMethod.getDeclaringType().getJavaClass().getClassLoader();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Throwable configException = validateConfigProperty(type, propertyName, defaultValue, classLoader);<NEW_LINE>if (configException != null) {<NEW_LINE>Tr.error(tc, "unable.to.resolve.observer.injection.point.CWMCG5005E", <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Tr.error(tc, "unable.to.process.observer.injection.point.CWMCG5006E", pot.getObserverMethod().getBeanClass());<NEW_LINE>}<NEW_LINE>}
annotatedMethod.getJavaMember(), configException);
1,070,947
public ErrorCode preAction(Request request, Response response) {<NEW_LINE>if (!adminLimiter.isGranted("admin")) {<NEW_LINE>return ErrorCode.ERROR_CODE_OVER_FREQUENCY;<NEW_LINE>}<NEW_LINE>if (APIPath.Health.equals(request.getUri())) {<NEW_LINE>return ErrorCode.ERROR_CODE_SUCCESS;<NEW_LINE>}<NEW_LINE>String nonce = request.getHeader("nonce");<NEW_LINE>if (StringUtil.isNullOrEmpty(nonce)) {<NEW_LINE>nonce = request.getHeader("Nonce");<NEW_LINE>}<NEW_LINE>String timestamp = request.getHeader("timestamp");<NEW_LINE>if (StringUtil.isNullOrEmpty(timestamp)) {<NEW_LINE>timestamp = request.getHeader("Timestamp");<NEW_LINE>}<NEW_LINE>String sign = request.getHeader("sign");<NEW_LINE>if (StringUtil.isNullOrEmpty(sign)) {<NEW_LINE>sign = request.getHeader("Sign");<NEW_LINE>}<NEW_LINE>if (StringUtil.isNullOrEmpty(nonce) || StringUtil.isNullOrEmpty(timestamp) || StringUtil.isNullOrEmpty(sign)) {<NEW_LINE>return ErrorCode.ERROR_CODE_API_NOT_SIGNED;<NEW_LINE>}<NEW_LINE>Long ts;<NEW_LINE>try {<NEW_LINE>ts = Long.parseLong(timestamp);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Utility.printExecption(LOG, e);<NEW_LINE>return ErrorCode.ERROR_CODE_API_NOT_SIGNED;<NEW_LINE>}<NEW_LINE>if (!NO_CHECK_TIME && System.currentTimeMillis() - ts > 2 * 60 * 60 * 1000) {<NEW_LINE>return ErrorCode.ERROR_CODE_SIGN_EXPIRED;<NEW_LINE>}<NEW_LINE>String str = nonce + "|" + SECRET_KEY + "|" + timestamp;<NEW_LINE>String <MASK><NEW_LINE>return localSign.equals(sign) ? ErrorCode.ERROR_CODE_SUCCESS : ErrorCode.ERROR_CODE_AUTH_FAILURE;<NEW_LINE>}
localSign = DigestUtils.sha1Hex(str);
989,417
private void saveAttachmentToFile() {<NEW_LINE>int index = cbContent.getSelectedIndex();<NEW_LINE>log.info("index=" + index);<NEW_LINE>if (m_attachment.getEntryCount() < index)<NEW_LINE>return;<NEW_LINE>String fileName = getFileName(index);<NEW_LINE>String ext = fileName.substring<MASK><NEW_LINE>log.config("Ext=" + ext);<NEW_LINE>JFileChooser chooser = new JFileChooser();<NEW_LINE>chooser.setDialogType(JFileChooser.SAVE_DIALOG);<NEW_LINE>chooser.setDialogTitle(Msg.getMsg(Env.getCtx(), "AttachmentSave"));<NEW_LINE>File f = new File(fileName);<NEW_LINE>chooser.setSelectedFile(f);<NEW_LINE>// Show dialog<NEW_LINE>int returnVal = chooser.showSaveDialog(this);<NEW_LINE>if (returnVal != JFileChooser.APPROVE_OPTION)<NEW_LINE>return;<NEW_LINE>File saveFile = chooser.getSelectedFile();<NEW_LINE>if (saveFile == null)<NEW_LINE>return;<NEW_LINE>log.config("Save to " + saveFile.getAbsolutePath());<NEW_LINE>m_attachment.getEntryFile(index, saveFile);<NEW_LINE>}
(fileName.lastIndexOf('.'));
1,272,080
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {<NEW_LINE>builder.startObject("shard_indexing_pressure");<NEW_LINE>builder.startObject("stats");<NEW_LINE>for (Map.Entry<ShardId, IndexingPressurePerShardStats> entry : shardIndexingPressureStore.entrySet()) {<NEW_LINE>entry.getValue().toXContent(builder, params);<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>if (shardIndexingPressureEnforced) {<NEW_LINE>builder.startObject("total_rejections_breakup");<NEW_LINE>} else {<NEW_LINE>builder.startObject("total_rejections_breakup_shadow_mode");<NEW_LINE>}<NEW_LINE>builder.field("node_limits", totalNodeLimitsBreachedRejections);<NEW_LINE>builder.field("no_successful_request_limits", totalLastSuccessfulRequestLimitsBreachedRejections);<NEW_LINE>builder.field("throughput_degradation_limits", totalThroughputDegradationLimitsBreachedRejections);<NEW_LINE>builder.endObject();<NEW_LINE><MASK><NEW_LINE>builder.field("enforced", shardIndexingPressureEnforced);<NEW_LINE>return builder.endObject();<NEW_LINE>}
builder.field("enabled", shardIndexingPressureEnabled);
1,627,338
public static DescribeScheduledTasksResponse unmarshall(DescribeScheduledTasksResponse describeScheduledTasksResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeScheduledTasksResponse.setRequestId(_ctx.stringValue("DescribeScheduledTasksResponse.RequestId"));<NEW_LINE>describeScheduledTasksResponse.setTotalCount(_ctx.integerValue("DescribeScheduledTasksResponse.TotalCount"));<NEW_LINE>describeScheduledTasksResponse.setPageNumber(_ctx.integerValue("DescribeScheduledTasksResponse.PageNumber"));<NEW_LINE>describeScheduledTasksResponse.setPageSize(_ctx.integerValue("DescribeScheduledTasksResponse.PageSize"));<NEW_LINE>List<ScheduledTask> scheduledTasks = new ArrayList<ScheduledTask>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeScheduledTasksResponse.ScheduledTasks.Length"); i++) {<NEW_LINE>ScheduledTask scheduledTask = new ScheduledTask();<NEW_LINE>scheduledTask.setScheduledTaskId(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].ScheduledTaskId"));<NEW_LINE>scheduledTask.setScheduledTaskName(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].ScheduledTaskName"));<NEW_LINE>scheduledTask.setDescription(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].Description"));<NEW_LINE>scheduledTask.setScheduledAction(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].ScheduledAction"));<NEW_LINE>scheduledTask.setRecurrenceEndTime(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].RecurrenceEndTime"));<NEW_LINE>scheduledTask.setLaunchTime(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].LaunchTime"));<NEW_LINE>scheduledTask.setRecurrenceType(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].RecurrenceType"));<NEW_LINE>scheduledTask.setRecurrenceValue(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].RecurrenceValue"));<NEW_LINE>scheduledTask.setLaunchExpirationTime(_ctx.integerValue<MASK><NEW_LINE>scheduledTask.setTaskEnabled(_ctx.booleanValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].TaskEnabled"));<NEW_LINE>scheduledTask.setMaxValue(_ctx.integerValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].MaxValue"));<NEW_LINE>scheduledTask.setMinValue(_ctx.integerValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].MinValue"));<NEW_LINE>scheduledTask.setDesiredCapacity(_ctx.integerValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].DesiredCapacity"));<NEW_LINE>scheduledTask.setScalingGroupId(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].ScalingGroupId"));<NEW_LINE>scheduledTasks.add(scheduledTask);<NEW_LINE>}<NEW_LINE>describeScheduledTasksResponse.setScheduledTasks(scheduledTasks);<NEW_LINE>return describeScheduledTasksResponse;<NEW_LINE>}
("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].LaunchExpirationTime"));
519,858
public static ObjectNode mapLinks(List<Link> links) {<NEW_LINE>ObjectNode result = nodeFactory.objectNode();<NEW_LINE>Map<String, List<Link>> byRel = new LinkedHashMap<>();<NEW_LINE>links.forEach((it) -> byRel.computeIfAbsent(it.getRel(), (k) -> new ArrayList<>()).add(it));<NEW_LINE>byRel.forEach((rel, l) -> {<NEW_LINE>if (l.size() == 1) {<NEW_LINE>ObjectNode root = JsonNodeFactory.instance.objectNode();<NEW_LINE>mapLink(l.get(0), root);<NEW_LINE>result.set(rel, root);<NEW_LINE>} else {<NEW_LINE>ArrayNode root <MASK><NEW_LINE>l.forEach((link) -> {<NEW_LINE>ObjectNode node = JsonNodeFactory.instance.objectNode();<NEW_LINE>mapLink(link, node);<NEW_LINE>root.add(node);<NEW_LINE>});<NEW_LINE>result.set(rel, root);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return result;<NEW_LINE>}
= JsonNodeFactory.instance.arrayNode();
367,321
public static int HSLtoRGB(int hue, int saturation, int lightness) {<NEW_LINE>int red = 0;<NEW_LINE>int green = 0;<NEW_LINE>int blue = 0;<NEW_LINE>float hueRatio = hue / 360f;<NEW_LINE>float saturationRatio = saturation / 100f;<NEW_LINE>float lightnessRatio = lightness / 100f;<NEW_LINE>if (saturationRatio == 0) {<NEW_LINE>red = green = blue = (int) (lightnessRatio * 255.0f + 0.5f);<NEW_LINE>} else {<NEW_LINE>float p = lightnessRatio < 0.5f ? lightnessRatio * (1f + saturationRatio) : lightnessRatio + saturationRatio - lightnessRatio * saturationRatio;<NEW_LINE>float q = 2 * lightnessRatio - p;<NEW_LINE>red = hslComponentToRgbComponent(p, q, hueRatio + (1f / 3f));<NEW_LINE>green = <MASK><NEW_LINE>blue = hslComponentToRgbComponent(p, q, hueRatio - (1f / 3f));<NEW_LINE>}<NEW_LINE>return 0xff000000 | (red << 16) | (green << 8) | (blue << 0);<NEW_LINE>}
hslComponentToRgbComponent(p, q, hueRatio);
1,321,447
private static Object applyToField(Object obj, String fieldName, String key, Object value, Predicate<Field> predicate) throws UnknownStyleException, IllegalArgumentException {<NEW_LINE>Class<?> cls = obj.getClass();<NEW_LINE>for (; ; ) {<NEW_LINE>try {<NEW_LINE>Field f = cls.getDeclaredField(fieldName);<NEW_LINE>if (predicate == null || predicate.test(f)) {<NEW_LINE>if (!isValidField(f))<NEW_LINE>throw new IllegalArgumentException("field '" + cls.getName() + "." + fieldName + "' is final or static");<NEW_LINE>try {<NEW_LINE>// necessary to access protected fields in other packages<NEW_LINE>f.setAccessible(true);<NEW_LINE>// get old value and set new value<NEW_LINE>Object oldValue = f.get(obj);<NEW_LINE>f.set(obj, convertToEnum(value, f.getType()));<NEW_LINE>return oldValue;<NEW_LINE>} catch (IllegalAccessException ex) {<NEW_LINE>throw new IllegalArgumentException("failed to access field '" + cls.getName() + "." + fieldName + "'", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (NoSuchFieldException ex) {<NEW_LINE>// field not found in class --> try superclass<NEW_LINE>}<NEW_LINE>cls = cls.getSuperclass();<NEW_LINE>if (cls == null)<NEW_LINE>throw new UnknownStyleException(key);<NEW_LINE>if (predicate != null) {<NEW_LINE><MASK><NEW_LINE>if (superclassName.startsWith("java.") || superclassName.startsWith("javax."))<NEW_LINE>throw new UnknownStyleException(key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String superclassName = cls.getName();
672,142
public void installMovementKeys(PointerTool callback, Map<KeyStroke, Action> actionMap) {<NEW_LINE>System.out.println("install iso movement keys");<NEW_LINE>if (movementKeys == null) {<NEW_LINE>// This is 13/0.75, rounded up<NEW_LINE>movementKeys = new HashMap<KeyStroke, Action>(18);<NEW_LINE>int size = getSize();<NEW_LINE>movementKeys.put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD8, 0), new MovementKey(callback, -size, -size));<NEW_LINE>movementKeys.put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD7, 0), new MovementKey(callback, 0, -size));<NEW_LINE>movementKeys.put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD9, 0), new MovementKey(callback, size, -size));<NEW_LINE>movementKeys.put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD4, 0), new MovementKey(<MASK><NEW_LINE>movementKeys.put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD5, 0), new MovementKey(callback, 0, 0));<NEW_LINE>movementKeys.put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD6, 0), new MovementKey(callback, size, 0));<NEW_LINE>movementKeys.put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD1, 0), new MovementKey(callback, -size, size));<NEW_LINE>movementKeys.put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD2, 0), new MovementKey(callback, 0, size));<NEW_LINE>movementKeys.put(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD3, 0), new MovementKey(callback, size, size));<NEW_LINE>movementKeys.put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), new MovementKey(callback, -size, 0));<NEW_LINE>movementKeys.put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), new MovementKey(callback, size, 0));<NEW_LINE>movementKeys.put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), new MovementKey(callback, 0, -size));<NEW_LINE>movementKeys.put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), new MovementKey(callback, 0, size));<NEW_LINE>}<NEW_LINE>actionMap.putAll(movementKeys);<NEW_LINE>}
callback, -size, 0));
1,076,805
public static DescribeElbAvailableResourceInfoResponse unmarshall(DescribeElbAvailableResourceInfoResponse describeElbAvailableResourceInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeElbAvailableResourceInfoResponse.setRequestId(_ctx.stringValue("DescribeElbAvailableResourceInfoResponse.RequestId"));<NEW_LINE>List<ElbAvailableResourceInfoItem> elbAvailableResourceInfo <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeElbAvailableResourceInfoResponse.ElbAvailableResourceInfo.Length"); i++) {<NEW_LINE>ElbAvailableResourceInfoItem elbAvailableResourceInfoItem = new ElbAvailableResourceInfoItem();<NEW_LINE>elbAvailableResourceInfoItem.setEnsRegionId(_ctx.stringValue("DescribeElbAvailableResourceInfoResponse.ElbAvailableResourceInfo[" + i + "].EnsRegionId"));<NEW_LINE>elbAvailableResourceInfoItem.setEnName(_ctx.stringValue("DescribeElbAvailableResourceInfoResponse.ElbAvailableResourceInfo[" + i + "].EnName"));<NEW_LINE>elbAvailableResourceInfoItem.setArea(_ctx.stringValue("DescribeElbAvailableResourceInfoResponse.ElbAvailableResourceInfo[" + i + "].Area"));<NEW_LINE>elbAvailableResourceInfoItem.setProvince(_ctx.stringValue("DescribeElbAvailableResourceInfoResponse.ElbAvailableResourceInfo[" + i + "].Province"));<NEW_LINE>elbAvailableResourceInfoItem.setName(_ctx.stringValue("DescribeElbAvailableResourceInfoResponse.ElbAvailableResourceInfo[" + i + "].Name"));<NEW_LINE>elbAvailableResourceInfoItem.setCanBuyCount(_ctx.stringValue("DescribeElbAvailableResourceInfoResponse.ElbAvailableResourceInfo[" + i + "].CanBuyCount"));<NEW_LINE>List<String> loadBalancerSpec = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeElbAvailableResourceInfoResponse.ElbAvailableResourceInfo[" + i + "].LoadBalancerSpec.Length"); j++) {<NEW_LINE>loadBalancerSpec.add(_ctx.stringValue("DescribeElbAvailableResourceInfoResponse.ElbAvailableResourceInfo[" + i + "].LoadBalancerSpec[" + j + "]"));<NEW_LINE>}<NEW_LINE>elbAvailableResourceInfoItem.setLoadBalancerSpec(loadBalancerSpec);<NEW_LINE>elbAvailableResourceInfo.add(elbAvailableResourceInfoItem);<NEW_LINE>}<NEW_LINE>describeElbAvailableResourceInfoResponse.setElbAvailableResourceInfo(elbAvailableResourceInfo);<NEW_LINE>return describeElbAvailableResourceInfoResponse;<NEW_LINE>}
= new ArrayList<ElbAvailableResourceInfoItem>();
444,330
final GetBotChannelAssociationResult executeGetBotChannelAssociation(GetBotChannelAssociationRequest getBotChannelAssociationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getBotChannelAssociationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetBotChannelAssociationRequest> request = null;<NEW_LINE>Response<GetBotChannelAssociationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetBotChannelAssociationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getBotChannelAssociationRequest));<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, "Lex Model Building Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetBotChannelAssociation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetBotChannelAssociationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetBotChannelAssociationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,618,195
public void requestRemoveFriend(final String userID, OnRequestRemoveFriendCompleteListener onRequestRemoveFriendCompleteListener) {<NEW_LINE>super.requestRemoveFriend(userID, onRequestRemoveFriendCompleteListener);<NEW_LINE>VKRequest request = VKApi.friends().delete(VKParameters.from(VKApiConst.USER_ID, userID));<NEW_LINE>request.executeWithListener(new VKRequest.VKRequestListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete(VKResponse response) {<NEW_LINE>((OnRequestRemoveFriendCompleteListener) mLocalListeners.get(REQUEST_REMOVE_FRIEND)).<MASK><NEW_LINE>mLocalListeners.remove(REQUEST_REMOVE_FRIEND);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(VKError error) {<NEW_LINE>mLocalListeners.get(REQUEST_REMOVE_FRIEND).onError(getID(), REQUEST_REMOVE_FRIEND, error.toString(), null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
onRequestRemoveFriendComplete(getID(), userID);
65,691
public ListenableFuture<?> execute(RenameColumn statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, Session session, List<Expression> parameters, WarningCollector warningCollector) {<NEW_LINE>QualifiedObjectName tableName = createQualifiedObjectName(session, statement, statement.getTable());<NEW_LINE>Optional<TableHandle> tableHandleOptional = metadata.getTableHandle(session, tableName);<NEW_LINE>if (!tableHandleOptional.isPresent()) {<NEW_LINE>if (!statement.isTableExists()) {<NEW_LINE>throw new SemanticException(MISSING_TABLE, statement, "Table '%s' does not exist", tableName);<NEW_LINE>}<NEW_LINE>return immediateFuture(null);<NEW_LINE>}<NEW_LINE>Optional<ConnectorMaterializedViewDefinition> optionalMaterializedView = metadata.getMaterializedView(session, tableName);<NEW_LINE>if (optionalMaterializedView.isPresent()) {<NEW_LINE>if (!statement.isTableExists()) {<NEW_LINE>throw new SemanticException(NOT_SUPPORTED, statement, "'%s' is a materialized view, and rename column is not supported", tableName);<NEW_LINE>}<NEW_LINE>return immediateFuture(null);<NEW_LINE>}<NEW_LINE>TableHandle tableHandle = tableHandleOptional.get();<NEW_LINE>String source = statement.getSource().<MASK><NEW_LINE>String target = statement.getTarget().getValue().toLowerCase(ENGLISH);<NEW_LINE>accessControl.checkCanRenameColumn(session.getRequiredTransactionId(), session.getIdentity(), session.getAccessControlContext(), tableName);<NEW_LINE>Map<String, ColumnHandle> columnHandles = metadata.getColumnHandles(session, tableHandle);<NEW_LINE>ColumnHandle columnHandle = columnHandles.get(source);<NEW_LINE>if (columnHandle == null) {<NEW_LINE>if (!statement.isColumnExists()) {<NEW_LINE>throw new SemanticException(MISSING_COLUMN, statement, "Column '%s' does not exist", source);<NEW_LINE>}<NEW_LINE>return immediateFuture(null);<NEW_LINE>}<NEW_LINE>if (columnHandles.containsKey(target)) {<NEW_LINE>throw new SemanticException(COLUMN_ALREADY_EXISTS, statement, "Column '%s' already exists", target);<NEW_LINE>}<NEW_LINE>if (metadata.getColumnMetadata(session, tableHandle, columnHandle).isHidden()) {<NEW_LINE>throw new SemanticException(NOT_SUPPORTED, statement, "Cannot rename hidden column");<NEW_LINE>}<NEW_LINE>metadata.renameColumn(session, tableHandle, columnHandle, target);<NEW_LINE>return immediateFuture(null);<NEW_LINE>}
getValue().toLowerCase(ENGLISH);
809,465
public void guess(TypeReference typeRef, Scope scope, GuessedTypeRequestor requestor) {<NEW_LINE>this.substituedTypes = new HashMap();<NEW_LINE>this.originalTypes = new HashMap();<NEW_LINE>this.combinationsCount = 1;<NEW_LINE>TypeReference convertedType = convert(typeRef);<NEW_LINE>if (convertedType == null)<NEW_LINE>return;<NEW_LINE>QualifiedTypeReference[] substituedTypeNodes = getSubstituedTypes();<NEW_LINE>int length = substituedTypeNodes.length;<NEW_LINE>int[] substitutionsIndexes = new int[substituedTypeNodes.length];<NEW_LINE>char[][][][] subtitutions = new char[substituedTypeNodes.length][][][];<NEW_LINE>char[][][] originalTypeNames = new char[substituedTypeNodes.length][][];<NEW_LINE>for (int i = 0; i < substituedTypeNodes.length; i++) {<NEW_LINE>subtitutions[i] = getSubstitution(substituedTypeNodes[i]);<NEW_LINE>originalTypeNames[i] = getOriginal(substituedTypeNodes[i]);<NEW_LINE>}<NEW_LINE>ResolutionCleaner resolutionCleaner = new ResolutionCleaner();<NEW_LINE>for (int i = 0; i < this.combinationsCount; i++) {<NEW_LINE>nextSubstitution(substituedTypeNodes, subtitutions, substitutionsIndexes);<NEW_LINE>this.problemFactory.startCheckingProblems();<NEW_LINE>TypeBinding guessedType = null;<NEW_LINE>switch(scope.kind) {<NEW_LINE>case Scope.METHOD_SCOPE:<NEW_LINE>case Scope.BLOCK_SCOPE:<NEW_LINE>resolutionCleaner.cleanUp(convertedType, (BlockScope) scope);<NEW_LINE>guessedType = convertedType<MASK><NEW_LINE>break;<NEW_LINE>case Scope.CLASS_SCOPE:<NEW_LINE>resolutionCleaner.cleanUp(convertedType, (ClassScope) scope);<NEW_LINE>guessedType = convertedType.resolveType((ClassScope) scope);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>this.problemFactory.stopCheckingProblems();<NEW_LINE>if (!this.problemFactory.hasForbiddenProblems) {<NEW_LINE>if (guessedType != null) {<NEW_LINE>Binding[] missingElements = new Binding[length];<NEW_LINE>int[] missingElementsStarts = new int[length];<NEW_LINE>int[] missingElementsEnds = new int[length];<NEW_LINE>if (computeMissingElements(substituedTypeNodes, originalTypeNames, missingElements, missingElementsStarts, missingElementsEnds)) {<NEW_LINE>requestor.accept(guessedType.capture(scope, typeRef.sourceStart, typeRef.sourceEnd), missingElements, missingElementsStarts, missingElementsEnds, this.problemFactory.hasAllowedProblems);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.resolveType((BlockScope) scope);
800,110
public void exportFieldRadio(JRPrintElement element) throws IOException {<NEW_LINE>String fieldName = element.getPropertiesMap().getProperty(PDF_FIELD_NAME);<NEW_LINE>fieldName = fieldName == null || fieldName.trim().length() == 0 ? "FIELD_" + element.getUUID() : fieldName;<NEW_LINE>PdfRadioCheck radioField = pdfProducer.getRadioField(element.getX() + exporterContext.getOffsetX(), jasperPrint.getPageHeight() - element.getY() - exporterContext.getOffsetY(), element.getX() + exporterContext.getOffsetX() + element.getWidth(), jasperPrint.getPageHeight() - element.getY() - exporterContext.getOffsetY() - element.getHeight(), fieldName, "FIELD_" + element.getUUID());<NEW_LINE>PdfFieldCheckTypeEnum checkType = PdfFieldCheckTypeEnum.getByName(element.getPropertiesMap<MASK><NEW_LINE>if (checkType != null) {<NEW_LINE>radioField.setCheckType(checkType);<NEW_LINE>}<NEW_LINE>if (ModeEnum.OPAQUE == element.getModeValue()) {<NEW_LINE>radioField.setBackgroundColor(element.getBackcolor());<NEW_LINE>}<NEW_LINE>radioField.setTextColor(element.getForecolor());<NEW_LINE>JRPen pen = getFieldPen(element);<NEW_LINE>if (pen != null) {<NEW_LINE>float borderWidth = Math.round(pen.getLineWidth());<NEW_LINE>if (borderWidth > 0) {<NEW_LINE>radioField.setBorderColor(pen.getLineColor());<NEW_LINE>radioField.setBorderWidth(borderWidth);<NEW_LINE>String strBorderStyle = propertiesUtil.getProperty(PDF_FIELD_BORDER_STYLE, element, jasperPrint);<NEW_LINE>PdfFieldBorderStyleEnum borderStyle = PdfFieldBorderStyleEnum.getByName(strBorderStyle);<NEW_LINE>if (borderStyle == null) {<NEW_LINE>borderStyle = pen.getLineStyleValue() == LineStyleEnum.DASHED ? PdfFieldBorderStyleEnum.DASHED : PdfFieldBorderStyleEnum.SOLID;<NEW_LINE>}<NEW_LINE>radioField.setBorderStyle(borderStyle);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>radioField.setOnValue("FIELD_" + element.getUUID());<NEW_LINE>String checked = element.getPropertiesMap().getProperty(PDF_FIELD_CHECKED);<NEW_LINE>// need to set to false if previous button was checked<NEW_LINE>radioField.setChecked(Boolean.valueOf(checked));<NEW_LINE>// setting the read-only option has to occur before the getRadioGroup() call<NEW_LINE>String readOnly = element.getPropertiesMap().getProperty(PDF_FIELD_READ_ONLY);<NEW_LINE>if (readOnly != null) {<NEW_LINE>if (Boolean.valueOf(readOnly)) {<NEW_LINE>radioField.setReadOnly();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>radioField.addToGroup();<NEW_LINE>}
().getProperty(PDF_FIELD_CHECK_TYPE));
145,276
private void initThreadPool(final TarsRegisterConfig config) {<NEW_LINE>if (Objects.nonNull(threadPool)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch(config.getThreadpool()) {<NEW_LINE>case Constants.SHARED:<NEW_LINE>try {<NEW_LINE>threadPool = SpringBeanUtils.getInstance().getBean(ShenyuThreadPoolExecutor.class);<NEW_LINE>return;<NEW_LINE>} catch (NoSuchBeanDefinitionException t) {<NEW_LINE>throw new ShenyuException("shared thread pool is not enable, config ${shenyu.sharedPool.enable} in your xml/yml !", t);<NEW_LINE>}<NEW_LINE>case Constants.FIXED:<NEW_LINE>case Constants.EAGER:<NEW_LINE>case Constants.LIMITED:<NEW_LINE>throw new UnsupportedOperationException();<NEW_LINE>case Constants.CACHED:<NEW_LINE>int corePoolSize = Optional.ofNullable(config.getCorethreads()).orElse(0);<NEW_LINE>int maximumPoolSize = Optional.ofNullable(config.getThreads()).orElse(Integer.MAX_VALUE);<NEW_LINE>int queueSize = Optional.ofNullable(config.getQueues()).orElse(0);<NEW_LINE>threadPool = new ThreadPoolExecutor(corePoolSize, maximumPoolSize, 60L, TimeUnit.SECONDS, queueSize > 0 ? new LinkedBlockingQueue<>(queueSize) : new <MASK><NEW_LINE>return;<NEW_LINE>default:<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
SynchronousQueue<>(), factory);
402,156
void colorB_actionPerformed(ActionEvent e) {<NEW_LINE>// Fix until Sun's JVM supports more locales...<NEW_LINE>UIManager.put("ColorChooser.swatchesNameText", Local.getString("Swatches"));<NEW_LINE>UIManager.put("ColorChooser.hsbNameText", Local.getString("HSB"));<NEW_LINE>UIManager.put("ColorChooser.rgbNameText", Local.getString("RGB"));<NEW_LINE>UIManager.put("ColorChooser.swatchesRecentText", Local.getString("Recent:"));<NEW_LINE>UIManager.put("ColorChooser.previewText", Local.getString("Preview"));<NEW_LINE>UIManager.put("ColorChooser.sampleText", Local.getString("Sample Text") + " " + Local.getString("Sample Text"));<NEW_LINE>UIManager.put("ColorChooser.okText", Local.getString("OK"));<NEW_LINE>UIManager.put("ColorChooser.cancelText", Local.getString("Cancel"));<NEW_LINE>UIManager.put("ColorChooser.resetText", Local.getString("Reset"));<NEW_LINE>UIManager.put("ColorChooser.hsbHueText", Local.getString("H"));<NEW_LINE>UIManager.put("ColorChooser.hsbSaturationText", Local.getString("S"));<NEW_LINE>UIManager.put("ColorChooser.hsbBrightnessText", Local.getString("B"));<NEW_LINE>UIManager.put("ColorChooser.hsbRedText"<MASK><NEW_LINE>UIManager.put("ColorChooser.hsbGreenText", Local.getString("G"));<NEW_LINE>UIManager.put("ColorChooser.hsbBlueText", Local.getString("B2"));<NEW_LINE>UIManager.put("ColorChooser.rgbRedText", Local.getString("Red"));<NEW_LINE>UIManager.put("ColorChooser.rgbGreenText", Local.getString("Green"));<NEW_LINE>UIManager.put("ColorChooser.rgbBlueText", Local.getString("Blue"));<NEW_LINE>Color c = JColorChooser.showDialog(this, Local.getString("Font color"), Util.decodeColor(colorField.getText()));<NEW_LINE>if (c == null)<NEW_LINE>return;<NEW_LINE>colorField.setText(Util.encodeColor(c));<NEW_LINE>Util.setColorField(colorField);<NEW_LINE>sample.setForeground(c);<NEW_LINE>}
, Local.getString("R"));
1,134,635
public void stop() {<NEW_LINE>_isStopping = true;<NEW_LINE>LOGGER.info("Awaiting segment metadata commits: maxWaitTimeMillis = {}", MAX_LLC_SEGMENT_METADATA_COMMIT_TIME_MILLIS);<NEW_LINE>long millisToWait = MAX_LLC_SEGMENT_METADATA_COMMIT_TIME_MILLIS;<NEW_LINE>// Busy-wait for all segments that are committing metadata to complete their operation.<NEW_LINE>// Waiting<NEW_LINE>while (_numCompletingSegments.get() > 0 && millisToWait > 0) {<NEW_LINE>try {<NEW_LINE>long thisWait = 1000;<NEW_LINE>if (millisToWait < thisWait) {<NEW_LINE>thisWait = millisToWait;<NEW_LINE>}<NEW_LINE>Thread.sleep(thisWait);<NEW_LINE>millisToWait -= thisWait;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>LOGGER.info("Interrupted: Remaining wait time {} (out of {})", millisToWait, MAX_LLC_SEGMENT_METADATA_COMMIT_TIME_MILLIS);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.info(<MASK><NEW_LINE>if (_fileUploadDownloadClient != null) {<NEW_LINE>try {<NEW_LINE>_fileUploadDownloadClient.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error("Failed to close fileUploadDownloadClient.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"Wait completed: Number of completing segments = {}", _numCompletingSegments.get());
1,482,213
public void prepareExportClassAndResourceCache() {<NEW_LINE>for (Plugin plugin : pluginManagerService.getPluginsInOrder()) {<NEW_LINE>for (String exportIndex : plugin.getExportPackageNodes()) {<NEW_LINE>exportNodeAndClassLoaderMap.putIfAbsent(exportIndex, plugin.getPluginClassLoader());<NEW_LINE>}<NEW_LINE>for (String exportIndex : plugin.getExportPackageStems()) {<NEW_LINE>exportStemAndClassLoaderMap.putIfAbsent(exportIndex, plugin.getPluginClassLoader());<NEW_LINE>}<NEW_LINE>for (String exportIndex : plugin.getExportClasses()) {<NEW_LINE>exportClassAndClassLoaderMap.putIfAbsent(exportIndex, plugin.getPluginClassLoader());<NEW_LINE>}<NEW_LINE>for (String resource : plugin.getExportResources()) {<NEW_LINE>exportResourceAndClassLoaderMap.putIfAbsent(resource, new LinkedList<>());<NEW_LINE>exportResourceAndClassLoaderMap.get(resource).add(plugin.getPluginClassLoader());<NEW_LINE>}<NEW_LINE>for (String resource : plugin.getExportPrefixResourceStems()) {<NEW_LINE>exportPrefixStemResourceAndClassLoaderMap.putIfAbsent(resource, new LinkedList<>());<NEW_LINE>exportPrefixStemResourceAndClassLoaderMap.get(resource).add(plugin.getPluginClassLoader());<NEW_LINE>}<NEW_LINE>for (String resource : plugin.getExportSuffixResourceStems()) {<NEW_LINE>exportSuffixStemResourceAndClassLoaderMap.putIfAbsent(resource, new LinkedList<>());<NEW_LINE>exportSuffixStemResourceAndClassLoaderMap.get(resource).<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
add(plugin.getPluginClassLoader());
1,341,247
protected IStatus loadAttributes(Object attributes) {<NEW_LINE>if (!(attributes instanceof Object[])) {<NEW_LINE>return createErrorStatus(Messages.AbstractConfigurationProcessor_expectedArrayError + attributes);<NEW_LINE>}<NEW_LINE>Object[] attrArray = (Object[]) attributes;<NEW_LINE>if (attrArray.length == 1 || attrArray.length == 2) {<NEW_LINE>// We only expects the URLs array<NEW_LINE>if (!(attrArray[0] instanceof Object[])) {<NEW_LINE>return createErrorStatus(Messages.AbstractConfigurationProcessor_expectedURLsArrayError + attributes);<NEW_LINE>}<NEW_LINE>Object[] attrURL = (Object[]) attrArray[0];<NEW_LINE>if (attrURL.length == 0) {<NEW_LINE>return createErrorStatus(Messages.AbstractConfigurationProcessor_emptyURLsArrayError);<NEW_LINE>}<NEW_LINE>// Load the urls<NEW_LINE>urls <MASK><NEW_LINE>for (int i = 0; i < attrURL.length; i++) {<NEW_LINE>urls[i] = attrURL[i].toString();<NEW_LINE>}<NEW_LINE>if (attrArray.length == 2) {<NEW_LINE>// We also expects an extra attributes Map<NEW_LINE>if (!(attrArray[1] instanceof Map)) {<NEW_LINE>return createErrorStatus(Messages.AbstractConfigurationProcessor_expectedMapError + attrArray[1]);<NEW_LINE>}<NEW_LINE>// save this map<NEW_LINE>attributesMap = (Map<String, String>) attrArray[1];<NEW_LINE>} else {<NEW_LINE>// assign an empty map<NEW_LINE>attributesMap = Collections.emptyMap();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}
= new String[attrURL.length];
1,701,650
private JExpression handleSystemGetProperty(JMethodCall gwtGetPropertyCall) {<NEW_LINE>assert (gwtGetPropertyCall.getArgs().size() == 1 || gwtGetPropertyCall.getArgs().size() == 2);<NEW_LINE>JExpression propertyNameExpression = gwtGetPropertyCall.getArgs().get(0);<NEW_LINE>boolean defaultVersionCalled = gwtGetPropertyCall.getArgs().size() == 2;<NEW_LINE>JExpression defaultValueExpression = defaultVersionCalled ? gwtGetPropertyCall.getArgs(<MASK><NEW_LINE>if (!(propertyNameExpression instanceof JStringLiteral)) {<NEW_LINE>error(gwtGetPropertyCall, "Only string constants may be used as property name in System.getProperty()");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String propertyName = ((JStringLiteral) propertyNameExpression).getValue();<NEW_LINE>if (!defaultVersionCalled && !isPropertyDefined(propertyName)) {<NEW_LINE>error(gwtGetPropertyCall, "Property '" + propertyName + "' is not defined.");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (isMultivaluedProperty(propertyName)) {<NEW_LINE>error(gwtGetPropertyCall, "Property '" + propertyName + "' is multivalued. " + "Multivalued properties are not supported by System.getProperty().");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (defaultValueExpression != null) {<NEW_LINE>defaultValueExpression = accept(defaultValueExpression);<NEW_LINE>}<NEW_LINE>return JPermutationDependentValue.createRuntimeProperty(program, gwtGetPropertyCall.getSourceInfo(), propertyName, defaultValueExpression);<NEW_LINE>}
).get(1) : null;
226,338
private static void drawHistogram(double[] runningTimesHistogram, double minValue, double rangeOfRunningTimesPerBucket, int arraySizePowerOf10) {<NEW_LINE>StdDraw.setCanvasSize(1024, 512);<NEW_LINE>double maxCount = 0;<NEW_LINE>for (int i = 0; i < runningTimesHistogram.length; i++) {<NEW_LINE>if (runningTimesHistogram[i] > maxCount) {<NEW_LINE>maxCount = runningTimesHistogram[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double minX = -1.5;<NEW_LINE>double maxX = runningTimesHistogram.length;<NEW_LINE>double middleX = minX + (maxX - minX) / 2;<NEW_LINE>double minY = -2.2;<NEW_LINE>double maxY = maxCount + 3;<NEW_LINE>double middleY = minY + (maxY - minY) / 2;<NEW_LINE>StdDraw.setXscale(minX, maxX);<NEW_LINE>StdDraw.setYscale(minY, maxY);<NEW_LINE>// Labels<NEW_LINE>String fontName = "Verdana";<NEW_LINE>Font titlesFont = new Font(fontName, Font.PLAIN, 14);<NEW_LINE>StdDraw.setFont(titlesFont);<NEW_LINE>StdDraw.text(middleX, maxCount + 2, "Frequency vs Running Times");<NEW_LINE>StdDraw.text(-1, middleY, "Frequency", 90);<NEW_LINE>StdDraw.text(middleX, -1.3, "Running Times");<NEW_LINE>StdDraw.text(middleX, <MASK><NEW_LINE>Font graphLabelsFont = new Font(fontName, Font.PLAIN, 10);<NEW_LINE>StdDraw.setFont(graphLabelsFont);<NEW_LINE>// Y labels<NEW_LINE>for (int y = 0; y <= maxCount; y++) {<NEW_LINE>StdDraw.text(-0.5, y, String.valueOf(y));<NEW_LINE>}<NEW_LINE>// X labels<NEW_LINE>String[] runningTimeDescriptions = getBucketDescriptions(minValue, rangeOfRunningTimesPerBucket);<NEW_LINE>int lineBreakIndex = 9;<NEW_LINE>double secondXLineYPosition;<NEW_LINE>if (maxCount <= 5) {<NEW_LINE>secondXLineYPosition = -0.5;<NEW_LINE>} else {<NEW_LINE>secondXLineYPosition = -0.7;<NEW_LINE>}<NEW_LINE>for (int x = 0; x < runningTimeDescriptions.length; x++) {<NEW_LINE>StdDraw.text(x, -0.3, runningTimeDescriptions[x].substring(0, lineBreakIndex));<NEW_LINE>StdDraw.text(x, secondXLineYPosition, runningTimeDescriptions[x].substring(lineBreakIndex));<NEW_LINE>}<NEW_LINE>StatsUtil.plotBars(runningTimesHistogram, 0.25);<NEW_LINE>}
maxCount + 1, "N = 10^" + arraySizePowerOf10);
693,726
final UpdateAnalysisPermissionsResult executeUpdateAnalysisPermissions(UpdateAnalysisPermissionsRequest updateAnalysisPermissionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateAnalysisPermissionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateAnalysisPermissionsRequest> request = null;<NEW_LINE>Response<UpdateAnalysisPermissionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateAnalysisPermissionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateAnalysisPermissionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateAnalysisPermissions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateAnalysisPermissionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateAnalysisPermissionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
894,534
private static <T> Entry<Constructor<T>, List<AnnotatedValueResolver>> findConstructor(BeanFactoryId beanFactoryId, List<RequestObjectResolver> objectResolvers) {<NEW_LINE>Entry<Constructor<T>, List<AnnotatedValueResolver>> candidate = null;<NEW_LINE>final Set<Constructor> constructors = getConstructors(beanFactoryId.type);<NEW_LINE>for (final Constructor<T> constructor : constructors) {<NEW_LINE>// A default constructor can be a candidate only if there has been no candidate yet.<NEW_LINE>if (constructor.getParameterCount() == 0 && candidate == null) {<NEW_LINE>candidate = new SimpleImmutableEntry<>(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final List<RequestConverter> converters = AnnotationUtil.findDeclared(constructor, RequestConverter.class);<NEW_LINE>final List<AnnotatedValueResolver> resolvers = AnnotatedValueResolver.ofBeanConstructorOrMethod(constructor, beanFactoryId.pathParams, addToFirstIfExists(objectResolvers, converters));<NEW_LINE>if (!resolvers.isEmpty()) {<NEW_LINE>// Can overwrite only if the current candidate is a default constructor.<NEW_LINE>if (candidate == null || candidate.getValue().isEmpty()) {<NEW_LINE>candidate = new SimpleImmutableEntry<>(constructor, resolvers);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("too many annotated constructors in " + beanFactoryId.type.getSimpleName() + " (expected: 0 or 1)");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (NoAnnotatedParameterException ignored) {<NEW_LINE>// There's no annotated parameters in the constructor.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return candidate;<NEW_LINE>}
constructor, ImmutableList.of());
643,668
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>jCheckBox1 = new javax.swing.JCheckBox();<NEW_LINE>jPanel1 = new javax.swing.JPanel();<NEW_LINE>setRequestFocusEnabled(false);<NEW_LINE>setLayout(new <MASK><NEW_LINE>jCheckBox1.setMnemonic(org.openide.util.NbBundle.getMessage(WrapperPanel.class, "LBL_WebModule_Mnemonic").charAt(0));<NEW_LINE>// NOI18N<NEW_LINE>jCheckBox1.setText(org.openide.util.NbBundle.getMessage(WrapperPanel.class, "OPT_FilterWrapper"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0);<NEW_LINE>add(jCheckBox1, gridBagConstraints);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 1;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>add(jPanel1, gridBagConstraints);<NEW_LINE>}
java.awt.GridBagLayout());
390,101
public Expression optimize(SessionLocal session) {<NEW_LINE>if (over != null) {<NEW_LINE>over.optimize(session);<NEW_LINE>ArrayList<QueryOrderBy> orderBy = over.getOrderBy();<NEW_LINE>if (orderBy != null) {<NEW_LINE>overOrderBySort = createOrder(<MASK><NEW_LINE>} else if (!isAggregate()) {<NEW_LINE>overOrderBySort = new SortOrder(session, new int[getNumExpressions()]);<NEW_LINE>}<NEW_LINE>WindowFrame frame = over.getWindowFrame();<NEW_LINE>if (frame != null) {<NEW_LINE>int index = getNumExpressions();<NEW_LINE>int orderBySize = 0;<NEW_LINE>if (orderBy != null) {<NEW_LINE>orderBySize = orderBy.size();<NEW_LINE>index += orderBySize;<NEW_LINE>}<NEW_LINE>int n = 0;<NEW_LINE>WindowFrameBound bound = frame.getStarting();<NEW_LINE>if (bound.isParameterized()) {<NEW_LINE>checkOrderBy(frame.getUnits(), orderBySize);<NEW_LINE>if (bound.isVariable()) {<NEW_LINE>bound.setExpressionIndex(index);<NEW_LINE>n++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>bound = frame.getFollowing();<NEW_LINE>if (bound != null && bound.isParameterized()) {<NEW_LINE>checkOrderBy(frame.getUnits(), orderBySize);<NEW_LINE>if (bound.isVariable()) {<NEW_LINE>bound.setExpressionIndex(index + n);<NEW_LINE>n++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>numFrameExpressions = n;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
session, orderBy, getNumExpressions());
45,994
public boolean tryOnNext(T t) {<NEW_LINE>if (done) {<NEW_LINE>Operators.onNextDropped(t, ctx);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>K k;<NEW_LINE>try {<NEW_LINE>k = Objects.requireNonNull(keyExtractor.apply(t), "The distinct extractor returned a null value.");<NEW_LINE>} catch (Throwable e) {<NEW_LINE>onError(Operators.onOperatorError(s, e, t, ctx));<NEW_LINE>Operators.onDiscard(t, ctx);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (null == lastKey) {<NEW_LINE>lastKey = k;<NEW_LINE>actual.onNext(t);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>boolean equiv;<NEW_LINE>try {<NEW_LINE>equiv = keyComparator.test(lastKey, k);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>onError(Operators.onOperatorError(s, e, t, ctx));<NEW_LINE>Operators.onDiscard(t, ctx);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (equiv) {<NEW_LINE><MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>lastKey = k;<NEW_LINE>actual.onNext(t);<NEW_LINE>return true;<NEW_LINE>}
Operators.onDiscard(t, ctx);
920,591
private void saveImageOriginalBytes(ResourceFieldLocation imageLocation) {<NEW_LINE>Data data = imageLocation.getResourceData();<NEW_LINE>if (data == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>GhidraFileChooser chooser = new GhidraFileChooser(tool.getActiveWindow());<NEW_LINE>chooser.setFileSelectionMode(GhidraFileChooserMode.FILES_ONLY);<NEW_LINE>chooser.setTitle("Save Image File As");<NEW_LINE>chooser.setApproveButtonText("Save Image As");<NEW_LINE>chooser.addFileFilter(GRAPHIC_FORMATS_FILTER);<NEW_LINE>File f = chooser.getSelectedFile();<NEW_LINE>if (f != null) {<NEW_LINE>if (f.exists() && OptionDialog.showYesNoDialog(tool.getActiveWindow(), "Overwrite Existing File?", "Overwrite " + f.getName() + "?") != OptionDialog.YES_OPTION) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>byte[<MASK><NEW_LINE>FileUtilities.writeBytes(f, bytes);<NEW_LINE>tool.setStatusInfo("Image resource at " + data.getAddress() + " saved as: " + f.getName());<NEW_LINE>}<NEW_LINE>} catch (MemoryAccessException | IOException e) {<NEW_LINE>Msg.showError(this, null, "Error Saving Image File", "Failed to save image", e);<NEW_LINE>}<NEW_LINE>}
] bytes = data.getBytes();
639,765
private void handleUnsplittableFiles(List<InputSplit> splits, List<FileInfo> unSplittableFiles, long maxSize, float compressFactor) throws IOException {<NEW_LINE>if (unSplittableFiles.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long totalFileSize = 0L;<NEW_LINE>for (FileInfo fileInfo : unSplittableFiles) {<NEW_LINE>totalFileSize = (long) (compressFactor * fileInfo.stat.getLen());<NEW_LINE>}<NEW_LINE>int needBlockNum = (int) (totalFileSize / maxSize) + 1;<NEW_LINE>Map<Integer, List<BlockInfo>> splitSlots = new HashMap<>(needBlockNum);<NEW_LINE>Map<Integer, Long> splitLens = new HashMap<>(needBlockNum);<NEW_LINE>for (int i = 0; i < needBlockNum; i++) {<NEW_LINE>splitSlots.put(i<MASK><NEW_LINE>splitLens.put(i, 0L);<NEW_LINE>}<NEW_LINE>int fileNum = unSplittableFiles.size();<NEW_LINE>int chooseIndex;<NEW_LINE>FileInfo fileInfo;<NEW_LINE>for (int fileIndex = 0; fileIndex < fileNum; fileIndex++) {<NEW_LINE>chooseIndex = choseMinLenIndex(splitLens);<NEW_LINE>fileInfo = unSplittableFiles.get(fileIndex);<NEW_LINE>splitSlots.get(chooseIndex).add(new BlockInfo(fileInfo.stat.getPath(), 0, fileInfo.stat.getLen(), fileInfo.blockLocations[0].getHosts(), null));<NEW_LINE>splitLens.put(chooseIndex, splitLens.get(chooseIndex) + fileInfo.stat.getLen());<NEW_LINE>}<NEW_LINE>for (Entry<Integer, List<BlockInfo>> splitEntry : splitSlots.entrySet()) {<NEW_LINE>if (splitEntry.getValue().size() > 0) {<NEW_LINE>splits.add(generateSplit(splitEntry.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, new ArrayList<>());
534,477
public OAuthClient updateOAuthClient(UpdateOAuthClientRequest body, String clientId, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling updateOAuthClient");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'clientId' is set<NEW_LINE>if (clientId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'clientId' when calling updateOAuthClient");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/system/config/oauth/clients/{client_id}".replaceAll("\\{" + "client_id" + "\\}", apiClient.escapeString<MASK><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 localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<OAuthClient> localVarReturnType = new GenericType<OAuthClient>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
(clientId.toString()));
1,128,601
public static boolean threshold(PathObjectHierarchy hierarchy, ImageServer<BufferedImage> densityServer, Map<Integer, ? extends Number> thresholds, String pathClassName, CreateObjectOptions... options) throws IOException {<NEW_LINE>logger.debug("Thresholding {} with thresholds {}, options", densityServer, thresholds, Arrays.asList(options));<NEW_LINE>// Apply threshold to densities<NEW_LINE>PathClass lessThan = <MASK><NEW_LINE>PathClass greaterThan = PathClassFactory.getPathClass(pathClassName);<NEW_LINE>// If we request to delete existing objects, apply this only to annotations with the target class<NEW_LINE>var optionsList = Arrays.asList(options);<NEW_LINE>boolean changes = false;<NEW_LINE>if (optionsList.contains(CreateObjectOptions.DELETE_EXISTING)) {<NEW_LINE>Collection<PathObject> toRemove;<NEW_LINE>if (hierarchy.getSelectionModel().noSelection())<NEW_LINE>toRemove = hierarchy.getAnnotationObjects().stream().filter(p -> p.getPathClass() == greaterThan).collect(Collectors.toList());<NEW_LINE>else {<NEW_LINE>toRemove = new HashSet<>();<NEW_LINE>var selectedObjects = new LinkedHashSet<>(hierarchy.getSelectionModel().getSelectedObjects());<NEW_LINE>for (var selected : selectedObjects) {<NEW_LINE>PathObjectTools.getDescendantObjects(selected, toRemove, PathAnnotationObject.class);<NEW_LINE>}<NEW_LINE>// Don't remove selected objects<NEW_LINE>toRemove.removeAll(selectedObjects);<NEW_LINE>}<NEW_LINE>if (!toRemove.isEmpty()) {<NEW_LINE>hierarchy.removeObjects(toRemove, true);<NEW_LINE>changes = true;<NEW_LINE>}<NEW_LINE>// Remove option<NEW_LINE>options = optionsList.stream().filter(o -> o != CreateObjectOptions.DELETE_EXISTING).toArray(CreateObjectOptions[]::new);<NEW_LINE>}<NEW_LINE>var thresholdedServer = PixelClassifierTools.createThresholdServer(densityServer, thresholds, lessThan, greaterThan);<NEW_LINE>return PixelClassifierTools.createAnnotationsFromPixelClassifier(hierarchy, thresholdedServer, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, options) | changes;<NEW_LINE>}
PathClassFactory.getPathClass(StandardPathClasses.IGNORE);
1,576,837
public void actionPerformed(@Nonnull AnActionEvent e) {<NEW_LINE>ExternalServiceConfiguration configuration = myExternalServiceConfigurationProvider.get();<NEW_LINE>if (configuration.getEmail() != null) {<NEW_LINE>Alerts.yesNo().asWarning().text(LocalizeValue.localizeTODO("Do logout?")).showAsync().doWhenDone(value -> {<NEW_LINE>if (value) {<NEW_LINE>// call internal implementation<NEW_LINE>((ExternalServiceConfigurationImpl) configuration).reset();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>String <MASK><NEW_LINE>int localPort = BuiltInServerManager.getInstance().getPort();<NEW_LINE>StringBuilder builder = new StringBuilder(WebServiceApi.LINK_CONSULO.buildUrl());<NEW_LINE>builder.append("?");<NEW_LINE>builder.append("token=").append(tokenForAuth).append("&");<NEW_LINE>builder.append("host=").append(URLEncoder.encode(getHostName(), StandardCharsets.UTF_8)).append("&");<NEW_LINE>String redirectUrl = "http://localhost:" + localPort + "/redirectAuth";<NEW_LINE>redirectUrl = redirectUrl.replace("&", "%26");<NEW_LINE>redirectUrl = redirectUrl.replace("/", "%2F");<NEW_LINE>redirectUrl = redirectUrl.replace(":", "%3A");<NEW_LINE>builder.append("redirect=").append(redirectUrl);<NEW_LINE>BrowserUtil.browse(builder.toString());<NEW_LINE>}<NEW_LINE>}
tokenForAuth = RandomStringUtils.randomAlphabetic(48);
875,173
public boolean onBlockActivated(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull EntityPlayer entityPlayer, @Nonnull EnumHand hand, @Nonnull EnumFacing side, float hitX, float hitY, float hitZ) {<NEW_LINE>T machine = getTileEntity(world, pos);<NEW_LINE>ItemStack <MASK><NEW_LINE>if (Prep.isValid(heldItem) && machine != null && machine.isValidUpgrade(heldItem)) {<NEW_LINE>InventorySlot upgradeSlot = machine.getInventory().getSlot(EnergyLogic.CAPSLOT);<NEW_LINE>ItemStack currentCap = upgradeSlot.get();<NEW_LINE>if (Prep.isInvalid(currentCap)) {<NEW_LINE>upgradeSlot.set(ItemTools.oneOf(entityPlayer, heldItem));<NEW_LINE>return true;<NEW_LINE>} else if (!ItemStack.areItemsEqual(heldItem, currentCap)) {<NEW_LINE>upgradeSlot.set(ItemTools.oneOf(entityPlayer, heldItem));<NEW_LINE>if (!entityPlayer.inventory.addItemStackToInventory(currentCap)) {<NEW_LINE>entityPlayer.dropItem(currentCap, true);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.onBlockActivated(world, pos, state, entityPlayer, hand, side, hitX, hitY, hitZ);<NEW_LINE>}
heldItem = entityPlayer.getHeldItem(hand);
825,379
public void validateOfflineSegment(String offlineTableName, SegmentMetadata segmentMetadata, File tempSegmentDir) {<NEW_LINE>TableConfig offlineTableConfig = ZKMetadataProvider.getOfflineTableConfig(_pinotHelixResourceManager.getPropertyStore(), offlineTableName);<NEW_LINE>if (offlineTableConfig == null) {<NEW_LINE>throw new ControllerApplicationException(LOGGER, "Failed to find table config for table: " + offlineTableName, Response.Status.NOT_FOUND);<NEW_LINE>}<NEW_LINE>String segmentName = segmentMetadata.getName();<NEW_LINE>StorageQuotaChecker.QuotaCheckerResponse quotaResponse;<NEW_LINE>try {<NEW_LINE>quotaResponse = checkStorageQuota(tempSegmentDir, segmentMetadata, offlineTableConfig);<NEW_LINE>} catch (InvalidConfigException e) {<NEW_LINE>// Admin port is missing, return response with 500 status code.<NEW_LINE>throw new ControllerApplicationException(LOGGER, "Quota check failed for segment: " + segmentName + " of table: " + offlineTableName + ", reason: " + e.getMessage(<MASK><NEW_LINE>}<NEW_LINE>if (!quotaResponse._isSegmentWithinQuota) {<NEW_LINE>throw new ControllerApplicationException(LOGGER, "Quota check failed for segment: " + segmentName + " of table: " + offlineTableName + ", reason: " + quotaResponse._reason, Response.Status.FORBIDDEN);<NEW_LINE>}<NEW_LINE>// Check time interval<NEW_LINE>// TODO: Pass in schema and check the existence of time interval when time field exists<NEW_LINE>Interval timeInterval = segmentMetadata.getTimeInterval();<NEW_LINE>if (timeInterval != null && !TimeUtils.isValidTimeInterval(timeInterval)) {<NEW_LINE>throw new ControllerApplicationException(LOGGER, String.format("Invalid segment start/end time: %s (in millis: %d/%d) for segment: %s of table: %s, must be between: %s", timeInterval, timeInterval.getStartMillis(), timeInterval.getEndMillis(), segmentName, offlineTableName, TimeUtils.VALID_TIME_INTERVAL), Response.Status.NOT_ACCEPTABLE);<NEW_LINE>}<NEW_LINE>}
), Response.Status.INTERNAL_SERVER_ERROR);
944,681
protected void encodeDefaultFilter(FacesContext context, DataTable table, UIColumn column, ResponseWriter writer) throws IOException {<NEW_LINE>String separator = String.valueOf(UINamingContainer.getSeparatorChar(context));<NEW_LINE>boolean disableTabbing = table.getScrollWidth() != null;<NEW_LINE>String filterId = column.getContainerClientId(context) + separator + "filter";<NEW_LINE>Object filterValue = findFilterValueForColumn(<MASK><NEW_LINE>String filterStyleClass = column.getFilterStyleClass();<NEW_LINE>// aria<NEW_LINE>String ariaLabelId = filterId + "_label";<NEW_LINE>String ariaHeaderLabel = getHeaderLabel(context, column);<NEW_LINE>String ariaMessage = MessageFactory.getMessage(DataTable.ARIA_FILTER_BY, ariaHeaderLabel);<NEW_LINE>writer.startElement("label", null);<NEW_LINE>writer.writeAttribute("id", ariaLabelId, null);<NEW_LINE>writer.writeAttribute("for", filterId, null);<NEW_LINE>writer.writeAttribute("class", "ui-helper-hidden", null);<NEW_LINE>writer.writeText(ariaMessage, null);<NEW_LINE>writer.endElement("label");<NEW_LINE>encodeFilterInput(column, writer, disableTabbing, filterId, filterStyleClass, filterValue, ariaLabelId);<NEW_LINE>}
context, table, column, filterId);
529,581
protected CodeExpression readComponentCode(CodeStatement statement, CodeGroup componentCode) {<NEW_LINE>if (getSimpleAddMethod().equals(statement.getMetaObject())) {<NEW_LINE>CodeExpression compExp = statement.getStatementParameters()[0];<NEW_LINE>componentCode.addStatement(statement);<NEW_LINE>AbsoluteLayoutConstraints constr = new AbsoluteLayoutConstraints(0, 0, -1, -1);<NEW_LINE>constr.nullMode = true;<NEW_LINE>// constr.refComponent = getLayoutContext().getPrimaryComponent(index);<NEW_LINE>// search for setBounds statement on component<NEW_LINE>Iterator it = CodeStructure.getDefinedStatementsIterator(compExp);<NEW_LINE>CodeStatement[] statements = CodeStructure.filterStatements(it, getSetBoundsMethod());<NEW_LINE>if (statements.length > 0) {<NEW_LINE>CodeStatement boundsStatement = statements[statements.length - 1];<NEW_LINE>constr.readPropertyExpressions(<MASK><NEW_LINE>componentCode.addStatement(boundsStatement);<NEW_LINE>}<NEW_LINE>getConstraintsList().add(constr);<NEW_LINE>return compExp;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
boundsStatement.getStatementParameters(), 0);
419,762
private void _updateEJBXML() throws Exception {<NEW_LINE>File xmlFile = new File("classes/META-INF/ejb-jar.xml");<NEW_LINE>StringBuffer methodsSB = new StringBuffer();<NEW_LINE>SAXReader reader = new SAXReader();<NEW_LINE>reader.setEntityResolver(new EntityResolver());<NEW_LINE>Document doc = reader.read(xmlFile);<NEW_LINE>Iterator itr = doc.getRootElement().element("enterprise-beans").elements("entity").iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>Element entity = <MASK><NEW_LINE>methodsSB.append("\t\t\t<method>\n");<NEW_LINE>methodsSB.append("\t\t\t\t<ejb-name>" + entity.elementText("ejb-name") + "</ejb-name>\n");<NEW_LINE>methodsSB.append("\t\t\t\t<method-name>*</method-name>\n");<NEW_LINE>methodsSB.append("\t\t\t</method>\n");<NEW_LINE>}<NEW_LINE>itr = doc.getRootElement().element("enterprise-beans").elements("session").iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>Element entity = (Element) itr.next();<NEW_LINE>methodsSB.append("\t\t\t<method>\n");<NEW_LINE>methodsSB.append("\t\t\t\t<ejb-name>" + entity.elementText("ejb-name") + "</ejb-name>\n");<NEW_LINE>methodsSB.append("\t\t\t\t<method-name>*</method-name>\n");<NEW_LINE>methodsSB.append("\t\t\t</method>\n");<NEW_LINE>}<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append("\t<assembly-descriptor>\n");<NEW_LINE>sb.append("\t\t<method-permission>\n");<NEW_LINE>sb.append("\t\t\t<unchecked />\n");<NEW_LINE>sb.append(methodsSB);<NEW_LINE>sb.append("\t\t</method-permission>\n");<NEW_LINE>sb.append("\t\t<container-transaction>\n");<NEW_LINE>sb.append(methodsSB);<NEW_LINE>sb.append("\t\t\t<trans-attribute>Required</trans-attribute>\n");<NEW_LINE>sb.append("\t\t</container-transaction>\n");<NEW_LINE>sb.append("\t</assembly-descriptor>\n");<NEW_LINE>String content = FileUtil.read(xmlFile);<NEW_LINE>int x = content.indexOf("<assembly-descriptor>") - 1;<NEW_LINE>int y = content.indexOf("</assembly-descriptor>", x) + 23;<NEW_LINE>if (x < 0) {<NEW_LINE>x = content.indexOf("</ejb-jar>");<NEW_LINE>y = x;<NEW_LINE>}<NEW_LINE>String newContent = content.substring(0, x) + sb.toString() + content.substring(y, content.length());<NEW_LINE>if (!content.equals(newContent)) {<NEW_LINE>FileUtil.write(xmlFile, newContent);<NEW_LINE>}<NEW_LINE>}
(Element) itr.next();
323,757
public static DescribeCustomEventAttributeResponse unmarshall(DescribeCustomEventAttributeResponse describeCustomEventAttributeResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeCustomEventAttributeResponse.setRequestId(_ctx.stringValue("DescribeCustomEventAttributeResponse.RequestId"));<NEW_LINE>describeCustomEventAttributeResponse.setCode(_ctx.stringValue("DescribeCustomEventAttributeResponse.Code"));<NEW_LINE>describeCustomEventAttributeResponse.setMessage<MASK><NEW_LINE>describeCustomEventAttributeResponse.setSuccess(_ctx.stringValue("DescribeCustomEventAttributeResponse.Success"));<NEW_LINE>List<CustomEvent> customEvents = new ArrayList<CustomEvent>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeCustomEventAttributeResponse.CustomEvents.Length"); i++) {<NEW_LINE>CustomEvent customEvent = new CustomEvent();<NEW_LINE>customEvent.setTime(_ctx.stringValue("DescribeCustomEventAttributeResponse.CustomEvents[" + i + "].Time"));<NEW_LINE>customEvent.setName(_ctx.stringValue("DescribeCustomEventAttributeResponse.CustomEvents[" + i + "].Name"));<NEW_LINE>customEvent.setGroupId(_ctx.stringValue("DescribeCustomEventAttributeResponse.CustomEvents[" + i + "].GroupId"));<NEW_LINE>customEvent.setContent(_ctx.stringValue("DescribeCustomEventAttributeResponse.CustomEvents[" + i + "].Content"));<NEW_LINE>customEvent.setId(_ctx.stringValue("DescribeCustomEventAttributeResponse.CustomEvents[" + i + "].Id"));<NEW_LINE>customEvents.add(customEvent);<NEW_LINE>}<NEW_LINE>describeCustomEventAttributeResponse.setCustomEvents(customEvents);<NEW_LINE>return describeCustomEventAttributeResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeCustomEventAttributeResponse.Message"));
163,538
public static DescribePersonMachineListResponse unmarshall(DescribePersonMachineListResponse describePersonMachineListResponse, UnmarshallerContext context) {<NEW_LINE>describePersonMachineListResponse.setRequestId(context.stringValue("DescribePersonMachineListResponse.RequestId"));<NEW_LINE>describePersonMachineListResponse.setBizCode(context.stringValue("DescribePersonMachineListResponse.BizCode"));<NEW_LINE>PersonMachineRes personMachineRes = new PersonMachineRes();<NEW_LINE>personMachineRes.setHasConfiguration<MASK><NEW_LINE>List<PersonMachine> personMachines = new ArrayList<PersonMachine>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribePersonMachineListResponse.PersonMachineRes.PersonMachines.Length"); i++) {<NEW_LINE>PersonMachine personMachine = new PersonMachine();<NEW_LINE>personMachine.setConfigurationName(context.stringValue("DescribePersonMachineListResponse.PersonMachineRes.PersonMachines[" + i + "].ConfigurationName"));<NEW_LINE>personMachine.setAppkey(context.stringValue("DescribePersonMachineListResponse.PersonMachineRes.PersonMachines[" + i + "].Appkey"));<NEW_LINE>personMachine.setConfigurationMethod(context.stringValue("DescribePersonMachineListResponse.PersonMachineRes.PersonMachines[" + i + "].ConfigurationMethod"));<NEW_LINE>personMachine.setApplyType(context.stringValue("DescribePersonMachineListResponse.PersonMachineRes.PersonMachines[" + i + "].ApplyType"));<NEW_LINE>personMachine.setScene(context.stringValue("DescribePersonMachineListResponse.PersonMachineRes.PersonMachines[" + i + "].Scene"));<NEW_LINE>personMachine.setLastUpdate(context.stringValue("DescribePersonMachineListResponse.PersonMachineRes.PersonMachines[" + i + "].LastUpdate"));<NEW_LINE>personMachine.setExtId(context.stringValue("DescribePersonMachineListResponse.PersonMachineRes.PersonMachines[" + i + "].ExtId"));<NEW_LINE>personMachine.setSceneOriginal(context.stringValue("DescribePersonMachineListResponse.PersonMachineRes.PersonMachines[" + i + "].SceneOriginal"));<NEW_LINE>personMachines.add(personMachine);<NEW_LINE>}<NEW_LINE>personMachineRes.setPersonMachines(personMachines);<NEW_LINE>describePersonMachineListResponse.setPersonMachineRes(personMachineRes);<NEW_LINE>return describePersonMachineListResponse;<NEW_LINE>}
(context.stringValue("DescribePersonMachineListResponse.PersonMachineRes.HasConfiguration"));
1,155,066
protected void exportDefinition(HttpServletResponse response, AbstractModel definitionModel, DmnJsonConverterContext converterContext) {<NEW_LINE>try {<NEW_LINE>JsonNode editorJsonNode = objectMapper.readTree(definitionModel.getModelEditorJson());<NEW_LINE>// URLEncoder.encode will replace spaces with '+', to keep the actual name replacing '+' to '%20'<NEW_LINE>String fileName = URLEncoder.encode(definitionModel.getName(), "UTF-8").replaceAll("\\+", "%20") + ".dmn";<NEW_LINE>response.setHeader("Content-Disposition", "attachment; filename*=UTF-8''" + fileName);<NEW_LINE>ServletOutputStream servletOutputStream = response.getOutputStream();<NEW_LINE>response.setContentType("application/xml");<NEW_LINE>DmnDefinition dmnDefinition = dmnJsonConverter.convertToDmn(editorJsonNode, definitionModel.getId(), converterContext);<NEW_LINE>byte[] xmlBytes = dmnXmlConverter.convertToXML(dmnDefinition);<NEW_LINE>BufferedInputStream in = new BufferedInputStream(new ByteArrayInputStream(xmlBytes));<NEW_LINE>byte[] buffer = new byte[8096];<NEW_LINE>while (true) {<NEW_LINE>int count = in.read(buffer);<NEW_LINE>if (count == -1)<NEW_LINE>break;<NEW_LINE>servletOutputStream.write(buffer, 0, count);<NEW_LINE>}<NEW_LINE>// Flush and close stream<NEW_LINE>servletOutputStream.flush();<NEW_LINE>servletOutputStream.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>throw new InternalServerErrorException("Could not export decision table model");<NEW_LINE>}<NEW_LINE>}
LOGGER.error("Could not export decision table model", e);
118,292
public String reorganizeString(String s) {<NEW_LINE>HashMap<Character, Integer> map = new HashMap<>();<NEW_LINE>for (int i = 0; i < s.length(); i++) {<NEW_LINE>map.put(s.charAt(i), map.getOrDefault(s.charAt(<MASK><NEW_LINE>}<NEW_LINE>PriorityQueue<Map.Entry<Character, Integer>> pq = new PriorityQueue<>((a, b) -> b.getValue() - a.getValue());<NEW_LINE>pq.addAll(map.entrySet());<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>while (!pq.isEmpty()) {<NEW_LINE>Map.Entry<Character, Integer> temp1 = pq.poll();<NEW_LINE>// if the character at sb's end is different from the max frequency character or the string is empty<NEW_LINE>if (sb.length() == 0 || sb.charAt(sb.length() - 1) != temp1.getKey()) {<NEW_LINE>sb.append(temp1.getKey());<NEW_LINE>// update the value<NEW_LINE>temp1.setValue(temp1.getValue() - 1);<NEW_LINE>} else {<NEW_LINE>// the character is same<NEW_LINE>// hold the current character and look for the 2nd most frequent character<NEW_LINE>Map.Entry<Character, Integer> temp2 = pq.poll();<NEW_LINE>// if there is no temp2 i.e. the temp1 was the only character in the heap then there is no way to avoid adjacent duplicate values<NEW_LINE>if (temp2 == null)<NEW_LINE>return "";<NEW_LINE>// else do the same thing as above<NEW_LINE>sb.append(temp2.getKey());<NEW_LINE>// update the value<NEW_LINE>temp2.setValue(temp2.getValue() - 1);<NEW_LINE>// if still has some value left add again to the heap<NEW_LINE>if (temp2.getValue() != 0)<NEW_LINE>pq.offer(temp2);<NEW_LINE>}<NEW_LINE>if (temp1.getValue() != 0)<NEW_LINE>pq.offer(temp1);<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
i), 0) + 1);
250,192
private static boolean roughlyEqual(String expectedRaw, String requestedPathRaw) {<NEW_LINE>LOG.debug("Comparing expected [{}] vs requested [{}]", expectedRaw, requestedPathRaw);<NEW_LINE>if (StringUtils.isEmpty(expectedRaw)) {<NEW_LINE>LOG.debug("False: empty expected");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>UriComponents expected = UriComponentsBuilder.fromUriString(expectedRaw).build();<NEW_LINE>UriComponents requested = UriComponentsBuilder.fromUriString(requestedPathRaw).build();<NEW_LINE>if (!Objects.equals(expected.getPath(), requested.getPath())) {<NEW_LINE>LOG.debug("False: expected path [{}] does not match requested path [{}]", expected.getPath(), requested.getPath());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Map<String, List<String>> left = new HashMap<>(expected.getQueryParams());<NEW_LINE>Map<String, List<String>> right = new HashMap<>(requested.getQueryParams());<NEW_LINE>left.remove("size");<NEW_LINE>right.remove("size");<NEW_LINE>MapDifference<String, List<String>> difference = Maps.difference(left, right);<NEW_LINE>if (difference.entriesDiffering().isEmpty() || difference.entriesOnlyOnLeft().isEmpty() || (difference.entriesOnlyOnRight().size() == 1 && difference.entriesOnlyOnRight().get(JWTSecurityService.JWT_PARAM_NAME) != null)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>LOG.debug("False: expected query params [{}] do not match requested query params [{}]", expected.getQueryParams(), requested.getQueryParams());<NEW_LINE>return false;<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
LOG.warn("Exception encountered while comparing paths", e);
31,712
// [START add_rating]<NEW_LINE>private Task<Void> addRating(final DocumentReference restaurantRef, final float rating) {<NEW_LINE>// Create reference for new rating, for use inside the transaction<NEW_LINE>final DocumentReference ratingRef = restaurantRef.collection("ratings").document();<NEW_LINE>// In a transaction, add the new rating and update the aggregate totals<NEW_LINE>return db.runTransaction(new Transaction.Function<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void apply(Transaction transaction) throws FirebaseFirestoreException {<NEW_LINE>Restaurant restaurant = transaction.get(restaurantRef).toObject(Restaurant.class);<NEW_LINE>// Compute new number of ratings<NEW_LINE>int newNumRatings = restaurant.numRatings + 1;<NEW_LINE>// Compute new average rating<NEW_LINE>double oldRatingTotal = restaurant.avgRating * restaurant.numRatings;<NEW_LINE>double newAvgRating = (oldRatingTotal + rating) / newNumRatings;<NEW_LINE>// Set new restaurant info<NEW_LINE>restaurant.numRatings = newNumRatings;<NEW_LINE>restaurant.avgRating = newAvgRating;<NEW_LINE>// Update restaurant<NEW_LINE>transaction.set(restaurantRef, restaurant);<NEW_LINE>// Update rating<NEW_LINE>Map<String, Object> data = new HashMap<>();<NEW_LINE><MASK><NEW_LINE>transaction.set(ratingRef, data, SetOptions.merge());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
data.put("rating", rating);
1,777,019
private void loadNode927() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.ServerDiagnosticsType_ServerDiagnosticsSummary_SecurityRejectedSessionCount, new QualifiedName(0, "SecurityRejectedSessionCount"), new LocalizedText("en", "SecurityRejectedSessionCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UInt32, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerDiagnosticsType_ServerDiagnosticsSummary_SecurityRejectedSessionCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerDiagnosticsType_ServerDiagnosticsSummary_SecurityRejectedSessionCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerDiagnosticsType_ServerDiagnosticsSummary_SecurityRejectedSessionCount, Identifiers.HasComponent, Identifiers.ServerDiagnosticsType_ServerDiagnosticsSummary<MASK><NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), false));
1,211,164
public ListFirewallPoliciesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListFirewallPoliciesResult listFirewallPoliciesResult = new ListFirewallPoliciesResult();<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 listFirewallPoliciesResult;<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("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listFirewallPoliciesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("FirewallPolicies", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listFirewallPoliciesResult.setFirewallPolicies(new ListUnmarshaller<FirewallPolicyMetadata>(FirewallPolicyMetadataJsonUnmarshaller.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 listFirewallPoliciesResult;<NEW_LINE>}
)).unmarshall(context));
1,631,549
public void save() {<NEW_LINE>logger.debug(<MASK><NEW_LINE>try {<NEW_LINE>// ensure full path exists<NEW_LINE>file.getParentFile().mkdirs();<NEW_LINE>final List<NeeoDevice> devices = new ArrayList<>();<NEW_LINE>// filter for only things that are still valid<NEW_LINE>final ThingRegistry thingRegistry = context.getThingRegistry();<NEW_LINE>for (NeeoDevice device : uidToDevice.values()) {<NEW_LINE>if (NeeoConstants.NEEOIO_BINDING_ID.equalsIgnoreCase(device.getUid().getBindingId())) {<NEW_LINE>devices.add(device);<NEW_LINE>} else {<NEW_LINE>if (thingRegistry.get(device.getUid().asThingUID()) != null) {<NEW_LINE>devices.add(device);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String json = gson.toJson(devices);<NEW_LINE>final byte[] contents = json.getBytes(StandardCharsets.UTF_8);<NEW_LINE>Files.write(file.toPath(), contents);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.debug("IOException writing {}: {}", file.toPath(), e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
"Saving devices to {}", file.toPath());